-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathremoveExtC.sh
executable file
·74 lines (69 loc) · 2.05 KB
/
removeExtC.sh
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
70
71
72
73
74
#!/bin/bash
CLUSTER1_NAME=cluster1
CLUSTER2_NAME=cluster2
ISTIO_NAMESPACE=external-istiod
EXTERNAL_ISTIOD_ADDR=$(kubectl get --context kind-${CLUSTER1_NAME} -n istio-system \
services/istio-ingressgateway -o jsonpath='{ .status.loadBalancer.ingress[0].ip}')
if [[ $1 != '' ]]; then
ACTION='x uninstall --purge'
else
ACTION='install'
fi
istioctl ${ACTION} --context="kind-${CLUSTER1_NAME}" -y -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: $ISTIO_NAMESPACE
spec:
profile: empty
meshConfig:
accessLogFile: /dev/stdout
rootNamespace: $ISTIO_NAMESPACE
defaultConfig:
discoveryAddress: $EXTERNAL_ISTIOD_ADDR:15012
components:
base:
enabled: true
pilot:
enabled: true
k8s:
overlays:
- kind: Deployment
name: istiod
patches:
- path: spec.template.spec.volumes[100]
value: |-
name: config-volume
configMap:
name: istio
- path: spec.template.spec.volumes[100]
value: |-
name: inject-volume
configMap:
name: istio-sidecar-injector
- path: spec.template.spec.containers[0].volumeMounts[100]
value: |-
name: config-volume
mountPath: /etc/istio/config
- path: spec.template.spec.containers[0].volumeMounts[100]
value: |-
name: inject-volume
mountPath: /var/lib/istio/inject
env:
- name: INJECTION_WEBHOOK_CONFIG_NAME
value: "istio-sidecar-injector-${ISTIO_NAMESPACE}"
- name: VALIDATION_WEBHOOK_CONFIG_NAME
value: "istio-validator-${ISTIO_NAMESPACE}"
- name: EXTERNAL_ISTIOD
value: "true"
- name: CLUSTER_ID
value: ${CLUSTER2_NAME}
- name: SHARED_MESH_CONFIG
value: istio
values:
global:
caAddress: $EXTERNAL_ISTIOD_ADDR:15012
istioNamespace: $ISTIO_NAMESPACE
operatorManageWebhooks: true
meshID: mesh1
EOF