Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
barroco committed Jan 3, 2024
1 parent 8ab48f9 commit 438bf52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions deploy/operations/ci/aws-1/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.

Expand Down
10 changes: 7 additions & 3 deletions deploy/operations/ci/aws-1/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@ 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

# 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"
Expand All @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit 438bf52

Please sign in to comment.