Skip to content

Commit 336a37b

Browse files
committed
Draft of deployment steps in progress
1 parent 19b7cf7 commit 336a37b

File tree

1 file changed

+190
-2
lines changed

1 file changed

+190
-2
lines changed

articles/openshift/confidential-containers-deploy.md

Lines changed: 190 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ Create a secure route with edge TLS termination for Trustee. External ingress tr
379379
```
380380
381381
> [!NOTE]
382-
> Currently, only a route with a valid CA-signed certificate is supported. You cannot use a route with self-signed certificate.
382+
> Currently, only a route with a valid CA-signed certificate is supported. You cannot use a route with self-signed certificate.
383383
>
384384
385385
1. Set the TRUSTEE_HOST variable by running the following command:
@@ -412,12 +412,200 @@ Create a secure route with edge TLS termination for Trustee. External ingress tr
412412
confidential: "true"
413413
```
414414
415-
2. Create the config map by running the following command:
415+
1. Create the config map by running the following command:
416416
417417
`$ oc apply -f cc-feature-gate.yaml`
418418
419419
420420
421+
### Update the peer pods config map
422+
423+
1. Obtain the following values from your Azure instance:
424+
425+
i. Retrieve and record the Azure resource group:
426+
427+
`$ AZURE_RESOURCE_GROUP=$(oc get infrastructure/cluster -o jsonpath='{.status.platformStatus.azure.resourceGroupName}') && echo "AZURE_RESOURCE_GROUP: \"$AZURE_RESOURCE_GROUP\""`
428+
429+
ii. Retrieve and record the Azure VNet name:
430+
431+
`$ AZURE_VNET_NAME=$(az network vnet list --resource-group ${AZURE_RESOURCE_GROUP} --query "[].{Name:name}" --output tsv)`
432+
433+
This value is used to retrieve the Azure subnet ID.
434+
435+
iii. Retrieve and record the Azure subnet ID:
436+
437+
`$ AZURE_SUBNET_ID=$(az network vnet subnet list --resource-group ${AZURE_RESOURCE_GROUP} --vnet-name $AZURE_VNET_NAME --query "[].{Id:id} | [? contains(Id, 'worker')]" --output tsv) && echo "AZURE_SUBNET_ID: \"$AZURE_SUBNET_ID\""`
438+
439+
iv. Retrieve and record the Azure network security group (NSG) ID:
440+
441+
`$ AZURE_NSG_ID=$(az network nsg list --resource-group ${AZURE_RESOURCE_GROUP} --query "[].{Id:id}" --output tsv) && echo "AZURE_NSG_ID: \"$AZURE_NSG_ID\""`
442+
443+
v. Retrieve and record the Azure region:
444+
445+
`$ AZURE_REGION=$(az group show --resource-group ${AZURE_RESOURCE_GROUP} --query "{Location:location}" --output tsv) && echo "AZURE_REGION: \"$AZURE_REGION\""`
446+
447+
1. Create a `peer-pods-cm.yaml` manifest file according to the following example:
448+
449+
```
450+
apiVersion: v1
451+
kind: ConfigMap
452+
metadata:
453+
name: peer-pods-cm
454+
namespace: openshift-sandboxed-containers-operator
455+
data:
456+
CLOUD_PROVIDER: "azure"
457+
VXLAN_PORT: "9000"
458+
AZURE_INSTANCE_SIZE: "Standard_DC2as_v5"
459+
AZURE_INSTANCE_SIZES: "Standard_DC2as_v5,Standard_DC4as_v5,Standard_DC8as_v5,Standard_DC16as_v5"
460+
AZURE_SUBNET_ID: "<azure_subnet_id>"
461+
AZURE_NSG_ID: "<azure_nsg_id>"
462+
PROXY_TIMEOUT: "5m"
463+
AZURE_IMAGE_ID: "<azure_image_id>"
464+
AZURE_REGION: "<azure_region>"
465+
AZURE_RESOURCE_GROUP: "<azure_resource_group>"
466+
DISABLECVM: "false"
467+
AA_KBC_PARAMS: "cc_kbc::https://${TRUSTEE_HOST}"
468+
```
469+
470+
**Notes:**
471+
- `AZURE_INSTANCE_SIZE` is the default if an instance size is not defined in the workload.
472+
- `AZURE_INSTANCE_SIZES` lists all of the instance sizes you can specify when creating the pod. This allows you to define smaller instance sizes for workloads that need less memory and fewer CPUs or larger instance sizes for larger workloads.
473+
- Specify the `AZURE_SUBNET_ID` value that you retrieved.
474+
- Specify the `AZURE_NSG_ID` value that you retrieved.
475+
- `AZURE_IMAGE_ID` (Optional): By default, this value is populated when you run the KataConfig CR, using an Azure image ID based on your cluster credentials. If you create your own Azure image, specify the correct image ID.
476+
- Specify the `AZURE_REGION` value you retrieved.
477+
- Specify the `AZURE_RESOURCE_GROUP` value you retrieved.
478+
- `AA_KBC_PARAMS` specifies the host name of the Trustee route.
479+
480+
1. Create the config map by running the following command:
481+
482+
`$ oc apply -f peer-pods-cm.yaml`
483+
484+
1. Restart the `peerpodconfig-ctrl-caa-daemon` daemon set by running the following command:
485+
486+
```
487+
$ oc set env ds/peerpodconfig-ctrl-caa-daemon \
488+
-n openshift-sandboxed-containers-operator REBOOT="$(date)"
489+
```
490+
491+
492+
493+
### Create the KataConfig custom resource
494+
495+
1. Create an `example-kataconfig.yaml` manifest file according to the following example:
496+
497+
```
498+
apiVersion: kataconfiguration.openshift.io/v1
499+
kind: KataConfig
500+
metadata:
501+
name: example-kataconfig
502+
spec:
503+
enablePeerPods: true
504+
logLevel: info
505+
# kataConfigPoolSelector:
506+
# matchLabels:
507+
# <label_key>: '<label_value>'
508+
```
509+
510+
Optional: If you have applied node labels to install kata-remote on specific nodes, specify the key and value, for example, cc: 'true'.
511+
512+
1. Create the KataConfig CR by running the following command:
513+
514+
`$ oc apply -f example-kataconfig.yaml`
515+
516+
The new KataConfig CR is created and installs kata-remote as a runtime class on the worker nodes.
517+
518+
> [!NOTE]
519+
> Wait for the kata-remote installation to complete and the worker nodes to reboot before verifying the installation.
520+
>
521+
522+
1. Monitor the installation progress by running the following command:
523+
524+
`$ watch "oc describe kataconfig | sed -n /^Status:/,/^Events/p"`
525+
526+
When the status of all workers under kataNodes is installed and the condition InProgress is False without specifying a reason, the kata-remote is installed on the cluster.
527+
528+
1. Verify the daemon set by running the following command:
529+
530+
`$ oc get -n openshift-sandboxed-containers-operator ds/peerpodconfig-ctrl-caa-daemon`
531+
532+
1. Verify the runtime classes by running the following command:
533+
534+
$ oc get runtimeclass
535+
536+
Example output:
537+
538+
```
539+
NAME HANDLER AGE
540+
kata-remote kata-remote 152m
541+
```
542+
543+
### Create the Trustee authentication secret
544+
545+
1. Create a private key by running the following command:
546+
547+
`$ openssl genpkey -algorithm ed25519 > privateKey`
548+
549+
1. Create a public key by running the following command:
550+
551+
`$ openssl pkey -in privateKey -pubout -out publicKey`
552+
553+
1. Create a secret by running the following command:
554+
555+
`$ oc create secret generic kbs-auth-public-key --from-file=publicKey -n trustee-operator-system`
556+
557+
1. Verify the secret by running the following command:
558+
559+
`$ oc get secret -n trustee-operator-system`
560+
561+
562+
### Create the Trustee config map
563+
564+
1. Create a kbs-config-cm.yaml manifest file:
565+
566+
```
567+
apiVersion: v1
568+
kind: ConfigMap
569+
metadata:
570+
name: kbs-config-cm
571+
namespace: trustee-operator-system
572+
data:
573+
kbs-config.json: |
574+
{
575+
"insecure_http" : true,
576+
"sockets": ["0.0.0.0:8080"],
577+
"auth_public_key": "/etc/auth-secret/publicKey",
578+
"attestation_token_config": {
579+
"attestation_token_type": "CoCo"
580+
},
581+
"repository_config": {
582+
"type": "LocalFs",
583+
"dir_path": "/opt/confidential-containers/kbs/repository"
584+
},
585+
"as_config": {
586+
"work_dir": "/opt/confidential-containers/attestation-service",
587+
"policy_engine": "opa",
588+
"attestation_token_broker": "Simple",
589+
"attestation_token_config": {
590+
"duration_min": 5
591+
},
592+
"rvps_config": {
593+
"store_type": "LocalJson",
594+
"store_config": {
595+
"file_path": "/opt/confidential-containers/rvps/reference-values/reference-values.json"
596+
}
597+
}
598+
},
599+
"policy_engine_config": {
600+
"policy_path": "/opt/confidential-containers/opa/policy.rego"
601+
}
602+
}
603+
```
604+
605+
1. Create the config map by running the following command:
606+
607+
`$ oc apply -f kbs-config-cm.yaml`
608+
421609
422610
423611

0 commit comments

Comments
 (0)