Skip to content

Commit

Permalink
Signed-off-by: liheng.zms <liheng.zms@alibaba-inc.com>
Browse files Browse the repository at this point in the history
kruise-rollout v0.1.0
  • Loading branch information
zmberg committed Apr 7, 2022
1 parent f46b9f3 commit c0044cb
Show file tree
Hide file tree
Showing 204 changed files with 1,157 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kruise
1 change: 1 addition & 0 deletions charts/kruise-rollout
23 changes: 23 additions & 0 deletions versions/kruise-rollout/0.1.0/.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.1.0/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.1.0
appVersion: 0.1.0
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
62 changes: 62 additions & 0 deletions versions/kruise-rollout/0.1.0/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 }}
89 changes: 89 additions & 0 deletions versions/kruise-rollout/0.1.0/templates/manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: {{ .Values.rollout.fullname }}
name: {{ .Values.installation.namespace }}
---
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:
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 }}
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
Loading

0 comments on commit c0044cb

Please sign in to comment.