Skip to content
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
39 changes: 21 additions & 18 deletions .pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CHART_DIR="$ROOT_DIR/deploy/helm/rawfile-localpv"
CHART="$CHART_DIR/Chart.yaml"

help() {
cat <<EOF
cat <<EOF
Usage: $(basename "$0") [OPTIONS]

Options:
Expand All @@ -21,24 +21,27 @@ EOF

DONE=
while [ "$#" -gt 0 ]; do
case $1 in
-h|--help)
break
shift;;
--version-sync)
PY_VERSION=$(grep -Po '(?<=version = ")[^"]*' "$ROOT_DIR/pyproject.toml")
sed -i'' -e "s/^version: .*/version: $PY_VERSION/" "$CHART"
sed -i'' -e "s/^appVersion: .*/appVersion: $PY_VERSION/" "$CHART"
DONE="yes"
shift;;
*)
echo -e "Unknown parameter $1" >&2
help
exit 1
esac
case $1 in
-h | --help)
break
shift
;;
--version-sync)
PY_VERSION=$(grep -Pom1 '(?<=version = ")[^"]*' "$ROOT_DIR/pyproject.toml")
sed -i'' -e "s/^version: .*/version: $PY_VERSION/" "$CHART"
sed -i'' -e "s/^appVersion: .*/appVersion: $PY_VERSION/" "$CHART"
DONE="yes"
shift
;;
*)
echo -e "Unknown parameter $1" >&2
help
exit 1
;;
esac
done

if [ -z "${DONE:-}" ]; then
help
exit 0
help
exit 0
fi
3 changes: 2 additions & 1 deletion deploy/helm/rawfile-localpv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Please follow the [install guide](https://github.com/openebs/rawfile-localpv/tre
| auth.enabled | bool | `true` | Enables authentication for internal gRPC server |
| auth.secretName | string | `""` | If managing secrets outside the chart, use this to reference the secret name; otherwise, leave empty. |
| auth.token | string | `""` | Sets authentication token for internal gRPC server, will generate one if nothing provided |
| capabilities.resize.enabled | bool | `true` | Sets whether volume resizing is enabled. If disabled, don't deploy controller statefulset |
| capabilities.apiServer.enabled | bool | `true` | Sets whether API Server has been enabled or not |
| capabilities.resize.enabled | bool | `true` | Sets whether volume resizing is enabled. If disabled, don't deploy controller component |
| capabilities.snapshots.enabled | bool | `true` | Sets whether taking volume snapshots is enabled. Required for volume cloning. Runs externalSnapshotter and snapshotController containers. |
| controller.affinity | string | `nil` | Affinities for controller component |
| controller.externalResizer.image.pullPolicy | string | `nil` | Image pull policy for `csi-resizer` |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{- if .Values.capabilities.resize.enabled }}
{{- $cap := .Values.capabilities | default dict }}
{{- if or ($cap.resize.enabled) ($cap.apiServer) }}
apiVersion: apps/v1
kind: StatefulSet
kind: Deployment
metadata:
name: {{ include "rawfile-localpv.fullname" . }}-controller
spec:
replicas: 1
serviceName: {{ include "rawfile-localpv.fullname" . }}
selector:
matchLabels: &selectorLabels
{{- include "rawfile-localpv.selectorLabels" . | nindent 6 }}
Expand All @@ -26,6 +26,64 @@ spec:
- name: socket-dir
emptyDir: {}
containers:
{{- if $cap.apiServer.enabled }}
- name: api-server
image: {{ include "rawfile-localpv.common.image" (dict "imageRoot" .Values.image "global" .Values.global "chartVersion" .Chart.AppVersion) | quote }}
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.global.imagePullPolicy }}
args:
- api
ports:
- containerPort: 8080
env:
- name: PROVISIONER_NAME
value: "{{ .Values.provisionerName }}"
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: LOG_LEVEL
value: {{ .Values.logLevel }}
- name: LOG_FORMAT
value: {{ .Values.logFormat }}
{{- if .Values.reservedCapacity }}
- name: RESERVED_CAPACITY
value: {{ .Values.reservedCapacity | toString | quote }}
{{- end }}
- name: GA_ENABLED
{{- if kindIs "bool" .Values.global.analytics.enabled }}
value: "{{ .Values.global.analytics.enabled }}"
{{- else }}
value: "{{ .Values.analytics.enabled }}"
{{- end }}
{{- if .Values.global.analytics.gaId }}
- name: GA_ID
value: {{ .Values.global.analytics.gaId | quote }}
{{- else if .Values.analytics.gaId }}
- name: GA_ID
value: {{ .Values.analytics.gaId | quote }}
{{- end }}
{{- if .Values.global.analytics.gaKey }}
- name: GA_KEY
value: {{ .Values.global.analytics.gaKey | quote }}
{{- else if .Values.analytics.gaKey }}
- name: GA_KEY
value: {{ .Values.analytics.gaKey | quote }}
{{- end }}
- name: NODE_DS
value: {{ include "rawfile-localpv.fullname" . }}-node
- name: INTERNAL_PORT
value: {{ .Values.node.internalGRPC.port | toString | quote }}
{{- if .Values.auth.enabled }}
- name: INTERNAL_SIGNATURE
valueFrom:
secretKeyRef:
{{- if .Values.auth.secretName }}
name: {{ .Values.auth.secretName }}
{{- else }}
name: {{ include "rawfile-localpv.fullname" . }}-secrets
{{- end }}
key: internal-signature
{{- end }}
{{- end }}
{{- if $cap.resize.enabled }}
Comment thread
mhkarimi1383 marked this conversation as resolved.
- name: csi-driver
image: {{ include "rawfile-localpv.common.image" (dict "imageRoot" .Values.image "global" .Values.global "chartVersion" .Chart.AppVersion) | quote }}
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.global.imagePullPolicy }}
Expand Down Expand Up @@ -76,12 +134,12 @@ spec:
- name: GA_KEY
value: {{ .Values.analytics.gaKey | quote }}
{{- end }}
- name: CSI_DRIVER__INTERNAL_PORT
- name: INTERNAL_PORT
Comment thread
mhkarimi1383 marked this conversation as resolved.
value: {{ .Values.node.internalGRPC.port | toString | quote }}
- name: CSI_DRIVER__NODE_DS
- name: NODE_DS
value: {{ include "rawfile-localpv.fullname" . }}-node
{{- if .Values.auth.enabled }}
- name: CSI_DRIVER__INTERNAL_SIGNATURE
- name: INTERNAL_SIGNATURE
valueFrom:
secretKeyRef:
{{- if .Values.auth.secretName }}
Expand Down Expand Up @@ -115,4 +173,5 @@ spec:
mountPath: /csi
resources:
{{- include "rawfile-localpv.controller-external-resizer-resources" . | nindent 12 }}
{{- end }}
{{- end }}
11 changes: 10 additions & 1 deletion deploy/helm/rawfile-localpv/templates/controller/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{- $cap := .Values.capabilities | default dict }}
{{- $api := $cap.apiServer | default dict }}
{{- if $api.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -7,7 +10,13 @@ metadata:
component: controller
spec:
type: ClusterIP
{{- if $api.enabled }}
ports:
- port: 8080
targetPort: 8080
name: api-server
{{- end }}
selector:
{{- include "rawfile-localpv.selectorLabels" . | nindent 4 }}
component: controller
clusterIP: None
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: CSI_DRIVER__INTERNAL_PORT
- name: INTERNAL_PORT
value: {{ .Values.node.internalGRPC.port | toString | quote }}
- name: CSI_DRIVER__INTERNAL_GRPC_WORKERS
value: {{ .Values.node.internalGRPC.workers | toString | quote }}
- name: CSI_DRIVER__NODE_DS
- name: NODE_DS
value: {{ include "rawfile-localpv.fullname" . }}-node
{{- if .Values.auth.enabled }}
- name: CSI_DRIVER__INTERNAL_SIGNATURE
- name: INTERNAL_SIGNATURE
valueFrom:
secretKeyRef:
{{- if .Values.auth.secretName }}
Expand Down
23 changes: 10 additions & 13 deletions deploy/helm/rawfile-localpv/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ analytics:
controller:
externalResizer:
# -- Sets compute resources for external-resizer container
resources:
{}
resources: {}
image:
# -- Image registry for `csi-resizer`
registry: ""
Expand Down Expand Up @@ -101,8 +100,7 @@ node:

driverRegistrar:
# -- Sets compute resources for driver-registrar container
resources:
{}
resources: {}
image:
# -- Image Registry for `csi-node-driver-registrar`
registry: ""
Expand All @@ -118,8 +116,7 @@ node:

externalProvisioner:
# -- Sets compute resources for external-provisioner container
resources:
{}
resources: {}
image:
# -- Image Registry for `csi-provisioner`
registry: ""
Expand All @@ -134,8 +131,7 @@ node:

externalSnapshotter:
# -- Sets compute resources for external-snapshotter container
resources:
{}
resources: {}
image:
# -- Image Registry for `csi-snapshotter`
registry: ""
Expand All @@ -148,8 +144,7 @@ node:

snapshotController:
# -- Sets compute resources for snapshot-controller container
resources:
{}
resources: {}
image:
# -- Image Registry for `snapshot-controller`
registry: ""
Expand Down Expand Up @@ -184,8 +179,7 @@ node:
kubeletPath: /var/lib/kubelet

# -- Sets compute resources for node component
resources:
{}
resources: {}
metrics:
enabled: false

Expand Down Expand Up @@ -278,5 +272,8 @@ capabilities:
# -- Sets whether taking volume snapshots is enabled. Required for volume cloning. Runs externalSnapshotter and snapshotController containers.
enabled: true
resize:
# -- Sets whether volume resizing is enabled. If disabled, don't deploy controller statefulset
# -- Sets whether volume resizing is enabled. If disabled, don't deploy controller component
enabled: true
apiServer:
# -- Sets whether API Server has been enabled or not
enabled: true
Loading
Loading