-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Tendyck <[email protected]>
- Loading branch information
Showing
7 changed files
with
128 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Deploy an Edgeless RT App on Azure Kubernetes Service (AKS) | ||
coming soon | ||
# Edgeless RT Apps on Azure Kubernetes Service (AKS) | ||
Edgeless RT apps can be deployed on AKS. Please see [the example](../samples_edgeless/aks) in `samples_edgeless/aks`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# syntax=docker/dockerfile:experimental | ||
|
||
FROM ghcr.io/edgelesssys/edgelessrt-dev AS build | ||
RUN git clone https://github.com/edgelesssys/edgelessrt /edgelessrt | ||
WORKDIR /edgelessrt/samples_edgeless/go_ra/build | ||
RUN cmake .. | ||
RUN --mount=type=secret,id=signingkey,dst=/edgelessrt/samples_edgeless/go_ra/build/private.pem,required=true make | ||
|
||
FROM ghcr.io/edgelesssys/edgelessrt-deploy | ||
LABEL description="ERT sample image" | ||
COPY --from=build /edgelessrt/samples_edgeless/go_ra/build/enclave.signed /go_ra/ | ||
ENTRYPOINT ["erthost", "/go_ra/enclave.signed"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Deploy an Edgeless RT App on Azure Kubernetes Service (AKS) | ||
|
||
This sample shows how to deploy an ERT App on AKS. | ||
|
||
## 0. Build the Docker image | ||
We provide a sample image that is used in the following steps. If you want to build it yourself (or your own app), you need to generate a signing key and then build and push the image: | ||
``` | ||
openssl genrsa -out private.pem -3 3072 | ||
openssl rsa -in private.pem -pubout -out public.pem | ||
DOCKER_BUILDKIT=1 docker build --secret id=signingkey,src=private.pem --tag ghcr.io/OWNER/ert-sample . | ||
docker push ghcr.io/OWNER/ert-sample | ||
``` | ||
|
||
## 1. Deploy on AKS | ||
|
||
### Prerequisites: Setting up an [AKS cluster](https://docs.microsoft.com/en-us/azure/confidential-computing/confidential-nodes-aks-get-started) | ||
* Note: see available [VM sizes](https://docs.microsoft.com/en-us/azure/virtual-machines/dcv2-series) and supported [regions](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=virtual-machines®ions=all#select-product) for confidential nodes | ||
|
||
### Push configuration to cluster | ||
* switch to AKS context: | ||
``` | ||
kubectl config use-context myAKSCluster | ||
``` | ||
* apply [deployment](aks.yml) to cluster: | ||
``` | ||
kubectl apply -f aks.yml | ||
``` | ||
|
||
### Verify that the pod is running | ||
``` | ||
$ kubectl get pods | ||
NAME READY STATUS RESTARTS AGE | ||
ert-sample-pod 1/1 Running 0 20s | ||
$ kubectl logs ert-sample-pod | ||
[erthost] loading enclave ... | ||
[erthost] entering enclave ... | ||
[deventry] running in development mode | ||
[deventry] invoking main | ||
listening ... | ||
``` | ||
|
||
## 2. Use the service | ||
* obtain IP from service: | ||
``` | ||
$ kubectl get service | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
ert-sample-svc LoadBalancer 10.0.216.92 <external-ip> 8080:32177/TCP 20s | ||
``` | ||
* use the client: | ||
``` | ||
$ cd ../go_ra | ||
$ go run client.go -s `oesign signerid -k ../aks/public.pem` -a <external-ip>:8080 | ||
Sent secret over attested TLS channel. | ||
``` | ||
## Managing the cluster | ||
* start cluster: ```az aks start --name myAKSCluster --resource-group myResourceGroup``` | ||
* stop cluster: ```az aks stop --name myAKSCluster --resource-group myResourceGroup``` | ||
|
||
## References | ||
* [az aks documentation](https://docs.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest) | ||
* [kubectl cheat sheet](https://kubernetes.io/de/docs/reference/kubectl/cheatsheet/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ert-sample-svc | ||
spec: | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 | ||
type: LoadBalancer | ||
selector: | ||
app: ert-sample-app | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: ert-sample-pod | ||
labels: | ||
app: ert-sample-app | ||
spec: | ||
containers: | ||
- name: ert-sample-image | ||
image: ghcr.io/edgelesssys/ert-sample | ||
resources: | ||
limits: | ||
kubernetes.azure.com/sgx_epc_mem_in_MiB: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MIIBoDANBgkqhkiG9w0BAQEFAAOCAY0AMIIBiAKCAYEAsqi2kC6Rfb3ev0dbr3iF | ||
wSKQjWjqJn8KvC1TiOiYUZAca0ee0OxI1PUBMrjnEDRTgpjpe5EOqLQRXQx1WL6x | ||
QCbFZcyvpqU0TS9YMyg4XWqTKq7Sof/4u+awbGy3D8o7TPryBUEPPxwLN3EAFU22 | ||
S87sjpePieVINH0k9sjQW5bRkCW425pzTAX/TdPtQYqXip7i1/a74ka1bPIn54BS | ||
GJiNzLrwhGSuPw9pvJMbqe3iMWXcl5XqumuQxsaZ/JVTTWe9ttexOpOY7IPITnwg | ||
X10dqWCPJ2V/qOEMsCK8EQian4g1jA0XmLcjJGKMT06Zf9TlVa87tkHHLEKODMWd | ||
4viB21Wya/bj1NcklyJd4hlkxuFlOTWZ0oBmb8fXYr98YAQh55lDkd32eUJA59HS | ||
+fQRJInEtiZTw804sNv2AoskNS7b8TLG7ilkmgJzu/BiOjm0KvyN8LM6p6E9UoLq | ||
x3fALuNQ4dyViQbv+gNClFDsW9JUTe8Agg3sC5Iozlx9AgED | ||
-----END PUBLIC KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters