Skip to content

Commit 39dcdf1

Browse files
feat: flatten out dynamo cloud helm chart (#1258)
1 parent 6336143 commit 39dcdf1

File tree

14 files changed

+125
-103
lines changed

14 files changed

+125
-103
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
apiVersion: v2
1616
name: dynamo-crds
17-
description: A Helm chart for CRDs of dynamo operator
17+
description: A Helm chart for dynamo CRDs
1818
type: application
1919
version: 0.1.6
2020
dependencies: []
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ kind: CustomResourceDefinition
1919
metadata:
2020
annotations:
2121
controller-gen.kubebuilder.io/version: v0.16.4
22+
# never delete this resource with helm delete
23+
helm.sh/resource-policy: keep
2224
name: dynamocomponentdeployments.nvidia.com
2325
spec:
2426
group: nvidia.com
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ kind: CustomResourceDefinition
1919
metadata:
2020
annotations:
2121
controller-gen.kubebuilder.io/version: v0.16.4
22+
# never delete this resource with helm delete
23+
helm.sh/resource-policy: keep
2224
name: dynamocomponents.nvidia.com
2325
spec:
2426
group: nvidia.com
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ kind: CustomResourceDefinition
1919
metadata:
2020
annotations:
2121
controller-gen.kubebuilder.io/version: v0.16.4
22+
# never delete this resource with helm delete
23+
helm.sh/resource-policy: keep
2224
name: dynamographdeployments.nvidia.com
2325
spec:
2426
group: nvidia.com

deploy/cloud/helm/deploy.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export ENABLE_LWS="${ENABLE_LWS:=false}"
4141

4242
# Add command line options
4343
INTERACTIVE=false
44-
44+
INSTALL_CRDS=false
4545
# Parse command line arguments
4646
while [[ $# -gt 0 ]]; do
4747
key="$1"
@@ -50,11 +50,16 @@ while [[ $# -gt 0 ]]; do
5050
INTERACTIVE=true
5151
shift
5252
;;
53+
--crds)
54+
INSTALL_CRDS=true
55+
shift
56+
;;
5357
--help)
5458
echo "Usage: $0 [options]"
5559
echo "Options:"
5660
echo " --interactive Run in interactive mode"
5761
echo " --help Show this help message"
62+
echo " --crds Also install the CRDs"
5863
exit 0
5964
;;
6065
*)
@@ -115,15 +120,6 @@ retry_command "$HELM_CMD repo add bitnami https://charts.bitnami.com/bitnami" 5
115120
retry_command "$HELM_CMD repo add minio https://charts.min.io/" 5 5 && \
116121
retry_command "$HELM_CMD repo update" 5 5
117122

118-
cd platform
119-
cd components/operator
120-
retry_command "$HELM_CMD dependency update" 5 5
121-
cd ../..
122-
cd components/api-store
123-
retry_command "$HELM_CMD dependency update" 5 5
124-
cd ../..
125-
retry_command "$HELM_CMD dep update" 7 5
126-
cd ..
127123

128124
# Generate the values file
129125
echo "Generating values file with:"
@@ -143,6 +139,7 @@ echo "INGRESS_CLASS: $INGRESS_CLASS"
143139
echo "ISTIO_GATEWAY: $ISTIO_GATEWAY"
144140
echo "DYNAMO_INGRESS_SUFFIX: $DYNAMO_INGRESS_SUFFIX"
145141
echo "VIRTUAL_SERVICE_SUPPORTS_HTTPS: $VIRTUAL_SERVICE_SUPPORTS_HTTPS"
142+
echo "INSTALL_CRDS: $INSTALL_CRDS"
146143

147144
envsubst '${NAMESPACE} ${RELEASE_NAME} ${DOCKER_USERNAME} ${DOCKER_PASSWORD} ${DOCKER_SERVER} ${IMAGE_TAG} ${DYNAMO_INGRESS_SUFFIX} ${PIPELINES_DOCKER_SERVER} ${PIPELINES_DOCKER_USERNAME} ${PIPELINES_DOCKER_PASSWORD} ${DOCKER_SECRET_NAME} ${INGRESS_ENABLED} ${ISTIO_ENABLED} ${INGRESS_CLASS} ${ISTIO_GATEWAY} ${VIRTUAL_SERVICE_SUPPORTS_HTTPS} ${ENABLE_LWS}' < dynamo-platform-values.yaml > generated-values.yaml
148145
echo "generated file contents:"
@@ -157,6 +154,12 @@ cd platform
157154
retry_command "$HELM_CMD dep build" 5 5
158155
cd ..
159156

157+
# Install/upgrade the helm chart for the CRDs
158+
if [ "$INSTALL_CRDS" = true ]; then
159+
echo "Installing/upgrading helm chart for the CRDs..."
160+
$HELM_CMD upgrade --install dynamo-crds crds/ --namespace default --wait --atomic
161+
fi
162+
160163
# Install/upgrade the helm chart
161164
echo "Installing/upgrading helm chart..."
162165
$HELM_CMD upgrade --install $RELEASE_NAME platform/ \

deploy/cloud/helm/dynamo-platform-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ dynamo-api-store:
6666
- path: /
6767
pathType: Prefix
6868

69+
postgresql:
70+
enabled: true
71+
72+
minio:
73+
enabled: true
74+
6975
etcd:
7076
enabled: true
7177
persistence:

deploy/cloud/helm/platform/Chart.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,11 @@ dependencies:
3838
version: 11.1.0
3939
repository: "https://charts.bitnami.com/bitnami"
4040
condition: etcd.enabled
41+
- name: postgresql
42+
version: 16.6.2
43+
repository: "https://charts.bitnami.com/bitnami"
44+
condition: postgresql.enabled
45+
- name: minio
46+
version: 16.0.2
47+
repository: "https://charts.bitnami.com/bitnami"
48+
condition: minio.enabled

deploy/cloud/helm/platform/components/api-store/Chart.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,4 @@ description: A Helm chart for the Dynamo API Store component
1818
type: application
1919
version: 0.1.0
2020
appVersion: "1.0.0"
21-
dependencies:
22-
- name: postgresql
23-
version: "16.6.2" # This is an example; update with the latest version if needed
24-
repository: "https://charts.bitnami.com/bitnami"
25-
- name: minio
26-
version: "16.0.2"
27-
repository: "https://charts.bitnami.com/bitnami"
21+
dependencies: []

deploy/cloud/helm/platform/components/api-store/templates/deployment.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
initContainers:
3939
- name: wait-for-postgres
4040
image: busybox
41-
command: [ 'sh', '-c', 'until nc -z {{ .Release.Name }}-postgresql 5432; do echo "PostgreSQL is unavailable. Sleeping for 5 seconds"; sleep 5; done;' ]
41+
command: [ 'sh', '-c', 'until nc -z {{ .Values.postgresql.host | default (printf "%s-postgresql" .Release.Name) }} {{ .Values.postgresql.port | default 5432 }}; do echo "PostgreSQL is unavailable. Sleeping for 5 seconds"; sleep 5; done;' ]
4242
containers:
4343
- name: "api-store"
4444
securityContext:
@@ -61,17 +61,17 @@ spec:
6161
{{- end }}
6262
env:
6363
- name: DB_HOST
64-
value: "{{ .Release.Name }}-postgresql"
64+
value: '{{ .Values.postgresql.host | default (printf "%s-postgresql" .Release.Name) }}'
6565
- name: DB_USER
66-
value: {{ .Values.postgresql.auth.username | quote }}
66+
value: '{{ .Values.postgresql.user | default "admin" }}'
6767
- name: DB_NAME
68-
value: {{ .Values.postgresql.auth.database | quote }}
68+
value: '{{ .Values.postgresql.database | default "dynamo" }}'
6969
- name: DB_PORT
70-
value: "5432"
70+
value: '{{ .Values.postgresql.port | default 5432 }}'
7171
- name: DB_PASSWORD
7272
valueFrom:
7373
secretKeyRef:
74-
name: "{{ .Release.Name }}-postgresql"
74+
name: '{{ .Values.postgresql.passwordSecret | default (printf "%s-postgresql" .Release.Name) }}'
7575
key: password
7676
- name: SERVICE_PORT
7777
value: "8000"
@@ -84,15 +84,15 @@ spec:
8484
- name: DYN_OBJECT_STORE_ID
8585
valueFrom:
8686
secretKeyRef:
87-
name: "{{ .Release.Name }}-minio"
87+
name: '{{ .Values.minio.passwordSecret | default (printf "%s-minio" .Release.Name) }}'
8888
key: root-user
8989
- name: DYN_OBJECT_STORE_KEY
9090
valueFrom:
9191
secretKeyRef:
92-
name: "{{ .Release.Name }}-minio"
92+
name: '{{ .Values.minio.passwordSecret | default (printf "%s-minio" .Release.Name) }}'
9393
key: root-password
9494
- name: DYN_OBJECT_STORE_ENDPOINT
95-
value: "http://{{ .Release.Name }}-minio:9000"
95+
value: 'http://{{ .Values.minio.host | default (printf "%s-minio" .Release.Name) }}:{{ .Values.minio.port | default 9000 }}'
9696
envFrom:
9797
- secretRef:
9898
name: dynamo-deployment-env

deploy/cloud/helm/platform/components/api-store/values.yaml

Lines changed: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -91,55 +91,18 @@ istio:
9191
host: ""
9292
gateway: ""
9393

94-
## In-cluster minio deployment configuration
95-
## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml
96-
## @param minio.apiIngress.enabled Enable ingress controller resource for MinIO API
97-
## @param minio.apiIngress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)
98-
## @param minio.apiIngress.hostname Default host for the ingress resource
94+
postgresql:
95+
host: ""
96+
port: 5432
97+
# allow to override the secret name containing the postgres password
98+
passwordSecret: ""
99+
database: "dynamo"
100+
99101
minio:
100-
mode: standalone
101-
auth:
102-
rootUser: minioadmin
103-
rootPassword: minioadmin
104-
persistence:
105-
enabled: true
106-
size: 10Gi
107-
storageClass: ""
108-
mountPath: /data
109-
annotations:
110-
helm.sh/resource-policy: keep
111-
apiIngress:
112-
enabled: false
113-
ingressClassName: ""
114-
hostname: ""
115-
pathType: ImplementationSpecific
116-
annotations: {}
117-
podSecurityContext:
118-
enabled: true
119-
fsGroup: 1000
120-
containerSecurityContext:
121-
enabled: true
122-
runAsUser: 1000
123-
runAsNonRoot: true
124-
readOnlyRootFilesystem: false
125-
startupProbe:
126-
enabled: true
127-
initialDelaySeconds: 10
128-
periodSeconds: 10
129-
timeoutSeconds: 5
130-
failureThreshold: 6
131-
resources:
132-
requests:
133-
memory: "256Mi"
134-
cpu: "250m"
135-
limits:
136-
memory: "512Mi"
137-
cpu: "500m"
138-
service:
139-
type: ClusterIP
140-
ports:
141-
api: 9000
142-
console: 9001
102+
host: ""
103+
port: 9000
104+
# allow to override the secret name containing the minio username and password
105+
passwordSecret: ""
143106

144107
resources: {}
145108
# We usually recommend not to specify default resources and to leave this as a conscious
@@ -157,14 +120,6 @@ dynamo:
157120
apiStore:
158121
port: 8000
159122

160-
postgresql:
161-
auth:
162-
existingSecret: ""
163-
postgresPassword: ""
164-
username: "admin"
165-
password: "password"
166-
database: "dynamo"
167-
168123
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
169124
livenessProbe:
170125
httpGet:

0 commit comments

Comments
 (0)