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

package key

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


Package Files

error.go key.go spec.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 = 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"

    K8SEndpointUpdaterDocker = "quay.io/giantswarm/k8s-endpoint-updater:0.1.0"
    K8SKVMDockerImage        = "quay.io/giantswarm/k8s-kvm:0.2.0"
    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"
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 (
    KubernetesNetworkSetupDocker = "0.2.0"
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 ContainerDistro Uses

func ContainerDistro(release *releasev1alpha1.Release) (string, error)

func CreateK8sClientForTenantCluster Uses

func CreateK8sClientForTenantCluster(ctx context.Context, obj interface{}, logger micrologger.Logger, tenantCluster tenantcluster.Interface) (kubernetes.Interface, error)

CreateK8sClientForTenantCluster takes the context of the reconciled object and the provided logger and tenant cluster interface and creates a K8s client for the tenant cluster

func DefaultVersions Uses

func DefaultVersions() k8scloudconfig.Versions

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 IsInvalidMemoryConfigurationError Uses

func IsInvalidMemoryConfigurationError(err error) bool

func IsMissingAnnotationError Uses

func IsMissingAnnotationError(err error) bool

func IsMissingVersionError Uses

func IsMissingVersionError(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 NodeIsUnschedulable Uses

func NodeIsUnschedulable(node corev1.Node) bool

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 OperatorVersion Uses

func OperatorVersion(cr v1alpha1.KVMConfig) string

func PVCNames Uses

func PVCNames(customObject v1alpha1.KVMConfig) []string

func PodIsReady Uses

func PodIsReady(pod corev1.Pod) bool

PodIsReady examines the Status Conditions of a Pod and returns true if the PodReady Condition is true.

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 ToOperatorVersion Uses

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

func ToPod Uses

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

func VMNumber Uses

func VMNumber(ID int) string

func VersionBundleVersionFromPod Uses

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

func WorkerCount Uses

func WorkerCount(customObject v1alpha1.KVMConfig) int

type LabelsGetter Uses

type LabelsGetter interface {
    GetLabels() map[string]string

Package key imports 20 packages (graph) and is imported by 15 packages. Updated 2020-08-02. Refresh now. Tools for package owners.