πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Security advanced ⏱ 25 minutes K8s 1.28+

Confidential Computing: SGX and SEV-SNP

Deploy confidential containers on Kubernetes with Intel SGX and AMD SEV-SNP. Encrypted memory, attestation, confidential VMs, Kata Containers.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Confidential computing protects data while it’s being processed (in-use), not just at rest or in transit. Intel SGX creates encrypted enclaves; AMD SEV-SNP encrypts entire VM memory. On Kubernetes, use Kata Containers with `peer-pods` for confidential VMs, or SGX device plugins for enclave-based workloads. Remote attestation proves to clients that their code runs in a genuine TEE.

The Problem

Traditional encryption protects data at rest (encrypted disks) and in transit (TLS). But during processing, data is decrypted in memory β€” accessible to anyone with root/admin access, including cloud operators, compromised hypervisors, or malicious co-tenants. Confidential computing creates hardware-enforced trusted execution environments (TEEs) where even the infrastructure owner can’t access the data.

flowchart TB
    subgraph TRADITIONAL["Traditional: 2/3 Protected"]
        REST["Data at Rest βœ…<br/>(encrypted disk)"]
        TRANSIT["Data in Transit βœ…<br/>(TLS)"]
        USE["Data in Use ❌<br/>(plaintext in RAM)"]
    end
    subgraph CONFIDENTIAL["Confidential: 3/3 Protected"]
        REST2["Data at Rest βœ…"]
        TRANSIT2["Data in Transit βœ…"]
        USE2["Data in Use βœ…<br/>(encrypted RAM / TEE)"]
    end

The Solution

Intel SGX on Kubernetes

# Install SGX device plugin
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: sgx-device-plugin
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: sgx-device-plugin
  template:
    spec:
      containers:
        - name: sgx-plugin
          image: intel/intel-device-plugins-for-kubernetes:0.30.0
          command: ["/usr/bin/intel_sgx_device_plugin"]
          securityContext:
            privileged: true
          volumeMounts:
            - name: dev-sgx
              mountPath: /dev/sgx
      volumes:
        - name: dev-sgx
          hostPath:
            path: /dev/sgx
---
# SGX workload requesting enclave memory
apiVersion: v1
kind: Pod
metadata:
  name: sgx-enclave-app
spec:
  containers:
    - name: app
      image: myorg/sgx-enclave-app:v1.0
      resources:
        limits:
          sgx.intel.com/epc: "10Mi"     # Enclave Page Cache
          sgx.intel.com/enclave: 1       # SGX enclave device
          sgx.intel.com/provision: 1     # Provisioning device

AMD SEV-SNP with Kata Containers

# RuntimeClass for confidential containers
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
  name: kata-cc-snp
handler: kata-cc-snp                    # Kata with SEV-SNP
overhead:
  podFixed:
    memory: "256Mi"
    cpu: "250m"
scheduling:
  nodeSelector:
    cc-capable: "true"                  # Node must have SEV-SNP
---
# Confidential pod β€” entire VM memory is encrypted
apiVersion: v1
kind: Pod
metadata:
  name: confidential-inference
spec:
  runtimeClassName: kata-cc-snp         # Run in confidential VM
  containers:
    - name: inference
      image: myorg/confidential-llm:v1.0
      env:
        - name: MODEL_KEY
          valueFrom:
            secretKeyRef:
              name: model-encryption-key
              key: key
      resources:
        limits:
          cpu: "4"
          memory: "16Gi"

Remote Attestation Service

# Attestation service verifies TEE authenticity
apiVersion: apps/v1
kind: Deployment
metadata:
  name: attestation-service
spec:
  template:
    spec:
      containers:
        - name: attestation
          image: myorg/attestation-service:v1.0
          ports:
            - containerPort: 8080
          env:
            - name: SUPPORTED_TEES
              value: "sgx,sev-snp,tdx"
            - name: INTEL_PCCS_URL
              value: "https://pccs.internal:8081"
            - name: AMD_VLEK_CACHE
              value: "/certs/amd-vlek"
          volumeMounts:
            - name: tee-certs
              mountPath: /certs
# Client verifies attestation before sending sensitive data
curl -X POST http://attestation-service:8080/verify \
  -d '{"quote": "<attestation-quote-base64>"}' 

# Response:
# {
#   "verified": true,
#   "tee_type": "sev-snp",
#   "measurement": "sha256:abc123...",  # Code measurement
#   "platform": "AMD EPYC 9004",
#   "firmware_version": "1.55.22",
#   "guest_policy": {
#     "debug_disabled": true,
#     "migration_disabled": true
#   }
# }

Confidential AI Inference

# Run sensitive AI inference in confidential VM
# Model weights and input data never visible to host
apiVersion: apps/v1
kind: Deployment
metadata:
  name: confidential-medical-ai
spec:
  template:
    spec:
      runtimeClassName: kata-cc-snp
      containers:
        - name: inference
          image: myorg/medical-ai:v2.0
          env:
            - name: MODEL_DECRYPTION_KEY
              valueFrom:
                secretKeyRef:
                  name: medical-model-key
                  key: key
            # Model is encrypted at rest, decrypted only inside TEE
            - name: ENCRYPTED_MODEL_PATH
              value: "/models/medical-diagnosis.enc"
            - name: ATTESTATION_SERVICE
              value: "http://attestation-service:8080"
          resources:
            limits:
              cpu: "8"
              memory: "32Gi"
          volumeMounts:
            - name: encrypted-models
              mountPath: /models

Technology Comparison

FeatureIntel SGXAMD SEV-SNPIntel TDX
Protection scopeApplication enclaveFull VMFull VM
Memory encryptionEnclave only (256MB-1GB)All VM memoryAll VM memory
Performance overhead5-20%2-5%2-5%
AttestationEPID/DCAPSEV-SNP reportTDX report
K8s integrationDevice pluginKata ContainersKata Containers
Best forSmall secure functionsFull confidential VMsFull confidential VMs
Cloud supportAzure, IBMAzure, AWS, GCPAzure

Key Rotation in TEE

# CronJob: rotate encryption keys inside confidential environment
apiVersion: batch/v1
kind: CronJob
metadata:
  name: tee-key-rotation
spec:
  schedule: "0 0 * * 0"              # Weekly
  jobTemplate:
    spec:
      template:
        spec:
          runtimeClassName: kata-cc-snp
          containers:
            - name: rotate
              image: myorg/key-rotation:v1.0
              env:
                - name: KMS_ENDPOINT
                  value: "http://confidential-kms:8080"
                - name: ATTESTATION_REQUIRED
                  value: "true"
          restartPolicy: Never

Common Issues

IssueCauseFix
`sgx.intel.com/epc` not availableSGX not enabled in BIOS/no device pluginEnable SGX in BIOS, deploy device plugin
Kata pod fails to startSEV-SNP not enabled or firmware outdatedVerify with `dmesg
Performance regressionEncryption overheadUse SEV-SNP over SGX for larger workloads
Attestation failsStale platform certificatesUpdate PCCS/VLEK certificates
Memory limit too smallSGX EPC limited to 256MB defaultIncrease EPC in BIOS or use SEV-SNP for larger workloads

Best Practices

  • Use SEV-SNP for full workloads β€” encrypts all VM memory with minimal overhead
  • Use SGX for small secure operations β€” key management, signing, secret computation
  • Always require remote attestation β€” verify TEE before sending sensitive data
  • Encrypt models and data at rest β€” decrypt only inside the TEE
  • Disable debug in production β€” debug mode allows host access to enclave memory
  • Combine with network isolation β€” TEE protects compute; NetworkPolicy protects network

Key Takeaways

  • Confidential computing encrypts data during processing β€” completing the at-rest + in-transit triad
  • Intel SGX = application-level enclaves; AMD SEV-SNP = full VM encryption
  • Kata Containers + peer-pods enables confidential VMs on Kubernetes
  • Remote attestation proves code integrity to clients before they send data
  • Essential for multi-tenant AI inference where model IP and input data must be protected
  • 2026 trend: confidential computing going mainstream as AI workloads move to shared infrastructure
#confidential-computing #sgx #sev-snp #trusted-execution #encryption
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens