-
Notifications
You must be signed in to change notification settings - Fork 113
/
index.ts
45 lines (38 loc) · 1.18 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
import * as k8s from "@pulumi/kubernetes";
//
// `get`s the Kubernetes Dashboard, which is deployed by default in minikube.
//
k8s.core.v1.Service.get("kube-dashboard", "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",
{
apiVersion: "stable.example.com/v1",
kind: "CronTab",
metadata: { name: "my-new-cron-object" },
spec: { cronSpec: "* * * * */5", image: "my-awesome-cron-image" }
},
{ dependsOn: ct }
);
const ctObj = k8s.apiextensions.CustomResource.get("my-new-cron-object-get", {
apiVersion: "stable.example.com/v1",
kind: "CronTab",
id: "my-new-cron-object"
});