[stable/ambassador] helm3 support crds (#19225)

* Move crds directory for Helm v3 support, and glob files to retain Helm 2 support

Signed-off-by: Scott Rigby <scott@r6by.com>

* Change crd cleanup job to target non-templated label (non-template label required for helm 3). To-do: should we conceptually remove the CRD cleanup job, since this was changed for a good reason in Helm 3?

Signed-off-by: Scott Rigby <scott@r6by.com>

* Bump version, and document breaking changes

Signed-off-by: Scott Rigby <scott@r6by.com>

* Update 5.0.0 breaking change note. Upgrading is fine, but labels on CRDs have changed for new installations

Signed-off-by: Scott Rigby <scott@r6by.com>
This commit is contained in:
Scott Rigby
2019-11-28 18:05:03 -08:00
committed by Kubernetes Prow Robot
parent c583863697
commit 3bc0f7104b
18 changed files with 38 additions and 107 deletions
+8
View File
@@ -3,6 +3,14 @@
This file documents all notable changes to Ambassador Helm Chart. The release
numbering uses [semantic versioning](http://semver.org).
## v5.0.0
### Breaking changes
**Note** If upgrading an existing helm 2 installation no action is needed, previously installed CRDs will not be modified.
- Helm 3 support for CRDs was added. Specifically, the CRD templates were moved to non-templated files in the `/crds` directory, and to keep Helm 2 support they are globbed from there by `/templates/crds.yaml`. However, because Helm 3 CRDs are not templated, the labels for new installations have necessarily changed
## v4.0.0
### Breaking Changes
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 0.85.0
description: A Helm chart for Datawire Ambassador
name: ambassador
version: 4.4.9
version: 5.0.0
icon: https://www.getambassador.io/images/logo.png
home: https://www.getambassador.io/
sources:
+8
View File
@@ -196,6 +196,14 @@ $ helm upgrade --install --wait my-release -f values.yaml stable/ambassador
# Upgrading
## To 5.0.0
### Breaking changes
**Note** If upgrading an existing helm 2 installation no action is needed, previously installed CRDs will not be modified.
- Helm 3 support for CRDs was added. Specifically, the CRD templates were moved to non-templated files in the `/crds` directory, and to keep Helm 2 support they are globbed from there by `/templates/crds.yaml`. However, because Helm 3 CRDs are not templated, the labels for new installations have necessarily changed
## To 4.0.0
The 4.0.0 chart contains a number of changes to the way Ambassador Pro is installed.
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: authservices.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: authservices
singular: authservice
kind: AuthService
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: consulresolvers.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: consulresolvers
singular: consulresolver
kind: ConsulResolver
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.pro.enabled -}}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: filters.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -26,4 +20,3 @@ spec:
kind: Filter
shortNames:
- fil
{{- end -}}
@@ -1,15 +1,9 @@
{{- if .Values.pro.enabled -}}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: filterpolicies.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -26,4 +20,3 @@ spec:
kind: FilterPolicy
shortNames:
- fp
{{- end -}}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: kubernetesendpointresolvers.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: kubernetesendpointresolvers
singular: kubernetesendpointresolver
kind: KubernetesEndpointResolver
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: kubernetesserviceresolvers.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: kubernetesserviceresolvers
singular: kubernetesserviceresolver
kind: KubernetesServiceResolver
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: mappings.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: mappings
singular: mapping
kind: Mapping
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: modules.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: modules
singular: module
kind: Module
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.pro.enabled -}}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ratelimits.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -26,4 +20,3 @@ spec:
kind: RateLimit
shortNames:
- rl
{{- end -}}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ratelimitservices.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: ratelimitservices
singular: ratelimitservice
kind: RateLimitService
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tcpmappings.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: tcpmappings
singular: tcpmapping
kind: TCPMapping
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlscontexts.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: tlscontexts
singular: tlscontext
kind: TLSContext
{{- end }}
@@ -1,15 +1,9 @@
{{- if .Values.crds.create }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tracingservices.getambassador.io
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: ambassador
annotations:
"helm.sh/hook": crd-install
spec:
@@ -24,4 +18,3 @@ spec:
plural: tracingservices
singular: tracingservice
kind: TracingService
{{- end }}
+2 -2
View File
@@ -35,6 +35,6 @@ spec:
- /bin/sh
- -c
- >
kubectl delete crds -l app.kubernetes.io/part-of={{ .Release.Name }}
kubectl delete crds -l app.kubernetes.io/name=ambassador
restartPolicy: OnFailure
{{- end }}
{{- end }}
+6
View File
@@ -0,0 +1,6 @@
{{- if .Values.crds.create }}
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }}
{{ $.Files.Get $path }}
---
{{- end }}
{{- end }}