Skip to content

Commit

Permalink
chore: cleanup helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Oct 22, 2024
1 parent 56200d7 commit d457789
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 54 deletions.
20 changes: 10 additions & 10 deletions charts/radix-ingress-deafult-backend/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "prometheus-proxy.name" -}}
{{- define "default-backend.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "prometheus-proxy.fullname" -}}
{{- define "default-backend.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "prometheus-proxy.chart" -}}
{{- define "default-backend.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "prometheus-proxy.labels" -}}
helm.sh/chart: {{ include "prometheus-proxy.chart" . }}
{{ include "prometheus-proxy.selectorLabels" . }}
{{- define "default-backend.labels" -}}
helm.sh/chart: {{ include "default-backend.chart" . }}
{{ include "default-backend.selectorLabels" . }}
{{- if .Chart.Version }}
app.kubernetes.io/version: {{ .Chart.Version | quote }}
{{- end }}
Expand All @@ -45,14 +45,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "prometheus-proxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "prometheus-proxy.name" . }}
{{- define "default-backend.selectorLabels" -}}
app.kubernetes.io/name: {{ include "default-backend.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "prometheus-proxy.serviceAccountName" -}}
{{- default (include "prometheus-proxy.fullname" .) .Values.serviceAccount.name }}
{{- define "default-backend.serviceAccountName" -}}
{{- default (include "default-backend.fullname" .) .Values.serviceAccount.name }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "prometheus-proxy.fullname" . }}
name: {{ template "default-backend.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "prometheus-proxy.labels" . | nindent 4 }}
{{- include "default-backend.labels" . | nindent 4 }}
{{- with .Values.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -13,11 +13,11 @@ spec:
replicas: 1
selector:
matchLabels:
{{- include "prometheus-proxy.selectorLabels" . | nindent 6 }}
{{- include "default-backend.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "prometheus-proxy.selectorLabels" . | nindent 8 }}
{{- include "default-backend.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
38 changes: 0 additions & 38 deletions charts/radix-ingress-deafult-backend/templates/ingress.api.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions charts/radix-ingress-deafult-backend/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "prometheus-proxy.fullname" . }}
name: {{ include "default-backend.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
spec:
selector:
{{- include "prometheus-proxy.selectorLabels" . | nindent 6 }}
{{- include "default-backend.selectorLabels" . | nindent 6 }}
ports:
- name: http
port: 8000

0 comments on commit d457789

Please sign in to comment.