"ssh:/git@developer.sourcefind.cn:2222/OpenDAS/dynamo.git" did not exist on "dbe48a1d2b90d63364136a325160dfa78730ec57"
Unverified Commit 39dcdf1f authored by julienmancuso's avatar julienmancuso Committed by GitHub
Browse files

feat: flatten out dynamo cloud helm chart (#1258)

parent 6336143d
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
apiVersion: v2 apiVersion: v2
name: dynamo-crds name: dynamo-crds
description: A Helm chart for CRDs of dynamo operator description: A Helm chart for dynamo CRDs
type: application type: application
version: 0.1.6 version: 0.1.6
dependencies: [] dependencies: []
\ No newline at end of file
...@@ -19,6 +19,8 @@ kind: CustomResourceDefinition ...@@ -19,6 +19,8 @@ kind: CustomResourceDefinition
metadata: metadata:
annotations: annotations:
controller-gen.kubebuilder.io/version: v0.16.4 controller-gen.kubebuilder.io/version: v0.16.4
# never delete this resource with helm delete
helm.sh/resource-policy: keep
name: dynamocomponentdeployments.nvidia.com name: dynamocomponentdeployments.nvidia.com
spec: spec:
group: nvidia.com group: nvidia.com
......
...@@ -19,6 +19,8 @@ kind: CustomResourceDefinition ...@@ -19,6 +19,8 @@ kind: CustomResourceDefinition
metadata: metadata:
annotations: annotations:
controller-gen.kubebuilder.io/version: v0.16.4 controller-gen.kubebuilder.io/version: v0.16.4
# never delete this resource with helm delete
helm.sh/resource-policy: keep
name: dynamocomponents.nvidia.com name: dynamocomponents.nvidia.com
spec: spec:
group: nvidia.com group: nvidia.com
......
...@@ -19,6 +19,8 @@ kind: CustomResourceDefinition ...@@ -19,6 +19,8 @@ kind: CustomResourceDefinition
metadata: metadata:
annotations: annotations:
controller-gen.kubebuilder.io/version: v0.16.4 controller-gen.kubebuilder.io/version: v0.16.4
# never delete this resource with helm delete
helm.sh/resource-policy: keep
name: dynamographdeployments.nvidia.com name: dynamographdeployments.nvidia.com
spec: spec:
group: nvidia.com group: nvidia.com
......
...@@ -41,7 +41,7 @@ export ENABLE_LWS="${ENABLE_LWS:=false}" ...@@ -41,7 +41,7 @@ export ENABLE_LWS="${ENABLE_LWS:=false}"
# Add command line options # Add command line options
INTERACTIVE=false INTERACTIVE=false
INSTALL_CRDS=false
# Parse command line arguments # Parse command line arguments
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
key="$1" key="$1"
...@@ -50,11 +50,16 @@ while [[ $# -gt 0 ]]; do ...@@ -50,11 +50,16 @@ while [[ $# -gt 0 ]]; do
INTERACTIVE=true INTERACTIVE=true
shift shift
;; ;;
--crds)
INSTALL_CRDS=true
shift
;;
--help) --help)
echo "Usage: $0 [options]" echo "Usage: $0 [options]"
echo "Options:" echo "Options:"
echo " --interactive Run in interactive mode" echo " --interactive Run in interactive mode"
echo " --help Show this help message" echo " --help Show this help message"
echo " --crds Also install the CRDs"
exit 0 exit 0
;; ;;
*) *)
...@@ -115,15 +120,6 @@ retry_command "$HELM_CMD repo add bitnami https://charts.bitnami.com/bitnami" 5 ...@@ -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 add minio https://charts.min.io/" 5 5 && \
retry_command "$HELM_CMD repo update" 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 # Generate the values file
echo "Generating values file with:" echo "Generating values file with:"
...@@ -143,6 +139,7 @@ echo "INGRESS_CLASS: $INGRESS_CLASS" ...@@ -143,6 +139,7 @@ echo "INGRESS_CLASS: $INGRESS_CLASS"
echo "ISTIO_GATEWAY: $ISTIO_GATEWAY" echo "ISTIO_GATEWAY: $ISTIO_GATEWAY"
echo "DYNAMO_INGRESS_SUFFIX: $DYNAMO_INGRESS_SUFFIX" echo "DYNAMO_INGRESS_SUFFIX: $DYNAMO_INGRESS_SUFFIX"
echo "VIRTUAL_SERVICE_SUPPORTS_HTTPS: $VIRTUAL_SERVICE_SUPPORTS_HTTPS" 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 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:" echo "generated file contents:"
...@@ -157,6 +154,12 @@ cd platform ...@@ -157,6 +154,12 @@ cd platform
retry_command "$HELM_CMD dep build" 5 5 retry_command "$HELM_CMD dep build" 5 5
cd .. 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 # Install/upgrade the helm chart
echo "Installing/upgrading helm chart..." echo "Installing/upgrading helm chart..."
$HELM_CMD upgrade --install $RELEASE_NAME platform/ \ $HELM_CMD upgrade --install $RELEASE_NAME platform/ \
......
...@@ -66,6 +66,12 @@ dynamo-api-store: ...@@ -66,6 +66,12 @@ dynamo-api-store:
- path: / - path: /
pathType: Prefix pathType: Prefix
postgresql:
enabled: true
minio:
enabled: true
etcd: etcd:
enabled: true enabled: true
persistence: persistence:
......
...@@ -38,3 +38,11 @@ dependencies: ...@@ -38,3 +38,11 @@ dependencies:
version: 11.1.0 version: 11.1.0
repository: "https://charts.bitnami.com/bitnami" repository: "https://charts.bitnami.com/bitnami"
condition: etcd.enabled 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
...@@ -18,10 +18,4 @@ description: A Helm chart for the Dynamo API Store component ...@@ -18,10 +18,4 @@ description: A Helm chart for the Dynamo API Store component
type: application type: application
version: 0.1.0 version: 0.1.0
appVersion: "1.0.0" appVersion: "1.0.0"
dependencies: dependencies: []
- name: postgresql \ No newline at end of file
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
...@@ -38,7 +38,7 @@ spec: ...@@ -38,7 +38,7 @@ spec:
initContainers: initContainers:
- name: wait-for-postgres - name: wait-for-postgres
image: busybox 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: containers:
- name: "api-store" - name: "api-store"
securityContext: securityContext:
...@@ -61,17 +61,17 @@ spec: ...@@ -61,17 +61,17 @@ spec:
{{- end }} {{- end }}
env: env:
- name: DB_HOST - name: DB_HOST
value: "{{ .Release.Name }}-postgresql" value: '{{ .Values.postgresql.host | default (printf "%s-postgresql" .Release.Name) }}'
- name: DB_USER - name: DB_USER
value: {{ .Values.postgresql.auth.username | quote }} value: '{{ .Values.postgresql.user | default "admin" }}'
- name: DB_NAME - name: DB_NAME
value: {{ .Values.postgresql.auth.database | quote }} value: '{{ .Values.postgresql.database | default "dynamo" }}'
- name: DB_PORT - name: DB_PORT
value: "5432" value: '{{ .Values.postgresql.port | default 5432 }}'
- name: DB_PASSWORD - name: DB_PASSWORD
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: "{{ .Release.Name }}-postgresql" name: '{{ .Values.postgresql.passwordSecret | default (printf "%s-postgresql" .Release.Name) }}'
key: password key: password
- name: SERVICE_PORT - name: SERVICE_PORT
value: "8000" value: "8000"
...@@ -84,15 +84,15 @@ spec: ...@@ -84,15 +84,15 @@ spec:
- name: DYN_OBJECT_STORE_ID - name: DYN_OBJECT_STORE_ID
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: "{{ .Release.Name }}-minio" name: '{{ .Values.minio.passwordSecret | default (printf "%s-minio" .Release.Name) }}'
key: root-user key: root-user
- name: DYN_OBJECT_STORE_KEY - name: DYN_OBJECT_STORE_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: "{{ .Release.Name }}-minio" name: '{{ .Values.minio.passwordSecret | default (printf "%s-minio" .Release.Name) }}'
key: root-password key: root-password
- name: DYN_OBJECT_STORE_ENDPOINT - 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: envFrom:
- secretRef: - secretRef:
name: dynamo-deployment-env name: dynamo-deployment-env
......
...@@ -91,55 +91,18 @@ istio: ...@@ -91,55 +91,18 @@ istio:
host: "" host: ""
gateway: "" gateway: ""
## In-cluster minio deployment configuration postgresql:
## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml host: ""
## @param minio.apiIngress.enabled Enable ingress controller resource for MinIO API port: 5432
## @param minio.apiIngress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) # allow to override the secret name containing the postgres password
## @param minio.apiIngress.hostname Default host for the ingress resource passwordSecret: ""
database: "dynamo"
minio: minio:
mode: standalone host: ""
auth: port: 9000
rootUser: minioadmin # allow to override the secret name containing the minio username and password
rootPassword: minioadmin passwordSecret: ""
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
resources: {} resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious
...@@ -157,14 +120,6 @@ dynamo: ...@@ -157,14 +120,6 @@ dynamo:
apiStore: apiStore:
port: 8000 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/ # 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: livenessProbe:
httpGet: httpGet:
......
...@@ -33,7 +33,3 @@ version: 0.1.7 ...@@ -33,7 +33,3 @@ version: 0.1.7
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes. # It is recommended to use it with quotes.
appVersion: "0.1.0" appVersion: "0.1.0"
dependencies:
- name: dynamo-crds
version: 0.1.6
repository: file://charts/dynamo-crds
\ No newline at end of file
...@@ -115,4 +115,7 @@ metricsService: ...@@ -115,4 +115,7 @@ metricsService:
port: 8443 port: 8443
protocol: TCP protocol: TCP
targetPort: https targetPort: https
type: ClusterIP type: ClusterIP
\ No newline at end of file
natsAddr: ""
etcdAddr: ""
...@@ -88,20 +88,69 @@ dynamo-api-store: ...@@ -88,20 +88,69 @@ dynamo-api-store:
paths: paths:
- path: / - path: /
pathType: Prefix pathType: Prefix
postgresql:
primary: ## In-cluster minio deployment configuration
persistence: ## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml
enabled: false ## @param minio.apiIngress.enabled Enable ingress controller resource for MinIO API
minio: ## @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: persistence:
enabled: true
size: 5Gi
storageClass: ""
apiIngress:
enabled: false enabled: false
ingressClassName: nginx
hostname: minio.example.com
pathType: Prefix
etcd: etcd:
enabled: false enabled: false
......
...@@ -148,18 +148,20 @@ kubectl create namespace $NAMESPACE ...@@ -148,18 +148,20 @@ kubectl create namespace $NAMESPACE
kubectl config set-context --current --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 ```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: if you wish to be guided through the deployment process, you can run the deploy script with the `--interactive` flag:
```bash ```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** 4. **Expose Dynamo Cloud Externally**
``` {note} ``` {note}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment