Skip to content

Commit

Permalink
Merge pull request #2 from koslibpro/private-ingress
Browse files Browse the repository at this point in the history
Private ingress
  • Loading branch information
Konstantinos Livieratos authored Sep 19, 2020
2 parents 1914213 + 62d0c41 commit f56f24b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: servicetpl
description: A Helm chart for services running on Kubernetes

version: 0.6.1
version: 0.7.0
41 changes: 41 additions & 0 deletions templates/ingress_private.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress_private.enabled -}}
{{- $fullName := include "service_template.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-private
labels:
{{- include "service_template.labels" . | nindent 4 }}
{{- with .Values.ingress_private.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress_private.tls }}
tls:
{{- range .Values.ingress_private.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress_private.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ ingress:
# hosts:
# - chart-example.local

ingress_private:
enabled: false
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/whitelist-source-range: 49.36.X.X/32 # Change this to satisfy your requirements
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}
# limits:
# cpu: 100m
Expand Down

0 comments on commit f56f24b

Please sign in to comment.