mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
Change some practice
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}-{{ .Release.Name }}
|
||||
labels:
|
||||
app: {{ .Chart.Name }}-{{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{ if .Values.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.annotations | indent 4 }}
|
||||
{{ end -}}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas | default 2 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Chart.Name }}-{{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Chart.Name }}-{{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: {{ .Values.image.name }}:{{ .Values.image.tag }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.port }}
|
||||
{{ if .Values.env }}
|
||||
env:
|
||||
{{- range $key, $val := .Values.env }}
|
||||
- name: {{ $key | quote }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 10 -}}
|
||||
|
||||
Reference in New Issue
Block a user