From 20f89dbccd29f9965d0d7be3ecbe6fbc66e0f2a7 Mon Sep 17 00:00:00 2001 From: VemComPY Date: Wed, 6 Jan 2021 16:41:11 -0300 Subject: [PATCH] Rafabios feature/ingress-and-svc-type (#135) * added ingress values and service type field * added ingress template * added service type to template * Removed namespace field --- helm/sloop/templates/ingress.yaml | 28 ++++++++++++++++++++++++++++ helm/sloop/templates/service.yaml | 1 + helm/sloop/values.yaml | 6 ++++++ 3 files changed, 35 insertions(+) create mode 100644 helm/sloop/templates/ingress.yaml diff --git a/helm/sloop/templates/ingress.yaml b/helm/sloop/templates/ingress.yaml new file mode 100644 index 0000000..568e50f --- /dev/null +++ b/helm/sloop/templates/ingress.yaml @@ -0,0 +1,28 @@ +{{- if .Values.ingress.enabled }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + labels: + app.kubernetes.io/name: {{ .Values.name }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" + name: {{ .Values.name }} +spec: + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - backend: + serviceName: {{ .Values.name }} + servicePort: {{ .Values.service.port }} + path: / +{{- end -}} + {{- if .Values.ingress.tls }} + tls: +{{ toYaml .Values.ingress.tls | indent 4 }} + {{- end -}} diff --git a/helm/sloop/templates/service.yaml b/helm/sloop/templates/service.yaml index 115dd4c..b791cc3 100644 --- a/helm/sloop/templates/service.yaml +++ b/helm/sloop/templates/service.yaml @@ -15,3 +15,4 @@ spec: targetPort: {{ .Values.service.targetPort }} selector: app.kubernetes.io/name: {{ .Values.name }} + type: {{ .Values.service.type }} diff --git a/helm/sloop/values.yaml b/helm/sloop/values.yaml index a488e12..d119035 100644 --- a/helm/sloop/values.yaml +++ b/helm/sloop/values.yaml @@ -15,6 +15,7 @@ resources: {} service: port: 80 targetPort: 8080 + type: ClusterIP ## Configure extra options for liveness and readiness probes livenessProbe: enabled: true @@ -30,3 +31,8 @@ readinessProbe: timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 +ingress: + enabled: false + host: sloop.example.com + annotations: {} + tls: {}