Skip to content

Commit

Permalink
Merge pull request #25 from foomo/squadron-keel-server-fix
Browse files Browse the repository at this point in the history
fix(squadron-keel-server): template
  • Loading branch information
franklinkim authored Oct 23, 2024
2 parents ab3b311 + 5970e75 commit a71373b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 36 deletions.
4 changes: 2 additions & 2 deletions charts/squadron-keel-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ annotations:
- name: Chart Source
url: https://github.com/foomo/helm-charts
version: 0.1.0
appVersion: 0.1.0
version: 0.1.1
appVersion: 0.1.1
6 changes: 3 additions & 3 deletions charts/squadron-keel-server/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# squadron-keel-server

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.1](https://img.shields.io/badge/AppVersion-0.1.1-informational?style=flat-square)

Squadron Keel Server chart

Expand Down Expand Up @@ -29,12 +29,12 @@ Squadron Keel Server chart
| graceful.delaySeconds | int | `15` | Seconds to wait for kubernetes to deregister |
| graceful.enabled | bool | `false` | Indicates wether graceful shutdown is enabled |
| graceful.periodSeconds | int | `45` | Total seconds for the grace period |
| image | object | `{"pullPolicy":"IfNotPresent","recreate":false,"repository":"","tag":""}` | Image settings |
| image | object | `{"pullPolicy":"IfNotPresent","pullSecrets":[],"recreate":false,"repository":"","tag":""}` | Image settings |
| image.pullPolicy | string | `"IfNotPresent"` | Image tag |
| image.pullSecrets | list | `[]` | Image pull secrets |
| image.recreate | bool | `false` | Force recreation |
| image.repository | string | `""` | Image repository |
| image.tag | string | `""` | Image tag |
| imagePullSecrets | list | `[]` | Image pull secrets |
| ingress | object | `{"additionalLabels":{},"annotations":{},"className":"","enabled":false,"hosts":[],"paths":[],"tls":[]}` | Ingress settings |
| ingress.additionalLabels | object | `{}` | Additional labels |
| ingress.annotations | object | `{}` | Ingress annotations |
Expand Down
21 changes: 17 additions & 4 deletions charts/squadron-keel-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ 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.
*/}}
{{- define "keel.server.chart" -}}
{{- if .Values.image.recreate }}
{{- printf "%s-%s-%d" .Chart.Name .Chart.Version .Release.Revision | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- else }}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "keel.server.chart-revision" -}}
{{- printf "%s-%s-%d" .Chart.Name .Chart.Version .Release.Revision | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
Expand Down Expand Up @@ -152,3 +155,13 @@ OpenTelemetry standard envs
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ .Values.otel.otlp.endpoint }}"
{{- end -}}

{{/*
Deployment force recreate annotions
{{- include "keel.server.annotations.recreatePod" . | nindent 8 }}
*/}}
{{- define "keel.server.annotations.recreatePod" -}}
{{- if .Values.image.recreate }}
helm.sh/chart: {{ include "keel.server.chart-revision" . }}
{{- end }}
{{- end -}}
12 changes: 7 additions & 5 deletions charts/squadron-keel-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ spec:
labels:
{{- include "keel.server.selectorLabels" . | nindent 8 }}
{{- include "keel.server.networkingLabels" . | nindent 8 }}
{{- with .Values.server.podAnnotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- include "keel.server.annotations.recreatePod" . | nindent 8 }}
{{- with .Values.server.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "keel.server.serviceAccountName" . }}
{{- if .Values.graceful.enabled }}
terminationGracePeriodSeconds: {{ .Values.graceful.periodSeconds }}
{{- end }}
{{- with .Values.imagePullSecrets }}
{{- with .Values.image.pullSecrets }}
imagePullSecrets: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.hostAliases }}
Expand Down Expand Up @@ -86,7 +88,7 @@ spec:
{{- end }}
volumeMounts:
{{- if .Values.persistence.enabled }}
- name: storage
- name: {{ include "keel.server.fullname" . }}-data
mountPath: {{ .Values.persistence.mountPath }}
{{- end }}
{{- with .Values.server.additionalVolumeMounts }}
Expand Down
6 changes: 1 addition & 5 deletions charts/squadron-keel-server/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ metadata:
labels: {{- include "keel.server.labels" . | nindent 4 }}
namespace: {{ include "keel.server.namespace" . }}
type: Opaque
stringData:
{{- range $key, $value := .Values.secretEnv }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
stringData: {{ toYaml .Values.secretEnv | nindent 2 }}
---
{{- end }}
20 changes: 10 additions & 10 deletions charts/squadron-keel-server/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@
"required": [],
"title": "pullPolicy"
},
"pullSecrets": {
"description": "Image pull secrets",
"items": {
"required": [],
"type": "string"
},
"required": [],
"title": "pullSecrets",
"type": "array"
},
"recreate": {
"default": false,
"description": "Force recreation",
Expand Down Expand Up @@ -168,16 +178,6 @@
"title": "image",
"type": "object"
},
"imagePullSecrets": {
"description": "Image pull secrets",
"items": {
"required": [],
"type": "string"
},
"required": [],
"title": "imagePullSecrets",
"type": "array"
},
"ingress": {
"additionalProperties": false,
"description": "Ingress settings",
Expand Down
14 changes: 7 additions & 7 deletions charts/squadron-keel-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ image:
# -- Image tag
pullPolicy: IfNotPresent
# @schema
# type: array
# items:
# type: string
# @schema
# -- Image pull secrets
pullSecrets: [ ]
# @schema
# type: string
# required: true
# @schema
Expand All @@ -154,13 +161,6 @@ image:
# -- Image tag
tag: ''

# @schema
# type: array
# items:
# type: string
# @schema
# -- Image pull secrets
imagePullSecrets: [ ]

# @schema
# type: object
Expand Down

0 comments on commit a71373b

Please sign in to comment.