Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Azure cluster setup #873

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 3 additions & 28 deletions docs/docs/getting-started/cluster-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ az group create \

## Create AKS cluster

First, we need to create an AKS cluster. We can't directly create a CoCo-enabled cluster, so we'll need to create a
non-CoCo cluster first, and then add a CoCo node pool, optionally replacing the non-CoCo node pool.

We'll first start by creating the non-CoCo cluster:
First, create a CoCo enabled AKS cluster with:

```sh
# Select the name for your AKS cluster
Expand All @@ -100,32 +97,11 @@ az aks create \
--kubernetes-version 1.29 \
--os-sku AzureLinux \
--node-vm-size Standard_DC4as_cc_v5 \
--workload-runtime KataCcIsolation \
--node-count 1 \
--generate-ssh-keys
```

We then add a second node pool with CoCo support:

```bash
az aks nodepool add \
--resource-group "${azResourceGroup:?}" \
--name nodepool2 \
--cluster-name "${azClusterName:?}" \
--node-count 1 \
--os-sku AzureLinux \
--node-vm-size Standard_DC4as_cc_v5 \
--workload-runtime KataCcIsolation
```

Optionally, we can now remove the non-CoCo node pool:

```bash
az aks nodepool delete \
--resource-group "${azResourceGroup:?}" \
--cluster-name "${azClusterName:?}" \
--name nodepool1
```

Finally, update your kubeconfig with the credentials to access the cluster:

```bash
Expand All @@ -140,12 +116,11 @@ For validation, list the available nodes using kubectl:
kubectl get nodes
```

It should show two nodes:
It should show a single node:

```bash
NAME STATUS ROLES AGE VERSION
aks-nodepool1-32049705-vmss000000 Ready <none> 9m47s v1.29.0
aks-nodepool2-32238657-vmss000000 Ready <none> 45s v1.29.0
```

## Cleanup
Expand Down
16 changes: 1 addition & 15 deletions packages/create-coco-aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,10 @@ az aks create \
--kubernetes-version "${k8sVersion}" \
--os-sku AzureLinux \
--node-vm-size Standard_DC4as_cc_v5 \
--workload-runtime KataCcIsolation \
--node-count 1 \
--generate-ssh-keys

az aks nodepool add \
--resource-group "${name}" \
--name nodepool2 \
--cluster-name "${name}" \
--mode System \
--node-count 1 \
--os-sku AzureLinux \
--node-vm-size Standard_DC4as_cc_v5 \
--workload-runtime KataCcIsolation

az aks get-credentials \
--resource-group "${name}" \
--name "${name}"

az aks nodepool delete \
--resource-group "${name}" \
--cluster-name "${name}" \
--name nodepool1
2 changes: 1 addition & 1 deletion packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
set -euo pipefail

name=""
pool="nodepool2"
pool="nodepool1"

for i in "$@"; do
case $i in
Expand Down
Loading