Skip to content

Commit

Permalink
add stable ingress support (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
puckpuck authored Nov 3, 2021
1 parent ecec0ce commit 5cc14f3
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 17 deletions.
10 changes: 6 additions & 4 deletions charts/secure-tenancy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: secure-tenancy
description: Honeycomb Secure Tenancy
version: 0.1.4
appVersion: 1.9.1
version: 1.0.0
appVersion: 1.10.1
keywords:
- observability
- security
Expand All @@ -17,5 +17,7 @@ icon: https://www.honeycomb.io/wp-content/themes/honeycomb/assets/img/logo.svg
maintainers:
- name: puckpuck
email: pierre@honeycomb.io
- name: nathanleclaire
email: nathan@honeycomb.io
- name: kentquirk
email: kentquirk@honeycomb.io
- name: reulan
email: michaelsimo@honeycomb.io
14 changes: 11 additions & 3 deletions charts/secure-tenancy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ The following table lists the configurable parameters of the Honeycomb chart, an
| `service.annotations` | Service annotations | `{}` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.hosts[0].name` | Hostname to your Secure Tenancy installation | `secure-tenancy.local` |
| `ingress.hosts[0].paths` | Path within the url structure | `[]` |
| `ingress.hosts[0].host` | Hostname to use for ingress | `secure-tenancy.local` |
| `ingress.hosts[0].paths` | Array of path prefixes that will be used with the host | `[/]` |
| `ingress.tls` | TLS hosts | `[]` |
| `autoscaling.enabled` | Enable autoscaling for Secure Tenancy deployment | `false` |
| `autoscaling.minReplicas` | Minimum number of replicas to scale back (should be no less than 2) | `2` |
Expand All @@ -124,5 +124,13 @@ The following table lists the configurable parameters of the Honeycomb chart, an
## Template Manifest
It may be desired to have Helm render Kubernetes manifests but not have them installed.
You can use the `helm template` command to accomplish this.
By default the output Kubernetes manifests will contain Helm specific annotations.
By default, the output Kubernetes manifests will contain Helm specific annotations.
You can remove these from the output templates by setting a special `omitHelm` parameter to false when generating the templates.

## Upgrading

### Upgrading from 0.1.4 or earlier
Support for stable Kubernetes was added. If you are deploying to a cluster that is Kubernetes version 1.19 or greater
this will leverage the stable version for Ingress. With the stable version, each path definition will use
`pathType: Prefix` which means the path itself can not contain any wildcards. If you previously had this set to `/*` or
similar, you will need to update your path to remove the wildcard.
41 changes: 41 additions & 0 deletions charts/secure-tenancy/templates/ingress-beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if and (.Values.ingress.enabled) (semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion) -}}
{{- $fullName := include "secure-tenancy.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 }}
labels:
{{- include "secure-tenancy.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
18 changes: 8 additions & 10 deletions charts/secure-tenancy/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- if and (.Values.ingress.enabled) (semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion) -}}
{{- $fullName := include "secure-tenancy.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
Expand Down Expand Up @@ -33,9 +28,12 @@ spec:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: Prefix
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
service:
name: {{ $fullName }}
port:
name: http
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 5cc14f3

Please sign in to comment.