-
Notifications
You must be signed in to change notification settings - Fork 113
/
istio.ts
69 lines (62 loc) · 2.51 KB
/
istio.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright 2016-2019, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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 k8s from "@pulumi/kubernetes";
import { k8sProvider } from "./cluster";
import * as config from "./config";
const appName = "istio";
const namespace = new k8s.core.v1.Namespace(
`${appName}-system`,
{ metadata: { name: `${appName}-system` } },
{ provider: k8sProvider }
);
const adminBinding = new k8s.rbac.v1.ClusterRoleBinding(
"cluster-admin-binding",
{
metadata: { name: "cluster-admin-binding" },
roleRef: {
apiGroup: "rbac.authorization.k8s.io",
kind: "ClusterRole",
name: "cluster-admin"
},
subjects: [
{ apiGroup: "rbac.authorization.k8s.io", kind: "User", name: config.gcpUsername }
]
},
{ provider: k8sProvider }
);
export const istio_init = new k8s.helm.v2.Chart(
`${appName}-init`,
{
path: "charts/istio-init",
// Note: had to use a hardcoded namespace name to avoid error: https://github.com/pulumi/pulumi-kubernetes/issues/814
// namespace: namespace.metadata.name,
namespace: "istio-system",
values: { kiali: { enabled: true } }
},
{ dependsOn: [namespace, adminBinding], providers: { kubernetes: k8sProvider } }
);
export const crd10 = istio_init.getResource("batch/v1/Job", "istio-system", "istio-init-crd-10");
export const crd11 = istio_init.getResource("batch/v1/Job", "istio-system", "istio-init-crd-11");
export const crd12 = istio_init.getResource("batch/v1/Job", "istio-system", "istio-init-crd-12");
export const istio = new k8s.helm.v2.Chart(
appName,
{
path: "charts/istio",
// Note: had to use a hardcoded namespace name to avoid error: https://github.com/pulumi/pulumi-kubernetes/issues/814
// namespace: namespace.metadata.name,
namespace: "istio-system",
values: { kiali: { enabled: true } }
},
{ dependsOn: [adminBinding, crd10, crd11, crd12], providers: { kubernetes: k8sProvider } }
);