Skip to content
Open
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
3 changes: 3 additions & 0 deletions charts/portworx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ The following tables lists the configurable parameters of the Portworx chart and
| `updateStrategy.minReadySeconds` | Minimum number of seconds that a pod should be ready before the next batch of pods is updated during a rolling update | 1 |
| `updateStrategy.disruption.allow` | This field is used to enable or disable smart and parallel upgrade. Smart upgrade is disabled by default, Enable it by setting to false. we can use the `maxUnavailable` field to control the maximum number of Portworx nodes that can be upgraded at a time | None |
| `updateStrategy.autoUpdateComponents` | Specifies the update strategy for the component images. Valid values: None, Once, Always | None |
| `annotations` | Map of annotations to set on the StorageCluster object itself. | {} |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have support to add annotations directly to the stc. However, most annotations are already supported in portworx chart. Which additional annotations are we want to set on the STC ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, we set the following annotations on the stc object:

# https://github.com/libopenstorage/operator/issues/354
# annotation needed to use tcr.paas.local as registry
operator.libopenstorage.org/common-image-registries: "gcr.io,k8s.gcr.io"
portworx.io/disable-storage-class: "true"

argocd.argoproj.io/sync-wave: "1"
# This resource doesn't exist yet on initial sync
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true

Mainly the first annotation is critical for us, to be able to use our own internal registry.

| `priorityClassName` | PriorityClassName to be passed to Podspec of px pods for it to be scheduled accordingly | "" |
| `imagePullPolicy` | ImagePullPolicy specifies the image pull policy for all the images deployed by the operator. The possible values can be `Always` or `IfNotPresent`. | "Always" |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

Expand Down
9 changes: 8 additions & 1 deletion charts/portworx/templates/storage-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ metadata:
{{- if eq .Values.migrateToKvdbTls true }}
portworx.io/migration-to-kvdb-tls: "true"
{{- end }}
{{- with .Values.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
labels:
heritage: {{.Release.Service | quote }}
release: {{.Release.Name | quote }}
Expand All @@ -97,7 +100,7 @@ metadata:
app.kubernetes.io/instance: {{.Release.Name | quote }}
spec:
image: portworx/oci-monitor:{{ required "A valid Image tag is required in the SemVer format" .Values.imageVersion }}
imagePullPolicy: Always
imagePullPolicy: {{ .Values.imagePullPolicy | default "Always" }}
{{- if not (eq $customRegistryURL "none") }}
customImageRegistry: {{ $customRegistryURL }}
{{- end }}
Expand Down Expand Up @@ -624,3 +627,7 @@ spec:
type: {{ .Values.deleteStrategy.type }}
{{- end }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}

4 changes: 4 additions & 0 deletions charts/portworx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,7 @@ updateStrategy:

autoUpdateComponents: # Indicates the update strategy for the component images
# valid values None,Once,Always

annotations: # Map of annotations to set on the StorageCluster object itself.
priorityClassName: # PriorityClassName to be passed to Podspec of px pods for it to be scheduled accordingly
imagePullPolicy: # ImagePullPolicy specifies the image pull policy for all the images deployed by the operator. The possible values can be `Always` or `IfNotPresent`. Default value is `Always`.
26 changes: 26 additions & 0 deletions test/portworx/storagecluster_helm_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,31 @@ func TestStorageClusterHelmTemplate(t *testing.T) {
},
},
},
{
name: "TestAnnotations",
resultFileName: "storagecluster_annotations.yaml",
helmOption: &helm.Options{
ValuesFiles: []string{"./testValues/storagecluster_annotations.yaml"},
},
},
{
name: "TestPriorityClassName",
resultFileName: "storagecluster_priorityclassname.yaml",
helmOption: &helm.Options{
SetValues: map[string]string{
"priorityClassName": "system-cluster-critical",
},
},
},
{
name: "TestImagePullPolicy",
resultFileName: "storagecluster_imagepullpolicy.yaml",
helmOption: &helm.Options{
SetValues: map[string]string{
"imagePullPolicy": "IfNotPresent",
},
},
},
{
name: "TestInternalKvdbTlsEnabled",
resultFileName: "storagecluster_internal_kvdb_tls_enabled.yaml",
Expand Down Expand Up @@ -364,6 +389,7 @@ func TestStorageClusterHelmTemplate(t *testing.T) {
"internalKVDB": "true",
"internalKvdbTls": "false",
"migrateToKvdbTls": "true",
>>>>>>> upstream/master
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions test/portworx/testValues/storagecluster_annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
annotations:
foo: bar
31 changes: 31 additions & 0 deletions test/portworx/testspec/storagecluster_annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
kind: StorageCluster
apiVersion: core.libopenstorage.org/v1
metadata:
name: "mycluster"
namespace: portworx
annotations:
foo: bar
labels:
heritage: "Helm"
release: "my-release"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/instance: "my-release"
spec:
image: portworx/oci-monitor:3.3.0.1
imagePullPolicy: Always

kvdb:
internal: true
storage:
useAll: true
secretsProvider: k8s

stork:
enabled: true
monitoring:
telemetry:
enabled: true
csi:
enabled: true
autopilot:
enabled: true
31 changes: 31 additions & 0 deletions test/portworx/testspec/storagecluster_imagepullpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
kind: StorageCluster
apiVersion: core.libopenstorage.org/v1
metadata:
name: "mycluster"
namespace: portworx
annotations:
labels:
heritage: "Helm"
release: "my-release"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/instance: "my-release"
spec:
image: portworx/oci-monitor:3.3.0.1
imagePullPolicy: IfNotPresent

kvdb:
internal: true
storage:
useAll: true
secretsProvider: k8s

stork:
enabled: true
monitoring:
telemetry:
enabled: true
csi:
enabled: true
autopilot:
enabled: true

31 changes: 31 additions & 0 deletions test/portworx/testspec/storagecluster_priorityclassname.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
kind: StorageCluster
apiVersion: core.libopenstorage.org/v1
metadata:
name: "mycluster"
namespace: portworx
annotations:
labels:
heritage: "Helm"
release: "my-release"
app.kubernetes.io/managed-by: "Helm"
app.kubernetes.io/instance: "my-release"
spec:
image: portworx/oci-monitor:3.3.0.1
imagePullPolicy: Always

kvdb:
internal: true
storage:
useAll: true
secretsProvider: k8s

stork:
enabled: true
monitoring:
telemetry:
enabled: true
csi:
enabled: true
autopilot:
enabled: true
priorityClassName: system-cluster-critical