Skip to content

Commit

Permalink
Merge pull request #4 from InfraWay/DEV-2060
Browse files Browse the repository at this point in the history
DEV-2060: add ingress and SA
  • Loading branch information
maZahaca authored Nov 15, 2024
2 parents e2f5bf0 + 01f73f9 commit 8fde4ce
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/senfu/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ 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.1.1
version: 0.1.2
7 changes: 6 additions & 1 deletion charts/senfu/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@ spec:
items:
- key: nginx.conf
path: nginx.conf
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
- name: regcred
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccount }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- end }}
45 changes: 45 additions & 0 deletions charts/senfu/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "senfu.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "senfu.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ $fullName }}-{{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/senfu/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "senfu.serviceAccountName" . }}
labels:
{{- include "senfu.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/senfu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ externalSecrets:
enabled: false
secretStoreName: ""
secrets: []

ingress:
enabled: false

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
create: false
annotations: {}
name: ""

0 comments on commit 8fde4ce

Please sign in to comment.