From 438bf528cee651f126ea2b3082faf34a5927d5a9 Mon Sep 17 00:00:00 2001 From: Michael Barroco Date: Wed, 3 Jan 2024 16:53:06 +0100 Subject: [PATCH] Comments --- deploy/operations/ci/aws-1/README.md | 5 +++-- deploy/operations/ci/aws-1/test.sh | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/deploy/operations/ci/aws-1/README.md b/deploy/operations/ci/aws-1/README.md index bdb0ebe21..1ed7d0ea9 100644 --- a/deploy/operations/ci/aws-1/README.md +++ b/deploy/operations/ci/aws-1/README.md @@ -1,6 +1,7 @@ # AWS-1 CI deployment -This module deploys a Kubernetes cluster to AWS. +This module deploys a DSS to a Kubernetes cluster in AWS. It is primarily by our [CI](../../../../.github/workflows/dss-deploy.yml). +See [test.sh](test.sh) for the complete list of actions. ## Terraform state @@ -23,7 +24,7 @@ Call the kubernetes cluster using `kubectl` #### Add other roles Access to the cluster is managed using the config map `aws-auth`. -Its definition is managed by [`kubernetes_admin_access.tf`](./kubernetes_admin_access.tf). +Its definition is managed in [`kubernetes_admin_access.tf`](./kubernetes_admin_access.tf). Currently only the user who bootstrapped the cluster and the ones assuming the administrator role (see [`local_variables.tf`](./local_variables.tf)) have access. diff --git a/deploy/operations/ci/aws-1/test.sh b/deploy/operations/ci/aws-1/test.sh index 875bac878..413149e69 100755 --- a/deploy/operations/ci/aws-1/test.sh +++ b/deploy/operations/ci/aws-1/test.sh @@ -12,14 +12,16 @@ else fi cd "${BASEDIR}" || exit 1 +# Initialize terraform terraform init # TODO: Fail if env is not clean -## Deploy the Kubernetes cluster +# Deploy the Kubernetes cluster terraform apply -auto-approve KUBE_CONTEXT="$(terraform output -raw cluster_context)" WORKSPACE_LOCATION="$(terraform output -raw workspace_location)" +# Login into the Kubernetes Cluster cd "${WORKSPACE_LOCATION}" ./get-credentials.sh aws sts get-caller-identity @@ -27,10 +29,11 @@ aws sts get-caller-identity # Allow access to the cluster to AWS admins kubectl apply -f "aws_auth_config_map.yml" -## Generate cockroachdb certificates +# Generate cockroachdb certificates ./make-certs.sh ./apply-certs.sh +# Install the DSS using the helm chart cd "$BASEDIR/../../../services/helm-charts/dss" RELEASE_NAME="dss" helm dep update --kube-context="$KUBE_CONTEXT" @@ -39,7 +42,7 @@ helm upgrade --install --kube-context="$KUBE_CONTEXT" -f "${WORKSPACE_LOCATION}/ # TODO: Test the deployment of the DSS if [ -n "$DO_NOT_DESTROY" ]; then - "Destroy disabled. Exit." + echo "Destroy disabled. Exit." exit 0 fi @@ -49,6 +52,7 @@ helm uninstall --kube-context="$KUBE_CONTEXT" "$RELEASE_NAME" # Delete PVC to delete persistant volumes kubectl delete pvc --all=true +# TODO: Check completness # Delete cluster cd "$BASEDIR"