Skip to content

Commit 8b679bc

Browse files
author
Alexander Weber
committed
+ HELM values example
1 parent 14c0e0f commit 8b679bc

8 files changed

Lines changed: 98 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 0.11
2+
templates:
3+
chart:
4+
content:
5+
file: "./Chart.tpl.yaml"
6+
values:
7+
version:
8+
prompt: "Enter the semver for the chart and app version"
9+
dev:
10+
content:
11+
file: "./values.dev.yaml"
12+
helpers:
13+
"_decrypt":
14+
shell: |-
15+
printf "$(echo $VALUE | openssl aes-256-cbc -d -a -pass $MY_SECRET_PASS)"
16+
values:
17+
env:
18+
static: "dev"
19+
prod:
20+
content:
21+
file: "./values.prod.yaml"
22+
helpers:
23+
"_decrypt":
24+
shell: |-
25+
printf "$(echo $VALUE | openssl aes-256-cbc -d -a -pass $MY_SECRET_PASS)"
26+
values:
27+
env:
28+
static: "prod"

examples/helm/Chart.tpl.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
name: "complate-helm-example"
3+
description: none
4+
5+
type: application
6+
version: "{{ version }}"
7+
appVersion: "{{ version }}"
8+
9+
dependencies: []

examples/helm/render.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# MY_SECRET_PASS should be set as env var in CI
4+
echo ">>> values dev <<<"
5+
echo ""
6+
complate -e render -t chart -v "version=0.1.0"
7+
echo ">>> values dev <<<"
8+
echo ""
9+
MY_SECRET_PASS="pass:superpass" complate -e render -t dev --helpers --shell-trust=ultimate
10+
echo ""
11+
echo ">>> values prod <<<"
12+
echo ""
13+
MY_SECRET_PASS="pass:superpass" complate -e render -t prod --helpers --shell-trust=ultimate
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Release.Name }}-{{ .Values.env }}-nginx
5+
spec:
6+
selector:
7+
matchLabels:
8+
app: {{ .Release.Name }}-{{ .Values.env }}-nginx
9+
strategy:
10+
type: Recreate
11+
revisionHistoryLimit: 0
12+
template:
13+
metadata:
14+
labels:
15+
app: {{ .Release.Name }}-{{ .Values.env }}-nginx
16+
spec:
17+
containers:
18+
- name: {{ .Release.Name }}-{{ .Values.env }}-nginx
19+
image: nginx:{{ .Chart.AppVersion }}
20+
imagePullPolicy: Always
21+
env: []
22+
ports:
23+
- containerPort: 80
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: some-secret
5+
type: Opaque
6+
stringData:
7+
{{- toYaml .Values.secret | nindent 2 }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Release.Name }}-{{ .Values.env }}-nginx
5+
spec:
6+
type: ClusterIP
7+
ports:
8+
- port: 8080
9+
targetPort: 80
10+
protocol: TCP
11+
selector:
12+
app: {{ .Release.Name }}-{{ .Values.env }}-nginx

examples/helm/values.dev.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
env: "{{ env }}"
2+
secret:
3+
apikey: '{{ _decrypt "U2FsdGVkX1/ugUBmzFwL8/GrodAJqhzuZSphwFqBuKa8t1tjWU+OjZ6dmXmO83Wq" }}'

examples/helm/values.prod.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
env: "{{ env }}"
2+
secret:
3+
apikey: '{{ _decrypt "U2FsdGVkX19o7/B7vdP8iTC5ToQl8mq6i1SEdrRy5R9Q0GhIahXqCY8PXkhTrRIx" }}'

0 commit comments

Comments
 (0)