Skip to content

Helm Chart Updates and Ingress Support #3484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions containers/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.37.9"
appVersion: "1.58.0"

maintainers:
- name: pglombardo
Expand Down
28 changes: 13 additions & 15 deletions containers/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "helm.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "helm.labels" . | nindent 4 }}
{{- range $k, $v := .Values.deployment.labels }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v | quote }}
{{- end }}
spec:
Expand All @@ -21,8 +20,8 @@ spec:
{{- end }}
labels:
{{- include "helm.selectorLabels" . | nindent 8 }}
{{- range $k, $v := .Values.deployment.labels }}
{{ $k }}: {{ $v | quote }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
securityContext:
Expand All @@ -33,19 +32,18 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range $key, $val := .Values.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.deployment.containerPort }}
containerPort: {{ .Values.service.port }}
protocol: TCP
{{- if .Values.deployment.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ .Values.deployment.livenessProbe.path }}
port: http
{{- end }}
{{- if .Values.deployment.readinessProbe.enabled }}
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
httpGet:
path: {{ .Values.deployment.readinessProbe.path }}
port: http
{{- end }}
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
46 changes: 46 additions & 0 deletions containers/helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "helm.fullname" . }}
labels:
{{- include "helm.labels" . | nindent 4 }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
backend:
service:
name: {{ include "helm.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 1 addition & 2 deletions containers/helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "helm.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "helm.labels" . | nindent 4 }}
{{- range $k, $v := .Values.deployment.labels }}
{{- range $k, $v := .Values.labels }}
{{ $k }}: {{ $v | quote }}
{{- end }}
spec:
Expand Down
56 changes: 43 additions & 13 deletions containers/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,55 @@ nameOverride: ""
fullnameOverride: ""
replicaCount: 1

deployment:
labels:
app: "pwpush"
# component: ingress-controller
# type: nginx
containerPort: 5100
readinessProbe:
enabled: true
path: /
livenessProbe:
enabled: true
path: /

image:
repository: docker.io/pglombardo/pwpush
pullPolicy: Always
tag: "release"

labels:
app: "pwpush"
podLabels:
app: "pwpush"

env:
PWP__ENABLE_LOGINS: true
# PWP__ENABLE_FILE_PUSHES: true
# PWP__FILES__STORAGE: local

livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http

resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

service:
type: ClusterIP
port: 5100
sessionAffinity: None

ingress:
enabled: false
className: "nginx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not hardcode the ingressclass. Usually you have a default one set by ingressclass.kubernetes.io/is-default-class: true.

annotations: {}
# kubernetes.io/ingress.class: nginx
# cert-manager.io/cluster-issuer: cluster-issuer
hosts:
- host: pwpush.example.com
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: pwpush-tls
# hosts:
# - pwpush.example.com
Loading