Use more generic name "django" instead of glitchtip for template

variables
This commit is contained in:
David Burke 2021-02-12 17:39:59 -05:00
parent e957cae6de
commit 883d0c6d20
15 changed files with 76 additions and 76 deletions

View file

@ -6,16 +6,16 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- else if contains "NodePort" .Values.web.service.type }} {{- else if contains "NodePort" .Values.web.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "glitchtip.fullname" . }}) export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "django.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.web.service.type }} {{- else if contains "LoadBalancer" .Values.web.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "glitchtip.fullname" . }}' You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "django.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "glitchtip.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "django.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.web.service.port }} echo http://$SERVICE_IP:{{ .Values.web.service.port }}
{{- else if contains "ClusterIP" .Values.web.service.type }} {{- else if contains "ClusterIP" .Values.web.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "glitchtip.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "django.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application" echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }} {{- end }}

View file

@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "glitchtip.name" -}} {{- define "django.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
@ -11,7 +11,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name. If release name contains chart name it will be used as a full name.
*/}} */}}
{{- define "glitchtip.fullname" -}} {{- define "django.fullname" -}}
{{- if .Values.fullnameOverride -}} {{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
@ -27,16 +27,16 @@ If release name contains chart name it will be used as a full name.
{{/* {{/*
Create chart name and version as used by the chart label. Create chart name and version as used by the chart label.
*/}} */}}
{{- define "glitchtip.chart" -}} {{- define "django.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{/* {{/*
Common labels Common labels
*/}} */}}
{{- define "glitchtip.labels" -}} {{- define "django.labels" -}}
helm.sh/chart: {{ include "glitchtip.chart" . }} helm.sh/chart: {{ include "django.chart" . }}
{{ include "glitchtip.selectorLabels" . }} {{ include "django.selectorLabels" . }}
{{- if .Chart.AppVersion }} {{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }} {{- end }}
@ -46,17 +46,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/* {{/*
Selector labels Selector labels
*/}} */}}
{{- define "glitchtip.selectorLabels" -}} {{- define "django.selectorLabels" -}}
app.kubernetes.io/name: {{ include "glitchtip.name" . }} app.kubernetes.io/name: {{ include "django.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}} {{- end -}}
{{/* {{/*
Create the name of the service account to use Create the name of the service account to use
*/}} */}}
{{- define "glitchtip.serviceAccountName" -}} {{- define "django.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}} {{- if .Values.serviceAccount.create -}}
{{ default (include "glitchtip.fullname" .) .Values.serviceAccount.name }} {{ default (include "django.fullname" .) .Values.serviceAccount.name }}
{{- else -}} {{- else -}}
{{ default "default" .Values.serviceAccount.name }} {{ default "default" .Values.serviceAccount.name }}
{{- end -}} {{- end -}}
@ -66,7 +66,7 @@ Create the name of the service account to use
Create a default fully qualified app name. Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}} */}}
{{- define "glitchtip.postgresql.fullname" -}} {{- define "django.postgresql.fullname" -}}
{{- if .Values.postgresql.fullnameOverride -}} {{- if .Values.postgresql.fullnameOverride -}}
{{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
@ -74,11 +74,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- if contains $name .Release.Name -}} {{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
{{- printf "%s-%s" .Release.Name "glitchtip-postgresql" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name "django-postgresql" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- define "glitchtip.redis.fullname" -}} {{- define "django.redis.fullname" -}}
{{- if .Values.redis.fullnameOverride -}} {{- if .Values.redis.fullnameOverride -}}
{{- .Values.redis.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- .Values.redis.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
@ -86,7 +86,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- if contains $name .Release.Name -}} {{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
{{- printf "%s-%s" .Release.Name "glitchtip-redis" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name "django-redis" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@ -94,9 +94,9 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{/* {{/*
Set redis host Set redis host
*/}} */}}
{{- define "glitchtip.redis.host" -}} {{- define "django.redis.host" -}}
{{- if .Values.redis.enabled -}} {{- if .Values.redis.enabled -}}
{{- template "glitchtip.redis.fullname" . -}}-redis-master {{- template "django.redis.fullname" . -}}-redis-master
{{- else -}} {{- else -}}
{{- .Values.redis.host | quote -}} {{- .Values.redis.host | quote -}}
{{- end -}} {{- end -}}
@ -105,16 +105,16 @@ Set redis host
{{/* {{/*
Set redis url Set redis url
*/}} */}}
{{- define "glitchtip.redis.url" -}} {{- define "django.redis.url" -}}
{{- if .Values.redis.enabled -}} {{- if .Values.redis.enabled -}}
redis://{{- template "glitchtip.redis.password" -}}{{- template "glitchtip.redis.fullname" . -}}-master redis://{{- template "django.redis.password" -}}{{- template "django.redis.fullname" . -}}-master
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/* {{/*
Set redis port Set redis port
*/}} */}}
{{- define "glitchtip.redis.port" -}} {{- define "django.redis.port" -}}
{{- if .Values.redis.enabled -}} {{- if .Values.redis.enabled -}}
"6379" "6379"
{{- else -}} {{- else -}}

View file

@ -1,15 +1,15 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "glitchtip.fullname" . }}-beat name: {{ include "django.fullname" . }}-beat
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
app.kubernetes.io/component: beat app.kubernetes.io/component: beat
spec: spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
{{- include "glitchtip.selectorLabels" . | nindent 6 }} {{- include "django.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: beat app.kubernetes.io/component: beat
template: template:
metadata: metadata:
@ -18,7 +18,7 @@ spec:
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
tag: "{{ .Values.image.tag }}" tag: "{{ .Values.image.tag }}"
labels: labels:
{{- include "glitchtip.selectorLabels" . | nindent 8 }} {{- include "django.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: beat app.kubernetes.io/component: beat
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
@ -52,14 +52,14 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: redis-password key: redis-password
name: {{ include "glitchtip.fullname" . }}-redis name: {{ include "django.fullname" . }}-redis
- name: REDIS_HOST - name: REDIS_HOST
value: {{ template "glitchtip.redis.host" . }} value: {{ template "django.redis.host" . }}
- name: REDIS_PORT - name: REDIS_PORT
value: {{ template "glitchtip.redis.port" . }} value: {{ template "django.redis.port" . }}
{{- end }} {{- end }}
envFrom: envFrom:
- secretRef: - secretRef:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
- configMapRef: - configMapRef:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}

View file

@ -1,9 +1,9 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
annotations: annotations:
"helm.sh/hook-weight": "-1" "helm.sh/hook-weight": "-1"
data: data:

View file

@ -1,9 +1,9 @@
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
annotations: annotations:
"helm.sh/hook": post-install,pre-upgrade "helm.sh/hook": post-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded

View file

@ -1,9 +1,9 @@
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
type: Opaque type: Opaque
data: data:
DATABASE_URL: {{ required "databaseURL is a required value." .Values.databaseURL | b64enc | quote }} DATABASE_URL: {{ required "databaseURL is a required value." .Values.databaseURL | b64enc | quote }}

View file

@ -2,9 +2,9 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ include "glitchtip.serviceAccountName" . }} name: {{ include "django.serviceAccountName" . }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }} {{- with .Values.serviceAccount.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}

View file

@ -1,9 +1,9 @@
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: "{{ include "glitchtip.fullname" . }}-test-connection" name: "{{ include "django.fullname" . }}-test-connection"
labels: labels:
{{ include "glitchtip.labels" . | nindent 4 }} {{ include "django.labels" . | nindent 4 }}
annotations: annotations:
"helm.sh/hook": test "helm.sh/hook": test
spec: spec:
@ -11,5 +11,5 @@ spec:
- name: wget - name: wget
image: busybox image: busybox
command: ['wget'] command: ['wget']
args: ['{{ include "glitchtip.fullname" . }}:{{ .Values.web.service.port }}'] args: ['{{ include "django.fullname" . }}:{{ .Values.web.service.port }}']
restartPolicy: Never restartPolicy: Never

View file

@ -1,9 +1,9 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "glitchtip.fullname" . }}-web name: {{ include "django.fullname" . }}-web
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
spec: spec:
{{- if not .Values.web.autoscaling.enabled }} {{- if not .Values.web.autoscaling.enabled }}
@ -11,7 +11,7 @@ spec:
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
{{- include "glitchtip.selectorLabels" . | nindent 6 }} {{- include "django.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
template: template:
metadata: metadata:
@ -20,14 +20,14 @@ spec:
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
tag: "{{ .Values.image.tag }}" tag: "{{ .Values.image.tag }}"
labels: labels:
{{- include "glitchtip.selectorLabels" . | nindent 8 }} {{- include "django.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "glitchtip.serviceAccountName" . }} serviceAccountName: {{ include "django.serviceAccountName" . }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers: containers:
@ -66,11 +66,11 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: redis-password key: redis-password
name: {{ include "glitchtip.fullname" . }}-redis name: {{ include "django.fullname" . }}-redis
- name: REDIS_HOST - name: REDIS_HOST
value: {{ template "glitchtip.redis.host" . }} value: {{ template "django.redis.host" . }}
- name: REDIS_PORT - name: REDIS_PORT
value: {{ template "glitchtip.redis.port" . }} value: {{ template "django.redis.port" . }}
{{- end }} {{- end }}
- name: POD_IP - name: POD_IP
valueFrom: valueFrom:
@ -78,9 +78,9 @@ spec:
fieldPath: status.podIP fieldPath: status.podIP
envFrom: envFrom:
- secretRef: - secretRef:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
- configMapRef: - configMapRef:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
{{- with .Values.web.nodeSelector }} {{- with .Values.web.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

View file

@ -2,14 +2,14 @@
apiVersion: autoscaling/v2beta1 apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: {{ template "glitchtip.fullname" . }} name: {{ template "django.fullname" . }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
name: {{ template "glitchtip.fullname" . }}-web name: {{ template "django.fullname" . }}-web
minReplicas: {{ .Values.web.autoscaling.minReplicas }} minReplicas: {{ .Values.web.autoscaling.minReplicas }}
maxReplicas: {{ .Values.web.autoscaling.maxReplicas }} maxReplicas: {{ .Values.web.autoscaling.maxReplicas }}
metrics: metrics:

View file

@ -1,5 +1,5 @@
{{- if .Values.web.ingress.enabled -}} {{- if .Values.web.ingress.enabled -}}
{{- $fullName := include "glitchtip.fullname" . -}} {{- $fullName := include "django.fullname" . -}}
{{- $svcPort := .Values.web.service.port -}} {{- $svcPort := .Values.web.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
@ -10,7 +10,7 @@ kind: Ingress
metadata: metadata:
name: {{ $fullName }} name: {{ $fullName }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
{{- with .Values.web.ingress.annotations }} {{- with .Values.web.ingress.annotations }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}

View file

@ -3,14 +3,14 @@
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ include "glitchtip.fullname" . }}-web name: {{ include "django.fullname" . }}-web
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
spec: spec:
minAvailable: {{ .Values.web.budget.minAvailable }} minAvailable: {{ .Values.web.budget.minAvailable }}
selector: selector:
matchLabels: matchLabels:
{{- include "glitchtip.selectorLabels" . | nindent 6 }} {{- include "django.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -1,9 +1,9 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "glitchtip.fullname" . }}-web name: {{ include "django.fullname" . }}-web
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
spec: spec:
type: {{ .Values.web.service.type }} type: {{ .Values.web.service.type }}
ports: ports:
@ -12,5 +12,5 @@ spec:
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
{{- include "glitchtip.selectorLabels" . | nindent 4 }} {{- include "django.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: web app.kubernetes.io/component: web

View file

@ -1,15 +1,15 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ include "glitchtip.fullname" . }}-worker name: {{ include "django.fullname" . }}-worker
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
app.kubernetes.io/component: worker app.kubernetes.io/component: worker
spec: spec:
replicas: {{ .Values.worker.replicaCount }} replicas: {{ .Values.worker.replicaCount }}
selector: selector:
matchLabels: matchLabels:
{{- include "glitchtip.selectorLabels" . | nindent 6 }} {{- include "django.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: worker app.kubernetes.io/component: worker
template: template:
metadata: metadata:
@ -18,7 +18,7 @@ spec:
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
tag: "{{ .Values.image.tag }}" tag: "{{ .Values.image.tag }}"
labels: labels:
{{- include "glitchtip.selectorLabels" . | nindent 8 }} {{- include "django.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: worker app.kubernetes.io/component: worker
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
@ -47,17 +47,17 @@ spec:
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
key: redis-password key: redis-password
name: {{ include "glitchtip.fullname" . }}-redis name: {{ include "django.fullname" . }}-redis
- name: REDIS_HOST - name: REDIS_HOST
value: {{ template "glitchtip.redis.host" . }} value: {{ template "django.redis.host" . }}
- name: REDIS_PORT - name: REDIS_PORT
value: {{ template "glitchtip.redis.port" . }} value: {{ template "django.redis.port" . }}
{{- end }} {{- end }}
envFrom: envFrom:
- secretRef: - secretRef:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
- configMapRef: - configMapRef:
name: {{ include "glitchtip.fullname" . }} name: {{ include "django.fullname" . }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

View file

@ -2,14 +2,14 @@
apiVersion: autoscaling/v2beta1 apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: {{ template "glitchtip.fullname" . }} name: {{ template "django.fullname" . }}
labels: labels:
{{- include "glitchtip.labels" . | nindent 4 }} {{- include "django.labels" . | nindent 4 }}
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
name: {{ template "glitchtip.fullname" . }}-worker name: {{ template "django.fullname" . }}-worker
minReplicas: {{ .Values.worker.autoscaling.minReplicas }} minReplicas: {{ .Values.worker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }} maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }}
metrics: metrics: