kvm-operator: github.com/giantswarm/kvm-operator/service/controller/v22/key Index | Files

package key

import "github.com/giantswarm/kvm-operator/service/controller/v22/key"


Package Files

error.go key.go


const (
    MasterID = "master"
    WorkerID = "worker"
    EtcdPort = 443

    // HealthEndpoint is http path for liveness probe.
    HealthEndpoint = "/healthz"
    // ProbeHost host for liveness probe.
    ProbeHost = ""
    // LivenessProbeInitialDelaySeconds is LivenessProbeInitialDelaySeconds param in liveness probe config.
    LivenessProbeInitialDelaySeconds = 360
    // 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"
    CoreosImageDir       = "/var/lib/coreos-kvm-images"
    CoreosVersion        = "2023.5.0"

    K8SEndpointUpdaterDocker = "quay.io/giantswarm/k8s-endpoint-updater:9172ffbc4838cf0c813d8e6d141e994d56dcc750"
    K8SKVMDockerImage        = "quay.io/giantswarm/k8s-kvm:34e40049f80ce8ea0f774e56c1b10c7f24921eca"
    K8SKVMHealthDocker       = "quay.io/giantswarm/k8s-kvm-health:20517098a762a0d7ca2b0902316ddff487dbc7f5"
    ShutdownDeferrerDocker   = "quay.io/giantswarm/shutdown-deferrer:022df58313aab9a185f2a78d9bd107d6f7db13c9"

    // 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"
const (
    AnnotationAPIEndpoint       = "kvm-operator.giantswarm.io/api-endpoint"
    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"
    LabelOrganization  = "giantswarm.io/organization"
    LabelVersionBundle = "giantswarm.io/version-bundle"

    LegacyLabelCluster = "cluster"
const (
    OperatorName = "kvm-operator"
const (
    PodDeletionGracePeriod = 5 * time.Minute
const (
    PodWatcherLabel = "kvm-operator.giantswarm.io/pod-watcher"
const (
    VersionBundleVersionAnnotation = "giantswarm.io/version-bundle-version"

func AllNodes Uses

func AllNodes(cr v1alpha1.KVMConfig) []v1alpha1.ClusterNode

func AllocatedNodeIndexes Uses

func AllocatedNodeIndexes(cr v1alpha1.KVMConfig) []int

func ArePodContainersTerminated Uses

func ArePodContainersTerminated(pod *corev1.Pod) bool

ArePodContainersTerminated checks ContainerState for all containers present in given pod. When all containers are in Terminated state, true is returned.

func BaseDomain Uses

func BaseDomain(customObject v1alpha1.KVMConfig) string

func CPUQuantity Uses

func CPUQuantity(n v1alpha1.KVMConfigSpecKVMNode) (resource.Quantity, error)

func ClusterAPIEndpoint Uses

func ClusterAPIEndpoint(customObject v1alpha1.KVMConfig) string

func ClusterAPIEndpointFromPod Uses

func ClusterAPIEndpointFromPod(pod *corev1.Pod) (string, error)

func ClusterCustomer Uses

func ClusterCustomer(customObject v1alpha1.KVMConfig) string

func ClusterEtcdDomain Uses

func ClusterEtcdDomain(customObject v1alpha1.KVMConfig) string

func ClusterID Uses

func ClusterID(customObject v1alpha1.KVMConfig) string

func ClusterIDFromPod Uses

func ClusterIDFromPod(pod *corev1.Pod) string

func ClusterNamespace Uses

func ClusterNamespace(customObject v1alpha1.KVMConfig) string

func ClusterRoleBindingName Uses

func ClusterRoleBindingName(customObject v1alpha1.KVMConfig) string

func ClusterRoleBindingPSPName Uses

func ClusterRoleBindingPSPName(customObject v1alpha1.KVMConfig) string

func ConfigMapName Uses

func ConfigMapName(cr v1alpha1.KVMConfig, node v1alpha1.ClusterNode, prefix string) string

func DeploymentName Uses

func DeploymentName(prefix string, nodeID string) string

func DockerVolumeSizeFromNode Uses

func DockerVolumeSizeFromNode(node v1alpha1.KVMConfigSpecKVMNode) string

func EtcdPVCName Uses

func EtcdPVCName(clusterID string, vmNumber string) string

func HealthListenAddress Uses

func HealthListenAddress(customObject v1alpha1.KVMConfig) string

func IsDeleted Uses

func IsDeleted(customObject v1alpha1.KVMConfig) bool

func IsMissingAnnotationError Uses

func IsMissingAnnotationError(err error) bool

func IsPodDeleted Uses

func IsPodDeleted(pod *corev1.Pod) bool

func IsPodDrained Uses

func IsPodDrained(pod *corev1.Pod) (bool, error)

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 Uses

func IsWrongTypeError(err error) bool

IsWrongTypeError asserts wrongTypeError.

func IscsiInitiatorName Uses

func IscsiInitiatorName(customObject v1alpha1.KVMConfig, nodeIndex int, nodeRole string) string

func KubeletVolumeSizeFromNode Uses

func KubeletVolumeSizeFromNode(node v1alpha1.KVMConfigSpecKVMNode) string

func LivenessPort Uses

func LivenessPort(customObject v1alpha1.KVMConfig) int32

func MasterCount Uses

func MasterCount(customObject v1alpha1.KVMConfig) int

func MasterHostPathVolumeDir Uses

func MasterHostPathVolumeDir(clusterID string, vmNumber string) string

func MemoryQuantityMaster Uses

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 Uses

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 Uses

func NetworkBridgeName(customObject v1alpha1.KVMConfig) string

func NetworkDNSBlock Uses

func NetworkDNSBlock(servers []net.IP) string

func NetworkEnvFilePath Uses

func NetworkEnvFilePath(customObject v1alpha1.KVMConfig) string

func NetworkNTPBlock Uses

func NetworkNTPBlock(servers []net.IP) string

func NetworkTapName Uses

func NetworkTapName(customObject v1alpha1.KVMConfig) string

func NodeIndex Uses

func NodeIndex(cr v1alpha1.KVMConfig, nodeID string) (int, bool)

func PVCNames Uses

func PVCNames(customObject v1alpha1.KVMConfig) []string

func PortMappings Uses

func PortMappings(customObject v1alpha1.KVMConfig) []corev1.ServicePort

func ServiceAccountName Uses

func ServiceAccountName(customObject v1alpha1.KVMConfig) string

func ShutdownDeferrerListenAddress Uses

func ShutdownDeferrerListenAddress(customObject v1alpha1.KVMConfig) string

func ShutdownDeferrerListenPort Uses

func ShutdownDeferrerListenPort(customObject v1alpha1.KVMConfig) int

func ShutdownDeferrerPollPath Uses

func ShutdownDeferrerPollPath(customObject v1alpha1.KVMConfig) string

func StorageType Uses

func StorageType(customObject v1alpha1.KVMConfig) string

func ToClusterEndpoint Uses

func ToClusterEndpoint(v interface{}) (string, error)

func ToClusterID Uses

func ToClusterID(v interface{}) (string, error)

func ToClusterStatus Uses

func ToClusterStatus(v interface{}) (v1alpha1.StatusCluster, error)

func ToCustomObject Uses

func ToCustomObject(v interface{}) (v1alpha1.KVMConfig, error)

func ToNodeCount Uses

func ToNodeCount(v interface{}) (int, error)

func ToPod Uses

func ToPod(v interface{}) (*corev1.Pod, error)

func ToVersionBundleVersion Uses

func ToVersionBundleVersion(v interface{}) (string, error)

func VMNumber Uses

func VMNumber(ID int) string

func VersionBundleVersion Uses

func VersionBundleVersion(customObject v1alpha1.KVMConfig) string

func VersionBundleVersionFromPod Uses

func VersionBundleVersionFromPod(pod *corev1.Pod) (string, error)

func WorkerCount Uses

func WorkerCount(customObject v1alpha1.KVMConfig) int

Package key imports 12 packages (graph) and is imported by 14 packages. Updated 2019-10-15. Refresh now. Tools for package owners.