Skip to content

Commit 87c515d

Browse files
Merge branch 'main' into bugfix/missing-attribute-field-ref
2 parents d2c14a8 + a11cd1b commit 87c515d

17 files changed

+386
-4
lines changed

charts/rollout-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: rollout-operator
33
description: "Grafana rollout-operator"
44
type: application
5-
version: 0.32.0
5+
version: 0.33.0
66
appVersion: v0.29.0
77
home: https://github.com/grafana/rollout-operator
88
kubeVersion: ^1.10.0-0

charts/rollout-operator/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Helm chart for deploying [Grafana rollout-operator](https://github.com/grafana/r
44

55
# rollout-operator
66

7-
![Version: 0.32.0](https://img.shields.io/badge/Version-0.32.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.29.0](https://img.shields.io/badge/AppVersion-v0.29.0-informational?style=flat-square)
7+
![Version: 0.33.0](https://img.shields.io/badge/Version-0.33.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.29.0](https://img.shields.io/badge/AppVersion-v0.29.0-informational?style=flat-square)
88

99
Grafana rollout-operator
1010

@@ -35,6 +35,14 @@ helm install -n <namespace> <release> grafana/rollout-operator
3535
The Grafana rollout-operator should be installed in the same namespace as the statefulsets it is operating upon.
3636
It is not a highly available application and runs as a single pod.
3737

38+
### Upgrade of Grafana Rollout Operator
39+
40+
Starting with v0.33.0 of the rollout-operator chart, the rollout-operator webhooks are enabled. See https://github.com/grafana/rollout-operator/#webhooks.
41+
42+
Before upgrading to this version, make sure that the CustomResourceDefinitions (CRDs) in the `crds` directory are applied to your cluster.
43+
44+
Manually applying these CRDs is only required if upgrading from a chart <= v0.32.0.
45+
3846
## Values
3947

4048
| Key | Type | Default | Description |
@@ -72,3 +80,6 @@ It is not a highly available application and runs as a single pod.
7280
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabel configs to apply to samples before scraping https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig |
7381
| serviceMonitor.scrapeTimeout | string | `nil` | ServiceMonitor scrape timeout in Go duration format (e.g. 15s) |
7482
| tolerations | list | `[]` | |
83+
| webhooks.enabled | bool | `true` | Enable the rollout-operator webhooks. See https://github.com/grafana/rollout-operator/#webhooks. Note that the webhooks require custom resource definitions. If upgrading, manually apply the files in the `crds` directory. |
84+
| webhooks.failurePolicy | string | `"Fail"` | Validating and mutating webhook failure policy. `Ignore` or `Fail`. |
85+
| webhooks.selfSignedCertSecretName | string | `"certificate"` | Secret resource name for the TLS certificate to be used with the webhooks |

charts/rollout-operator/README.md.gotmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ helm install -n <namespace> <release> grafana/rollout-operator
3535
The Grafana rollout-operator should be installed in the same namespace as the statefulsets it is operating upon.
3636
It is not a highly available application and runs as a single pod.
3737

38+
### Upgrade of Grafana Rollout Operator
39+
40+
Starting with v0.33.0 of the rollout-operator chart, the rollout-operator webhooks are enabled. See https://github.com/grafana/rollout-operator/#webhooks.
41+
42+
Before upgrading to this version, make sure that the CustomResourceDefinitions (CRDs) in the `crds` directory are applied to your cluster.
43+
44+
Manually applying these CRDs is only required if upgrading from a chart <= v0.32.0.
45+
3846
{{ template "chart.valuesSection" . }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: replicatemplates.rollout-operator.grafana.com
5+
spec:
6+
group: rollout-operator.grafana.com
7+
versions:
8+
- name: v1
9+
served: true
10+
storage: true
11+
additionalPrinterColumns:
12+
- description: Status replicas
13+
jsonPath: .status.replicas
14+
name: StatusReplicas
15+
type: string
16+
- description: Spec replicas
17+
jsonPath: .spec.replicas
18+
name: SpecReplicas
19+
type: string
20+
schema:
21+
openAPIV3Schema:
22+
type: object
23+
properties:
24+
spec:
25+
type: object
26+
properties:
27+
replicas:
28+
type: integer
29+
default: 1
30+
minimum: 0
31+
labelSelector:
32+
type: string
33+
status:
34+
type: object
35+
properties:
36+
replicas:
37+
type: integer
38+
subresources:
39+
status: { }
40+
scale:
41+
specReplicasPath: .spec.replicas
42+
statusReplicasPath: .status.replicas
43+
labelSelectorPath: .spec.labelSelector
44+
scope: Namespaced
45+
names:
46+
plural: replicatemplates
47+
singular: replicatemplate
48+
kind: ReplicaTemplate
49+
categories:
50+
# Include in "kubectl get all" output
51+
- all
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: zoneawarepoddisruptionbudgets.rollout-operator.grafana.com
5+
spec:
6+
group: rollout-operator.grafana.com
7+
versions:
8+
- name: v1
9+
served: true
10+
storage: true
11+
schema:
12+
openAPIV3Schema:
13+
type: object
14+
properties:
15+
spec:
16+
type: object
17+
required:
18+
- selector
19+
properties:
20+
maxUnavailable:
21+
type: integer
22+
description: The number of pods that can be unavailable within a zone or partition.
23+
minimum: 0
24+
maxUnavailablePercentage:
25+
type: integer
26+
description: Calculate the maxUnavailable value as a percentage of the StatefulSet's spec.Replica count. This option is not supported when using podNamePartitionRegex.
27+
minimum: 0
28+
maximum: 100
29+
selector:
30+
type: object
31+
description: A selector for finding pods and statefulsets that this ZoneAwarePodDisruptionBudget applies to.
32+
required:
33+
- matchLabels
34+
properties:
35+
matchLabels:
36+
type: object
37+
additionalProperties:
38+
type: string
39+
podNamePartitionRegex:
40+
type: string
41+
description: A regular expression for returning a partition name given a pod name. This field is optional and should only be used when the ZoneAwarePodDisruptionBudget is to be scoped to a partition, such as a multi-zone ingester deployment with ingest_storage_enabled. Enabling this changes the ZPDB functionality such that minAvailability is applied across ALL zones for a given partition. When not enabled, the minAvailability is applied to pods within the eviction zone assuming there are no disruptions in the other zones.
42+
podNameRegexGroup:
43+
type: integer
44+
minimum: 1
45+
description: The regular expression group number that contains the partition name. This field is only required when the podNamePartitionRegex field is set and has more then one subexpression grouping. The default value is 1.
46+
subresources:
47+
status: {}
48+
scope: Namespaced
49+
names:
50+
kind: ZoneAwarePodDisruptionBudget
51+
plural: zoneawarepoddisruptionbudgets
52+
singular: zoneawarepoddisruptionbudget
53+
shortNames:
54+
- zdpb

charts/rollout-operator/templates/deployment.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,22 @@ spec:
5151
imagePullPolicy: {{ .Values.image.pullPolicy }}
5252
args:
5353
- -kubernetes.namespace={{ .Release.Namespace }}
54+
{{- if .Values.webhooks.enabled }}
55+
- -server-tls.enabled=true
56+
- -server-tls.self-signed-cert.secret-name={{ .Values.webhooks.selfSignedCertSecretName }}
57+
{{- end }}
5458
{{- range .Values.extraArgs }}
5559
- {{ . }}
5660
{{- end }}
5761
ports:
5862
- name: http-metrics
5963
containerPort: 8001
6064
protocol: TCP
65+
{{- if .Values.webhooks.enabled }}
66+
- name: https
67+
containerPort: 8443
68+
protocol: TCP
69+
{{- end }}
6170
readinessProbe:
6271
httpGet:
6372
path: /ready
@@ -77,4 +86,4 @@ spec:
7786
{{- with .Values.tolerations }}
7887
tolerations:
7988
{{- toYaml . | nindent 8 }}
80-
{{- end }}
89+
{{- end }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{- if .Values.webhooks.enabled -}}
2+
apiVersion: admissionregistration.k8s.io/v1
3+
kind: ValidatingWebhookConfiguration
4+
metadata:
5+
name: no-downscale-{{ .Release.Namespace }}
6+
labels:
7+
grafana.com/inject-rollout-operator-ca: "true"
8+
grafana.com/namespace: {{ .Release.Namespace | quote }}
9+
{{- include "rollout-operator.labels" . | nindent 4 }}
10+
webhooks:
11+
- name: no-downscale-{{ .Release.Namespace }}.grafana.com
12+
clientConfig:
13+
service:
14+
namespace: {{ .Release.Namespace | quote }}
15+
name: {{ include "rollout-operator.fullname" . }}
16+
path: /admission/no-downscale
17+
port: 443
18+
rules:
19+
- operations:
20+
- UPDATE
21+
apiGroups:
22+
- apps
23+
apiVersions:
24+
- v1
25+
resources:
26+
- statefulsets
27+
- statefulsets/scale
28+
scope: Namespaced
29+
admissionReviewVersions:
30+
- v1
31+
namespaceSelector:
32+
matchLabels:
33+
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
34+
sideEffects: None
35+
failurePolicy: {{.Values.webhooks.failurePolicy}}
36+
{{- end -}}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{{- if .Values.webhooks.enabled -}}
2+
apiVersion: admissionregistration.k8s.io/v1
3+
kind: ValidatingWebhookConfiguration
4+
metadata:
5+
name: pod-eviction-{{ .Release.Namespace }}
6+
labels:
7+
grafana.com/inject-rollout-operator-ca: "true"
8+
grafana.com/namespace: {{ .Release.Namespace | quote }}
9+
{{- include "rollout-operator.labels" . | nindent 4 }}
10+
webhooks:
11+
- name: pod-eviction-{{ .Release.Namespace }}.grafana.com
12+
clientConfig:
13+
service:
14+
namespace: {{ .Release.Namespace | quote }}
15+
name: {{ include "rollout-operator.fullname" . }}
16+
path: /admission/pod-eviction
17+
port: 443
18+
rules:
19+
- operations:
20+
- CREATE
21+
apiGroups:
22+
- ""
23+
apiVersions:
24+
- v1
25+
resources:
26+
- pods/eviction
27+
scope: Namespaced
28+
admissionReviewVersions:
29+
- v1
30+
namespaceSelector:
31+
matchLabels:
32+
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
33+
sideEffects: None
34+
failurePolicy: {{.Values.webhooks.failurePolicy}}
35+
{{- end -}}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{- if .Values.webhooks.enabled -}}
2+
apiVersion: admissionregistration.k8s.io/v1
3+
kind: MutatingWebhookConfiguration
4+
metadata:
5+
name: prepare-downscale-{{ .Release.Namespace }}
6+
labels:
7+
grafana.com/inject-rollout-operator-ca: "true"
8+
grafana.com/namespace: {{ .Release.Namespace | quote }}
9+
{{- include "rollout-operator.labels" . | nindent 4 }}
10+
webhooks:
11+
- name: prepare-downscale-{{ .Release.Namespace }}.grafana.com
12+
clientConfig:
13+
service:
14+
namespace: {{ .Release.Namespace | quote }}
15+
name: {{ include "rollout-operator.fullname" . }}
16+
path: /admission/prepare-downscale
17+
port: 443
18+
rules:
19+
- operations:
20+
- UPDATE
21+
apiGroups:
22+
- apps
23+
apiVersions:
24+
- v1
25+
resources:
26+
- statefulsets
27+
- statefulsets/scale
28+
scope: Namespaced
29+
admissionReviewVersions:
30+
- v1
31+
namespaceSelector:
32+
matchLabels:
33+
kubernetes.io/metadata.name: {{ .Release.Namespace | quote }}
34+
sideEffects: NoneOnDryRun
35+
matchPolicy: Equivalent
36+
timeoutSeconds: 10
37+
failurePolicy: {{.Values.webhooks.failurePolicy}}
38+
{{- end -}}

charts/rollout-operator/templates/role.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,21 @@ rules:
3030
- statefulsets/status
3131
verbs:
3232
- update
33+
{{- if .Values.webhooks.enabled }}
34+
- apiGroups:
35+
- rollout-operator.grafana.com
36+
resources:
37+
- zoneawarepoddisruptionbudgets
38+
verbs:
39+
- get
40+
- list
41+
- watch
42+
- apiGroups:
43+
- rollout-operator.grafana.com
44+
resources:
45+
- replicatemplates/scale
46+
- replicatemplates/status
47+
verbs:
48+
- get
49+
- patch
50+
{{- end }}

0 commit comments

Comments
 (0)