Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install: Update node label prefix #195

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup kind cluster
run: |
kind create cluster --image "kindest/node:v1.26.0-coco" -n coco-sgx --config tests/e2e/enclave-cc-kind-config.yaml --wait 120s
kubectl label node coco-sgx-worker node-role.kubernetes.io/worker=
kubectl label node coco-sgx-worker node.kubernetes.io/worker=

- name: Deploy operator from the local registry
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enclave-cc-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup kind cluster
run: |
kind create cluster --image "kindest/node:v1.26.0-coco" -n coco-sgx --config tests/e2e/enclave-cc-kind-config.yaml --wait 120s
kubectl label node coco-sgx-worker node-role.kubernetes.io/worker=
kubectl label node coco-sgx-worker node.kubernetes.io/worker=

- name: Deploy operator from the local registry
run: |
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/cc-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
"spec": {
"ccNodeSelector": {
"matchLabels": {
"node-role.kubernetes.io/worker": ""
"node.kubernetes.io/worker": ""
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion config/samples/ccruntime/base/ccruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
runtimeName: kata
ccNodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
node.kubernetes.io/worker: ""
config:
installType: bundle
payloadImage: quay.io/confidential-containers/runtime-payload:kata-containers
Expand Down
2 changes: 1 addition & 1 deletion config/samples/enclave-cc/base/ccruntime-enclave-cc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
runtimeName: enclave-cc
ccNodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
node.kubernetes.io/worker: ""
config:
installType: bundle
payloadImage: quay.io/confidential-containers/runtime-payload-ci:enclave-cc-HW-cc-kbc-latest
Expand Down
8 changes: 4 additions & 4 deletions controllers/ccruntime_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (r *CcRuntimeReconciler) processCcRuntimeInstallRequest() (ctrl.Result, err

if r.ccRuntime.Spec.CcNodeSelector == nil {
r.ccRuntime.Spec.CcNodeSelector = &metav1.LabelSelector{
MatchLabels: map[string]string{"node-role.kubernetes.io/worker": ""},
MatchLabels: map[string]string{"node.kubernetes.io/worker": ""},
}
}

Expand Down Expand Up @@ -535,7 +535,7 @@ func (r *CcRuntimeReconciler) getAllNodes() (*corev1.NodeList, ctrl.Result, erro

if r.ccRuntime.Spec.CcNodeSelector == nil {
r.ccRuntime.Spec.CcNodeSelector = &metav1.LabelSelector{
MatchLabels: map[string]string{"node-role.kubernetes.io/worker": ""},
MatchLabels: map[string]string{"node.kubernetes.io/worker": ""},
}
}

Expand Down Expand Up @@ -629,7 +629,7 @@ func (r *CcRuntimeReconciler) processDaemonset(operation DaemonOperation) *appsv
nodeSelector = r.ccRuntime.Spec.Config.UninstallDoneLabel
} else {
nodeSelector = map[string]string{
"node-role.kubernetes.io/worker": "",
"node.kubernetes.io/worker": "",
}
}

Expand Down Expand Up @@ -839,7 +839,7 @@ func (r *CcRuntimeReconciler) makeHookDaemonset(operation DaemonOperation) *apps
nodeSelector = r.ccRuntime.Spec.CcNodeSelector.MatchLabels
} else {
nodeSelector = map[string]string{
"node-role.kubernetes.io/worker": "",
"node.kubernetes.io/worker": "",
}
}

Expand Down
4 changes: 2 additions & 2 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
- Only containerd runtime based Kubernetes clusters are supported with the current Confidential Containers (CoCo) release
- The minimum Kubernetes version should be 1.24.
- Ensure KUBECONFIG points to the target Kubernetes cluster.
- Ensure at least one Kubernetes node in the cluster is having the label `node-role.kubernetes.io/worker=`
- Ensure at least one Kubernetes node in the cluster is having the label `node.kubernetes.io/worker=`
```
kubectl label node $NODENAME node-role.kubernetes.io/worker=
kubectl label node $NODENAME node.kubernetes.io/worker=
```

## Deploy the Operator
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/cluster/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ main() {
kubectl taint nodes "$(hostname)" \
"node-role.kubernetes.io/$role:NoSchedule-"
done

kubectl label node "$(hostname)" node.kubernetes.io/worker=
}

main "$@"
2 changes: 1 addition & 1 deletion tests/e2e/operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install_operator() {
start_local_registry

# The node should be 'worker' labeled
local label="node-role.kubernetes.io/worker"
local label="node.kubernetes.io/worker"
if ! kubectl get node "$(hostname)" -o jsonpath='{.metadata.labels}' \
| grep -q "$label"; then
kubectl label node "$(hostname)" "$label="
Expand Down