fix pathing
This commit is contained in:
24
charts/app/templates/_helpers.tpl
Normal file
24
charts/app/templates/_helpers.tpl
Normal file
@@ -0,0 +1,24 @@
|
||||
{{/*
|
||||
Resource name: explicit .Values.name wins, else the release name.
|
||||
Keeping this in one helper means every template names things identically.
|
||||
*/}}
|
||||
{{- define "app.name" -}}
|
||||
{{- default .Release.Name .Values.name -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels stamped on every object, so `kubectl get all -l ...` and ArgoCD
|
||||
can group a service's resources together.
|
||||
*/}}
|
||||
{{- define "app.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "app.name" . }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Selector labels: the stable subset used to wire Deployment <-> Service. Must
|
||||
NOT change over a release's life or the Service would stop matching the pods.
|
||||
*/}}
|
||||
{{- define "app.selectorLabels" -}}
|
||||
app: {{ include "app.name" . }}
|
||||
{{- end -}}
|
||||
40
charts/app/templates/deployment.yaml
Normal file
40
charts/app/templates/deployment.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "app.name" . }}
|
||||
labels:
|
||||
{{- include "app.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "app.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "app.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ include "app.name" . }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.containerPort }}
|
||||
{{- with .Values.env }}
|
||||
env:
|
||||
{{- range $key, $val := . }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.envFromSecret }}
|
||||
# Loads every key of this Secret as an env var. In Phase 5 this Secret
|
||||
# is created + kept in sync by the External Secrets Operator.
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ .Values.envFromSecret }}
|
||||
{{- end }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
32
charts/app/templates/ingress.yaml
Normal file
32
charts/app/templates/ingress.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- if not .Values.ingress.host }}
|
||||
{{- fail "ingress.enabled is true but ingress.host is empty — set the hostname in your service's values.yaml" }}
|
||||
{{- end }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "app.name" . }}
|
||||
labels:
|
||||
{{- include "app.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
# Phase 1: cert-manager issues the cert. Phase 2: external-dns reads the
|
||||
# host below and creates the DNS record. Both driven off this one Ingress.
|
||||
cert-manager.io/cluster-issuer: {{ .Values.ingress.clusterIssuer }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ .Values.ingress.host }}
|
||||
secretName: {{ .Values.ingress.tlsSecretName | default (printf "%s-tls" (include "app.name" .)) }}
|
||||
rules:
|
||||
- host: {{ .Values.ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "app.name" . }}
|
||||
port:
|
||||
number: {{ .Values.service.port }}
|
||||
{{- end }}
|
||||
12
charts/app/templates/service.yaml
Normal file
12
charts/app/templates/service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "app.name" . }}
|
||||
labels:
|
||||
{{- include "app.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
{{- include "app.selectorLabels" . | nindent 4 }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.containerPort }}
|
||||
Reference in New Issue
Block a user