Skip to content

Instantly share code, notes, and snippets.

@m4r10k
Created September 15, 2020 06:26
Show Gist options
  • Save m4r10k/dec6ba377275e666f862aadae0b51339 to your computer and use it in GitHub Desktop.
Save m4r10k/dec6ba377275e666f862aadae0b51339 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ (ds "data").name }}-{{ (ds "data").suffix }}
namespace: {{ (ds "data").namespace }}
spec:
replicas: {{ (ds "config").replicas }}
selector:
matchLabels:
service: {{ (ds "data").name }}-{{ (ds "data").suffix }}
template:
metadata:
labels:
{{ range $key, $value := (ds "data").labels }}
{{$key}}: {{$value}}
{{ end }}
service: {{ (ds "data").name }}-{{ (ds "data").suffix }}
spec:
securityContext:
{{- if has (ds "data") "runasid" }}
runAsUser: {{ (ds "data").runasid }}
runAsGroup: {{ (ds "data").runasid }}
{{- end }}
containers:
- image: {{ (ds "config").image }}
name: {{ (ds "data").name }}-{{ (ds "data").suffix }}
ports:
- protocol: TCP
containerPort: {{ (ds "data").containerport }}
{{ if (file.Exists "./tmp/kploy-customize/yaml/20-kploy-secrets.yaml") }}
envFrom:
- secretRef:
name: {{ (ds "data").name }}-{{ (ds "data").suffix }}
{{ end }}
resources:
{{ (ds "config").resources | data.ToYAML | strings.Indent 10 }}
imagePullSecrets:
- name: regcred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment