apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Chart.Name }} labels: app: {{ .Chart.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: app: {{ .Chart.Name }} template: metadata: labels: app: {{ .Chart.Name }} spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP {{- if .Values.probes.liveness.enabled }} livenessProbe: httpGet: path: {{ .Values.probes.liveness.path }} port: {{ .Values.probes.liveness.port }} initialDelaySeconds: 30 periodSeconds: 10 {{- end }} {{- if .Values.probes.readiness.enabled }} readinessProbe: httpGet: path: {{ .Values.probes.readiness.path }} port: {{ .Values.probes.readiness.port }} initialDelaySeconds: 5 periodSeconds: 5 {{- end }} env: {{- toYaml .Values.env | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} --- apiVersion: v1 kind: Service metadata: name: {{ .Chart.Name }} spec: type: {{ .Values.service.type }} selector: app: {{ .Chart.Name }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http {{- if .Values.ingress.enabled }} --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Chart.Name }} annotations: {{- if .Values.ingress.className }} kubernetes.io/ingress.class: {{ .Values.ingress.className }} {{- end }} spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }} {{- end }} rules: - host: {{ .Values.ingress.host }} http: paths: - path: {{ .Values.ingress.path | default "/" }} pathType: Prefix backend: service: name: {{ .Chart.Name }} port: number: {{ .Values.service.port }} {{- end }}