Skip to content

Commit

Permalink
add webapp ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Feb 6, 2024
1 parent f45f1db commit 26625c3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/webapp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: webapp
description: basic webapp workload
type: application
version: 0.1.7
version: 0.1.8
appVersion: "1.16.0"
29 changes: 29 additions & 0 deletions charts/webapp/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "webapp.fullname" . }}
labels:
{{ include "webapp.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.ingressClass }}
tls:
- hosts:
- {{ .Values.ingress.hostname | quote }}
secretName: console-tls
rules:
- host: {{ .Values.ingress.hostname | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: console
port:
name: http
{{ end }}
15 changes: 15 additions & 0 deletions charts/webapp/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "webapp.fullname" . }}
labels:
{{ include "webapp.labels" . | indent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "webapp.selectorLabels" . | nindent 4 }}
9 changes: 5 additions & 4 deletions charts/webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ service:

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
ingressClass: nginx
annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: plural
nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
hosts:
- host: chart-example.local
paths:
Expand Down

0 comments on commit 26625c3

Please sign in to comment.