-
Notifications
You must be signed in to change notification settings - Fork 242
/
helm.json
238 lines (238 loc) · 6.93 KB
/
helm.json
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
{
"Chart.yaml": {
"prefix": "Chart.yaml",
"body": [
"apiVersion: v1",
"name: \"$1\"",
"description: \"${2:A helm chart}\"",
"version: 0.1.0"
],
"description": "Create a Chart.yaml file"
},
"ConfigMap": {
"prefix": "kindConfigMap",
"body": [
"kind: ConfigMap",
"apiVersion: v1",
"metadata:",
" name: ${1}",
" namespace: ${3:default}",
"data:",
" ${2}"
],
"description": "Create a ConfigMap manifest"
},
"Deployment": {
"prefix": "kindDeployment",
"body": [
"apiVersion: extensions/v1beta1",
"kind: Deployment",
"metadata: {{ \\$fullname := printf \"%s-%s\" .Release.Name .Chart.Name | trunc 63 | trimSuffix \"-\" }}",
" name: {{ \\$fullname }}",
" labels:",
" chart: \"{{ .Chart.Name }}-{{ .Chart.Version | replace \"+\" \"_\" }}\"",
"spec:",
" replicas: {{ default 1 .Values.replicaCount | int }}",
" template:",
" metadata:",
" labels:",
" app: {{ \\$fullname }}",
" spec:",
" containers:",
" - name: {{ .Chart.Name }}",
" image: \"{{ .Values.image }}\"",
" imagePullPolicy: IfNotPresent",
" ports:",
" - containerPort: {{ .Values.service.internalPort | int }}",
" livenessProbe:",
" httpGet:",
" path: /",
" port: {{ .Values.service.internalPort | int }}",
" readinessProbe:",
" httpGet:",
" path: /",
" port: {{ .Values.service.internalPort | int }}",
" resources:",
"{{ toYaml .Values.resources | indent 10 }}"
],
"description": "Create a Deployment manifest"
},
"Ingress": {
"prefix": "kindIngress",
"body": [
"{{- if .Values.ingress.enabled -}}",
"{{- \\$serviceName := $1 . -}}",
"{{- \\$servicePort := .Values.service.externalPort -}}",
"apiVersion: extensions/v1beta1",
"kind: Ingress",
"metadata:",
" name: $1",
" labels:",
" app: $1",
" chart: \"{{ .Chart.Name }}-{{ .Chart.Version | replace \"+\" \"_\" }}\"",
" release: \"{{ .Release.Name }}\"",
" heritage: \"{{ .Release.Service }}\"",
" annotations:",
" {{- range \\$key, \\$value := .Values.ingress.annotations }}",
" {{ \\$key }}: {{ \\$value | quote }}",
" {{- end }}",
"spec:",
" rules:",
" {{- range \\$host := .Values.ingress.hosts }}",
" - host: {{ \\$host }}",
" http:",
" paths:",
" - path: /",
" backend:",
" serviceName: {{ \\$serviceName }}",
" servicePort: {{ \\$servicePort }}",
" {{- end -}}",
" {{- if .Values.ingress.tls }}",
" tls:",
"{{ toYaml .Values.ingress.tls | indent 4 }}",
" {{- end -}}",
"{{- end -}}"
],
"description": "Create a Ingress manifest"
},
"Pod": {
"prefix": "kindPod",
"body": [
"apiVersion: v1",
"kind: Pod",
"metadata:",
" name: \"{{.Release.Name}}-{{.Values.Name}}\"",
" labels:",
" # The \"heritage\" label is used to track which tool deployed a given chart.",
" # It is useful for admins who want to see what releases a particular tool",
" # is responsible for.",
" heritage: {{.Release.Service | quote }}",
" # The \"release\" convention makes it easy to tie a release to all of the",
" # Kubernetes resources that were created as part of that release.",
" release: {{.Release.Name | quote }}",
" # This makes it easy to audit chart usage.",
" chart: \"{{.Chart.Name}}-{{.Chart.Version}}\"",
"spec:",
" # This shows how to use a simple value. This will look for a passed-in value",
" # called restartPolicy. If it is not found, it will use the default value.",
" # {{default \"Never\" .restartPolicy}} is a slightly optimized version of the",
" # more conventional syntax: {{.restartPolicy | default \"Never\"}}",
" restartPolicy: {{default \"Never\" .Values.restartPolicy}}",
" containers:",
" - name: main",
" image: \"{{ default \"alpine:3.3\" .Values.image }}\""
],
"description": "Create a Pod manifest"
},
"Secret": {
"prefix": "kindSecret",
"body": [
"apiVersion: v1",
"kind: Secret",
"metadata:",
" name: mysecret",
"type: Opaque",
"data:",
" # Example:",
" # password: {{ .Values.password | b64enc }}"
],
"description": "Create a Secret manifest"
},
"Service": {
"prefix": "kindService",
"body": [
"apiVersion: v1",
"kind: Service",
"metadata:",
" name: $1",
" labels:",
" chart: \"{{ .Chart.Name }}-{{ .Chart.Version | replace \"+\" \"_\" }}\"",
"spec:",
" type: {{ .Values.service.type }}",
" ports:",
" - port: {{ .Values.service.externalPort }}",
" targetPort: {{ .Values.service.internalPort }}",
" protocol: TCP",
" name: {{ .Values.service.name }}",
" selector:",
" app: $1"
],
"description": "Create a Service manifest"
},
"define": {
"prefix": "define",
"body": [
"{{- define \"${1}\" }}",
"${2}",
"{{- end -}}"
],
"description": "Define a template"
},
"if": {
"prefix": "if",
"body": [
"{{- if ${1:condition} -}}",
"{{- end -}}"
],
"description": "Create a conditional"
},
"ifelse": {
"prefix": "ifElse",
"body": [
"{{- if ${1:condition} -}}",
" ${2}",
"{{- else if ${3:condition2} -}}",
" ${4}",
"{{- else -}}",
" ${5}",
"{{- end -}}"
],
"description": "Create a conditional with else if, else"
},
"range-list": {
"prefix": "rangeList",
"body": [
"{{- range \\$i, \\$val := ${1:list} }}",
" $2",
"{{ end -}}"
],
"description": "Loop over a list"
},
"range-map": {
"prefix": "rangeDict",
"body": [
"{{- range \\$key, \\$val := ${1:dict} }}",
" $2",
"{{ end -}}"
],
"description": "Loop over a dict or map"
},
"range-until": {
"prefix": "rangeUntil",
"body": [
"{{- range \\$i := until ${1:number} }}",
" $2",
"{{ end -}}"
],
"description": "Loop a fixed number of times."
},
"requirements.yaml": {
"prefix": "requirements.yaml",
"body": [
"dependencies:",
"- name: ${1:redis}",
" version: \"${2:\u003e0.1.0}\"",
" repository: ${3:https://kubernetes-charts.storage.googleapis.com/}"
],
"description": "Create a Helm requirements.yaml"
},
"with": {
"prefix": "with",
"body": [
"{{- with ${1:.Values} }}",
" ${2}",
"{{- end -}}"
],
"description": "Create a with block"
}
}