diff --git a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/Chart.yaml b/deploy/cloud/helm/crds/Chart.yaml similarity index 93% rename from deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/Chart.yaml rename to deploy/cloud/helm/crds/Chart.yaml index 31245f07b9..0025609dfb 100644 --- a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/Chart.yaml +++ b/deploy/cloud/helm/crds/Chart.yaml @@ -14,7 +14,7 @@ # limitations under the License. apiVersion: v2 name: dynamo-crds -description: A Helm chart for CRDs of dynamo operator +description: A Helm chart for dynamo CRDs type: application version: 0.1.6 dependencies: [] \ No newline at end of file diff --git a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamocomponentdeployments.yaml b/deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml similarity index 99% rename from deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamocomponentdeployments.yaml rename to deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml index b0360c0bf0..3c8d5c5738 100644 --- a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamocomponentdeployments.yaml +++ b/deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml @@ -19,6 +19,8 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.16.4 + # never delete this resource with helm delete + helm.sh/resource-policy: keep name: dynamocomponentdeployments.nvidia.com spec: group: nvidia.com diff --git a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamocomponents.yaml b/deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponents.yaml similarity index 99% rename from deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamocomponents.yaml rename to deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponents.yaml index a39a1b05b3..6455afdd39 100644 --- a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamocomponents.yaml +++ b/deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponents.yaml @@ -19,6 +19,8 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.16.4 + # never delete this resource with helm delete + helm.sh/resource-policy: keep name: dynamocomponents.nvidia.com spec: group: nvidia.com diff --git a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamographdeployments.yaml b/deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml similarity index 99% rename from deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamographdeployments.yaml rename to deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml index d5a67d2493..6520e9deeb 100644 --- a/deploy/cloud/helm/platform/components/operator/charts/dynamo-crds/crds/nvidia.com_dynamographdeployments.yaml +++ b/deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml @@ -19,6 +19,8 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.16.4 + # never delete this resource with helm delete + helm.sh/resource-policy: keep name: dynamographdeployments.nvidia.com spec: group: nvidia.com diff --git a/deploy/cloud/helm/deploy.sh b/deploy/cloud/helm/deploy.sh index 9b5b69317a..1144a429d2 100755 --- a/deploy/cloud/helm/deploy.sh +++ b/deploy/cloud/helm/deploy.sh @@ -41,7 +41,7 @@ export ENABLE_LWS="${ENABLE_LWS:=false}" # Add command line options INTERACTIVE=false - +INSTALL_CRDS=false # Parse command line arguments while [[ $# -gt 0 ]]; do key="$1" @@ -50,11 +50,16 @@ while [[ $# -gt 0 ]]; do INTERACTIVE=true shift ;; + --crds) + INSTALL_CRDS=true + shift + ;; --help) echo "Usage: $0 [options]" echo "Options:" echo " --interactive Run in interactive mode" echo " --help Show this help message" + echo " --crds Also install the CRDs" exit 0 ;; *) @@ -115,15 +120,6 @@ retry_command "$HELM_CMD repo add bitnami https://charts.bitnami.com/bitnami" 5 retry_command "$HELM_CMD repo add minio https://charts.min.io/" 5 5 && \ retry_command "$HELM_CMD repo update" 5 5 -cd platform -cd components/operator -retry_command "$HELM_CMD dependency update" 5 5 -cd ../.. -cd components/api-store -retry_command "$HELM_CMD dependency update" 5 5 -cd ../.. -retry_command "$HELM_CMD dep update" 7 5 -cd .. # Generate the values file echo "Generating values file with:" @@ -143,6 +139,7 @@ echo "INGRESS_CLASS: $INGRESS_CLASS" echo "ISTIO_GATEWAY: $ISTIO_GATEWAY" echo "DYNAMO_INGRESS_SUFFIX: $DYNAMO_INGRESS_SUFFIX" echo "VIRTUAL_SERVICE_SUPPORTS_HTTPS: $VIRTUAL_SERVICE_SUPPORTS_HTTPS" +echo "INSTALL_CRDS: $INSTALL_CRDS" 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 echo "generated file contents:" @@ -157,6 +154,12 @@ cd platform retry_command "$HELM_CMD dep build" 5 5 cd .. +# Install/upgrade the helm chart for the CRDs +if [ "$INSTALL_CRDS" = true ]; then + echo "Installing/upgrading helm chart for the CRDs..." + $HELM_CMD upgrade --install dynamo-crds crds/ --namespace default --wait --atomic +fi + # Install/upgrade the helm chart echo "Installing/upgrading helm chart..." $HELM_CMD upgrade --install $RELEASE_NAME platform/ \ diff --git a/deploy/cloud/helm/dynamo-platform-values.yaml b/deploy/cloud/helm/dynamo-platform-values.yaml index 5381901251..a5301c0f53 100644 --- a/deploy/cloud/helm/dynamo-platform-values.yaml +++ b/deploy/cloud/helm/dynamo-platform-values.yaml @@ -66,6 +66,12 @@ dynamo-api-store: - path: / pathType: Prefix +postgresql: + enabled: true + +minio: + enabled: true + etcd: enabled: true persistence: diff --git a/deploy/cloud/helm/platform/Chart.yaml b/deploy/cloud/helm/platform/Chart.yaml index 80fb57fa20..36e50cf8d9 100644 --- a/deploy/cloud/helm/platform/Chart.yaml +++ b/deploy/cloud/helm/platform/Chart.yaml @@ -38,3 +38,11 @@ dependencies: version: 11.1.0 repository: "https://charts.bitnami.com/bitnami" condition: etcd.enabled + - name: postgresql + version: 16.6.2 + repository: "https://charts.bitnami.com/bitnami" + condition: postgresql.enabled + - name: minio + version: 16.0.2 + repository: "https://charts.bitnami.com/bitnami" + condition: minio.enabled diff --git a/deploy/cloud/helm/platform/components/api-store/Chart.yaml b/deploy/cloud/helm/platform/components/api-store/Chart.yaml index c4b86bf194..fa2d20618d 100644 --- a/deploy/cloud/helm/platform/components/api-store/Chart.yaml +++ b/deploy/cloud/helm/platform/components/api-store/Chart.yaml @@ -18,10 +18,4 @@ description: A Helm chart for the Dynamo API Store component type: application version: 0.1.0 appVersion: "1.0.0" -dependencies: - - name: postgresql - version: "16.6.2" # This is an example; update with the latest version if needed - repository: "https://charts.bitnami.com/bitnami" - - name: minio - version: "16.0.2" - repository: "https://charts.bitnami.com/bitnami" \ No newline at end of file +dependencies: [] \ No newline at end of file diff --git a/deploy/cloud/helm/platform/components/api-store/templates/deployment.yaml b/deploy/cloud/helm/platform/components/api-store/templates/deployment.yaml index a2e190ed9f..aa133f58ea 100644 --- a/deploy/cloud/helm/platform/components/api-store/templates/deployment.yaml +++ b/deploy/cloud/helm/platform/components/api-store/templates/deployment.yaml @@ -38,7 +38,7 @@ spec: initContainers: - name: wait-for-postgres image: busybox - command: [ 'sh', '-c', 'until nc -z {{ .Release.Name }}-postgresql 5432; do echo "PostgreSQL is unavailable. Sleeping for 5 seconds"; sleep 5; done;' ] + 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;' ] containers: - name: "api-store" securityContext: @@ -61,17 +61,17 @@ spec: {{- end }} env: - name: DB_HOST - value: "{{ .Release.Name }}-postgresql" + value: '{{ .Values.postgresql.host | default (printf "%s-postgresql" .Release.Name) }}' - name: DB_USER - value: {{ .Values.postgresql.auth.username | quote }} + value: '{{ .Values.postgresql.user | default "admin" }}' - name: DB_NAME - value: {{ .Values.postgresql.auth.database | quote }} + value: '{{ .Values.postgresql.database | default "dynamo" }}' - name: DB_PORT - value: "5432" + value: '{{ .Values.postgresql.port | default 5432 }}' - name: DB_PASSWORD valueFrom: secretKeyRef: - name: "{{ .Release.Name }}-postgresql" + name: '{{ .Values.postgresql.passwordSecret | default (printf "%s-postgresql" .Release.Name) }}' key: password - name: SERVICE_PORT value: "8000" @@ -84,15 +84,15 @@ spec: - name: DYN_OBJECT_STORE_ID valueFrom: secretKeyRef: - name: "{{ .Release.Name }}-minio" + name: '{{ .Values.minio.passwordSecret | default (printf "%s-minio" .Release.Name) }}' key: root-user - name: DYN_OBJECT_STORE_KEY valueFrom: secretKeyRef: - name: "{{ .Release.Name }}-minio" + name: '{{ .Values.minio.passwordSecret | default (printf "%s-minio" .Release.Name) }}' key: root-password - name: DYN_OBJECT_STORE_ENDPOINT - value: "http://{{ .Release.Name }}-minio:9000" + value: 'http://{{ .Values.minio.host | default (printf "%s-minio" .Release.Name) }}:{{ .Values.minio.port | default 9000 }}' envFrom: - secretRef: name: dynamo-deployment-env diff --git a/deploy/cloud/helm/platform/components/api-store/values.yaml b/deploy/cloud/helm/platform/components/api-store/values.yaml index 9052176aa2..55eff9bd25 100644 --- a/deploy/cloud/helm/platform/components/api-store/values.yaml +++ b/deploy/cloud/helm/platform/components/api-store/values.yaml @@ -91,55 +91,18 @@ istio: host: "" gateway: "" -## In-cluster minio deployment configuration -## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml -## @param minio.apiIngress.enabled Enable ingress controller resource for MinIO API -## @param minio.apiIngress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) -## @param minio.apiIngress.hostname Default host for the ingress resource +postgresql: + host: "" + port: 5432 + # allow to override the secret name containing the postgres password + passwordSecret: "" + database: "dynamo" + minio: - mode: standalone - auth: - rootUser: minioadmin - rootPassword: minioadmin - persistence: - enabled: true - size: 10Gi - storageClass: "" - mountPath: /data - annotations: - helm.sh/resource-policy: keep - apiIngress: - enabled: false - ingressClassName: "" - hostname: "" - pathType: ImplementationSpecific - annotations: {} - podSecurityContext: - enabled: true - fsGroup: 1000 - containerSecurityContext: - enabled: true - runAsUser: 1000 - runAsNonRoot: true - readOnlyRootFilesystem: false - startupProbe: - enabled: true - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - resources: - requests: - memory: "256Mi" - cpu: "250m" - limits: - memory: "512Mi" - cpu: "500m" - service: - type: ClusterIP - ports: - api: 9000 - console: 9001 + host: "" + port: 9000 + # allow to override the secret name containing the minio username and password + passwordSecret: "" resources: {} # We usually recommend not to specify default resources and to leave this as a conscious @@ -157,14 +120,6 @@ dynamo: apiStore: port: 8000 -postgresql: - auth: - existingSecret: "" - postgresPassword: "" - username: "admin" - password: "password" - database: "dynamo" - # 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/ livenessProbe: httpGet: diff --git a/deploy/cloud/helm/platform/components/operator/Chart.yaml b/deploy/cloud/helm/platform/components/operator/Chart.yaml index 50a4ea2149..28a1a82933 100644 --- a/deploy/cloud/helm/platform/components/operator/Chart.yaml +++ b/deploy/cloud/helm/platform/components/operator/Chart.yaml @@ -33,7 +33,3 @@ version: 0.1.7 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "0.1.0" -dependencies: - - name: dynamo-crds - version: 0.1.6 - repository: file://charts/dynamo-crds \ No newline at end of file diff --git a/deploy/cloud/helm/platform/components/operator/values.yaml b/deploy/cloud/helm/platform/components/operator/values.yaml index 67fa3c93a7..4c48f01312 100644 --- a/deploy/cloud/helm/platform/components/operator/values.yaml +++ b/deploy/cloud/helm/platform/components/operator/values.yaml @@ -115,4 +115,7 @@ metricsService: port: 8443 protocol: TCP targetPort: https - type: ClusterIP \ No newline at end of file + type: ClusterIP + +natsAddr: "" +etcdAddr: "" diff --git a/deploy/cloud/helm/platform/values.yaml b/deploy/cloud/helm/platform/values.yaml index f614e09962..ee5f6f3752 100644 --- a/deploy/cloud/helm/platform/values.yaml +++ b/deploy/cloud/helm/platform/values.yaml @@ -88,20 +88,69 @@ dynamo-api-store: paths: - path: / pathType: Prefix - postgresql: - primary: - persistence: - enabled: false - minio: + +## In-cluster minio deployment configuration +## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml +## @param minio.apiIngress.enabled Enable ingress controller resource for MinIO API +## @param minio.apiIngress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) +## @param minio.apiIngress.hostname Default host for the ingress resource +minio: + enabled: false + mode: standalone + auth: + rootUser: minioadmin + rootPassword: minioadmin + persistence: + enabled: true + size: 10Gi + storageClass: "" + mountPath: /data + annotations: + helm.sh/resource-policy: keep + apiIngress: + enabled: false + ingressClassName: "" + hostname: "" + pathType: ImplementationSpecific + annotations: {} + podSecurityContext: + enabled: true + fsGroup: 1000 + containerSecurityContext: + enabled: true + runAsUser: 1000 + runAsNonRoot: true + readOnlyRootFilesystem: false + startupProbe: + enabled: true + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 6 + resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "512Mi" + cpu: "500m" + service: + type: ClusterIP + ports: + api: 9000 + console: 9001 + +postgresql: + enabled: false + auth: + existingSecret: "" + postgresPassword: "" + username: "admin" + password: "password" + database: "dynamo" + primary: persistence: - enabled: true - size: 5Gi - storageClass: "" - apiIngress: enabled: false - ingressClassName: nginx - hostname: minio.example.com - pathType: Prefix etcd: enabled: false diff --git a/docs/guides/dynamo_deploy/dynamo_cloud.md b/docs/guides/dynamo_deploy/dynamo_cloud.md index df6682250f..3099040abb 100644 --- a/docs/guides/dynamo_deploy/dynamo_cloud.md +++ b/docs/guides/dynamo_deploy/dynamo_cloud.md @@ -148,18 +148,20 @@ kubectl create namespace $NAMESPACE kubectl config set-context --current --namespace=$NAMESPACE ``` -3. Deploy the helm chart using the deploy script: +3. Deploy the Helm charts (install CRDs first, then platform) using the deployment script: ```bash -./deploy.sh +./deploy.sh --crds ``` if you wish to be guided through the deployment process, you can run the deploy script with the `--interactive` flag: ```bash -./deploy.sh --interactive +./deploy.sh --crds --interactive ``` +omitting `--crds` will skip the CRDs installation/upgrade. This is useful when installing on a shared cluster as CRDs are cluster-scoped resources. + 4. **Expose Dynamo Cloud Externally** ``` {note}