common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultAPIServerPort                = 6443
	DrainTimeout                        = 5 * time.Minute
	DrainGracePeriodSeconds             = -1
	DrainDeleteLocalData                = false
	DrainForce                          = false
	MasterRole                          = "master"
	NodeRole                            = "node"
	DefaultSSHPort                      = 22
	DefaultNamespace                    = "default"
	DefaultClusterName                  = "cctl-cluster"
	DefaultSSHCredentialSecretName      = "ssh-credential"
	DefaultCommonCASecretName           = "common-ca"
	DefaultEtcdCASecretName             = "etcd-ca"
	DefaultAPIServerCASecretName        = "apiserver-ca"
	DefaultFrontProxyCASecretName       = "front-proxy-ca"
	DefaultServiceAccountKeySecretName  = "serviceaccount-key"
	DefaultBootstrapTokenSecretName     = "bootstrap-token"
	SystemUUIDFile                      = "/sys/class/dmi/id/product_uuid"
	KubectlFile                         = "/opt/bin/kubectl"
	AdminKubeconfig                     = "/etc/kubernetes/admin.conf"
	KubeletKubeconfig                   = "/etc/kubernetes/kubelet.conf"
	DefaultNodeadmVersion               = "v0.3.0"
	DefaultEtcdadmVersion               = "v0.1.1"
	DefaultKubernetesVersion            = "1.12.8"
	DefaultCNIVersion                   = "v0.6.0"
	DefaultFlannelVersion               = "v0.10.0"
	DefaultKeepalivedVersion            = "v2.0.4"
	DefaultEtcdVersion                  = "v3.3.8"
	DockerKubeAPIServerNameFilter       = "name=k8s_kube-apiserver.*kube-system.*"
	DockerRunningStatusFilter           = "status=running"
	InstanceStatusAnnotationKey         = "instance-status"
	KubeAPIServer                       = "kube-apiserver"
	KubeControllerManager               = "kube-controller-manager"
	KubeScheduler                       = "kube-scheduler"
	KubeSystemNamespace                 = "kube-system"
	MinimumControlPlaneVersion          = "v1.11.0"
	TmpKubeConfigNamePrefix             = "kubeconfig"
	DefaultAdminConfigSecretName        = "admin-kubeconfig"
	DefaultAdminConfigSecretKey         = "data"
	KubeAPIServerServiceNodePortRange   = "80-32767"
	KubeControllerMgrPodEvictionTimeout = "20s"
	DashcamBundleBaseDir                = "/var/tmp"
	DashcamCommandPath                  = "/opt/bin/dashcam"
	SupportBundleFileNamePrefix         = "cctl-bundle"
	ClusterV1PrintTemplate              = `` /* 551-byte string literal not displayed */

	MachineV1PrintTemplate = `` /* 263-byte string literal not displayed */

	// LabelNodeRoleMaster specifies that a node is a master
	LabelNodeRoleMaster = "node-role.kubernetes.io/master"
)

Variables

View Source
var (
	// TODO(dlipovetsky) Move fields to configuration
	KubeletFailSwapOn   = false
	KubeletMaxPods      = int32(500)
	KubeletKubeAPIQPS   = int32(20)
	KubeletKubeAPIBurst = int32(40)
	KubeletEvictionHard = map[string]string{
		"memory.available": "600Mi",
		"nodefs.available": "10%",
	}
	KubeletFeatureGates = map[string]bool{
		"PodPriority": true,
	}
	DefaultKubeAPIServerExtraArgs         = map[string]string{}
	DefaultKubeControllerManagerExtraArgs = map[string]string{}
	DefaultKubeSchedulerExtraArgs         = map[string]string{}
)

Functions

func CertOrKeyExist

func CertOrKeyExist(pkiPath, name string) bool

CertOrKeyExist returns a boolean whether the cert or the key exists

func ControlPlaneReady

func ControlPlaneReady(kubeconfig string) error

ControlPlaneReady checks whether all master pods in the cluster are in the Ready state

func HasServerAuth

func HasServerAuth(cert *x509.Certificate) bool

HasServerAuth returns true if the given certificate is a ServerAuth

func MasterNodesReady

func MasterNodesReady(kubeconfig string) error

MasterNodesReady checks whether all master Nodes in the cluster are in the Ready state

func NewCertAndKey

func NewCertAndKey(caCert *x509.Certificate, caKey *rsa.PrivateKey, config certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)

NewCertAndKey creates new certificate and key by passing the certificate authority certificate and key

func NewCertificateAuthority

func NewCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)

NewCertificateAuthority creates new certificate and private key for the certificate authority

func TryLoadCertAndKeyFromDisk

func TryLoadCertAndKeyFromDisk(pkiPath, name string) (*x509.Certificate, *rsa.PrivateKey, error)

TryLoadCertAndKeyFromDisk tries to load a cert and a key from the disk and validates that they are valid

func TryLoadCertFromDisk

func TryLoadCertFromDisk(pkiPath, name string) (*x509.Certificate, error)

TryLoadCertFromDisk tries to load the cert from the disk and validates that it is valid

func TryLoadKeyFromDisk

func TryLoadKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, error)

TryLoadKeyFromDisk tries to load the key from the disk and validates that it is valid

func TryLoadPrivatePublicKeyFromDisk

func TryLoadPrivatePublicKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, *rsa.PublicKey, error)

TryLoadPrivatePublicKeyFromDisk tries to load the key from the disk and validates that it is valid

func WriteCert

func WriteCert(pkiPath, name string, cert *x509.Certificate) error

WriteCert stores the given certificate at the given location

func WriteCertAndKey

func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key *rsa.PrivateKey) error

WriteCertAndKey stores certificate and key at the specified location

func WriteKey

func WriteKey(pkiPath, name string, key *rsa.PrivateKey) error

WriteKey stores the given key at the given location

func WritePublicKey

func WritePublicKey(pkiPath, name string, key *rsa.PublicKey) error

WritePublicKey stores the given public key at the given location

Types

This section is empty.

Jump to

Keyboard shortcuts

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