Documentation ¶
Index ¶
- Constants
- Variables
- func AllNodes(cr v1alpha1.KVMConfig) []v1alpha1.ClusterNode
- func AllocatedNodeIndexes(cr v1alpha1.KVMConfig) []int
- func AnyPodContainerRunning(pod corev1.Pod) bool
- func BaseDomain(customObject v1alpha1.KVMConfig) string
- func CPUQuantity(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)
- func ClusterAPIEndpoint(customObject v1alpha1.KVMConfig) string
- func ClusterAPIEndpointFromPod(pod *corev1.Pod) (string, error)
- func ClusterCustomer(customObject v1alpha1.KVMConfig) string
- func ClusterEtcdDomain(customObject v1alpha1.KVMConfig) string
- func ClusterID(customObject v1alpha1.KVMConfig) string
- func ClusterNamespace(customObject v1alpha1.KVMConfig) string
- func ClusterRoleBindingName(customObject v1alpha1.KVMConfig) string
- func ClusterRoleBindingPSPName(customObject v1alpha1.KVMConfig) string
- func ConfigMapName(cr v1alpha1.KVMConfig, node v1alpha1.ClusterNode, prefix string) string
- func ContainerDistro(release *releasev1alpha1.Release) (string, error)
- func CreateK8sClientForWorkloadCluster(ctx context.Context, cluster v1alpha1.KVMConfig, logger micrologger.Logger, ...) (*k8sclient.Clients, error)
- func DefaultVersions() k8scloudconfig.Versions
- func DeploymentName(prefix string, nodeID string) string
- func DockerVolumeSizeFromNode(node v1alpha1.KVMConfigSpecKVMNode) string
- func EtcdPVCName(clusterID string, vmNumber string) string
- func EtcdStorageType(customObject v1alpha1.KVMConfig) string
- func FindNodeCondition(node corev1.Node, conditionType corev1.NodeConditionType) (corev1.NodeCondition, bool)
- func FindPodCondition(pod corev1.Pod, conditionType corev1.PodConditionType) (corev1.PodCondition, bool)
- func HasHostVolumes(customObject v1alpha1.KVMConfig) bool
- func HealthListenAddress(customObject v1alpha1.KVMConfig) string
- func HostVolumesToEnvVar(hostVolumes []v1alpha1.KVMConfigSpecKVMNodeHostVolumes) corev1.EnvVar
- func HostVolumesToVolumeMounts(hostVolumes []v1alpha1.KVMConfigSpecKVMNodeHostVolumes) []corev1.VolumeMount
- func HostVolumesToVolumes(customObject v1alpha1.KVMConfig, nodeIndex int) []corev1.Volume
- func IsDeleted(object v1.Object) bool
- func IsInvalidMemoryConfigurationError(err error) bool
- func IsMissingAnnotationError(err error) bool
- func IsMissingNodeInternalIP(err error) bool
- func IsMissingVersionError(err error) bool
- func IsPodDrained(pod corev1.Pod) (bool, error)
- func IsWrongTypeError(err error) bool
- func IscsiInitiatorName(customObject v1alpha1.KVMConfig, nodeIndex int, nodeRole string) string
- func KubeletVolumeSizeFromNode(node v1alpha1.KVMConfigSpecKVMNode) string
- func LivenessPort(customObject v1alpha1.KVMConfig) int32
- func LocalWorkerPVCName(clusterID string, vmNumber, mountTag string) string
- func MasterCount(customObject v1alpha1.KVMConfig) int
- func MasterHostPathVolumeDir(clusterID string, vmNumber string) string
- func MemoryQuantityMaster(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)
- func MemoryQuantityWorker(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)
- func NetworkBridgeName(customObject v1alpha1.KVMConfig) string
- func NetworkDNSBlock(servers []net.IP) string
- func NetworkEnvFilePath(customObject v1alpha1.KVMConfig) string
- func NetworkTapName(customObject v1alpha1.KVMConfig) string
- func NodeIndex(cr v1alpha1.KVMConfig, nodeID string) (int, bool)
- func NodeInternalIP(node corev1.Node) (string, error)
- func NodeIsReady(node corev1.Node) bool
- func NodeIsUnschedulable(node corev1.Node) bool
- func NodePodObjectKey(cluster v1alpha1.KVMConfig, node corev1.Node) client.ObjectKey
- func OperatorVersion(cr v1alpha1.KVMConfig) string
- func PodIsReady(pod corev1.Pod) bool
- func PodNodeIsReady(pod corev1.Pod) bool
- func PortMappings(customObject v1alpha1.KVMConfig) []corev1.ServicePort
- func ReleaseVersion(cr v1alpha1.KVMConfig) string
- func ServiceAccountName(customObject v1alpha1.KVMConfig) string
- func ShutdownDeferrerListenAddress(customObject v1alpha1.KVMConfig) string
- func ShutdownDeferrerListenPort(customObject v1alpha1.KVMConfig) int
- func ShutdownDeferrerPollPath(customObject v1alpha1.KVMConfig) string
- func ToClusterEndpoint(v interface{}) (string, error)
- func ToClusterID(v interface{}) (string, error)
- func ToClusterStatus(v interface{}) (v1alpha1.StatusCluster, error)
- func ToCustomObject(v interface{}) (v1alpha1.KVMConfig, error)
- func ToNode(v interface{}) (corev1.Node, error)
- func ToNodeCount(v interface{}) (int, error)
- func ToOperatorVersion(v interface{}) (string, error)
- func ToPod(v interface{}) (corev1.Pod, error)
- func VMNumber(ID int) string
- func WorkerCount(customObject v1alpha1.KVMConfig) int
- type LabelsGetter
Constants ¶
const ( MasterID = "master" WorkerID = "worker" EtcdPort = 443 // HealthEndpoint is http path for liveness probe. HealthEndpoint = "/healthz" // ProbeHost host for liveness probe. ProbeHost = "127.0.0.1" // LivenessProbeInitialDelaySeconds is LivenessProbeInitialDelaySeconds param in liveness probe config. LivenessProbeInitialDelaySeconds = 500 // ReadinessProbeInitialDelaySeconds is ReadinessProbeInitialDelaySeconds param in readiness probe config. ReadinessProbeInitialDelaySeconds = 100 // TimeoutSeconds is TimeoutSeconds param in liveness probe config. TimeoutSeconds = 5 // PeriodSeconds is PeriodSeconds param in liveness probe config. PeriodSeconds = 35 // FailureThreshold is FailureThreshold param in liveness probe config FailureThreshold = 4 // SuccessThreshold is SuccessThreshold param in liveness probe config SuccessThreshold = 1 // Enable k8s-kvm-health check for k8s api. CheckK8sApi = "true" // Environment variable names for Downward API use (shutdown-deferrer). EnvKeyMyPodName = "MY_POD_NAME" EnvKeyMyPodNamespace = "MY_POD_NAMESPACE" FlannelEnvPathPrefix = "/run/flannel" ContainerLinuxComponentName = "containerlinux" FlatcarImageDir = "/var/lib/flatcar-kvm-images" FlatcarChannel = "stable" K8SKVMContainerName = "k8s-kvm" K8SEndpointUpdaterDocker = "quay.io/giantswarm/k8s-endpoint-updater:0.1.0" K8SKVMDockerImage = "quay.io/giantswarm/k8s-kvm:0.6.2" K8SKVMHealthDocker = "quay.io/giantswarm/k8s-kvm-health:0.1.0" ShutdownDeferrerDocker = "quay.io/giantswarm/shutdown-deferrer:0.1.0" // DefaultDockerDiskSize defines the space used to partition the docker FS // within k8s-kvm. Note we use this only for masters, since the value for the // workers can be configured at runtime by the user. DefaultDockerDiskSize = "50G" // DefaultKubeletDiskSize defines the space used to partition the kubelet FS // within k8s-kvm. Note we use this only for masters, since the value for the // workers can be configured at runtime by the user. DefaultKubeletDiskSize = "5G" // DefaultOSDiskSize defines the space used to partition the root FS within // k8s-kvm. DefaultOSDiskSize = "5G" DefaultImagePullProgressDeadline = "1m" )
const ( AnnotationAPIEndpoint = "kvm-operator.giantswarm.io/api-endpoint" AnnotationComponentVersionPrefix = "kvm-operator.giantswarm.io/component-version" AnnotationEtcdDomain = "giantswarm.io/etcd-domain" AnnotationIp = "endpoint.kvm.giantswarm.io/ip" AnnotationService = "endpoint.kvm.giantswarm.io/service" AnnotationPodDrained = "endpoint.kvm.giantswarm.io/drained" AnnotationPrometheusCluster = "giantswarm.io/prometheus-cluster" AnnotationVersionBundle = "kvm-operator.giantswarm.io/version-bundle" LabelApp = "app" LabelCluster = "giantswarm.io/cluster" LabelCustomer = "customer" LabelManagedBy = "giantswarm.io/managed-by" LabelMountTag = "mount-tag" LabelOrganization = "giantswarm.io/organization" LabelVersionBundle = "giantswarm.io/version-bundle" LegacyLabelCluster = "cluster" )
const ( VersionBundleVersionAnnotation = "giantswarm.io/version-bundle-version" ReleaseVersionAnnotation = "giantswarm.io/release-version" )
const ( // Keep in sync with https://github.com/giantswarm/node-operator/blob/e8f8250f7d518d7af0acfdb1b0934a1174c22d7d/service/controller/v2/resource/drainer/create.go#L50 PodDeletionGracePeriod = 10 * time.Minute WorkloadClusterNodeReady corev1.PodConditionType = "kvm-operator.giantswarm.io/workload-cluster-node-ready" )
const (
KubernetesNetworkSetupDocker = "0.2.0"
)
const (
OperatorName = "kvm-operator"
)
const (
PodWatcherLabel = "kvm-operator.giantswarm.io/pod-watcher"
)
Variables ¶
Functions ¶
func AllocatedNodeIndexes ¶
func AnyPodContainerRunning ¶
AnyPodContainerRunning checks ContainerState for all containers present in given pod. If any container is in Running state, true is returned.
func BaseDomain ¶
func CPUQuantity ¶
func CPUQuantity(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)
func ClusterAPIEndpoint ¶
func ClusterCustomer ¶
func ClusterEtcdDomain ¶
func ClusterNamespace ¶
func ClusterRoleBindingName ¶
func ConfigMapName ¶
func ContainerDistro ¶
func ContainerDistro(release *releasev1alpha1.Release) (string, error)
func CreateK8sClientForWorkloadCluster ¶
func CreateK8sClientForWorkloadCluster(ctx context.Context, cluster v1alpha1.KVMConfig, logger micrologger.Logger, workloadCluster tenantcluster.Interface) (*k8sclient.Clients, error)
CreateK8sClientForWorkloadCluster takes the context of the reconciled object and the provided logger and tenant cluster interface and creates a K8s client for the workload cluster
func DefaultVersions ¶
func DefaultVersions() k8scloudconfig.Versions
func DeploymentName ¶
func DockerVolumeSizeFromNode ¶
func DockerVolumeSizeFromNode(node v1alpha1.KVMConfigSpecKVMNode) string
func EtcdPVCName ¶
func EtcdStorageType ¶
func FindNodeCondition ¶
func FindNodeCondition(node corev1.Node, conditionType corev1.NodeConditionType) (corev1.NodeCondition, bool)
FindNodeCondition returns the condition of the given type from the node. The second return value indicates if the condition was found.
func FindPodCondition ¶
func FindPodCondition(pod corev1.Pod, conditionType corev1.PodConditionType) (corev1.PodCondition, bool)
FindNodeCondition returns the condition of the given type from the pod. The second return value indicates if the condition was found.
func HasHostVolumes ¶
func HealthListenAddress ¶
func HostVolumesToEnvVar ¶
func HostVolumesToEnvVar(hostVolumes []v1alpha1.KVMConfigSpecKVMNodeHostVolumes) corev1.EnvVar
func HostVolumesToVolumeMounts ¶
func HostVolumesToVolumeMounts(hostVolumes []v1alpha1.KVMConfigSpecKVMNodeHostVolumes) []corev1.VolumeMount
func HostVolumesToVolumes ¶
func IsMissingNodeInternalIP ¶
func IsMissingVersionError ¶
func IsPodDrained ¶
IsPodDrained checks whether the pod status indicates it got drained. The pod status is partially reflected by its annotations. Here we check for the annotation that tells us if the pod was already drained or not. In case the pod does not have any annotations an unrecoverable error is returned. Such situations should actually never happen. If it happens, something really bad is going on. This is nothing we can just sort right away in our code.
TODO(xh3b4sd) handle pod status via the runtime object status primitives and not via annotations.
func IsWrongTypeError ¶
IsWrongTypeError asserts wrongTypeError.
func IscsiInitiatorName ¶
func KubeletVolumeSizeFromNode ¶
func KubeletVolumeSizeFromNode(node v1alpha1.KVMConfigSpecKVMNode) string
func LivenessPort ¶
func LocalWorkerPVCName ¶
func MasterCount ¶
func MasterHostPathVolumeDir ¶
func MemoryQuantityMaster ¶
func MemoryQuantityMaster(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)
MemoryQuantity returns a resource.Quantity that represents the memory to be used by the nodes. It adds the memory from the node definition parameter to the additional memory calculated on the node role
func MemoryQuantityWorker ¶
func MemoryQuantityWorker(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)
MemoryQuantity returns a resource.Quantity that represents the memory to be used by the nodes. It adds the memory from the node definition parameter to the additional memory calculated on the node role
func NetworkBridgeName ¶
func NetworkDNSBlock ¶
func NetworkEnvFilePath ¶
func NetworkTapName ¶
func NodeInternalIP ¶
NodeInternalIP examines the Status Addresses of a Node and returns its InternalIP..
func NodeIsReady ¶
NodeIsReady examines the Status Conditions of a Node and returns true if the NodeReady Condition is true.
func NodeIsUnschedulable ¶
NodeIsUnschedulable examines a Node and returns true if the Node is marked Unschedulable or has a NoSchedule/NoExecute taint. Ignores the default NoSchedule effect for master nodes.
func NodePodObjectKey ¶
func OperatorVersion ¶
func PodIsReady ¶
PodIsReady examines the Status Conditions of a Pod and returns true if the PodReady Condition is true.
func PodNodeIsReady ¶
PodNodeIsReady examines the Status Conditions of a Pod and returns true if the WorkloadClusterNodeReady Condition is true.
func PortMappings ¶
func PortMappings(customObject v1alpha1.KVMConfig) []corev1.ServicePort
func ReleaseVersion ¶
func ServiceAccountName ¶
func ToClusterEndpoint ¶
func ToClusterID ¶
func ToClusterStatus ¶
func ToClusterStatus(v interface{}) (v1alpha1.StatusCluster, error)