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

cilium: remove appArmorProfile for k8s<v1.30.0 #19888

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

ComradeProgrammer
Copy link
Member

@ComradeProgrammer ComradeProgrammer commented Oct 30, 2024

FIX #19683
cilium: remove spec.template.spec.securityContext.appArmorProfile field when k8s version is smaller than 1.30.0

Before:

./out/minikube start --cni cilium --cpus max --kubernetes-version v1.28.9
😄  minikube v1.34.0 on Darwin 14.6.1 (arm64)
✨  Automatically selected the docker driver. Other choices: qemu2, ssh
📌  Using Docker Desktop driver with root privileges
👍  Starting "minikube" primary control-plane node in "minikube" cluster
🚜  Pulling base image v0.0.45-1730110049-19872 ...
🔥  Creating docker container (CPUs=8, Memory=6100MB) ...
🐳  Preparing Kubernetes v1.28.9 on Docker 27.3.1 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring Cilium (Container Networking Interface) ...
💢  initialization failed, will try again: apply cni: cni apply: cmd: sudo /var/lib/minikube/binaries/v1.28.9/kubectl apply --kubeconfig=/var/lib/minikube/kubeconfig -f /var/tmp/minikube/cni.yaml output: -- stdout --
serviceaccount/cilium created
serviceaccount/cilium-envoy created
serviceaccount/cilium-operator created
configmap/cilium-config created
configmap/cilium-envoy-config created
clusterrole.rbac.authorization.k8s.io/cilium created
clusterrole.rbac.authorization.k8s.io/cilium-operator created
clusterrolebinding.rbac.authorization.k8s.io/cilium created
clusterrolebinding.rbac.authorization.k8s.io/cilium-operator created
role.rbac.authorization.k8s.io/cilium-config-agent created
rolebinding.rbac.authorization.k8s.io/cilium-config-agent created
service/cilium-envoy created
service/hubble-peer created
deployment.apps/cilium-operator created

-- /stdout --
** stderr ** 
Error from server (BadRequest): error when creating "/var/tmp/minikube/cni.yaml": DaemonSet in version "v1" cannot be handled as a DaemonSet: strict decoding error: unknown field "spec.template.spec.securityContext.appArmorProfile"
Error from server (BadRequest): error when creating "/var/tmp/minikube/cni.yaml": DaemonSet in version "v1" cannot be handled as a DaemonSet: strict decoding error: unknown field "spec.template.spec.securityContext.appArmorProfile"

** /stderr **: sudo /var/lib/minikube/binaries/v1.28.9/kubectl apply --kubeconfig=/var/lib/minikube/kubeconfig -f /var/tmp/minikube/cni.yaml: Process exited with status 1
stdout:
serviceaccount/cilium created
serviceaccount/cilium-envoy created
serviceaccount/cilium-operator created
configmap/cilium-config created
configmap/cilium-envoy-config created
clusterrole.rbac.authorization.k8s.io/cilium created
clusterrole.rbac.authorization.k8s.io/cilium-operator created
clusterrolebinding.rbac.authorization.k8s.io/cilium created
clusterrolebinding.rbac.authorization.k8s.io/cilium-operator created
role.rbac.authorization.k8s.io/cilium-config-agent created
rolebinding.rbac.authorization.k8s.io/cilium-config-agent created
service/cilium-envoy created
service/hubble-peer created
deployment.apps/cilium-operator created

stderr:
Error from server (BadRequest): error when creating "/var/tmp/minikube/cni.yaml": DaemonSet in version "v1" cannot be handled as a DaemonSet: strict decoding error: unknown field "spec.template.spec.securityContext.appArmorProfile"
Error from server (BadRequest): error when creating "/var/tmp/minikube/cni.yaml": DaemonSet in version "v1" cannot be handled as a DaemonSet: strict decoding error: unknown field "spec.template.spec.securityContext.appArmorProfile"

^C

After:


$ ./out/minikube start --cni cilium --cpus max --kubernetes-version v1.28.9
😄  minikube v1.34.0 on Darwin 14.6.1 (arm64)
✨  Automatically selected the docker driver. Other choices: qemu2, ssh
📌  Using Docker Desktop driver with root privileges
👍  Starting "minikube" primary control-plane node in "minikube" cluster
🚜  Pulling base image v0.0.45-1730110049-19872 ...
🔥  Creating docker container (CPUs=8, Memory=6100MB) ...
🐳  Preparing Kubernetes v1.28.9 on Docker 27.3.1 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring Cilium (Container Networking Interface) ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default


@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 30, 2024
@ComradeProgrammer ComradeProgrammer requested review from medyagh and removed request for medyagh October 30, 2024 22:21
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 30, 2024
@medyagh
Copy link
Member

medyagh commented Oct 31, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 31, 2024
@medyagh
Copy link
Member

medyagh commented Oct 31, 2024

@ComradeProgrammer thanks for the PR :) plz check the lint

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets make sure the PR mentions cillim, so in the changelog users know it only affects the cillim

cilium: remove appArmorProfile for k8s<v1.30.0

@minikube-pr-bot

This comment has been minimized.

@ComradeProgrammer ComradeProgrammer changed the title remove appArmorProfile for k8s<v1.30.0 cilium: remove appArmorProfile for k8s<v1.30.0 Oct 31, 2024
@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

pkg/minikube/cni/cilium.go Outdated Show resolved Hide resolved
pkg/minikube/cni/cilium.go Outdated Show resolved Hide resolved
pkg/minikube/cni/cilium.go Outdated Show resolved Hide resolved
@medyagh
Copy link
Member

medyagh commented Nov 22, 2024

@ComradeProgrammer plz take a look at the review

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 19888) |
+----------------+----------+---------------------+
| minikube start | 71.5s    | 51.6s               |
| enable ingress | 18.2s    | 16.7s               |
+----------------+----------+---------------------+

Times for minikube start: 51.1s 46.7s 48.9s 160.5s 50.7s
Times for minikube (PR 19888) start: 47.9s 51.3s 53.2s 53.2s 52.2s

Times for minikube ingress: 14.5s 19.0s 26.5s 15.5s 15.6s
Times for minikube (PR 19888) ingress: 19.5s 15.0s 19.0s 15.5s 14.5s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 19888) |
+----------------+----------+---------------------+
| minikube start | 22.0s    | 22.7s               |
| enable ingress | 12.9s    | 13.4s               |
+----------------+----------+---------------------+

Times for minikube start: 20.6s 21.5s 21.7s 21.8s 24.4s
Times for minikube (PR 19888) start: 24.4s 23.3s 20.6s 24.3s 20.7s

Times for minikube ingress: 13.3s 13.3s 12.3s 13.3s 12.3s
Times for minikube (PR 19888) ingress: 13.8s 12.8s 13.8s 13.3s 13.3s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 19888) |
+----------------+----------+---------------------+
| minikube start | 21.0s    | 22.2s               |
| enable ingress | 39.2s    | 36.1s               |
+----------------+----------+---------------------+

Times for minikube ingress: 38.8s 39.3s 38.8s 39.3s 39.8s
Times for minikube (PR 19888) ingress: 38.8s 23.8s 38.8s 39.3s 39.8s

Times for minikube start: 18.9s 22.3s 22.6s 20.4s 20.9s
Times for minikube (PR 19888) start: 20.3s 22.4s 22.8s 24.0s 21.7s

@minikube-pr-bot
Copy link

Here are the number of top 10 failed tests in each environments with lowest flake rate.

Environment Test Name Flake Rate
Docker_Linux_crio (3 failed) TestFunctional/parallel/ImageCommands/ImageListShort(gopogh) 5.88% (chart)
Hyperkit_macOS (10 failed) TestFunctional/parallel/UpdateContextCmd/no_minikube_cluster(gopogh) 0.00% (chart)
Docker_Windows (2 failed) TestStartStop/group/old-k8s-version/serial/SecondStart(gopogh) 0.00% (chart)
Docker_Linux_containerd_arm64 (1 failed) TestStartStop/group/old-k8s-version/serial/SecondStart(gopogh) 47.06% (chart)

Besides the following environments also have failed tests:

To see the flake rates of all tests by environment, click here.

@medyagh
Copy link
Member

medyagh commented Dec 12, 2024

/lgtm

@medyagh medyagh merged commit 323c007 into kubernetes:master Dec 12, 2024
27 of 37 checks passed
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ComradeProgrammer, medyagh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
5 participants