Skip to content

This library is to be used to create K8s Daemonset that would run in the privilege mode

License

Notifications You must be signed in to change notification settings

redhat-best-practices-for-k8s/privileged-daemonset

Folders and files

NameName
Last commit message
Last commit date
Mar 25, 2025
Aug 25, 2022
Mar 25, 2025
Aug 25, 2022
Feb 13, 2025
Aug 7, 2024
Mar 17, 2025
Mar 17, 2025
Jan 28, 2025

Repository files navigation

K8s Daemonset in privilege mode

Functions

  • Creation of the daemonset in priviledge mode
  • Deletion of a daemonset in a specified namespace
  • Check if a daemonset is ready within a specified time

Usage

  1. Import the library
import k8sPriviledgedDs "github.com/redhat-best-practices-for-k8s/privileged-daemonset"
  1. Set the K8s client to act on Daemonset object
k8sPriviledgedDs.SetDaemonSetClient(myK8sInterface) // myK8sInterface is of type kubernetes.Interface
  1. Invoke the exported functions in a specified namespace with a specified imagename

To create

daemonSetRunningPods, err := k8sPriviledgedDs.CreateDaemonSet(myDaemonSetName, myNameSpace, daemonSetContainerName, imageWithVersion, timeOut)

To delete

err := k8sPriviledgedDs.DeleteDaemonSet(myDaemonSetName, myNameSpace)

To check if the daemonset is ready

err := k8sPriviledgedDs.WaitDaemonsetReady(myDaemonSetName, myNameSpace)

About

This library is to be used to create K8s Daemonset that would run in the privilege mode

Resources

License

Stars

Watchers

Forks

Packages

No packages published