Skip to content

Commit

Permalink
kruise-rollout 0.4.1, fix the bug that MutatingWebhookConfiguration i…
Browse files Browse the repository at this point in the history
…s not updated when upgrading charts. (#93)
  • Loading branch information
zmberg committed Feb 29, 2024
1 parent 52e41dc commit 089189d
Show file tree
Hide file tree
Showing 13 changed files with 2,252 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kruise-rollout
23 changes: 23 additions & 0 deletions versions/kruise-rollout/0.4.1/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
12 changes: 12 additions & 0 deletions versions/kruise-rollout/0.4.1/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
name: kruise-rollout
description: Helm chart for kruise-rollout components
version: 0.4.1
appVersion: 0.4.1
kubeVersion: ">= 1.19.0-0"
icon: https://openkruise.io/img/openkruise-logo-bg.jpg
keywords:
- rollout
home: https://openkruise.io
sources:
- https://github.com/openkruise/rollouts
47 changes: 47 additions & 0 deletions versions/kruise-rollout/0.4.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Kruise Rollout v0.4.1

## Configuration

The following table lists the configurable parameters of the kruise chart and their default values.

| Parameter | Description | Default |
|----------------------------------|-------------------------------------------------------------------|-------------------------------------|
| `installation.namespace` | Namespace for kruise-rollout operation installation | `kruise-rollout` |
| `installation.createNamespace` | Whether to create the installation.namespace | `true` |
| `rollout.fullname` | Nick name for kruise-rollout deployment and other configurations | `kruise-rollout-controller-manager` |
| `rollout.featureGates` | Feature gates for kruise-rollout, empty string means all disabled | `AdvancedDeployment=true` |
| `rollout.healthBindPort` | Port for checking health of kruise-rollout container | `8081` |
| `rollout.metricsBindAddr` | Port of metrics served by kruise-rollout container | `127.0.0.1:8080` |
| `rollout.log.level` | Log level that kruise-rollout printed | `4` |
| `rollout.webhook.port` | Port of webhook served by kruise-rollout container | `9876` |
| `rollout.webhook.objectSelector` | ObjectSelector for workloads in MutatingWebhookConfigurations | ` ` |
| `image.repository` | Repository for kruise-rollout image | `openkruise/kruise-rollout` |
| `image.tag` | Tag for kruise-rollout image | `v0.4.0` |
| `image.pullPolicy` | ImagePullPolicy for kruise-rollout container | `Always` |
| `imagePullSecrets` | The list of image pull secrets for kruise-rollout image | ` ` |
| `resources.limits.cpu` | CPU resource limit of kruise-rollout container | `500m` |
| `resources.limits.memory` | Memory resource limit of kruise-rollout container | `1Gi` |
| `resources.requests.cpu` | CPU resource request of kruise-rollout container | `100m` |
| `resources.requests.memory` | Memory resource request of kruise-rollout container | `256Mi` |
| `replicaCount` | Replicas of kruise-rollout deployment | `2` |
| `service.port` | Port of webhook served by kruise-rollout webhook service | `443` |
| `serviceAccount.annotations` | The annotations for serviceAccount of kruise-rollout | ` ` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

### Optional: feature-gate

Feature-gate controls some influential features in Kruise:

| Name | Description | Default | Effect (if closed) |
|-----------------------|--------------------------------------------------------------------------------------------------------|----------|-----------------------------------------|
| `AdvancedDeployment` | Whether to enable the ability to rolling update deployment in batches without extra canary deployment | `true` | advanced deployment controller disabled |

### Optional: the local image for China

If you are in China and have problem to pull image from official DockerHub, you can use the registry hosted on Alibaba Cloud:

```bash
$ helm install kruise https://... --set image.repository=openkruise-registry.cn-shanghai.cr.aliyuncs.com/openkruise/kruise-rollout
...
```
62 changes: 62 additions & 0 deletions versions/kruise-rollout/0.4.1/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "rollout.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "rollout.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "rollout.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "rollout.labels" -}}
helm.sh/chart: {{ include "rollout.chart" . }}
{{ include "rollout.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "rollout.selectorLabels" -}}
app.kubernetes.io/name: {{ include "rollout.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "rollout.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "rollout.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
102 changes: 102 additions & 0 deletions versions/kruise-rollout/0.4.1/templates/manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{{- if .Values.installation.createNamespace }}
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: {{ .Values.rollout.fullname }}
name: {{ .Values.installation.namespace }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: kruise-rollout-webhook-service
namespace: {{ .Values.installation.namespace }}
spec:
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.rollout.webhook.port }}
selector:
control-plane: {{ .Values.rollout.fullname }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.rollout.fullname }}
namespace: {{ .Values.installation.namespace }}
labels:
control-plane: {{ .Values.rollout.fullname }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
control-plane: {{ .Values.rollout.fullname }}
minReadySeconds: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 100%
template:
metadata:
labels:
control-plane: {{ .Values.rollout.fullname }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.rollout.fullname }}
containers:
- name: {{ .Chart.Name }}
args:
- --leader-elect
- --health-probe-bind-address=:{{ .Values.rollout.healthBindPort }}
- --metrics-bind-address={{ .Values.rollout.metricsBindAddr }}
- --v={{ .Values.rollout.log.level }}
{{- if .Values.rollout.featureGates }}
- --feature-gates={{ .Values.rollout.featureGates }}
{{- end }}
command:
- /manager
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: {{ .Values.rollout.webhook.port }}
name: webhook-server
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: {{ .Values.rollout.healthBindPort }}
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: {{ .Values.rollout.healthBindPort }}
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: control-plane
operator: In
values:
- {{ .Values.rollout.fullname }}
topologyKey: kubernetes.io/hostname
weight: 100
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit 089189d

Please sign in to comment.