nats chart provisoning
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
name: nats-box
|
||||
{{ include "nats.image" (merge (pick $.Values "global") .Values.natsBox.container.image) }}
|
||||
|
||||
{{- with .Values.natsBox.container.env }}
|
||||
env:
|
||||
{{- include "nats.env" . }}
|
||||
{{- end }}
|
||||
|
||||
command:
|
||||
- sh
|
||||
- -ec
|
||||
- |
|
||||
work_dir="$(pwd)"
|
||||
mkdir -p "$XDG_CONFIG_HOME/nats"
|
||||
cd "$XDG_CONFIG_HOME/nats"
|
||||
if ! [ -s context ]; then
|
||||
ln -s /etc/nats-contexts context
|
||||
fi
|
||||
{{- if .Values.natsBox.defaultContextName }}
|
||||
if ! [ -f context.txt ]; then
|
||||
echo -n {{ .Values.natsBox.defaultContextName | quote }} > context.txt
|
||||
fi
|
||||
{{- end }}
|
||||
cd "$work_dir"
|
||||
exec /entrypoint.sh "$@"
|
||||
- --
|
||||
args:
|
||||
- sh
|
||||
- -ec
|
||||
- trap true INT TERM; sleep infinity & wait
|
||||
volumeMounts:
|
||||
# contexts secret
|
||||
- name: contexts
|
||||
mountPath: /etc/nats-contexts
|
||||
# contents secret
|
||||
{{- if .hasContentsSecret }}
|
||||
- name: contents
|
||||
mountPath: /etc/nats-contents
|
||||
{{- end }}
|
||||
# tlsCA
|
||||
{{- include "nats.tlsCAVolumeMount" $ }}
|
||||
# secrets
|
||||
{{- range (include "natsBox.secretNames" $ | fromJson).secretNames }}
|
||||
- name: {{ .name | quote }}
|
||||
mountPath: {{ .dir | quote }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- include "nats.metadataNamespace" $ | nindent 2 }}
|
||||
name: {{ .Values.natsBox.deployment.name }}
|
||||
labels:
|
||||
{{- include "natsBox.labels" $ | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "natsBox.selectorLabels" $ | nindent 6 }}
|
||||
replicas: 1
|
||||
template:
|
||||
{{- with .Values.natsBox.podTemplate }}
|
||||
{{ include "nats.loadMergePatch" (merge (dict "file" "nats-box/deployment/pod-template.yaml" "ctx" $) .) | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,44 @@
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "natsBox.labels" $ | nindent 4 }}
|
||||
spec:
|
||||
containers:
|
||||
{{- with .Values.natsBox.container }}
|
||||
- {{ include "nats.loadMergePatch" (merge (dict "file" "nats-box/deployment/container.yaml" "ctx" $) .) | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
# service discovery uses DNS; don't need service env vars
|
||||
enableServiceLinks: false
|
||||
|
||||
{{- with .Values.global.image.pullSecretNames }}
|
||||
imagePullSecrets:
|
||||
{{- range . }}
|
||||
- name: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.natsBox.serviceAccount }}
|
||||
{{- if .enabled }}
|
||||
serviceAccountName: {{ .name | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
volumes:
|
||||
# contexts secret
|
||||
- name: contexts
|
||||
secret:
|
||||
secretName: {{ .Values.natsBox.contextsSecret.name }}
|
||||
# contents secret
|
||||
{{- if .hasContentsSecret }}
|
||||
- name: contents
|
||||
secret:
|
||||
secretName: {{ .Values.natsBox.contentsSecret.name }}
|
||||
{{- end }}
|
||||
# tlsCA
|
||||
{{- include "nats.tlsCAVolume" $ | nindent 2 }}
|
||||
# secrets
|
||||
{{- range (include "natsBox.secretNames" $ | fromJson).secretNames }}
|
||||
- name: {{ .name | quote }}
|
||||
secret:
|
||||
secretName: {{ .secretName | quote }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user