Skip to content

Commit e36251c

Browse files
authored
Merge pull request #6 from HomeDevopsLab/multiple-ingresses
Release 2.3.0
2 parents a3632b1 + 68f0618 commit e36251c

File tree

8 files changed

+75
-43
lines changed

8 files changed

+75
-43
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
11
# Changelog
22

3+
## [2.3.0] - 2024-08-05
4+
5+
### Changed
6+
7+
- removed liveness probes
8+
- redefined startup probes
9+
10+
### Added
11+
12+
- private container registries support (imagePullSecrets)
13+
- support of multiple ingresses to single deployment
14+
315
## [2.2.0] - 2023-08-11
16+
417
### Added
18+
519
- option to run containers with additional command and args.
620

721
## [2.1.0] - 2023-07-27
22+
823
### Added
9-
- replaced strict TCP protocol family in ports specification with variable: protocol which allows to decide which protocol is needed
1024

25+
- replaced strict TCP protocol family in ports specification with variable: protocol which allows to decide which protocol is needed
1126

1227
## [2.0.0] - 2023-07-21
28+
1329
### Added
30+
1431
- ability to use nodeSelector function
1532

1633
## [1.0.3] - 2023-06-05
34+
1735
### Chaged
36+
1837
- increased failure threshold
38+
1939
## [1.0.2] - 2023-05-25
2040

2141
### Fixed

chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 2.2.0
18+
version: 2.3.0
1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application. Versions are not expected to
2121
# follow Semantic Versioning. They should reflect the version the application is using.

chart/templates/deployment.yaml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,17 @@ spec:
6262
protocol: TCP
6363
{{- end }}
6464
{{- if .Values.startupProbes.enabled }}
65-
{{- $livenessPort := 80 }}
66-
{{- range .Values.services }}
67-
{{- if eq .name "http" }}
68-
{{- $livenessPort = .targetPort }}
69-
{{- end }}
70-
{{- end }}
71-
livenessProbe:
72-
httpGet:
73-
path: /
74-
port: {{ $livenessPort }}
75-
failureThreshold: 10
76-
periodSeconds: 10
7765
startupProbe:
7866
httpGet:
7967
path: /
80-
port: {{ $livenessPort }}
68+
port: {{ .Values.startupProbes.port | default 80 }}
8169
failureThreshold: 30
8270
periodSeconds: 10
8371
{{- end }}
72+
{{ if .Values.image.registrySecret }}
73+
imagePullSecrets:
74+
- name: {{ .Values.image.registrySecret }}
75+
{{ end }}
8476
nodeSelector:
8577
{{- with .Values.nodeSelector }}
8678
{{- toYaml . | nindent 8 }}

chart/templates/imagerepository.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ metadata:
77
namespace: flux-system
88
spec:
99
image: {{ .Values.image.repository }}
10+
{{ if .Values.image.registrySecret }}
11+
secretRef:
12+
name: {{ .Values.image.registrySecret }}
13+
{{- end }}
1014
interval: 1m0s
1115
{{- end -}}

chart/templates/ingress.yaml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
11
{{- if .Values.ingress.enabled -}}
2-
{{- $svcPort := 0 -}}
3-
{{- range .Values.services -}}
4-
{{- if eq .name "http" -}}
5-
{{- $svcPort = .servicePort -}}
6-
{{- else -}}
7-
{{- $svcPort = "80" -}}
8-
{{- end -}}
9-
{{- end -}}
2+
{{- range .Values.ingress.hosts }}
3+
{{- $subdomain := .name | splitList "." | first -}}
4+
{{- $ReleaseName := printf "%s-%s" $.Release.Name $subdomain -}}
5+
---
106
apiVersion: networking.k8s.io/v1
117
kind: Ingress
128
metadata:
13-
name: {{ .Release.Name }}
9+
name: {{ $ReleaseName }}
1410
namespace: default
15-
{{- if .Values.ingress.ssl }}
11+
{{- if $.Values.ingress.ssl }}
1612
annotations:
1713
kubernetes.io/ingress.class: traefik
1814
cert-manager.io/cluster-issuer: letsencrypt
1915
traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
2016
{{- end }}
2117
spec:
2218
rules:
23-
{{- range .Values.ingress.hosts }}
24-
- host: {{ .host | quote }}
19+
- host: {{ .name }}
2520
http:
2621
paths:
2722
- path: /
2823
pathType: Prefix
2924
backend:
3025
service:
31-
name: {{ $.Release.Name }}-http-svc
26+
name: {{ $ReleaseName }}
3227
port:
33-
number: {{ $svcPort }}
34-
{{- end }}
35-
{{- if .Values.ingress.ssl }}
28+
number: {{ .servicePort }}
29+
{{- if $.Values.ingress.ssl }}
3630
tls:
37-
{{- range .Values.ingress.tls }}
38-
- secretName: {{ $.Release.Name }}-tls
31+
- secretName: {{ $ReleaseName }}-tls
3932
hosts:
40-
- {{ .hosts | first }}
33+
- {{ .name }}
4134
{{- end }}
35+
{{ printf "\n" }}
4236
{{- end }}
4337
{{- end -}}

chart/templates/service.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55
apiVersion: v1
66
kind: Service
77
metadata:
8-
name: {{ $.Release.Name }}-{{ .name }}-svc
8+
name: "{{ $.Release.Name }}-{{ .name }}"
99
namespace: default
1010
spec:
11-
{{- if eq .name "http" }}
12-
type: ClusterIP
13-
{{- else }}
14-
type: LoadBalancer
15-
{{- end }}
11+
type: {{ .type }}
1612
ports:
1713
- name: {{ .name }}
1814
protocol: {{ .protocol }}

chart/test_values.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
replicaCount: 1
22
image:
3+
registrySecret: gitlab-registry
34
imagePolicy: enabled
45
repository: devkrolikowski/swiss-army-knife
56
tag: 0.3.0 # {"$imagepolicy": "flux-system:helper:tag"}
@@ -14,8 +15,8 @@ resources:
1415
requests:
1516
memory: "1024Mi"
1617
cpu: "1"
17-
ingress:
18-
enabled: false
18+
# ingress:
19+
# enabled: false
1920
volumes:
2021
enabled: true
2122
mountPath:
@@ -25,4 +26,28 @@ volumes:
2526
server: lab-storage.lan
2627
path: /volume1/storagelab
2728
nodeSelector:
28-
kubernetes.io/arch: arm64
29+
kubernetes.io/arch: arm64
30+
services:
31+
- name: http
32+
type: ClusterIP
33+
protocol: 'TCP'
34+
servicePort: 80
35+
targetPort: 80
36+
- name: ssh
37+
type: LoadBalancer
38+
protocol: 'TCP'
39+
servicePort: 2223
40+
targetPort: 22
41+
- name: registry
42+
type: ClusterIP
43+
protocol: 'TCP'
44+
servicePort: 5050
45+
targetPort: 5050
46+
ingress:
47+
enabled: true
48+
ssl: true
49+
hosts:
50+
- name: gitlab.angrybits.pl
51+
servicePort: 80
52+
- name: registry.lab.angrybits.pl
53+
servicePort: 5050

chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ image:
99
tag: ""
1010
command: []
1111
args: []
12+
registrySecret: ""
1213
env: {}
1314
resources:
1415
limits:

0 commit comments

Comments
 (0)