daemon

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFileToPod

func CopyFileToPod(config *rest.Config, clientset *kubernetes.Clientset, podName string, filepath string, contents string) error

func ExecInPod

func ExecInPod(config *rest.Config, clientset *kubernetes.Clientset, podName string, command []string) error

func WriteHostsFileAndRestartPihole

func WriteHostsFileAndRestartPihole(config *rest.Config, clientset *kubernetes.Clientset, podName string, hostsfile string) error

Types

type DaemonBetaIngressMonitor added in v0.3.0

type DaemonBetaIngressMonitor struct {
	// contains filtered or unexported fields
}

func (*DaemonBetaIngressMonitor) GetResourceHostsEntry added in v0.3.0

func (d *DaemonBetaIngressMonitor) GetResourceHostsEntry(obj interface{}) hostsfile.HostsEntry

func (*DaemonBetaIngressMonitor) Informer added in v0.3.0

func (*DaemonBetaIngressMonitor) Name added in v0.3.0

func (d *DaemonBetaIngressMonitor) Name() string

func (*DaemonBetaIngressMonitor) ValidateResource added in v0.3.0

func (d *DaemonBetaIngressMonitor) ValidateResource(obj interface{}) (string, error)

type DaemonConfig

type DaemonConfig struct {
	RestConfig          *rest.Config
	KubernetesClientSet *kubernetes.Clientset

	PiholePodName string
	IngressIp     string
	SearchDomain  string
}

Everything needed to control what the daemon executes against.

func NewDaemonConfig

func NewDaemonConfig(ingressIp, searchDomain, clusterIp, bearerToken, piholePodName string) (*DaemonConfig, error)

func NewDaemonConfigInCluster

func NewDaemonConfigInCluster(ingressIp string, searchDomain string) (*DaemonConfig, error)

Assumes that this is running in the same pod as the pihole. Uses the pod's own hostname to find the pod's name.

type DaemonIngressMonitor

type DaemonIngressMonitor struct {
	// contains filtered or unexported fields
}

func (*DaemonIngressMonitor) GetResourceHostsEntry

func (d *DaemonIngressMonitor) GetResourceHostsEntry(obj interface{}) hostsfile.HostsEntry

func (*DaemonIngressMonitor) Informer

func (*DaemonIngressMonitor) Name

func (d *DaemonIngressMonitor) Name() string

func (*DaemonIngressMonitor) ValidateResource

func (d *DaemonIngressMonitor) ValidateResource(obj interface{}) (string, error)

type DaemonResourceMonitor

type DaemonResourceMonitor interface {
	Name() string

	Informer(sif informers.SharedInformerFactory) cache.SharedInformer

	ValidateResource(obj interface{}) (string, error)
	GetResourceHostsEntry(obj interface{}) hostsfile.HostsEntry
}

type DaemonServiceMonitor

type DaemonServiceMonitor struct {
	// contains filtered or unexported fields
}

func (*DaemonServiceMonitor) GetResourceHostsEntry

func (d *DaemonServiceMonitor) GetResourceHostsEntry(obj interface{}) hostsfile.HostsEntry

func (*DaemonServiceMonitor) Informer

func (*DaemonServiceMonitor) Name

func (d *DaemonServiceMonitor) Name() string

func (*DaemonServiceMonitor) ValidateResource

func (d *DaemonServiceMonitor) ValidateResource(obj interface{}) (string, error)

type HostsFileDaemon

type HostsFileDaemon struct {
	// contains filtered or unexported fields
}

func NewHostsFileDaemon

func NewHostsFileDaemon(config DaemonConfig) *HostsFileDaemon

func (*HostsFileDaemon) InformerAddFunc

func (hfd *HostsFileDaemon) InformerAddFunc(drm DaemonResourceMonitor) func(obj interface{})

func (*HostsFileDaemon) InformerDeleteFunc

func (hfd *HostsFileDaemon) InformerDeleteFunc(drm DaemonResourceMonitor) func(obj interface{})

func (*HostsFileDaemon) InformerUpdateFunc

func (hfd *HostsFileDaemon) InformerUpdateFunc(drm DaemonResourceMonitor) func(oldObj, newObj interface{})

func (*HostsFileDaemon) Monitor

func (hfd *HostsFileDaemon) Monitor(drm DaemonResourceMonitor)

func (*HostsFileDaemon) Run

func (hfd *HostsFileDaemon) Run()

type IHostsFileDaemon

type IHostsFileDaemon interface {
	Run()

	Monitor(drm DaemonResourceMonitor)

	InformerAddFunc(drm DaemonResourceMonitor) func(obj interface{})
	InformerDeleteFunc(drm DaemonResourceMonitor) func(obj interface{})
	InformerUpdateFunc(drm DaemonResourceMonitor) func(oldObj, newObj interface{})
}

Jump to

Keyboard shortcuts

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