Skip to content

Commit

Permalink
Add disableController parameter to helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Aug 13, 2024
1 parent 18d2c19 commit 3565ca0
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 3 deletions.
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/clusterrole-attacher.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -24,3 +25,4 @@ rules:
{{- with .Values.sidecars.attacher.additionalClusterRoleRules }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -39,3 +40,4 @@ rules:
{{- with .Values.sidecars.provisioner.additionalClusterRoleRules }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/clusterrole-resizer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -35,3 +36,4 @@ rules:
{{- with .Values.sidecars.resizer.additionalClusterRoleRules }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -28,3 +29,4 @@ rules:
{{- with .Values.sidecars.snapshotter.additionalClusterRoleRules }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -13,3 +14,4 @@ roleRef:
kind: ClusterRole
name: ebs-external-attacher-role
apiGroup: rbac.authorization.k8s.io
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -13,3 +14,4 @@ roleRef:
kind: ClusterRole
name: ebs-external-provisioner-role
apiGroup: rbac.authorization.k8s.io
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -13,3 +14,4 @@ roleRef:
kind: ClusterRole
name: ebs-external-resizer-role
apiGroup: rbac.authorization.k8s.io
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -13,3 +14,4 @@ roleRef:
kind: ClusterRole
name: ebs-external-snapshotter-role
apiGroup: rbac.authorization.k8s.io
{{- end -}}
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/controller.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
# Controller Service
kind: Deployment
apiVersion: apps/v1
Expand Down Expand Up @@ -518,3 +519,4 @@ spec:
dnsConfig:
{{- toYaml .Values.controller.dnsConfig | nindent 8 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/csidriver.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
apiVersion: {{ ternary "storage.k8s.io/v1" "storage.k8s.io/v1beta1" (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version) }}
kind: CSIDriver
metadata:
Expand All @@ -10,3 +11,4 @@ spec:
{{- if not .Values.useOldCSIDriver }}
fsGroupPolicy: File
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/ebs-csi-default-sc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
{{- if .Values.defaultStorageClass.enabled }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
Expand All @@ -9,3 +10,4 @@ provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/aws-ebs-csi-driver/templates/metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.controller.enableMetrics -}}
{{- if and .Values.controller.enableMetrics (not .Values.nodeComponentOnly) -}}
---
apiVersion: v1
kind: Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand All @@ -15,3 +16,4 @@ spec:
{{- else }}
minAvailable: 2
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/role-leases.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -9,3 +10,4 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
{{- end }}
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/templates/rolebinding-leases.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nodeComponentOnly -}}
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -13,3 +14,4 @@ roleRef:
kind: Role
name: ebs-csi-leases-role
apiGroup: rbac.authorization.k8s.io
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.controller.serviceAccount.create -}}
{{- if and .Values.controller.serviceAccount.create (not .Values.nodeComponentOnly) -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/aws-ebs-csi-driver/templates/tests/helm-tester.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.helmTester.enabled -}}
{{- if and .Values.helmTester.enabled (not .Values.nodeComponentOnly) -}}
---
apiVersion: v1
kind: ServiceAccount
Expand Down
2 changes: 2 additions & 0 deletions charts/aws-ebs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ volumeSnapshotClasses: []
# Intended for use with older clusters that cannot easily replace the CSIDriver object
# This parameter should always be false for new installations
useOldCSIDriver: false
# Deploy EBS CSI Driver without controller and associated resources
nodeComponentOnly: false
helmTester:
enabled: true
# Supply a custom image to the ebs-csi-driver-test pod in helm-tester.yaml
Expand Down

0 comments on commit 3565ca0

Please sign in to comment.