-
Notifications
You must be signed in to change notification settings - Fork 9
/
service-mesh-wf.yaml
189 lines (186 loc) · 6.01 KB
/
service-mesh-wf.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: service-mesh
namespace: argo
spec:
entrypoint: deploy
arguments:
parameters:
- name: site_name
value: hanu-reference
- name: app_group
value: service-mesh
- name: manifest_repo_url
value: 'https://github.com/openinfradev/decapod-manifests'
- name: revision
value: main
templates:
- name: deploy
dag:
tasks:
- name: create-eck-secret
template: copy-eck-secret
arguments:
parameters:
- name: secret_name
value: eck-elasticsearch-es-http-certs-public
- name: source_namespace
value: lma
- name: target_namespace
value: istio-system
- name: istio-operator
arguments:
parameters:
- name: list
value: |
[
{ "path": "istio-operator", "namespace": "istio-operator" }
]
templateRef:
name: create-application
template: installApps
dependencies:
- create-eck-secret
- name: istio-controlplane
arguments:
parameters:
- name: list
value: |
[
{ "path": "servicemesh-controlplane", "namespace": "istio-system" }
]
templateRef:
name: create-application
template: installApps
dependencies:
- istio-operator
- name: istio-gateway
arguments:
parameters:
- name: list
value: |
[
{ "path": "servicemesh-gateway", "namespace": "istio-system" }
]
templateRef:
name: create-application
template: installApps
dependencies:
- istio-controlplane
- name: jaeger-kiali-operator
arguments:
parameters:
- name: list
value: |
[
{ "path": "jaeger-operator", "namespace": "istio-system" },
{ "path": "kiali-operator", "namespace": "istio-system" }
]
templateRef:
name: create-application
template: installApps
dependencies:
- istio-controlplane
- name: servicemesh-jaeger-kiali-resource
arguments:
parameters:
- name: list
value: |
[
{ "path": "servicemesh-jaeger-resource", "namespace": "istio-system" },
{ "path": "servicemesh-kiali-resource", "namespace": "istio-system" }
]
templateRef:
name: create-application
template: installApps
dependencies:
- jaeger-kiali-operator
- name: grafana-prometheus-resource
arguments:
parameters:
- name: list
value: |
[
{ "path": "servicemesh-grafana-dashboard", "namespace": "istio-system" },
{ "path": "servicemesh-prometheusmonitor", "namespace": "istio-system" },
{ "path": "servicemesh-prometheusrule", "namespace": "istio-system" }
]
templateRef:
name: create-application
template: installApps
dependencies:
- jaeger-kiali-operator
- name: sync-app
template: sync-app
arguments: {}
dependencies:
- grafana-prometheus-resource
- name: copy-eck-secret
arguments: {}
inputs:
parameters:
- name: secret_name
- name: source_namespace
- name: target_namespace
outputs: {}
metadata: {}
container:
name: copy-eck-secret
image: 'k8s.gcr.io/hyperkube:v1.18.6'
command:
- /bin/bash
- '-c'
- |
function log() {
level=$1
msg=$2
date=$(date '+%F %H:%M:%S')
echo "[$date] $level $msg"
}
kubectl get ns ${TARGET_NAMESPACE}
if [[ $? =~ 1 ]]; then
kubectl create ns ${TARGET_NAMESPACE}
kubectl label ns ${TARGET_NAMESPACE} name=lma
log "INFO" "${TARGET_NAMESPACE} successfully created."
fi
kubectl get secret ${SECRET_NAME}
if [[ $? =~ 1 ]]; then
kubectl get secret ${SECRET_NAME} -n ${SOURCE_NAMESPACE} -o yaml \
| grep -v '^\s*namespace:\s' \
| kubectl apply -n ${TARGET_NAMESPACE} -f -
log "INFO" "${SECRET_NAME} successfully created."
fi
env:
- name: SECRET_NAME
value: '{{inputs.parameters.secret_name}}'
- name: SOURCE_NAMESPACE
value: '{{inputs.parameters.source_namespace}}'
- name: TARGET_NAMESPACE
value: '{{inputs.parameters.target_namespace}}'
resources: {}
activeDeadlineSeconds: 900
retryStrategy:
limit: 2
- name: sync-app
arguments: {}
inputs: {}
outputs: {}
metadata: {}
container:
name: sync-app
image: 'docker.io/sktdev/argocd:latest'
command:
- /bin/bash
- '-c'
- |
./argocd login $ARGO_SERVER --plaintext --insecure --username $ARGO_USERNAME \
--password $ARGO_PASSWORD
./argocd app sync -l app=service-mesh
envFrom:
- secretRef:
name: decapod-argocd-config
resources: {}
activeDeadlineSeconds: 900
retryStrategy:
limit: 2