Skip to content

Commit

Permalink
(helm/v1alpha): add samples manifests
Browse files Browse the repository at this point in the history
Add samples to the helm chart so that consumers and developers can decide if should provide good samples configurations and enable them for the chart be installed within
  • Loading branch information
camilamacedo86 committed Nov 10, 2024
1 parent 40db2b8 commit 6ae680f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/plugins/optional/helm/v1alpha/scaffolds/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func (s *initScaffolder) copyConfigFiles() error {
}{
{"config/rbac", "dist/chart/templates/rbac", "rbac"},
{"config/crd/bases", "dist/chart/templates/crd", "crd"},
{"config/samples", "dist/chart/templates/samples", "samples"},
{"config/network-policy", "dist/chart/templates/network-policy", "networkPolicy"},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ crd:
# (Certificates, Issuers, ...) due to garbage collection.
keep: true
# [SAMPLES]: To apply the sample(s) manifests set true
samples:
enable: false
# [METRICS]: Set to true to generate manifests for exporting metrics.
# To disable metrics export set false, and ensure that the
# ControllerManager argument "--metrics-bind-address=:8443" is removed.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.samples.enable }}
apiVersion: example.com.testproject.org/v1
kind: Wordpress
metadata:
labels:
{{- include "chart.labels" . | nindent 4 }}
name: wordpress-sample
spec:
# TODO(user): Add fields here
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.samples.enable }}
apiVersion: example.com.testproject.org/v1alpha1
kind: Busybox
metadata:
labels:
{{- include "chart.labels" . | nindent 4 }}
name: busybox-sample
spec:
# TODO(user): edit the following value to ensure the number
# of Pods/Instances your Operand must have on cluster
size: 1
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.samples.enable }}
apiVersion: example.com.testproject.org/v1alpha1
kind: Memcached
metadata:
labels:
{{- include "chart.labels" . | nindent 4 }}
name: memcached-sample
spec:
# TODO(user): edit the following value to ensure the number
# of Pods/Instances your Operand must have on cluster
size: 1

# TODO(user): edit the following value to ensure the container has the right port to be initialized
containerPort: 11211
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.samples.enable }}
apiVersion: example.com.testproject.org/v2
kind: Wordpress
metadata:
labels:
{{- include "chart.labels" . | nindent 4 }}
name: wordpress-sample
spec:
# TODO(user): Add fields here
{{- end -}}
4 changes: 4 additions & 0 deletions testdata/project-v4-with-plugins/dist/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ crd:
# (Certificates, Issuers, ...) due to garbage collection.
keep: true

# [SAMPLES]: To apply the sample(s) manifests set true
samples:
enable: false

# [METRICS]: Set to true to generate manifests for exporting metrics.
# To disable metrics export set false, and ensure that the
# ControllerManager argument "--metrics-bind-address=:8443" is removed.
Expand Down

0 comments on commit 6ae680f

Please sign in to comment.