Skip to content

Commit dda26e5

Browse files
authored
Add usage examples for exposed devices in README
* Add usage examples for exposed devices in README Added examples for requesting Intel TDX, AMD SEV, and vTPM devices in Kubernetes pods. * Refactor README for clarity and completeness Updated README to improve formatting
1 parent 976265f commit dda26e5

1 file changed

Lines changed: 80 additions & 8 deletions

File tree

README.md

Lines changed: 80 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55

66
This is a [Kubernetes][k8s] [device plugin][dp] implementation that enables
77
the registration of Confidential Computing devices in a Google Kubernetes
8-
Engine (GKE) cluster for compute workloads. With the appropriate GKE setup
9-
and this plugin deployed, your Kubernetes cluster will be able to run jobs
10-
(e.g., Attestation) that require Confidential Computing devices.
8+
Engine (GKE) cluster for compute workloads. With the appropriate
9+
[GKE setup][gke-cc-docs] and this plugin deployed, your Kubernetes cluster
10+
will be able to run jobs (e.g., Attestation) that require Confidential
11+
Computing devices.
1112

1213
This plugin supports the following technologies on GKE:
13-
* **vTPM / AMD SEV:** Exposes `google.com/cc` resource.
14-
* **AMD SEV-SNP:** Exposes `amd.com/sev-snp` resource. Requires AMD SNP machines.
15-
* **Intel TDX:** Exposes `intel.com/tdx` resource. Requires Intel TDX machines.
14+
* **vTPM / AMD SEV:** Exposes `google.com/cc` resource.
15+
* **AMD SEV-SNP:** Exposes `amd.com/sev-snp` resource. Requires AMD SNP
16+
machines.
17+
* **Intel TDX:** Exposes `intel.com/tdx` resource. Requires Intel TDX
18+
machines.
1619

1720
## Prerequisites
1821
* A GKE cluster with node pools configured to support the desired
@@ -31,7 +34,6 @@ node images) are branch-dependent:
3134
* Refer to [Confidential VM Supported Configurations][supported-configs]
3235
for specific version and region availability.
3336

34-
3537
## Deployment
3638
The device plugin needs to be run on all the nodes that are equipped with
3739
Confidential Computing devices. The simplest way to do this is to create a
@@ -52,10 +54,80 @@ or directly pull from the web using
5254
kubectl create -f https://raw.githubusercontent.com/google/cc-device-plugin/main/manifests/cc-device-plugin.yaml
5355
```
5456

57+
## Using the Exposed Devices
58+
59+
To use the devices, request them in your Pod's resource limits. This will cause
60+
the device plugin to mount the appropriate device node into your container.
61+
62+
**Example: Requesting Intel TDX**
63+
64+
```yaml
65+
apiVersion: v1
66+
kind: Pod
67+
metadata:
68+
name: example-tdx-pod
69+
spec:
70+
containers:
71+
- name: test-container
72+
image: ubuntu # Your application image
73+
command: ["/bin/sh", "-c", "ls -l /dev/tdx_guest; sleep 3600"]
74+
resources:
75+
limits:
76+
intel.com/tdx: 1 # Request TDX device
77+
nodeSelector:
78+
cloud.google.com/gke-confidential-nodes-instance-type: "TDX"
79+
cloud.google.com/machine-family: "c3"
80+
```
81+
Inside this container, `/dev/tdx_guest` will be available for interacting
82+
with the Intel Trust Domain.
83+
84+
**Example: Requesting AMD SEV-SNP**
85+
86+
```yaml
87+
apiVersion: v1
88+
kind: Pod
89+
metadata:
90+
name: example-sev-snp-pod
91+
spec:
92+
containers:
93+
- name: test-container
94+
image: ubuntu # Your application image
95+
command: ["/bin/sh", "-c", "ls -l /dev/sev-guest; sleep 3600"]
96+
resources:
97+
limits:
98+
amd.com/sev-snp: 1 # Request SEV-SNP device
99+
nodeSelector:
100+
cloud.google.com/gke-confidential-nodes-instance-type: "SEV_SNP"
101+
cloud.google.com/machine-family: "n2d"
102+
```
103+
Inside this container, `/dev/sev-guest` will be available for interacting
104+
with the AMD Secure Processor.
105+
106+
**Example: Requesting vTPM / AMD SEV**
107+
108+
```yaml
109+
apiVersion: v1
110+
kind: Pod
111+
metadata:
112+
name: example-vtpm-pod
113+
spec:
114+
containers:
115+
- name: test-container
116+
image: ubuntu # Your application image
117+
command: ["/bin/sh", "-c", "ls -l /dev/tpmrm0; sleep 3600"]
118+
resources:
119+
limits:
120+
google.com/cc: 1 # Request vTPM device
121+
nodeSelector:
122+
cloud.google.com/gke-confidential-nodes-instance-type: "SEV"
123+
```
124+
Inside this container, `/dev/tpmrm0` will be available.
125+
55126
[dp]: https://kubernetes.io/docs/concepts/cluster-administration/device-plugins/
56127
[k8s]: https://kubernetes.io
57128
[tpm]: https://cloud.google.com/compute/shielded-vm/docs/shielded-vm#vtpm
58129
[sevsnp]: https://cloud.google.com/confidential-computing/confidential-vm/docs/confidential-vm-overview#amd_sev-snp
59-
[tdx]: https://cloud.google.com/blog/products/identity-security/confidential-vms-on-intel-cpus-your-datas-new-intelligent-defense
130+
[tdx]: https://cloud.google.com/confidential-computing/confidential-vm/docs/confidential-vm-overview#intel_tdx
60131
[release]: https://us-central1-docker.pkg.dev/gce-confidential-compute/release/cc-device-plugin
61132
[supported-configs]: https://cloud.google.com/confidential-computing/confidential-vm/docs/supported-configurations
133+
[gke-cc-docs]: https://cloud.google.com/kubernetes-engine/docs/how-to/confidential-gke-nodes

0 commit comments

Comments
 (0)