Skip to content

Commit

Permalink
update helm script
Browse files Browse the repository at this point in the history
  • Loading branch information
xcaspar committed Nov 3, 2019
1 parent 119bfeb commit 579b6b4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 55 deletions.
32 changes: 0 additions & 32 deletions deploy/helm/chaosblade-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,33 +1 @@
{{/* vim: set filetype=mustache: */}}

{{- define "image.domain" -}}
{{- $domain := "" -}}
{{- if eq .Values.env.region "cn-public" }}
{{- printf "%s" "registry" -}}
{{- else -}}
{{- printf "%s" "registry-vpc" -}}
{{- end -}}
{{- end -}}

{{- define "image.region" -}}
{{- if eq .Values.env.region "cn-public" }}
{{- printf "%s" "cn-hangzhou" -}}
{{- else -}}
{{- printf "%s" .Values.env.region -}}
{{- end -}}
{{- end -}}


{{/*
Create the repository for the service image
*/}}
{{- define "operator.image" -}}
{{- printf "%s.%s.aliyuncs.com/chaosblade/chaosblade-operator" (include "image.domain" .) (include "image.region" .) -}}
{{- end -}}

{{/*
Create the repository for the service image
*/}}
{{- define "tool.image" -}}
{{- printf "%s.%s.aliyuncs.com/chaosblade/chaosblade-tool" (include "image.domain" .) (include "image.region" .) -}}
{{- end -}}
20 changes: 8 additions & 12 deletions deploy/helm/chaosblade-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ spec:
values:
- virtual-kubelet
containers:
- image: {{ template "tool.image" .}}:0.4.0
imagePullPolicy: {{ .Values.image.pullPolicy }}
- image: {{ .Values.blade.repository }}:{{ .Values.blade.version }}
imagePullPolicy: {{ .Values.blade.pullPolicy }}
name: chaosblade-tool
securityContext:
privileged: true
Expand Down Expand Up @@ -70,8 +70,7 @@ spec:
serviceAccountName: chaosblade
containers:
- name: chaosblade-operator
# Replace this with the built image name
image: {{ template "operator.image" .}}:0.0.1
image: {{ .Values.operator.repository }}:{{ .Values.operator.version }}
command: ["chaosblade-operator"]
args:
{{- if .Values.env.zapLevel }}
Expand All @@ -80,16 +79,13 @@ spec:
{{- if .Values.blade.version }}
- '--blade-version={{ .Values.blade.version }}'
{{- end }}
{{- if .Values.blade.imageRepo }}
- '--image-repo={{ .Values.blade.imageRepo }}'
{{- if .Values.blade.repository }}
- '--image-repo={{ .Values.blade.repository }}'
{{- end }}
{{- if .Values.env.region }}
- '--aliyun-region={{ .Values.env.region }}'
{{- if .Values.blade.pullPolicy }}
- '--pull-policy={{ .Values.blade.pullPolicy }}'
{{- end }}
{{- if .Values.image.pullPolicy }}
- '--pull-policy={{ .Values.image.pullPolicy }}'
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
imagePullPolicy: {{ .Values.operator.pullPolicy }}
env:
- name: WATCH_NAMESPACE
value: ""
Expand Down
21 changes: 10 additions & 11 deletions deploy/helm/chaosblade-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ rbac:
# rabc.create: whether RABC should be created or not. Must be true or false
create: true

image:
# image.repository: the value is related to the running env
repository: "registry.cn-hangzhou.aliyuncs.com/chaosblade/chaosblade-operator:0.0.1"
# image.tag: the agent version
tag: 0.0.1
# chaosblade-operator
operator:
repository: "registry.cn-hangzhou.aliyuncs.com/chaosblade/chaosblade-operator"
version: 0.0.1
# image.pullPolicy: must be Always|IfNotPresent|Never
pullPolicy: IfNotPresent

# chaosblade-tool
blade:
repository: registry.cn-hangzhou.aliyuncs.com/chaosblade/chaosblade-tool
version: 0.4.0
pullPolicy: IfNotPresent

env:
# env.name: the cluster environment that is running
region: cn-hangzhou
zapLevel: ""

blade:
imageRepo: registry.cn-hangzhou.aliyuncs.com/chaosblade/chaosblade-tool
version: 0.4.0

0 comments on commit 579b6b4

Please sign in to comment.