Skip to content

Commit

Permalink
Update Portworx to 2.13.3 and add custom namespace support
Browse files Browse the repository at this point in the history
Signed-off-by: Tapas Sharma <[email protected]>
  • Loading branch information
Tapas Sharma authored and sharma-tapas committed May 4, 2023
1 parent c4a4344 commit aab89e0
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 67 deletions.
4 changes: 2 additions & 2 deletions charts/portworx/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: portworx
version: 2.13.0
version: 2.13.3
description: A Helm chart for installing Portworx on Kubernetes.
kubeVersion: ">=1.10.0"
appVersion: "2.12.2"
appVersion: "2.13.3"
apiVersion: v1
keywords:
- Storage
Expand Down
12 changes: 12 additions & 0 deletions charts/portworx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@ Generate a random token for storage provisioning
{{- end -}}


{{- define "px.getDeploymentNamespace" -}}

This comment has been minimized.

Copy link
@CharudathGopal

CharudathGopal May 4, 2023

Member

nit: this could be px.namespace for better readability.

{{- if (.Release.Namespace) -}}
{{- if (eq "default" .Release.Namespace) -}}
{{- printf "kube-system" -}}
{{- else -}}
{{- printf "%s" .Release.Namespace -}}
{{- end -}}
{{- end -}}
{{- end -}}



{{- define "px.affinityPxEnabledValue" -}}
{{- if .Values.requirePxEnabledTag -}}
{{- "true" | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
apiVersion: batch/v1
kind: Job
metadata:
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
name: px-set-cluster-token
labels:
heritage: {{.Release.Service | quote }}
Expand Down Expand Up @@ -36,7 +36,7 @@ spec:
{{- end }}
env:
- name: NS
value: kube-system
value: {{ template "px.getDeploymentNamespace" . }}
- name: KEY
value: cluster-wide-secret-key
command: ['/bin/bash', '-c']
Expand All @@ -53,7 +53,7 @@ spec:
{{- end }}
env:
- name: NS
value: kube-system
value: {{ template "px.getDeploymentNamespace" . }}
command: ['/bin/bash', '-c']
args:
- |
Expand All @@ -69,7 +69,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.clusterToken.serviceAccountName }}
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
annotations:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook": "post-install"
Expand All @@ -87,7 +87,7 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook": post-install
name: {{ .Values.clusterToken.serviceAccountName }}-role
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
rules:
- apiGroups: [""]
resources: ["pods"]
Expand All @@ -103,11 +103,11 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook": post-install
name: {{ .Values.clusterToken.serviceAccountName }}-binding
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
subjects:
- kind: ServiceAccount
name: {{ .Values.clusterToken.serviceAccountName }}
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
roleRef:
kind: Role
name: {{ .Values.clusterToken.serviceAccountName }}-role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
apiVersion: batch/v1
kind: Job
metadata:
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
name: px-hook-delete-storagecluster
labels:
heritage: {{.Release.Service | quote }}
Expand Down Expand Up @@ -37,5 +37,5 @@ spec:
{{- end}}
command: ['/bin/sh',
'-c',
'kubectl -n kube-system delete storagecluster {{ $clusterName }} --ignore-not-found']
'kubectl -n {{ template "px.getDeploymentNamespace" . }} delete storagecluster {{ $clusterName }} --ignore-not-found']
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: batch/v1
kind: Job
metadata:
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
name: px-hook-retain-daemonset-resources
labels:
heritage: {{.Release.Service | quote }}
Expand Down
6 changes: 3 additions & 3 deletions charts/portworx/templates/portworx-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: portworx-operator
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
{{- if (semverCompare "<1.25" (.Capabilities.KubeVersion.GitVersion | regexFind "^v\\d+\\.\\d+\\.\\d+"| trimPrefix "v"))}}
---
apiVersion: policy/v1beta1
Expand Down Expand Up @@ -47,7 +47,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: portworx-operator
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
roleRef:
kind: ClusterRole
name: portworx-operator
Expand All @@ -57,7 +57,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: portworx-operator
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
spec:
strategy:
rollingUpdate:
Expand Down
4 changes: 2 additions & 2 deletions charts/portworx/templates/serviceaccount-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "px.hookServiceAccount" . }}
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
annotations:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook": "post-install,pre-upgrade,pre-delete"
Expand Down Expand Up @@ -40,7 +40,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: {{ template "px.hookServiceAccount" . }}
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
roleRef:
kind: ClusterRole
name: {{ template "px.hookClusterRole" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/portworx/templates/storage-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ kind: StorageCluster
apiVersion: core.libopenstorage.org/v1
metadata:
name: "{{ required "Clustername cannot be empty" .Values.clusterName }}"
namespace: kube-system
namespace: {{ template "px.getDeploymentNamespace" . }}
annotations:
{{- if eq $openshiftInstall true }}
portworx.io/is-openshift: "true"
Expand Down
4 changes: 2 additions & 2 deletions charts/portworx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
deployOperator: true # Deploy the Portworx operator
deployCluster: true # Deploy the Portworx cluster

imageVersion: 2.13.0 # Version of the PX Image.
pxOperatorImageVersion: 23.3.0 # Version of the PX operator image.
imageVersion: 2.13.3 # Version of the PX Image.
pxOperatorImageVersion: 23.4.0 # Version of the PX operator image.

openshiftInstall: false # Defaults to false for installing Portworx on Openshift .
isTargetOSCoreOS: false # Is your target OS CoreOS? Defaults to false.
Expand Down
Loading

0 comments on commit aab89e0

Please sign in to comment.