Documentation
¶
Index ¶
- func ComponentPod(container v1.Container, volumes map[string]v1.Volume, ...) v1.Pod
- func ComponentResources(cpu string) v1.ResourceRequirements
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func GetAPIServerProbeAddress(endpoint *kubeadmapi.APIEndpoint) string
- func GetControllerManagerProbeAddress(cfg *kubeadmapi.ClusterConfiguration) string
- func GetEtcdProbeEndpoint(cfg *kubeadmapi.Etcd, isIPv6 bool) (string, int, v1.URIScheme)
- func GetExtraParameters(overrides map[string]string, defaults map[string]string) []string
- func GetSchedulerProbeAddress(cfg *kubeadmapi.ClusterConfiguration) string
- func GetUsersAndGroups() (*users.UsersAndGroups, error)
- func LivenessProbe(host, path string, port int, scheme v1.URIScheme) *v1.Probe
- func ManifestFilesAreEqual(path1, path2 string) (bool, error)
- func NewVolume(name, path string, pathType *v1.HostPathType) v1.Volume
- func NewVolumeMount(name, path string, readOnly bool) v1.VolumeMount
- func PatchStaticPod(pod *v1.Pod, patchesDir string, output io.Writer) (*v1.Pod, error)
- func ReadStaticPodFromDisk(manifestPath string) (*v1.Pod, error)
- func ReadinessProbe(host, path string, port int, scheme v1.URIScheme) *v1.Probe
- func RunComponentAsNonRoot(componentName string, pod *v1.Pod, usersAndGroups *users.UsersAndGroups, ...) error
- func StartupProbe(host, path string, port int, scheme v1.URIScheme, ...) *v1.Probe
- func VolumeMapToSlice(volumes map[string]v1.Volume) []v1.Volume
- func VolumeMountMapToSlice(volumeMounts map[string]v1.VolumeMount) []v1.VolumeMount
- func WriteStaticPodToDisk(componentName, manifestDir string, pod v1.Pod) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentPod ¶
func ComponentPod(container v1.Container, volumes map[string]v1.Volume, annotations map[string]string) v1.Pod
ComponentPod returns a Pod object from the container, volume and annotations specifications
func ComponentResources ¶
func ComponentResources(cpu string) v1.ResourceRequirements
ComponentResources returns the v1.ResourceRequirements object needed for allocating a specified amount of the CPU
func DeepHashObject ¶
DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes. Copied from github.com/sanposhiho/kubernetes/pkg/util/hash/hash.go#DeepHashObject
func GetAPIServerProbeAddress ¶
func GetAPIServerProbeAddress(endpoint *kubeadmapi.APIEndpoint) string
GetAPIServerProbeAddress returns the probe address for the API server
func GetControllerManagerProbeAddress ¶
func GetControllerManagerProbeAddress(cfg *kubeadmapi.ClusterConfiguration) string
GetControllerManagerProbeAddress returns the kubernetes controller manager probe address
func GetEtcdProbeEndpoint ¶
GetEtcdProbeEndpoint takes a kubeadm Etcd configuration object and attempts to parse the first URL in the listen-metrics-urls argument, returning an etcd probe hostname, port and scheme
func GetExtraParameters ¶
GetExtraParameters builds a list of flag arguments two string-string maps, one with default, base commands and one with overrides
func GetSchedulerProbeAddress ¶
func GetSchedulerProbeAddress(cfg *kubeadmapi.ClusterConfiguration) string
GetSchedulerProbeAddress returns the kubernetes scheduler probe address
func GetUsersAndGroups ¶
func GetUsersAndGroups() (*users.UsersAndGroups, error)
func LivenessProbe ¶
LivenessProbe creates a Probe object with a HTTPGet handler
func ManifestFilesAreEqual ¶
ManifestFilesAreEqual compares 2 files. It returns true if their contents are equal, false otherwise
func NewVolume ¶
func NewVolume(name, path string, pathType *v1.HostPathType) v1.Volume
NewVolume creates a v1.Volume with a hostPath mount to the specified location
func NewVolumeMount ¶
func NewVolumeMount(name, path string, readOnly bool) v1.VolumeMount
NewVolumeMount creates a v1.VolumeMount to the specified location
func PatchStaticPod ¶
PatchStaticPod applies patches stored in patchesDir to a static Pod.
func ReadStaticPodFromDisk ¶
ReadStaticPodFromDisk reads a static pod file from disk
func ReadinessProbe ¶
ReadinessProbe creates a Probe object with a HTTPGet handler
func RunComponentAsNonRoot ¶
func RunComponentAsNonRoot(componentName string, pod *v1.Pod, usersAndGroups *users.UsersAndGroups, cfg *kubeadmapi.ClusterConfiguration) error
RunComponentAsNonRoot updates the pod manifest and the hostVolume permissions to run as non root.
func StartupProbe ¶
func StartupProbe(host, path string, port int, scheme v1.URIScheme, timeoutForControlPlane *metav1.Duration) *v1.Probe
StartupProbe creates a Probe object with a HTTPGet handler
func VolumeMapToSlice ¶
VolumeMapToSlice returns a slice of volumes from a map's values
func VolumeMountMapToSlice ¶
func VolumeMountMapToSlice(volumeMounts map[string]v1.VolumeMount) []v1.VolumeMount
VolumeMountMapToSlice returns a slice of volumes from a map's values
Types ¶
This section is empty.