-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add ingress chart #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| apiVersion: v2 | ||
| name: ingress | ||
| version: 1.1.1 | ||
| description: A Helm chart for Ingress | ||
| type: application | ||
| home: https://github.com/technicaldomain/helm | ||
| sources: | ||
| - https://github.com/technicaldomain/helm | ||
| maintainers: | ||
| - email: alex@kharkevich.org | ||
| name: Alexander Kharkevich | ||
| icon: file://icon.png | ||
| appVersion: "1.0" | ||
|
|
||
| dependencies: | ||
| - name: common | ||
| repository: https://technicaldomain.github.io/helm/ | ||
| version: 2.1.4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Manage Ingress in a Simple Way | ||
|
|
||
| See [values.yaml](./values.yaml) for more details | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,65 @@ | ||||||||||
| {{- $fullName := include "common.fullname" . }} | ||||||||||
| {{- $appLabels := include "common.labels.standard" . -}} | ||||||||||
| {{- range .Values.services }} | ||||||||||
| {{- $contextPath := .contextPath }} | ||||||||||
| {{- $serviceName := .name }} | ||||||||||
| {{- $servicePort := .port | default 80 }} | ||||||||||
| {{- $annotations := .annotations }} | ||||||||||
| {{- $useRewrite := .useRewrite }} | ||||||||||
| {{- $ingressClass := .ingressClass | default $.Values.ingressClass | default "traefik" }} | ||||||||||
| {{- /* Define default annotations */}} | ||||||||||
| {{- $defaultAnnotations := dict }} | ||||||||||
| {{- if eq $ingressClass "nginx" }} | ||||||||||
| {{- $_ := set $defaultAnnotations "kubernetes.io/ingress.class" "nginx" }} | ||||||||||
| {{- $_ := set $defaultAnnotations "nginx.ingress.kubernetes.io/service-upstream" "true" }} | ||||||||||
| {{- $_ := set $defaultAnnotations "nginx.ingress.kubernetes.io/upstream-vhost" (printf "%s.%s.svc.cluster.local" $serviceName $.Release.Namespace) }} | ||||||||||
| {{- $_ := set $defaultAnnotations "nginx.ingress.kubernetes.io/use-regex" "true" }} | ||||||||||
| {{- if (default $useRewrite false) }} | ||||||||||
| {{- $_ := set $defaultAnnotations "nginx.ingress.kubernetes.io/rewrite-target" "/$2" }} | ||||||||||
| {{- end }} | ||||||||||
| {{- else if eq $ingressClass "traefik" }} | ||||||||||
| {{- $_ := set $defaultAnnotations "kubernetes.io/ingress.class" "traefik" }} | ||||||||||
| {{- $_ := set $defaultAnnotations "traefik.ingress.kubernetes.io/router.entrypoints" "web" }} | ||||||||||
| {{- if (default $useRewrite false) }} | ||||||||||
| {{- $_ := set $defaultAnnotations "traefik.ingress.kubernetes.io/router.middlewares" (printf "%s-rewrite" $serviceName) }} | ||||||||||
| {{- end }} | ||||||||||
| {{- end }} | ||||||||||
|
|
||||||||||
| {{- /* Merge annotations from values file, overriding defaults */}} | ||||||||||
| {{- $mergedAnnotations := mergeOverwrite $defaultAnnotations $annotations }} | ||||||||||
|
|
||||||||||
| --- | ||||||||||
| apiVersion: networking.k8s.io/v1 | ||||||||||
| kind: Ingress | ||||||||||
| metadata: | ||||||||||
| name: {{ $fullName}}-{{ $serviceName }} | ||||||||||
| labels: {{ $appLabels | nindent 4 }} | ||||||||||
| annotations: | ||||||||||
| {{- range $key, $value := $mergedAnnotations }} | ||||||||||
| {{ $key }}: {{ $value | quote }} | ||||||||||
| {{- end }} | ||||||||||
| spec: | ||||||||||
| tls: | ||||||||||
| - hosts: | ||||||||||
| {{- range $.Values.hosts }} | ||||||||||
| - {{ . | quote }} | ||||||||||
| {{- end }} | ||||||||||
| {{- if $.Values.explicitTLS }} | ||||||||||
| secretName: {{ $.Values.explicitTLS }} | ||||||||||
|
Comment on lines
+47
to
+48
|
||||||||||
| {{- if $.Values.explicitTLS }} | |
| secretName: {{ $.Values.explicitTLS }} | |
| {{- if $.Values.tls.enabled }} | |
| secretName: {{ $.Values.tls.secretName }} |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||
| --- | ||||||||
| # ingressClass: nginx | ||||||||
kharkevich marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
|
|
||||||||
| solution: | ||||||||
| component: ingress | ||||||||
|
|
||||||||
|
Comment on lines
+4
to
+6
|
||||||||
| solution: | |
| component: ingress | |
| # Removed unused solution.component key |
Uh oh!
There was an error while loading. Please reload this page.