Skip to content

Commit

Permalink
update chart version to 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wansir committed Mar 31, 2024
1 parent 4972407 commit 258b15f
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 72 deletions.
52 changes: 52 additions & 0 deletions charts/gatekeeper/charts/agent/templates/_images.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{/*
Return the proper image name
*/}}

{{- define "apiserver.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.apiserver.image "global" .Values.global) }}
{{- end -}}

{{- define "kubectl.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.kubectl.image "global" .Values.global) }}
{{- end -}}

{{- define "common.images.image" -}}
{{- $registryName := .global.imageRegistry -}}
{{- $repositoryName := .imageRoot.repository -}}
{{- $separator := ":" -}}
{{- $termination := .global.tag | toString -}}
{{- if .imageRoot.registry }}
{{- $registryName = .imageRoot.registry -}}
{{- end -}}
{{- if .imageRoot.tag }}
{{- $termination = .imageRoot.tag | toString -}}
{{- end -}}
{{- if .imageRoot.digest }}
{{- $separator = "@" -}}
{{- $termination = .imageRoot.digest | toString -}}
{{- end -}}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}}
{{- end -}}

{{- define "common.images.pullSecrets" -}}
{{- $pullSecrets := list }}

{{- if .global }}
{{- range .global.imagePullSecrets -}}
{{- $pullSecrets = append $pullSecrets . -}}
{{- end -}}
{{- end -}}

{{- range .images -}}
{{- range .pullSecrets -}}
{{- $pullSecrets = append $pullSecrets . -}}
{{- end -}}
{{- end -}}

{{- if (not (empty $pullSecrets)) }}
imagePullSecrets:
{{- range $pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/gatekeeper/charts/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: {{ template "apiserver.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand Down
22 changes: 22 additions & 0 deletions charts/gatekeeper/charts/agent/templates/post-patch-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}-post-patch-crd"
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
spec:
template:
spec:
restartPolicy: Never
serviceAccountName: helm-executor.gatekeeper
containers:
- name: post-patch-crds
image: {{ template "kubectl.image" . }}
command:
- /bin/bash
- -c
- |
kubectl label crd constrainttemplates.templates.gatekeeper.sh kubesphere.io/resource-served=true --overwrite
resources: {{- toYaml .Values.resources | nindent 12 }}
4 changes: 4 additions & 0 deletions charts/gatekeeper/charts/agent/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: helm-executor.gatekeeper
55 changes: 33 additions & 22 deletions charts/gatekeeper/charts/agent/values.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
global:
imageRegistry: docker.io
imagePullSecrets: []

replicaCount: 1

image:
repository: docker.io/kubesphere/gatekeeper-extension-apiserver
tag: "v0.1.0"
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
apiserver:
image:
repository: kubesphere/gatekeeper-extension-apiserver
tag: "v0.1.0"
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.

kubectl:
image:
repository: kubesphere/kubectl
tag: "v1.27.12"
pullPolicy: IfNotPresent

imagePullSecrets: []
podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

Expand Down
7 changes: 5 additions & 2 deletions charts/gatekeeper/extension.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: kubesphere.io/v1alpha1
name: gatekeeper
version: 0.1.1
version: 0.1.2
displayName:
en: Gatekeeper
zh: Gatekeeper
Expand Down Expand Up @@ -42,4 +42,7 @@ dependencies:
# installationMode describes how to install subcharts, it can be HostOnly or Multicluster.
# In Multicluster mode, the subchart with tag `extension` will only be deployed to the host cluster,
# and the subchart with tag `agent` will be deployed to all selected clusters.
installationMode: Multicluster
installationMode: Multicluster
images:
- registry.cn-beijing.aliyuncs.com/kse/gatekeeper-extension-apiserver:v0.1.0"
- registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.27.12"
83 changes: 36 additions & 47 deletions charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,18 @@ gatekeeper:
pullPolicy: IfNotPresent
pullSecrets: []
extraNamespaces: []
podSecurity:
[
"pod-security.kubernetes.io/audit=restricted",
"pod-security.kubernetes.io/audit-version=latest",
"pod-security.kubernetes.io/warn=restricted",
"pod-security.kubernetes.io/warn-version=latest",
"pod-security.kubernetes.io/enforce=privileged",
"pod-security.kubernetes.io/enforce-version=v1.24",
]
podSecurity: ["pod-security.kubernetes.io/audit=restricted", "pod-security.kubernetes.io/audit-version=latest", "pod-security.kubernetes.io/warn=restricted", "pod-security.kubernetes.io/warn-version=latest", "pod-security.kubernetes.io/enforce=privileged", "pod-security.kubernetes.io/enforce-version=v1.24"]
extraAnnotations: {}
priorityClassName: ""
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
nodeSelector: {kubernetes.io/os: linux}
resources: {}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsGroup: 999
runAsNonRoot: true
Expand All @@ -96,15 +88,7 @@ gatekeeper:
pullPolicy: IfNotPresent
pullSecrets: []
extraNamespaces: []
podSecurity:
[
"pod-security.kubernetes.io/audit=restricted",
"pod-security.kubernetes.io/audit-version=latest",
"pod-security.kubernetes.io/warn=restricted",
"pod-security.kubernetes.io/warn-version=latest",
"pod-security.kubernetes.io/enforce=privileged",
"pod-security.kubernetes.io/enforce-version=v1.24",
]
podSecurity: ["pod-security.kubernetes.io/audit=restricted", "pod-security.kubernetes.io/audit-version=latest", "pod-security.kubernetes.io/warn=restricted", "pod-security.kubernetes.io/warn-version=latest", "pod-security.kubernetes.io/enforce=privileged", "pod-security.kubernetes.io/enforce-version=v1.24"]
extraAnnotations: {}
priorityClassName: ""
probeWebhook:
Expand All @@ -120,12 +104,12 @@ gatekeeper:
priorityClassName: ""
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
nodeSelector: {kubernetes.io/os: linux}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsGroup: 999
runAsNonRoot: true
Expand All @@ -142,13 +126,13 @@ gatekeeper:
priorityClassName: ""
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
nodeSelector: {kubernetes.io/os: linux}
resources: {}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsGroup: 999
runAsNonRoot: true
Expand Down Expand Up @@ -177,18 +161,18 @@ gatekeeper:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: gatekeeper.sh/operation
operator: In
values:
- webhook
topologyKey: kubernetes.io/hostname
weight: 100
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: gatekeeper.sh/operation
operator: In
values:
- webhook
topologyKey: kubernetes.io/hostname
weight: 100
topologySpreadConstraints: []
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
nodeSelector: {kubernetes.io/os: linux}
resources:
limits:
memory: 512Mi
Expand All @@ -199,23 +183,22 @@ gatekeeper:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsGroup: 999
runAsNonRoot: true
runAsUser: 1000
podSecurityContext:
fsGroup: 999
supplementalGroups:
- 999
- 999
extraRules: []
networkPolicy:
enabled: false
ingress:
{}
# - from:
# - ipBlock:
# cidr: 0.0.0.0/0
ingress: {}
# - from:
# - ipBlock:
# cidr: 0.0.0.0/0
audit:
enablePubsub: false
hostNetwork: false
Expand All @@ -228,7 +211,7 @@ gatekeeper:
disableCertRotation: false
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
nodeSelector: {kubernetes.io/os: linux}
resources:
limits:
memory: 512Mi
Expand All @@ -239,27 +222,27 @@ gatekeeper:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsGroup: 999
runAsNonRoot: true
runAsUser: 1000
podSecurityContext:
fsGroup: 999
supplementalGroups:
- 999
- 999
writeToRAMDisk: false
extraRules: []
crds:
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
nodeSelector: {kubernetes.io/os: linux}
resources: {}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsGroup: 65532
runAsNonRoot: true
Expand All @@ -284,6 +267,12 @@ gatekeeper:
agent:
replicaCount: 1
image:
repository: docker.io/kubesphere/gatekeeper-extension-apiserver
repository: kubesphere/gatekeeper-extension-apiserver
tag: "v0.1.0"
pullPolicy: IfNotPresent
kubectl:
image:
repository: kubesphere/kubectl
tag: "v1.27.12"
pullPolicy: IfNotPresent

0 comments on commit 258b15f

Please sign in to comment.