Skip to content

Commit

Permalink
chore: add correct labels and revert back nested checks
Browse files Browse the repository at this point in the history
  • Loading branch information
karimatwa committed Oct 4, 2024
1 parent 4b524d2 commit 6f9e58e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 39 deletions.
74 changes: 49 additions & 25 deletions helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,86 @@ metadata:
name: {{ .Values.controlPlane.name }}-deploy
namespace: {{ .Values.namespace }}
labels:
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{- toYaml .Values.controlPlane.deploymentLabels | nindent 4 }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
{{- if .Values.controlPlane.deploymentLabels }}
{{ toYaml .Values.controlPlane.deploymentLabels | nindent 6 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- toYaml .Values.controlPlane.podLabels | nindent 6 }}
app.kubernetes.io/name: {{ .Values.controlPlane.name }}
{{- if .Values.controlPlane.podLabels }}
{{ toYaml .Values.controlPlane.podLabels | nindent 6 }}
{{- end }}
template:
metadata:
labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{- toYaml .Values.controlPlane.podLabels | nindent 8 }}
app.kubernetes.io/name: {{ .Values.controlPlane.name }}
{{- if .Values.controlPlane.podLabels }}
{{ toYaml .Values.controlPlane.podLabels | nindent 8 }}
{{- end }}
spec:
serviceAccountName: "{{ .Values.controlPlane.name }}-service-account"
{{- if .Values.controlPlane.securityContext }}
securityContext:
{{- toYaml .Values.controlPlane.securityContext | nindent 8 }}
{{ toYaml .Values.controlPlane.securityContext | nindent 8 }}
{{- end }}
{{- if .Values.controlPlane.nodeSelector }}
nodeSelector:
{{- toYaml .Values.controlPlane.nodeSelector | nindent 8 }}
{{ toYaml .Values.controlPlane.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.controlPlane.affinity }}
affinity:
{{- toYaml .Values.controlPlane.affinity | nindent 8 }}
{{ toYaml .Values.controlPlane.affinity | nindent 8 }}
{{- end }}
{{- if .Values.controlPlane.tolerations }}
tolerations:
{{- toYaml .Values.controlPlane.tolerations | nindent 8 }}
{{ toYaml .Values.controlPlane.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.controlPlane.image.pullSecrets }}
imagePullSecrets:
{{- toYaml .Values.controlPlane.image.pullSecrets | nindent 8 }}
{{ toYaml .Values.controlPlane.image.pullSecrets | nindent 8 }}
{{- end }}
{{- if .Values.controlPlane.initContainers }}
initContainers:
{{- toYaml .Values.controlPlane.initContainers | nindent 8 }}
{{ toYaml .Values.controlPlane.initContainers | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.controlPlane.name }}
image: {{ .Values.controlPlane.image.name }}
imagePullPolicy: {{ .Values.controlPlane.image.pullPolicy }}
command:
{{- toYaml .Values.controlPlane.command | nindent 12 }}
{{- if .Values.controlPlane.command }}
command:
{{ toYaml .Values.controlPlane.command | nindent 12 }}
{{- end }}
{{- if .Values.controlPlane.env }}
env:
{{- toYaml .Values.controlPlane.env | nindent 12 }}
{{ toYaml .Values.controlPlane.env | nindent 12 }}
{{- end }}
{{- if .Values.controlPlane.resources }}
resources:
{{- toYaml .Values.controlPlane.resources | nindent 12 }}
{{- if .Values.privatePackage.enabled }}
ports:
- containerPort: {{ .Values.privatePackage.repository.server.port }}
{{ toYaml .Values.controlPlane.resources | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /app/conf/
name: "{{ .Values.controlPlane.name }}-conf-volume"
{{- if .Values.privatePackage.enabled }}
{{- if .Values.privatePackage.enabled }}
- mountPath: {{ .Values.privatePackage.repository.directory }}
name: "{{ .Values.controlPlane.name }}-pv-volume"
{{- end }}
{{- toYaml .Values.controlPlane.volumeMounts | nindent 12 }}
{{- end }}
{{- if .Values.controlPlane.volumeMounts }}
{{ toYaml .Values.controlPlane.volumeMounts | nindent 12 }}
{{- end }}
volumes:
- name: "{{ .Values.controlPlane.name }}-conf-volume"
configMap:
name: "{{ .Values.controlPlane.name }}-config"
{{- if .Values.privatePackage.enabled }}
{{- if .Values.privatePackage.enabled }}
- name: "{{ .Values.controlPlane.name }}-pv-volume"
persistentVolumeClaim:
claimName: "{{ .Values.controlPlane.name }}-pvc"
{{- end }}
{{- toYaml .Values.controlPlane.volumes | nindent 8 }}

{{- end }}
{{- if .Values.controlPlane.volumes }}
{{ toYaml .Values.controlPlane.volumes | nindent 8 }}
{{- end }}
24 changes: 10 additions & 14 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ controlPlane:
name: gatlingcorp/control-plane:latest
pullPolicy: IfNotPresent
pullSecrets: []
deploymentLabels:
app: gatling-cp-deploy
podLabels:
app: gatling-cp-pod
deploymentLabels: {}
podLabels: {}
initContainers: []
env: [] # Use KUBERNETES_TRUSTSTORE_FILE&KUBERNETES_TRUSTSTORE_PASSPHRASE/KUBERNETES_KEYSTORE_FILE&KUBERNETES_KEYSTORE_PASSPHRASE if custom truststore or keystore is needed to connect to the cluster via HTTPS.
command: []
Expand All @@ -22,16 +20,14 @@ controlPlane:
nodeSelector: {}
affinity: {}
tolerations: {}
#resources:
#requests:
#memory: "64Mi"
#cpu: "250m"
#limits:
#memory: "128Mi"
#cpu: "500m"
#securityContext:
#runAsUser: 1000
#runAsGroup: 3000
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
securityContext: {}
#extra_content: {}

privateLocations:
Expand Down

0 comments on commit 6f9e58e

Please sign in to comment.