{{- define "fullname" -}} {{- .Chart.Name }} {{- end }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Chart.Name }} labels: app: {{ .Chart.Name }} 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: - containerPort: {{ .Values.service.port }} name: http livenessProbe: {{- if .Values.probes.liveness.enabled }} httpGet: path: {{ .Values.probes.liveness.path }} port: {{ .Values.probes.liveness.port }} initialDelaySeconds: 30 periodSeconds: 10 {{- else }} exec: command: ["true"] {{- end }} readinessProbe: {{- if .Values.probes.readiness.enabled }} httpGet: path: {{ .Values.probes.readiness.path }} port: {{ .Values.probes.readiness.port }} initialDelaySeconds: 5 periodSeconds: 5 {{- else }} exec: command: ["true"] {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} env: {{- toYaml .Values.env | nindent 12 }} --- apiVersion: v1 kind: Service metadata: name: {{ .Chart.Name }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http selector: app: {{ .Chart.Name }} {{- if .Values.ingress.enabled }} --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Chart.Name }} annotations: traefik.ingress.kubernetes.io/router.entrypoints: web spec: rules: - host: {{ .Values.ingress.host }} http: paths: - path: {{ .Values.ingress.path }} pathType: Prefix backend: service: name: {{ .Chart.Name }} port: number: {{ .Values.service.port }} {{- end }}