Skip to content

Commit 9966081

Browse files
committed
fix: 🐛 application.fullname
1 parent 61da063 commit 9966081

File tree

6 files changed

+96
-46
lines changed

6 files changed

+96
-46
lines changed

charts/application/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ 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: 0.1.0
18+
version: 0.1.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.1.0"
24+
appVersion: "0.1.1"

charts/application/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Thank you for installing {{ include "application.name" . }}.
1+
Thank you for installing {{ include "application.fullname" . }}.
22

33
{{- if .Values.repoUrl }}
44
GitHub Repository: {{ .Values.repoUrl }}
@@ -65,7 +65,7 @@ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
6565
{{- else if contains "ClusterIP" .Values.service.type }}
6666
To access your application using port-forward:
6767

68-
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "application.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
68+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "application.fullname" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
6969
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
7070
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
7171

charts/application/templates/_helpers.tpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
1111
If release name contains chart name it will be used as a full name.
1212
*/}}
1313
{{- define "application.fullname" -}}
14-
{{- if .Values.fullnameOverride }}
15-
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16-
{{- else }}
17-
{{- $name := default .Chart.Name .Values.nameOverride }}
18-
{{- if contains $name .Release.Name }}
1914
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20-
{{- else }}
21-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22-
{{- end }}
23-
{{- end }}
2415
{{- end }}
2516

2617
{{/*

charts/application/templates/deployment.yaml

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
- name: {{ include "application.fullname" . }}
4545
securityContext:
4646
{{- toYaml .Values.securityContext | nindent 12 }}
47-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
47+
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}
4848
imagePullPolicy: {{ .Values.image.pullPolicy }}
4949
{{- if .Values.service.port }}
5050
ports:
@@ -64,13 +64,69 @@ spec:
6464
- secretRef:
6565
name: {{ include "application.fullname" . }}
6666
{{- end }}
67-
{{- if .Values.healthcheck.enabled }}
67+
{{- with .Values.healthcheck }}
68+
{{- if .enabled }}
6869
livenessProbe:
69-
{{- toYaml .Values.healthcheck.livenessProbe | nindent 12 }}
70+
{{- if .livenessProbe }}
71+
{{- if .livenessProbe.tcpSocket }}
72+
tcpSocket:
73+
port: http
74+
{{- else if .livenessProbe.httpGet }}
75+
httpGet:
76+
port: {{ .livenessProbe.httpGet.port | default "http" }}
77+
path: {{ .livenessProbe.httpGet.path }}
78+
scheme: {{ .livenessProbe.httpGet.scheme | default "HTTP" }}
79+
{{- end }}
80+
{{- else }}
81+
tcpSocket:
82+
port: http
83+
{{- end }}
84+
initialDelaySeconds: {{ .livenessProbe.initialDelaySeconds | default 0 }}
85+
periodSeconds: {{ .livenessProbe.periodSeconds | default 10 }}
86+
timeoutSeconds: {{ .livenessProbe.timeoutSeconds | default 5 }}
87+
successThreshold: {{ .livenessProbe.successThreshold | default 1 }}
88+
failureThreshold: {{ .livenessProbe.failureThreshold | default 3 }}
7089
readinessProbe:
71-
{{- toYaml .Values.healthcheck.readinessProbe | nindent 12 }}
90+
{{- if .readinessProbe }}
91+
{{- if .readinessProbe.tcpSocket }}
92+
tcpSocket:
93+
port: {{ .readinessProbe.tcpSocket.port | default "http" }}
94+
{{- else if .readinessProbe.httpGet }}
95+
httpGet:
96+
port: {{ .readinessProbe.httpGet.port | default "http" }}
97+
path: {{ .readinessProbe.httpGet.path }}
98+
scheme: {{ .readinessProbe.httpGet.scheme | default "HTTP" }}
99+
{{- end}}
100+
{{- else}}
101+
tcpSocket:
102+
port: http
103+
{{- end }}
104+
initialDelaySeconds: {{ .readinessProbe.initialDelaySeconds | default 0 }}
105+
periodSeconds: {{ .readinessProbe.periodSeconds | default 10 }}
106+
timeoutSeconds: {{ .readinessProbe.timeoutSeconds | default 5 }}
107+
successThreshold: {{ .readinessProbe.successThreshold | default 1 }}
108+
failureThreshold: {{ .readinessProbe.failureThreshold | default 3 }}
72109
startupProbe:
73-
{{- toYaml .Values.healthcheck.startupProbe | nindent 12 }}
110+
{{- if .startupProbe }}
111+
{{- if .startupProbe.tcpSocket }}
112+
tcpSocket:
113+
port: {{ .startupProbe.tcpSocket.port | default "http" }}
114+
{{- else if .startupProbe.httpGet }}
115+
httpGet:
116+
port: {{ .startupProbe.httpGet.port | default "http" }}
117+
path: {{ .startupProbe.httpGet.path }}
118+
scheme: {{ .startupProbe.httpGet.scheme | default "HTTP" }}
119+
{{- end }}
120+
{{- else }}
121+
tcpSocket:
122+
port: http
123+
{{- end }}
124+
initialDelaySeconds: {{ .startupProbe.initialDelaySeconds | default 0 }}
125+
periodSeconds: {{ .startupProbe.periodSeconds | default 10 }}
126+
timeoutSeconds: {{ .startupProbe.timeoutSeconds | default 5 }}
127+
successThreshold: {{ .startupProbe.successThreshold | default 1 }}
128+
failureThreshold: {{ .startupProbe.failureThreshold | default 3 }}
129+
{{- end }}
74130
{{- end }}
75131
{{- if .Values.resources }}
76132
resources:

charts/application/values-example.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nameOverride: "app"
1+
nameOverride: "nginx"
22

33
# github repository, for example: RSSNext/follow-server
44
repoUrl: "RSSNext/follow-server"
@@ -50,15 +50,15 @@ healthcheck:
5050
enabled: true
5151
livenessProbe:
5252
httpGet:
53-
path: /health
53+
path: /
5454
port: http
5555
readinessProbe:
5656
httpGet:
57-
path: /health
57+
path: /
5858
port: http
5959
startupProbe:
6060
httpGet:
61-
path: /health
61+
path: /
6262
port: http
6363

6464
strategy:

charts/application/values.yaml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,30 +110,33 @@ ingress:
110110
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
111111
healthcheck:
112112
enabled: true
113-
livenessProbe:
114-
tcpSocket:
115-
port: http
116-
initialDelaySeconds: 0
117-
periodSeconds: 10
118-
timeoutSeconds: 3
119-
successThreshold: 1
120-
failureThreshold: 3
121-
readinessProbe:
122-
tcpSocket:
123-
port: http
124-
initialDelaySeconds: 0
125-
periodSeconds: 10
126-
timeoutSeconds: 3
127-
successThreshold: 1
128-
failureThreshold: 3
129-
startupProbe:
130-
tcpSocket:
131-
port: http
132-
initialDelaySeconds: 0
133-
periodSeconds: 10
134-
timeoutSeconds: 3
135-
successThreshold: 1
136-
failureThreshold: 3
113+
livenessProbe: {}
114+
readinessProbe: {}
115+
startupProbe: {}
116+
# livenessProbe:
117+
# tcpSocket:
118+
# port: http
119+
# initialDelaySeconds: 0
120+
# periodSeconds: 10
121+
# timeoutSeconds: 3
122+
# successThreshold: 1
123+
# failureThreshold: 3
124+
# readinessProbe:
125+
# tcpSocket:
126+
# port: http
127+
# initialDelaySeconds: 0
128+
# periodSeconds: 10
129+
# timeoutSeconds: 3
130+
# successThreshold: 1
131+
# failureThreshold: 3
132+
# startupProbe:
133+
# tcpSocket:
134+
# port: http
135+
# initialDelaySeconds: 0
136+
# periodSeconds: 10
137+
# timeoutSeconds: 3
138+
# successThreshold: 1
139+
# failureThreshold: 3
137140

138141
# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
139142
autoscaling:

0 commit comments

Comments
 (0)