components

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package components contains functions for configuring and creating Kubernetes components.

Index

Constants

View Source
const (
	KubeletEnvFileName = "crit-flags.env"

	// KubeletEnvFileVariableName specifies the environment variable name crit
	// should write a value to dynamic environment file
	KubeletEnvFileVariableName = "KUBELET_CRIT_ARGS"
)

Variables

View Source
var (
	AdmissionPlugins = []string{
		"NodeRestriction",
		"PodPreset",
	}
	FeatureGates = map[string]bool{
		"TTLAfterFinished": true,
	}
)
View Source
var (
	KubeProxyName = "kube-proxy"

	KubeProxyServiceAccount = &corev1.ServiceAccount{
		ObjectMeta: metav1.ObjectMeta{
			Name:      KubeProxyName,
			Namespace: metav1.NamespaceSystem,
		},
	}

	KubeProxyClusterRoleBinding = &rbacv1.ClusterRoleBinding{
		ObjectMeta: metav1.ObjectMeta{
			Name: "crit:node-proxier",
		},
		RoleRef: rbacv1.RoleRef{
			APIGroup: rbacv1.GroupName,
			Kind:     "ClusterRole",
			Name:     "system:node-proxier",
		},
		Subjects: []rbacv1.Subject{
			{
				Kind:      rbacv1.ServiceAccountKind,
				Name:      KubeProxyName,
				Namespace: metav1.NamespaceSystem,
			},
		},
	}

	KubeProxyRole = &rbacv1.Role{
		ObjectMeta: metav1.ObjectMeta{
			Name:      KubeProxyName,
			Namespace: metav1.NamespaceSystem,
		},
		Rules: []rbacv1.PolicyRule{
			{
				Verbs:         []string{"get"},
				APIGroups:     []string{""},
				Resources:     []string{"configmaps"},
				ResourceNames: []string{KubeProxyName},
			},
		},
	}

	KubeProxyRoleBinding = &rbacv1.RoleBinding{
		ObjectMeta: metav1.ObjectMeta{
			Name:      KubeProxyName,
			Namespace: metav1.NamespaceSystem,
		},
		RoleRef: rbacv1.RoleRef{
			APIGroup: rbacv1.GroupName,
			Kind:     "Role",
			Name:     "kube-proxy",
		},
		Subjects: []rbacv1.Subject{
			{
				Kind: rbacv1.GroupKind,
				Name: "system:bootstrappers:crit:default-node-token",
			},
		},
	}
)

Functions

func ApplyKubeProxyRBAC

func ApplyKubeProxyRBAC(client *clientset.Clientset, ctx context.Context) error

func NewAPIServerStaticPod

func NewAPIServerStaticPod(cfg *config.ControlPlaneConfiguration) (*corev1.Pod, error)

func NewBootstrapServerStaticPod

func NewBootstrapServerStaticPod(cfg *config.ControlPlaneConfiguration) *corev1.Pod

func NewControllerManagerStaticPod

func NewControllerManagerStaticPod(cfg *config.ControlPlaneConfiguration) *corev1.Pod

func NewKubeProxyConfigMap

func NewKubeProxyConfigMap(cfg *config.ControlPlaneConfiguration) (*corev1.ConfigMap, error)

func NewSchedulerStaticPod

func NewSchedulerStaticPod(cfg *config.ControlPlaneConfiguration) *corev1.Pod

func WriteKubeletConfigFile

func WriteKubeletConfigFile(kc *kubeletconfigv1beta1.KubeletConfiguration, path string) error

func WriteKubeletDynamicEnvFile

func WriteKubeletDynamicEnvFile(cfg *config.NodeConfiguration, registerTaintsUsingFlags bool, kubeletDir string) error

WriteKubeletDynamicEnvFile writes an environment file with dynamic flags to the kubelet. This is identical to how kubeadm creates a dynamic environment file, but with names changed. This will most likely be changed in the future to fit better with crit usage.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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