Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charts: update lvm csi driver webhook related charts #295

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/harvester-csi-driver-lvm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: v0.1.1
appVersion: "v0.1.2"

maintainers:
- name: harvester
80 changes: 80 additions & 0 deletions charts/harvester-csi-driver-lvm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "harvester-csi-driver-lvm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
CSI-plugin labels
*/}}
{{- define "harvester-csi-driver-lvm.labels" -}}
helm.sh/chart: {{ include "harvester-csi-driver-lvm.chart" . }}
{{ include "harvester-csi-driver-lvm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: storage
{{- end }}

{{/*
CSI-plugin Selector labels
*/}}
{{- define "harvester-csi-driver-lvm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "harvester-csi-driver-lvm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
CSI-controller labels
*/}}
{{- define "harvester-csi-driver-lvm-controller.labels" -}}
helm.sh/chart: {{ include "harvester-csi-driver-lvm.chart" . }}
{{ include "harvester-csi-driver-lvm-controller.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: storage
{{- end }}

{{/*
CSI-controller Selector labels
*/}}
{{- define "harvester-csi-driver-lvm-controller.selectorLabels" -}}
app.kubernetes.io/name: {{ include "harvester-csi-driver-lvm.name" . }}-controller
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
CSI-webhook labels
*/}}
{{- define "harvester-csi-driver-lvm-webhook.labels" -}}
helm.sh/chart: {{ include "harvester-csi-driver-lvm.chart" . }}
{{ include "harvester-csi-driver-lvm-webhook.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: webhook
{{- end }}

{{/*
CSI-webhook Selector labels
*/}}
{{- define "harvester-csi-driver-lvm-webhook.selectorLabels" -}}
app.kubernetes.io/name: {{ include "harvester-csi-driver-lvm.name" . }}-webhook
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
CSI components
*/}}
{{- define "externalImages.csiAttacher" -}}
{{- if .Values.customCSISidecars.enabled -}}
{{- print .Values.customCSISidecars.attacher -}}
Expand Down
11 changes: 5 additions & 6 deletions charts/harvester-csi-driver-lvm/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@ apiVersion: apps/v1
metadata:
name: harvester-csi-driver-lvm-controller
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "harvester-csi-driver-lvm-controller.labels" . | nindent 4 }}
spec:
serviceName: harvester-csi-driver-lvm-controller
replicas: 1
selector:
matchLabels:
app: harvester-csi-driver-lvm-controller
{{- include "harvester-csi-driver-lvm-controller.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: harvester-csi-driver-lvm-controller
{{- include "harvester-csi-driver-lvm-controller.labels" . | nindent 8 }}
spec:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
- key: app.kubernetes.io/name
operator: In
values:
- harvester-csi-driver-lvm-plugin
- harvester-csi-driver-lvm
topologyKey: kubernetes.io/hostname
{{- if .Values.nodeSelector.provisioner }}
nodeSelector:
Expand Down
7 changes: 3 additions & 4 deletions charts/harvester-csi-driver-lvm/templates/csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ kind: DaemonSet
metadata:
name: harvester-csi-driver-lvm-plugin
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "harvester-csi-driver-lvm.labels" . | nindent 4 }}
spec:
revisionHistoryLimit: 10
selector:
matchLabels:
app: harvester-csi-driver-lvm-plugin
{{- include "harvester-csi-driver-lvm.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: harvester-csi-driver-lvm-plugin
{{- include "harvester-csi-driver-lvm.labels" . | nindent 8 }}
spec:
serviceAccountName: harvester-csi-driver-lvm
{{- if .Values.tolerations.plugin }}
Expand Down
44 changes: 43 additions & 1 deletion charts/harvester-csi-driver-lvm/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,46 @@ roleRef:
kind: ClusterRole
name: harvester-csi-driver-lvm
apiGroup: rbac.authorization.k8s.io
---
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: harvester-csi-driver-lvm-webhook
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: harvester-csi-driver-lvm-webhook
rules:
- apiGroups: [ "" ]
resources: [ "secrets", "configmaps" ]
verbs: [ "*" ]
- apiGroups: [ "" ]
resources: [ "nodes" ]
verbs: [ "get", "list" ]
- apiGroups: [ "storage.k8s.io" ]
resources: [ "storageclasses" ]
verbs: [ "*" ]
- apiGroups: [ "apiregistration.k8s.io" ]
resources: [ "apiservices" ]
verbs: [ "get", "watch", "list" ]
- apiGroups: [ "apiextensions.k8s.io" ]
resources: [ "customresourcedefinitions" ]
verbs: [ "get", "watch", "list" ]
- apiGroups: [ "admissionregistration.k8s.io" ]
resources: [ "validatingwebhookconfigurations", "mutatingwebhookconfigurations" ]
verbs: [ "*" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: harvester-csi-driver-lvm-webhook
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: harvester-csi-driver-lvm-webhook
subjects:
- kind: ServiceAccount
name: harvester-csi-driver-lvm-webhook
namespace: {{ .Release.Namespace }}
49 changes: 49 additions & 0 deletions charts/harvester-csi-driver-lvm/templates/webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "harvester-csi-driver-lvm-webhook.labels" . | nindent 4 }}
name: harvester-csi-driver-lvm-webhook
spec:
replicas: {{ .Values.webhook.replicas }}
selector:
matchLabels:
{{- include "harvester-csi-driver-lvm-webhook.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "harvester-csi-driver-lvm-webhook.labels" . | nindent 8 }}
spec:
serviceAccountName: harvester-csi-driver-lvm-webhook
{{- if .Values.tolerations.webhook }}
tolerations:
{{ toYaml .Values.tolerations.webhook | indent 8 }}
{{- end }}
containers:
- name: harvester-csi-driver-lvm-webhook
image: "{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.webhook.image.pullPolicy }}
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- csi-driver-lvm-webhook
---
apiVersion: v1
kind: Service
metadata:
name: harvester-csi-driver-lvm-webhook
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
selector:
{{- include "harvester-csi-driver-lvm-webhook.selectorLabels" . | nindent 4 }}
ports:
- name: https
port: 443
protocol: TCP
targetPort: {{ .Values.webhook.httpsPort }}
22 changes: 20 additions & 2 deletions charts/harvester-csi-driver-lvm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ pluginImage:
repository: rancher/harvester-lvm-csi-plugin
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "main-head"
tag: "v0.1.2"

provisionerImage:
repository: rancher/harvester-lvm-provisioner
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "main-head"
tag: "v0.1.2"

nameOverride: ""

lvm:
# You will want to change this for read-only filesystems
Expand All @@ -21,6 +23,15 @@ lvm:

driverName: lvm.driver.harvesterhci.io

webhook:
replicas: 1
image:
repository: rancher/harvester-lvm-csi-driver-webhook
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v0.1.2"
httpsPort: 8443

rbac:
create: true

Expand Down Expand Up @@ -87,3 +98,10 @@ tolerations:
# - key: node-role.kubernetes.io/control-plane
# operator: Exists
# effect: NoSchedule
webhook:
# - key: node-role.kubernetes.io/master
# operator: Exists
# effect: NoSchedule
# - key: node-role.kubernetes.io/control-plane
# operator: Exists
# effect: NoSchedule
Loading