Skip to content

Commit 093d4b3

Browse files
committed
docs: Update Azure & GCP installation using Helm charts
Updated documentation for Azure and Google cloud to use Helm charts. Signed-off-by: Pawel Proskurnicki <pawel.proskurnicki@intel.com>
1 parent 8d869a4 commit 093d4b3

File tree

4 files changed

+284
-313
lines changed

4 files changed

+284
-313
lines changed

content/en/docs/examples/alibaba-cloud-simple.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ This documentation will walk you through setting up CAA (a.k.a. Peer Pods) on Al
2323
2424
## Prerequisites
2525

26-
- Install `aliyun` CLI [tool](https://www.alibabacloud.com/help/en/cli/installation-guide/?spm=a2c63.p38356.help-menu-29991.d_2.28f346a6IMqkop) and [configure credentials](https://www.alibabacloud.com/help/en/cli/configure-credentials)
27-
- Have an `aliyun` OSS storage with a bucket.
26+
1. **Install Required Tools**:
27+
- Install `aliyun` CLI [tool](https://www.alibabacloud.com/help/en/cli/installation-guide/?spm=a2c63.p38356.help-menu-29991.d_2.28f346a6IMqkop) and [configure credentials](https://www.alibabacloud.com/help/en/cli/configure-credentials)
28+
- Have an `aliyun` OSS storage with a bucket.
2829

2930
## Create pod VM Image
3031

content/en/docs/examples/aws-simple.md

Lines changed: 91 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
title: AWS
3-
description: Cloud API Adaptor (CAA) on AWS
3+
description: Peer Pods Helm Chart using Cloud API Adaptor (CAA) on AWS
44
categories:
55
- examples
66
tags:
7+
- helm
78
- caa
89
- aws
910
- eks
@@ -17,10 +18,12 @@ This documentation will walk you through setting up CAA (a.k.a. Peer Pods) on AW
1718

1819
## Pre-requisites
1920

20-
- Install `aws` CLI [tool](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
21-
- Install `eksctl` CLI [tool](https://eksctl.io/installation/)
22-
- Install kubectl by following the instructions [here](https://kubernetes.io/docs/tasks/tools/#kubectl).
23-
- Ensure that the tools `curl`, `git` and `jq` are installed.
21+
1. **Install Required Tools**:
22+
- Install [Helm](https://helm.sh/docs/intro/install)
23+
- Install [AWS CLI (`aws`)](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
24+
- Install `eksctl` CLI [tool](https://eksctl.io/installation/)
25+
- Install [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl).
26+
- Ensure that the tools `curl`, `git` and `jq` are installed.
2427

2528
## AWS Preparation
2629

@@ -77,6 +80,14 @@ eksctl create cluster --name "$CLUSTER_NAME" \
7780

7881
Wait for the cluster to be created.
7982

83+
Label the cluster nodes with `node.kubernetes.io/worker=`
84+
85+
```bash
86+
for NODE_NAME in $(kubectl get nodes -o jsonpath='{.items[*].metadata.name}'); do
87+
kubectl label node $NODE_NAME node.kubernetes.io/worker=
88+
done
89+
```
90+
8091
### Allow required network ports
8192

8293
```bash
@@ -109,20 +120,20 @@ aws ec2 authorize-security-group-ingress --group-id "$EKS_CLUSTER_SG" --protocol
109120
> - Port `9000` is the VXLAN port used by CAA. Ensure it doesn't conflict with the VXLAN port
110121
> used by the Kubernetes CNI.
111122
112-
## Deploy CAA
123+
## Deploy the Helm chart
113124

114-
### Download the CAA deployment artifacts
125+
### Download the helm deployment artifacts
115126

116127
{{< tabpane text=true right=true persist=header >}}
117128
{{% tab header="**Versions**:" disabled=true /%}}
118129

119130
{{% tab header="Last Release" %}}
120131

121132
```bash
122-
export CAA_VERSION="0.16.0"
133+
export CAA_VERSION="0.17.0"
123134
curl -LO "https://github.com/confidential-containers/cloud-api-adaptor/archive/refs/tags/v${CAA_VERSION}.tar.gz"
124135
tar -xvzf "v${CAA_VERSION}.tar.gz"
125-
cd "cloud-api-adaptor-${CAA_VERSION}/src/cloud-api-adaptor"
136+
cd "cloud-api-adaptor-${CAA_VERSION}/src/cloud-api-adaptor/install/charts/peerpods"
126137
```
127138

128139
{{% /tab %}}
@@ -133,18 +144,19 @@ cd "cloud-api-adaptor-${CAA_VERSION}/src/cloud-api-adaptor"
133144
export CAA_BRANCH="main"
134145
curl -LO "https://github.com/confidential-containers/cloud-api-adaptor/archive/refs/heads/${CAA_BRANCH}.tar.gz"
135146
tar -xvzf "${CAA_BRANCH}.tar.gz"
136-
cd "cloud-api-adaptor-${CAA_BRANCH}/src/cloud-api-adaptor"
147+
cd "cloud-api-adaptor-${CAA_BRANCH}/src/cloud-api-adaptor/install/charts/peerpods"
137148
```
138149

139150
{{% /tab %}}
140151

141152
{{% tab header="DIY" %}}
142-
This assumes that you already have the code ready to use. On your terminal change directory to the Cloud API Adaptor's code base.
153+
This assumes that you already have the code ready to use.
154+
On your terminal change directory to the Cloud API Adaptor's code base.
143155
{{% /tab %}}
144156

145157
{{< /tabpane >}}
146158

147-
### CAA pod VM image
159+
### Export PodVM image version
148160

149161
{{< tabpane text=true right=true persist=header >}}
150162
{{% tab header="**Versions**:" disabled=true /%}}
@@ -187,7 +199,7 @@ Once image build is finished, export image id to the environment variable `PODVM
187199

188200
{{< /tabpane >}}
189201

190-
### CAA container image
202+
### Export CAA container image path
191203

192204
{{< tabpane text=true right=true persist=header >}}
193205
{{% tab header="**Versions**:" disabled=true /%}}
@@ -229,17 +241,6 @@ If you have made changes to the CAA code and you want to deploy those changes th
229241

230242
{{< /tabpane >}}
231243

232-
### Create the AWS credentials file
233-
234-
```bash
235-
cat <<EOF > install/overlays/aws/aws-cred.env
236-
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
237-
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
238-
EOF
239-
```
240-
241-
> **Note**: The values should be without quotes
242-
243244
### Select peer-pods machine type
244245

245246
{{< tabpane text=true right=true persist=header >}}
@@ -264,75 +265,78 @@ export DISABLECVM="true"
264265
{{% /tab %}}
265266
{{< /tabpane >}}
266267

267-
### Populate the `kustomization.yaml` file
268-
269-
Run the following command to update the [`kustomization.yaml`](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/install/overlays/aws/kustomization.yaml) file:
270-
271-
```yaml
272-
cat <<EOF > install/overlays/aws/kustomization.yaml
273-
apiVersion: kustomize.config.k8s.io/v1beta1
274-
kind: Kustomization
275-
resources:
276-
- ../../yamls
277-
images:
278-
- name: cloud-api-adaptor
279-
newName: "${CAA_IMAGE}"
280-
newTag: "${CAA_TAG}"
281-
generatorOptions:
282-
disableNameSuffixHash: true
283-
configMapGenerator:
284-
- name: peer-pods-cm
285-
namespace: confidential-containers-system
286-
literals:
287-
- CLOUD_PROVIDER="aws"
288-
- DISABLECVM="${DISABLECVM}"
289-
- VXLAN_PORT="9000"
290-
- PODVM_AMI_ID="${PODVM_AMI_ID}"
291-
- PODVM_INSTANCE_TYPE="${PODVM_INSTANCE_TYPE}"
292-
secretGenerator:
293-
- name: peer-pods-secret
294-
namespace: confidential-containers-system
295-
envs:
296-
- aws-cred.env
297-
EOF
298-
```
299-
300-
### Deploy CAA on the Kubernetes cluster
301-
302-
Label the cluster nodes with `node.kubernetes.io/worker=`
268+
### Populate the `providers/aws.yaml` file
303269

304-
```bash
305-
for NODE_NAME in $(kubectl get nodes -o jsonpath='{.items[*].metadata.name}'); do
306-
kubectl label node $NODE_NAME node.kubernetes.io/worker=
307-
done
308-
```
270+
List of all available configuration options can be found in two places:
271+
- [Main charts values](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/src/cloud-api-adaptor/install/charts/peerpods/values.yaml)
272+
- [AWS specific values](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/src/cloud-api-adaptor/install/charts/peerpods/providers/aws.yaml)
309273

310-
Deploy the coco operator. Usually it's the same version as CAA, but it can be adjusted.
274+
Run the following command to update the [`providers/aws.yaml`](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/src/cloud-api-adaptor/install/charts/peerpods/providers/aws.yaml) file:
311275

312276
```bash
313-
export COCO_OPERATOR_VERSION="${CAA_VERSION}"
314-
kubectl apply -k "github.com/confidential-containers/operator/config/release?ref=v${COCO_OPERATOR_VERSION}"
315-
kubectl apply -k "github.com/confidential-containers/operator/config/samples/ccruntime/peer-pods?ref=v${COCO_OPERATOR_VERSION}"
316-
```
317-
318-
Run the following command to deploy CAA:
319-
320-
```bash
321-
kubectl apply -k "install/overlays/aws"
277+
cat <<EOF > providers/aws.yaml
278+
provider: aws
279+
image:
280+
name: "${CAA_IMAGE}"
281+
tag: "${CAA_TAG}"
282+
providerConfigs:
283+
aws:
284+
DISABLECVM: ${DISABLECVM}
285+
PODVM_AMI_ID: "${PODVM_AMI_ID}"
286+
PODVM_INSTANCE_TYPE: "${PODVM_INSTANCE_TYPE}"
287+
VXLAN_PORT: 9000
288+
EOF
322289
```
323290

324-
Generic CAA deployment instructions are also described [here](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/install/README.md).
325-
326-
## Deploy the Peerpod controller for garbage collecting pod VMs
327-
328-
Change the working directory from `cloud-api-adaptor-${CAA_VERSION}/src/cloud-api-adaptor`
329-
to `cloud-api-adaptor-${CAA_VERSION}/src/peerpod-ctrl`
330-
331-
Run the following command to deploy the Peerpod CRD
332-
333-
```bash
334-
kubectl apply -k "config/default"
335-
```
291+
### Deploy helm chart on the Kubernetes cluster
292+
293+
1. Create namespace managed by Helm:
294+
```bash
295+
kubectl apply -f - << EOF
296+
apiVersion: v1
297+
kind: Namespace
298+
metadata:
299+
name: confidential-containers-system
300+
labels:
301+
app.kubernetes.io/managed-by: Helm
302+
annotations:
303+
meta.helm.sh/release-name: peerpods
304+
meta.helm.sh/release-namespace: confidential-containers-system
305+
EOF
306+
```
307+
308+
2. Create the secret using `kubectl`:
309+
310+
See [providers/aws-secrets.yaml.template](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/src/cloud-api-adaptor/install/charts/peerpods/providers/aws-secrets.yaml.template) for required keys.
311+
312+
```bash
313+
kubectl create secret generic my-provider-creds \
314+
-n confidential-containers-system \
315+
--from-literal=AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
316+
--from-literal=AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
317+
--from-file=id_rsa.pub="$SSH_KEY"
318+
```
319+
320+
> **Note**: The values should be without quotes
321+
322+
> **Note**: `--from-file=id_rsa.pub="$SSH_KEY"` is optional. It allows user to SSH into the pod VMs for troubleshooting purposes.
323+
> This option works only for custom debug enabled pod VM images. The prebuilt pod VM images do not have SSH connection enabled.
324+
325+
3. Install helm chart:
326+
327+
Below command uses customization options `-f` and `--set` which are described [here](../../getting-started/installation/advanced_configuration).
328+
329+
```bash
330+
helm install peerpods . \
331+
-f providers/aws.yaml \
332+
--set secrets.mode=reference \
333+
--set secrets.existingSecretName=my-provider-creds \
334+
--dependency-update \
335+
-n confidential-containers-system
336+
```
337+
338+
Generic Peer pods Helm charts deployment instructions are also described
339+
[here](https://github.com/confidential-containers/cloud-api-adaptor/tree/main/src/cloud-api-adaptor/install/charts/peerpods/README.md).
336340
337341
## Run sample application
338342

0 commit comments

Comments
 (0)