How to use the @pulumi/kubernetes.apiextensions function in @pulumi/kubernetes

To help you get started, we’ve selected a few @pulumi/kubernetes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / pulumi-kubernetes / tests / sdk / nodejs / get / step1 / index.ts View on Github external
const namespace = new k8s.core.v1.Namespace("test-namespace");

//
// `get`s the Kubernetes API service.
//

const svc = k8s.core.v1.Service.get("kube-api", "default/kubernetes");

// This will fail with a TypeError if the status was not populated (i.e. the .get isn't working)
export const loadBalancer = svc.status.loadBalancer;

//
// Create a CustomResourceDefinition, a CustomResource, and then `.get` it.
//

const ct = new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", {
    metadata: { name: "crontabs.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "crontabs",
            singular: "crontab",
            kind: "CronTab",
            shortNames: ["ct"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-cron-object",
github pulumi / pulumi-kubernetes / tests / sdk / nodejs / crds / step2 / index.ts View on Github external
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as k8s from "@pulumi/kubernetes";

const namespace = new k8s.core.v1.Namespace("test-namespace");

//
// Delete the CustomResourceDefinition. On the next refresh, the CustomResource will be
// automatically deleted from the state rather than returning a "kind not found" error.
// This is a contrived example for testing, and it doesn't make any sense to delete a
// CRD while leaving related CRs.
//

new k8s.apiextensions.CustomResource(
    "my-new-foobar-object",
    {
        apiVersion: "stable.example.com/v1",
        kind: "FooBar",
        metadata: {
            namespace: namespace.metadata.name,
            name: "my-new-foobar-object",
        },
        spec: { foo: "such amaze" }
    },
);
github pulumi / pulumi-kubernetes / tests / integration / get / step1 / index.ts View on Github external
import * as k8s from "@pulumi/kubernetes";

const namespace = new k8s.core.v1.Namespace("test-namespace");

//
// `get`s the Kubernetes API service.
//

k8s.core.v1.Service.get("kube-api", "default/kubernetes");

//
// Create a CustomResourceDefinition, a CustomResource, and then `.get` it.
//

const ct = new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", {
    metadata: { name: "crontabs.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "crontabs",
            singular: "crontab",
            kind: "CronTab",
            shortNames: ["ct"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-cron-object",
github pulumi / pulumi-kubernetes / tests / sdk / nodejs / crds / step1 / index.ts View on Github external
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as k8s from "@pulumi/kubernetes";

const namespace = new k8s.core.v1.Namespace("test-namespace");

//
// Create a CustomResourceDefinition and a CustomResource.
//

new k8s.apiextensions.v1beta1.CustomResourceDefinition("foobar", {
    metadata: { name: "foobars.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "foobars",
            singular: "foobar",
            kind: "FooBar",
            shortNames: ["fb"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-foobar-object",
github pulumi / pulumi-kubernetes / tests / sdk / nodejs / get / step2 / index.ts View on Github external
const namespace = new k8s.core.v1.Namespace("test-namespace");

//
// `get`s the Kubernetes API service.
//

const svc = k8s.core.v1.Service.get("kube-api", "default/kubernetes");

// This will fail with a TypeError if the status was not populated (i.e. the .get isn't working)
export const loadBalancer = svc.status.loadBalancer;

//
// Create a CustomResourceDefinition, a CustomResource, and then `.get` it.
//

const ct = new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", {
    metadata: { name: "crontabs.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "crontabs",
            singular: "crontab",
            kind: "CronTab",
            shortNames: ["ct"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-cron-object",
github pulumi / pulumi-kubernetes / tests / sdk / nodejs / examples / prometheus-operator / index.ts View on Github external
const myMonitoring = prometheusOperator.service.apply(service => {
    return new k8s.apiextensions.CustomResource('my-monitoring', {
        apiVersion: 'monitoring.coreos.com/v1',
        kind: 'ServiceMonitor',
        spec: {
            selector: {
                matchLabels: { app: 'my-app' },
            },
            endpoints: [
                {
                    port: 'http',
                    interval: '65s',
                    // start with the following
                    relabelings: [
                        {
                            regex: '(.*)',
                            targetLabel: 'stackdriver',
                            replacement: 'true',
github pulumi / pulumi-kubernetes / tests / integration / get / step2 / index.ts View on Github external
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";

const namespace = new k8s.core.v1.Namespace("test-namespace");

const idNamespace = namespace.metadata.name;

k8s.apiextensions.CustomResource.get("my-new-cron-object-get", {
    apiVersion: "stable.example.com/v1",
    kind: "CronTab",
    id: pulumi.interpolate `${idNamespace}/my-new-cron-object`,
});
github pulumi / pulumi-kubernetes / tests / integration / get / step1 / index.ts View on Github external
const ct = new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", {
    metadata: { name: "crontabs.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "crontabs",
            singular: "crontab",
            kind: "CronTab",
            shortNames: ["ct"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-cron-object",
    {
        apiVersion: "stable.example.com/v1",
        kind: "CronTab",
      metadata: {
        namespace: namespace.metadata.name,
        name: "my-new-cron-object",
      },
        spec: { cronSpec: "* * * * */5", image: "my-awesome-cron-image" }
    },
    { dependsOn: ct }
);
github pulumi / pulumi-kubernetes / tests / sdk / nodejs / get / step2 / index.ts View on Github external
const ct = new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", {
    metadata: { name: "crontabs.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "crontabs",
            singular: "crontab",
            kind: "CronTab",
            shortNames: ["ct"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-cron-object",
    {
        apiVersion: "stable.example.com/v1",
        kind: "CronTab",
        metadata: {
            namespace: namespace.metadata.name,
            name: "my-new-cron-object",
        },
        spec: { cronSpec: "* * * * */5", image: "my-awesome-cron-image" }
    },
    { dependsOn: ct }
);

k8s.apiextensions.CustomResource.get("my-new-cron-object-get", {
    apiVersion: "stable.example.com/v1",
    kind: "CronTab",
github pulumi / pulumi-kubernetes / tests / sdk / nodejs / get / step1 / index.ts View on Github external
const ct = new k8s.apiextensions.v1beta1.CustomResourceDefinition("crontab", {
    metadata: { name: "crontabs.stable.example.com" },
    spec: {
        group: "stable.example.com",
        version: "v1",
        scope: "Namespaced",
        names: {
            plural: "crontabs",
            singular: "crontab",
            kind: "CronTab",
            shortNames: ["ct"]
        }
    }
});

new k8s.apiextensions.CustomResource(
    "my-new-cron-object",
    {
        apiVersion: "stable.example.com/v1",
        kind: "CronTab",
      metadata: {
        namespace: namespace.metadata.name,
        name: "my-new-cron-object",
      },
        spec: { cronSpec: "* * * * */5", image: "my-awesome-cron-image" }
    },
    { dependsOn: ct }
);

@pulumi/kubernetes

[![Build Status](https://travis-ci.com/pulumi/pulumi-kubernetes.svg?token=eHg7Zp5zdDDJfTjY8ejq&branch=master)](https://travis-ci.com/pulumi/pulumi-kubernetes) [![Slack](http://www.pulumi.com/images/docs/badges/slack.svg)](https://slack.pulumi.com) [![NPM

Apache-2.0
Latest version published 11 days ago

Package Health Score

92 / 100
Full package analysis