Skip to content

Kubernetes apparmor annotation deprecated since kubernetes v1.30 #3211

Open
@mamoit

Description

@mamoit

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

When starting buildx with the kubernetes driver on a kubernetes cluster version v1.31 the command throws the following warning:

warnings.go:70] spec.template.metadata.annotations[container.apparmor.security.beta.kubernetes.io/buildkitd]: deprecated since v1.30; use the "appArmorProfile" field instead

Expected behaviour

There should be no warning in the docker buildx --driver kubernetes output

Actual behaviour

The command throws a warning:

W0528 07:54:48.294930     187 warnings.go:70] spec.template.metadata.annotations[container.apparmor.security.beta.kubernetes.io/buildkitd]: deprecated since v1.30; use the "appArmorProfile" field instead

Buildx version

github.com/docker/buildx v0.24.0 d0e5e86

Docker info

Client:
 Version:    28.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.24.0
    Path:     /usr/local/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.36.2
    Path:     /usr/local/libexec/docker/cli-plugins/docker-compose

Builders list

None, this is ran within a pipeline, and the runners are (for now) spawned and killed within the same step, so they are not kept around

Configuration

Not applicable, any Dockerfile will produce this warning.

FROM scratch

Build logs


Additional info

According to the documentation since v1.30 the securityContext.appArmorProfile is used instead of an annotation.

Prior to Kubernetes v1.30, AppArmor was specified through annotations.

The annotation seems to be set here, I'm not sure how to make it use the securityContext instead so I won't be able to provide a PR.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions