kubewarden-controller

command module
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

README

Artifact HUB CII Best Practices E2E FOSSA license scan

Kubewarden is a Kubernetes Dynamic Admission Controller that uses policies written in WebAssembly.

For more information refer to the official Kubewarden website.

kubewarden-controller

kubewarden-controller is a Kubernetes controller that allows you to dynamically register Kubewarden admission policies.

The kubewarden-controller will reconcile the admission policies you have registered against the Kubernetes webhooks of the cluster where it is deployed.

Installation

The kubewarden-controller can be deployed using a helm chart. For instructions, see https://charts.kubewarden.io.

Usage

Once the kubewarden-controller is up and running, Kubewarden policies can be defined via the ClusterAdmissionPolicy resource.

The documentation of this Custom Resource can be found here or on docs.crds.dev.

Note well: ClusterAdmissionPolicy resources are cluster-wide.

Deploy your first admission policy

The following snippet defines a Kubewarden Policy based on the psp-capabilities policy:

apiVersion: policies.kubewarden.io/v1alpha2
kind: ClusterAdmissionPolicy
metadata:
  name: psp-capabilities
spec:
  module: registry://ghcr.io/kubewarden/policies/psp-capabilities:v0.1.3
  rules:
    - apiGroups: [""]
      apiVersions: ["v1"]
      resources: ["pods"]
      operations:
        - CREATE
        - UPDATE
  mutating: true
  settings:
    allowed_capabilities:
      - CHOWN
    required_drop_capabilities:
      - NET_ADMIN

This ClusterAdmissionPolicy will evaluate all the CREATE and UPDATE operations performed against Pods. The homepage of this policy provides more insights about how this policy behaves.

Creating the resource inside of Kubernetes is sufficient to enforce the policy:

$ kubectl apply -f https://raw.githubusercontent.com/kubewarden/kubewarden-controller/main/config/samples/policies_v1alpha2_clusteradmissionpolicy.yaml
Remove your first admission policy

You can delete the admission policy you just created:

$ kubectl delete clusteradmissionpolicy psp-capabilities
$ kubectl patch clusteradmissionpolicy psp-capabilities -p '{"metadata":{"finalizers":null}}' --type=merge

Learn more

The official documentation provides more insights about how the project works and how to use it.

Software bill of materials

Kubewarden controller has its software bill of materials (SBOM) published every release. It follows the SPDX version 2.2 format and it can be found together with the signature and certificate used to signed it in the release assets

Roadmap

Roadmap for the Kubewarden project.

Governance

See our governance document.

Community meeting

We host regular online meetings for contributors, adopters, maintainers, and anyone else interested to connect in a synchronous fashion. These meetings usually take place on second Thursday of the month at 4PM UTC.

We're a friendly group, so please feel free to join us!

Community

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg
apis/policies/v1
Package v1 contains API Schema definitions for the policies v1 API group +kubebuilder:object:generate=true +groupName=policies.kubewarden.io
Package v1 contains API Schema definitions for the policies v1 API group +kubebuilder:object:generate=true +groupName=policies.kubewarden.io
apis/policies/v1alpha2
Package v1alpha2 contains API Schema definitions for the policies v1alpha2 API group +kubebuilder:object:generate=true +groupName=policies.kubewarden.io
Package v1alpha2 contains API Schema definitions for the policies v1alpha2 API group +kubebuilder:object:generate=true +groupName=policies.kubewarden.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL