Skip to content

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Contributors 8