Skip to content

Commit

Permalink
Portworx: operator helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
wormhole-wayne committed May 4, 2023
1 parent 65797d9 commit 593b69e
Show file tree
Hide file tree
Showing 26 changed files with 503 additions and 553 deletions.
2 changes: 1 addition & 1 deletion charts/portworx/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: portworx
version: 2.13.0
description: A Helm chart for installing Portworx on Kubernetes.
kubeVersion: ">=1.10.0"
appVersion: "2.12.2"
appVersion: 2.13.0
apiVersion: v1
keywords:
- Storage
Expand Down
13 changes: 13 additions & 0 deletions charts/portworx/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: portworx-operator
subjects:
- kind: ServiceAccount
name: portworx-operator
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: portworx-operator
apiGroup: rbac.authorization.k8s.io
8 changes: 4 additions & 4 deletions charts/portworx/files/portworx-cluster-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
"#d44a3a"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 100,
"minValue": 0,
Expand Down Expand Up @@ -508,7 +508,7 @@
"#d44a3a"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 100,
"minValue": 0,
Expand Down Expand Up @@ -600,7 +600,7 @@
"#d44a3a"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 100,
"minValue": 0,
Expand Down Expand Up @@ -972,4 +972,4 @@
"title": "Portworx Cluster Dashboard",
"uid": "xLgt8oTik",
"version": 6
}
}
2 changes: 1 addition & 1 deletion charts/portworx/files/portworx-etcd-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"datasource": "prometheus",
"editable": true,
"error": false,
"format": "none",
"format": "null",
"gauge": {
"maxValue": 100,
"minValue": 0,
Expand Down
4 changes: 2 additions & 2 deletions charts/portworx/files/portworx-node-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"#d44a3a"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 100,
"minValue": 0,
Expand Down Expand Up @@ -168,7 +168,7 @@
"#d44a3a"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 100,
"minValue": 0,
Expand Down
10 changes: 5 additions & 5 deletions charts/portworx/files/portworx-volume-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
"rgba(50, 172, 45, 0.97)"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 3,
"minValue": 0,
Expand Down Expand Up @@ -561,7 +561,7 @@
"rgba(50, 172, 45, 0.97)"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 3,
"minValue": 0,
Expand Down Expand Up @@ -1055,7 +1055,7 @@
"rgba(50, 172, 45, 0.97)"
],
"datasource": "prometheus",
"format": "none",
"format": "null",
"gauge": {
"maxValue": 3,
"minValue": 0,
Expand Down Expand Up @@ -1477,7 +1477,7 @@
"yaxes": [
{
"decimals": 0,
"format": "none",
"format": "null",
"label": null,
"logBase": 1,
"max": null,
Expand Down Expand Up @@ -1950,7 +1950,7 @@
},
"yaxes": [
{
"format": "none",
"format": "null",
"label": "",
"logBase": 1,
"max": null,
Expand Down
14 changes: 7 additions & 7 deletions charts/portworx/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,19 @@ Generate a random token for storage provisioning

{{- define "px.deprecatedKvdbArgs" }}
{{- $result := "" }}
{{- if ne .Values.etcd.credentials "none:none" }}
{{- if ne .Values.etcd.credentials "null:null" }}
{{- $result = printf "%s -userpwd %s" $result .Values.etcd.credentials }}
{{- end }}
{{- if ne .Values.etcd.ca "none" }}
{{- if ne .Values.etcd.ca "null" }}
{{- $result = printf "%s -ca %s" $result .Values.etcd.ca }}
{{- end }}
{{- if ne .Values.etcd.cert "none" }}
{{- if ne .Values.etcd.cert "null" }}
{{- $result = printf "%s -cert %s" $result .Values.etcd.cert }}
{{- end }}
{{- if ne .Values.etcd.key "none" }}
{{- if ne .Values.etcd.key "null" }}
{{- $result = printf "%s -key %s" $result .Values.etcd.key }}
{{- end }}
{{- if ne .Values.consul.token "none" }}
{{- if ne .Values.consul.token "null" }}
{{- $result = printf "%s -acltoken %s" $result .Values.consul.token }}
{{- end }}
{{- trim $result }}
Expand All @@ -254,7 +254,7 @@ Generate a random token for storage provisioning
{{- if (include "px.deprecatedKvdbArgs" .) }}
{{- $result = printf "%s %s" $result (include "px.deprecatedKvdbArgs" .) }}
{{- end }}
{{- if ne .Values.miscArgs "none" }}
{{- if ne .Values.miscArgs "null" }}
{{- $result = printf "%s %s" $result .Values.miscArgs }}
{{- end }}
{{- trim $result }}
Expand All @@ -265,7 +265,7 @@ Generate a random token for storage provisioning
{{- if (default false .Values.isTargetOSCoreOS) }}
{{- $result = true }}
{{- end }}
{{- if ne (default "none" .Values.etcd.certPath) "none" }}
{{- if ne (default "null" .Values.etcd.certPath) "null" }}
{{- $result = true }}
{{- end }}
{{- if .Values.volumes }}
Expand Down
15 changes: 15 additions & 0 deletions charts/portworx/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: portworx-operator
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
{{- if semverCompare "<1.25" (.Capabilities.KubeVersion.Version) }}
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames: ["px-operator"]
verbs: ["use"]
{{- end }}
14 changes: 14 additions & 0 deletions charts/portworx/templates/clustertoken-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.clusterToken.serviceAccountName }}
annotations:
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded,hook-failed
helm.sh/hook: post-install
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
48 changes: 48 additions & 0 deletions charts/portworx/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: portworx-operator
namespace: {{ .Release.Namespace }}
spec:
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
replicas: 1
selector:
matchLabels:
name: portworx-operator
template:
metadata:
labels:
name: portworx-operator
spec:
containers:
- name: portworx-operator
imagePullPolicy: Always
image: "{{ .Values.operator.image.repository }}:{{ default .Chart.AppVersion .Values.image.operator.tag }}"
command:
- /operator
- --verbose
- --driver=portworx
- --leader-elect=true
env:
- name: OPERATOR_NAME
value: portworx-operator
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "name"
operator: In
values:
- portworx-operator
topologyKey: "kubernetes.io/hostname"
serviceAccountName: portworx-operator
15 changes: 15 additions & 0 deletions charts/portworx/templates/hooks/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
kind: ClusterRole
apiVersion: {{ template "rbac.apiVersion" . }}
metadata:
annotations:
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
helm.sh/hook: post-install,pre-upgrade,pre-delete
name: {{ template "px.hookClusterRole" . }}
rules:
# for daemonset to operator migration, we need hooks for all resources deployed by daemonset, due to resources are
# different in different helm charts (GCP, IKS, Rancher and portworx), we use wild card here. After daemonset
# migration is finished for all customers we shall change this back to limited access.
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
17 changes: 17 additions & 0 deletions charts/portworx/templates/hooks/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
kind: ClusterRoleBinding
apiVersion: {{ template "rbac.apiVersion" . }}
metadata:
annotations:
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
helm.sh/hook: "post-install,pre-upgrade,pre-delete"
name: {{ template "px.hookClusterRoleBinding" . }}
subjects:
- kind: ServiceAccount
name: {{ template "px.hookServiceAccount" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "px.hookClusterRole" . }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
Loading

0 comments on commit 593b69e

Please sign in to comment.