Skip to content

Commit ed08d11

Browse files
Merge pull request #1392 from mythi/PR-2023-019
sgx: stop using local source hooks for EPC registration
2 parents 63e3ecf + 3a4c0e5 commit ed08d11

File tree

15 files changed

+22
-74
lines changed

15 files changed

+22
-74
lines changed

cmd/operator/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ The default operator deployment depends on NFD and cert-manager. Those component
2323
2424
### NFD
2525

26-
Install NFD (if it's not already installed) and node labelling rules (requires NFD v0.10+):
26+
Install NFD (if it's not already installed) and node labelling rules (requires NFD v0.13+):
2727

2828
```
29-
# either with default NFD installation
29+
# deploy NFD
3030
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=<RELEASE_VERSION>'
31-
# or when setting up with SGX
32-
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/sgx?ref=<RELEASE_VERSION>'
33-
# and finally, NodeFeatureRules
31+
# deploy NodeFeatureRules
3432
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=<RELEASE_VERSION>'
3533
```
3634
Make sure both NFD master and worker pods are running:

cmd/sgx_plugin/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Where `<RELEASE_VERSION>` needs to be substituted with the desired [release tag]
8484
First, deploy `node-feature-discovery`:
8585

8686
```bash
87-
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/sgx?ref=<RELEASE_VERSION>'
87+
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/?ref=<RELEASE_VERSION>'
8888
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=<RELEASE_VERSION>'
8989
```
9090

@@ -110,13 +110,13 @@ $ kubectl apply -f 'https://raw.githubusercontent.com/intel/intel-device-plugins
110110
There are two alternative ways to deploy SGX device plugin using `kubectl`.
111111

112112
The first approach involves deployment of the [SGX DaemonSet YAML](/deployments/sgx_plugin/base/intel-sgx-plugin.yaml)
113-
and [node-feature-discovery](/deployments/nfd/overlays/sgx/kustomization.yaml)
113+
and [node-feature-discovery](/deployments/nfd/kustomization.yaml)
114114
with the necessary configuration.
115115

116116
The following kustomizations are needed for deploying everything:
117117
```bash
118118
# first, deploy NFD and the necessary NodeFeatureRules
119-
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/sgx'
119+
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd'
120120
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules'
121121
# and then, deploy SGX plugin
122122
$ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/sgx_plugin/overlays/epc-nfd/'
@@ -150,9 +150,9 @@ $ kubectl describe node <node name> | grep sgx.intel.com
150150
sgx.intel.com/enclave: 20
151151
sgx.intel.com/epc: 98566144
152152
sgx.intel.com/provision: 20
153-
sgx.intel.com/enclave 1 1
154-
sgx.intel.com/epc 400 400
155-
sgx.intel.com/provision 1 1
153+
sgx.intel.com/enclave 0 0
154+
sgx.intel.com/epc 0 0
155+
sgx.intel.com/provision 0 0
156156
```
157157

158158
## Testing and Demos
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
bases:
4-
- "https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.12.1"
4+
- "https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.13.1"

deployments/nfd/components/sgx/kustomization.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

deployments/nfd/components/sgx/master-args.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

deployments/nfd/components/sgx/master-rbac.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

deployments/nfd/overlays/node-feature-rules/node-feature-rules-openshift.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ spec:
8686
- name: "intel.sgx"
8787
labels:
8888
"intel.feature.node.kubernetes.io/sgx": "true"
89+
extendedResources:
90+
sgx.intel.com/epc: "@cpu.security.sgx.epc"
8991
matchFeatures:
9092
- feature: cpu.cpuid
9193
matchExpressions:
9294
SGX: {op: Exists}
9395
SGXLC: {op: Exists}
94-
- feature: cpu.sgx
96+
- feature: cpu.security
9597
matchExpressions:
96-
enabled: {op: IsTrue}
98+
sgx.enabled: {op: IsTrue}
9799
- feature: kernel.config
98100
matchExpressions:
99101
X86_SGX: {op: Exists}

deployments/nfd/overlays/node-feature-rules/node-feature-rules.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ spec:
9090
- name: "intel.sgx"
9191
labels:
9292
"intel.feature.node.kubernetes.io/sgx": "true"
93+
extendedResources:
94+
sgx.intel.com/epc: "@cpu.security.sgx.epc"
9395
matchFeatures:
9496
- feature: cpu.cpuid
9597
matchExpressions:

deployments/nfd/overlays/sgx/kustomization.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

deployments/operator/samples/deviceplugin_v1_sgxdeviceplugin.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ metadata:
44
name: sgxdeviceplugin-sample
55
spec:
66
image: intel/intel-sgx-plugin:0.26.0
7-
initImage: intel/intel-sgx-initcontainer:0.26.0
87
enclaveLimit: 110
98
provisionLimit: 110
109
logLevel: 4

deployments/sgx_plugin/overlays/epc-nfd/add-epc-nfd-initcontainer.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
bases:
22
- ../../base
33
- ../../../sgx_admissionwebhook/overlays/default-with-certmanager
4-
patches:
5-
- path: add-epc-nfd-initcontainer.yaml

pkg/apis/deviceplugin/v1/sgxdeviceplugin_webhook.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ func (r *SgxDevicePlugin) Default() {
5353
if len(r.Spec.Image) == 0 {
5454
r.Spec.Image = "intel/intel-sgx-plugin:" + sgxMinVersion.String()
5555
}
56-
57-
if len(r.Spec.InitImage) == 0 {
58-
r.Spec.InitImage = "intel/intel-sgx-initcontainer:" + sgxMinVersion.String()
59-
}
6056
}
6157

6258
// +kubebuilder:webhook:verbs=create;update,path=/validate-deviceplugin-intel-com-v1-sgxdeviceplugin,mutating=false,failurePolicy=fail,groups=deviceplugin.intel.com,resources=sgxdeviceplugins,versions=v1,name=vsgxdeviceplugin.kb.io,sideEffects=None,admissionReviewVersions=v1
@@ -93,5 +89,9 @@ func (r *SgxDevicePlugin) validatePlugin() error {
9389
return err
9490
}
9591

92+
if r.Spec.InitImage == "" {
93+
return nil
94+
}
95+
9696
return validatePluginImage(r.Spec.InitImage, "intel-sgx-initcontainer", sgxMinVersion)
9797
}

test/e2e/deviceplugins_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func setupFirstNode() []byte {
103103
framework.Logf("kube-apiserver version: %s", serverVersion.GitVersion)
104104
}
105105

106-
utils.Kubectl("node-feature-discovery", "apply", "-k", "deployments/nfd/overlays/sgx/kustomization.yaml")
106+
utils.Kubectl("node-feature-discovery", "apply", "-k", "deployments/nfd/kustomization.yaml")
107107

108108
utils.Kubectl("node-feature-discovery", "apply", "-k", "deployments/nfd/overlays/node-feature-rules/kustomization.yaml")
109109

test/e2e/sgx/sgx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const (
3737
ns = "inteldeviceplugins-system"
3838
timeout = time.Second * 120
3939
kustomizationWebhook = "deployments/sgx_admissionwebhook/overlays/default-with-certmanager/kustomization.yaml"
40-
kustomizationPlugin = "deployments/sgx_plugin/overlays/epc-hook-initcontainer/kustomization.yaml"
40+
kustomizationPlugin = "deployments/sgx_plugin/base/kustomization.yaml"
4141
)
4242

4343
func init() {

0 commit comments

Comments
 (0)