Skip to content
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

fix: clusterIP None in the service and name of it. #90

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion charts/polymorphic-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ description: A Helm chart for deploying any custom applications, specifically po
maintainers:
- name: improwised
type: application
version: 2.2.1
version: 2.2.2
appVersion: 1.0.0
31 changes: 21 additions & 10 deletions charts/polymorphic-app/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ spec:
port: {{ .healthcheck.port }}
timeoutSeconds: 7
initialDelaySeconds: {{ .healthcheck.initialDelaySeconds | default "20" }}
periodSeconds: {{ .healthcheck.periodSeconds | default "20" }}
periodSeconds: {{ .healthcheck.periodSeconds | default "20" }}
readinessProbe:
httpGet:
path: {{ .healthcheck.path }}
port: {{ .healthcheck.port }}
timeoutSeconds: 7
initialDelaySeconds: {{ .healthcheck.initialDelaySeconds | default "20" }}
periodSeconds: {{ .healthcheck.periodSeconds | default "20" }}
periodSeconds: {{ .healthcheck.periodSeconds | default "20" }}
{{- else if and (eq $healthType "tcpSocket") ( .healthcheck.port ) }}
livenessProbe:
tcpSocket:
Expand All @@ -172,14 +172,14 @@ spec:
port: {{ $.Values.serviceTemplate.healthcheck.port }}
timeoutSeconds: 7
initialDelaySeconds: {{ $.Values.serviceTemplate.healthcheck.initialDelaySeconds | default "20" }}
periodSeconds: {{ $.Values.serviceTemplate.healthcheck.periodSeconds | default "20" }}
periodSeconds: {{ $.Values.serviceTemplate.healthcheck.periodSeconds | default "20" }}
readinessProbe:
httpGet:
path: {{ $.Values.serviceTemplate.healthcheck.path }}
port: {{ $.Values.serviceTemplate.healthcheck.port }}
timeoutSeconds: 7
initialDelaySeconds: {{ $.Values.serviceTemplate.healthcheck.initialDelaySeconds | default "20" }}
periodSeconds: {{ $.Values.serviceTemplate.healthcheck.periodSeconds | default "20" }}
periodSeconds: {{ $.Values.serviceTemplate.healthcheck.periodSeconds | default "20" }}
{{- else if and (eq $healthType "tcpSocket") ($.Values.serviceTemplate.healthcheck.port) }}
livenessProbe:
tcpSocket:
Expand Down Expand Up @@ -235,7 +235,7 @@ spec:
{{- end }}
{{- if .volumeClaimTemplates }}
volumeClaimTemplates:

{{ toYaml .volumeClaimTemplates | indent 8 }}
{{- end }}
{{- if $.Values.volumeClaimTemplates }}
Expand Down Expand Up @@ -289,7 +289,11 @@ apiVersion: v1
kind: Service
metadata:
{{- if $.Values.prefixWithReleaseName.enabled }}
{{- if .service.ClusterIP }}
name: "{{ $.Release.Name }}-{{ .name | default $.Values.serviceTemplate.name }}-svc-headless"
{{- else }}
name: "{{ $.Release.Name }}-{{ .name | default $.Values.serviceTemplate.name }}-svc"
{{- end }}
{{- else}}
name: "{{ .name | default $.Values.serviceTemplate.name }}"
{{- end }}
Expand All @@ -303,9 +307,9 @@ metadata:
spec:
type: {{ .service.type }}
{{- if .service.ClusterIP }}
ClusterIP: {{ .service.ClusterIP }}
clusterIP: {{ .service.ClusterIP }}
{{- end}}
ports:
ports:
{{- with .service.ports }}
{{ toYaml . | nindent 4 }}
{{- end }}
Expand All @@ -319,7 +323,11 @@ apiVersion: v1
kind: Service
metadata:
{{- if $.Values.prefixWithReleaseName.enabled }}
{{- if $.Values.serviceTemplate.service.ClusterIP }}
name: "{{ $.Release.Name }}-{{ .name | default $.Values.serviceTemplate.name }}-svc-headless"
{{- else }}
name: "{{ $.Release.Name }}-{{ .name | default $.Values.serviceTemplate.name }}-svc"
{{- end }}
{{- else}}
name: "{{ .name | default $.Values.serviceTemplate.name }}"
{{- end }}
Expand All @@ -332,7 +340,10 @@ metadata:
{{- end }}
spec:
type: {{ $.Values.serviceTemplate.service.type }}
ports:
{{- if $.Values.serviceTemplate.service.ClusterIP }}
clusterIP: {{ $.Values.serviceTemplate.service.ClusterIP }}
{{- end}}
ports:
{{- with $.Values.serviceTemplate.service.ports }}
{{ toYaml . | nindent 4 }}
{{- end }}
Expand Down Expand Up @@ -390,8 +401,8 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if or
(and $.Values.serviceTemplate.podDisruptionBudget.enabled (not (and .podDisruptionBudget (hasKey .podDisruptionBudget "enabled") (eq .podDisruptionBudget.enabled false))))
{{- if or
(and $.Values.serviceTemplate.podDisruptionBudget.enabled (not (and .podDisruptionBudget (hasKey .podDisruptionBudget "enabled") (eq .podDisruptionBudget.enabled false))))
(and .podDisruptionBudget (hasKey .podDisruptionBudget "enabled") .podDisruptionBudget.enabled)
}}
---
Expand Down