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 @@
# 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
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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/ \
......
......@@ -66,6 +66,12 @@ dynamo-api-store:
- path: /
pathType: Prefix
postgresql:
enabled: true
minio:
enabled: true
etcd:
enabled: true
persistence:
......
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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:
......
......@@ -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
......@@ -115,4 +115,7 @@ metricsService:
port: 8443
protocol: TCP
targetPort: https
type: ClusterIP
\ No newline at end of file
type: ClusterIP
natsAddr: ""
etcdAddr: ""
......@@ -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
......
......@@ -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}
......
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