diff --git a/charts/gke-ingress/Chart.yaml b/charts/gke-ingress/Chart.yaml index f025740..d4299e7 100644 --- a/charts/gke-ingress/Chart.yaml +++ b/charts/gke-ingress/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: gke-ingress -version: 0.1.0 +version: 0.2.0 appVersion: 0.1.0 description: gke-ingress and related resources sources: @@ -12,4 +12,4 @@ keywords: - ingress annotations: artifacthub.io/changes: | - - Initial chart + - Fix service diff --git a/charts/gke-ingress/README.md b/charts/gke-ingress/README.md index ab1ff67..3e9fb4f 100644 --- a/charts/gke-ingress/README.md +++ b/charts/gke-ingress/README.md @@ -1,6 +1,6 @@ # gke-ingress -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE) +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) ![Release Status](https://github.com/ricardo-ch/helm-charts/workflows/Release%20Charts/badge.svg) [![License](https://img.shields.io/github/license/ricardo-ch/helm-charts)](https://github.com/ricardo-ch/helm-charts/blob/main/LICENSE) gke-ingress and related resources diff --git a/charts/gke-ingress/templates/_helpers.tpl b/charts/gke-ingress/templates/_helpers.tpl deleted file mode 100644 index 432e2f4..0000000 --- a/charts/gke-ingress/templates/_helpers.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{{- define "gke-ingress.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -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 "gke-ingress.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "gke-ingress.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{- define "gke-ingress.labels" -}} -helm.sh/chart: {{ include "gke-ingress.chart" . }} -{{ include "gke-ingress.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/name: {{ include "gke-ingress.name" . }} -{{- range $key, $val := .Values.service.labels }} -{{- if not (or (eq $key "app") (eq $key "istio")) }} -{{ $key | quote }}: {{ $val | quote }} -{{- end }} -{{- end }} -{{- end }} - -{{- define "gke-ingress.selectorLabels" -}} -{{- if hasKey .Values.service.labels "app" }} -{{- with .Values.service.labels.app }}app: {{.|quote}} -{{- end}} -{{- else }}app: {{ include "gke-ingress.name" . }} -{{- end }} -{{- if hasKey .Values.service.labels "istio" }} -{{- with .Values.service.labels.istio }} -istio: {{.|quote}} -{{- end}} -{{- else }} -istio: {{ include "gke-ingress.name" . | trimPrefix "istio-" }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/gke-ingress/templates/service.yaml b/charts/gke-ingress/templates/service.yaml index fb2f160..7659ec5 100644 --- a/charts/gke-ingress/templates/service.yaml +++ b/charts/gke-ingress/templates/service.yaml @@ -1,18 +1,17 @@ -{{range .Values.service}} +{{ with .Values.service }} apiVersion: v1 kind: Service metadata: name: {{ .name }} namespace: {{ default "istio-ingress" .namespace}} labels: - {{- include "gke-ingress.labels" . | nindent 4 }} +{{- .labels | toYaml | nindent 4 }} annotations: - {{- .annotations | toYaml | nindent 4 }} +{{- .annotations | toYaml | nindent 4 }} spec: type: {{ .type }} ports: {{ .ports | toYaml | indent 4 }} selector: - {{- include "gke-ingress.selectorLabels" . | nindent 4 }} ---- +{{- .selector | toYaml | nindent 4 }} {{ end }} \ No newline at end of file