deploy

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAgentConfigMap

func BuildAgentConfigMap(agentConfig *config.AgentConfig) (*corev1.ConfigMap, error)

func BuildClusterConfig

func BuildClusterConfig(nodes []*corev1.Node, agentPods []*corev1.Pod,
	internalKubeAPIServer, kubeAPIServer *config.Endpoint,
) (*config.ClusterConfig, error)

func BuildClusterConfigMap

func BuildClusterConfigMap(clusterConfig *config.ClusterConfig) (*corev1.ConfigMap, error)

func CreateDeployCmd

func CreateDeployCmd(imageTag string) *cobra.Command

func GetAPIServerEndpointFromShootInfo

func GetAPIServerEndpointFromShootInfo(shootInfo *corev1.ConfigMap) (*config.Endpoint, error)

Types

type AgentDeployConfig

type AgentDeployConfig struct {
	// Image is the image of the network problem detector agent to deploy.
	Image string
	// DefaultPeriod is the default period for jobs.
	DefaultPeriod time.Duration
	// DefaultSeccompProfileEnabled if seccomp profile should be defaulted to RuntimeDefault for the daemonsets.
	DefaultSeccompProfileEnabled bool
	// PingEnabled if ping checks are enabled (needs NET_ADMIN capabilities).
	PingEnabled bool
	// IgnoreAPIServerEndpoint if the check of the API server endpoint should be ignored.
	IgnoreAPIServerEndpoint bool
	// PriorityClassName is the priority class name used for the daemon sets.
	PriorityClassName string
	// K8sExporterEnabled if node conditions and events should be updated/created.
	K8sExporterEnabled bool
	// K8sExporterHeartbeat if K8sExporterEnabled sets the period of updating the node condition `ClusterNetworkProblems` or `HostNetworkProblems`.
	K8sExporterHeartbeat time.Duration
	// K8sExporterMinFailingPeerNodeShare if > 0, reports node conditions `ClusterNetworkProblems` or `HostNetworkProblems` for node checks only if minimum share of destination peer nodes are failing. Valid range: [0.0,1.0].
	K8sExporterMinFailingPeerNodeShare float64
	// AdditionalAnnotations adds annotations to the daemonset spec template.
	AdditionalAnnotations map[string]string
	// AdditionalLabels adds labels to the daemonset spec template.
	AdditionalLabels map[string]string
	// DisableAutomountServiceAccountTokenForAgents controls if automountServiceAccountToken should always be false for agents as it is provided.
	// by other means (e.g. https://github.com/gardener/gardener/blob/eb8400a2961400a8b984252a76eb546ea44432fd/docs/concepts/resource-manager.md#auto-mounting-projected-serviceaccount-tokens)
	DisableAutomountServiceAccountTokenForAgents bool
	// MaxPeerNodes if != 0 restricts number of peer nodes used as destinations for checks (nodes are selected randomly, but stable in this case).
	MaxPeerNodes int
}

AgentDeployConfig contains configuration for deploying the nwpd agent daemonset.

func (*AgentDeployConfig) AddImageFlag

func (ac *AgentDeployConfig) AddImageFlag(imageTag string, flags *pflag.FlagSet)

func (*AgentDeployConfig) AddOptionFlags

func (ac *AgentDeployConfig) AddOptionFlags(flags *pflag.FlagSet)

func (*AgentDeployConfig) BuildAgentConfig

func (ac *AgentDeployConfig) BuildAgentConfig() (*config.AgentConfig, error)

type Object

type Object interface {
	runtime.Object
	metav1.Object
}

func NetworkProblemDetectorAgent

func NetworkProblemDetectorAgent(config *AgentDeployConfig) ([]Object, error)

NetworkProblemDetectorAgent returns K8s resources to be created.

type ObjectDelete

type ObjectDelete interface {
	Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
}

type ObjectInterface

type ObjectInterface[T Object] interface {
	Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error)
	Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
	Get(ctx context.Context, name string, opts metav1.GetOptions) (T, error)
}

Jump to

Keyboard shortcuts

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