Documentation ¶
Index ¶
- Constants
- Variables
- func CertOrKeyExist(pkiPath, name string) bool
- func ControlPlaneReady(kubeconfig string) error
- func HasServerAuth(cert *x509.Certificate) bool
- func MasterNodesReady(kubeconfig string) error
- func NewCertAndKey(caCert *x509.Certificate, caKey *rsa.PrivateKey, config certutil.Config) (*x509.Certificate, *rsa.PrivateKey, error)
- func NewCertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)
- func TryLoadCertAndKeyFromDisk(pkiPath, name string) (*x509.Certificate, *rsa.PrivateKey, error)
- func TryLoadCertFromDisk(pkiPath, name string) (*x509.Certificate, error)
- func TryLoadKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, error)
- func TryLoadPrivatePublicKeyFromDisk(pkiPath, name string) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func WriteCert(pkiPath, name string, cert *x509.Certificate) error
- func WriteCertAndKey(pkiPath string, name string, cert *x509.Certificate, key *rsa.PrivateKey) error
- func WriteKey(pkiPath, name string, key *rsa.PrivateKey) error
- func WritePublicKey(pkiPath, name string, key *rsa.PublicKey) error
Constants ¶
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 ¶
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{} )
var MasterComponents = []string{KubeAPIServer, KubeControllerManager, KubeScheduler}
Functions ¶
func CertOrKeyExist ¶
CertOrKeyExist returns a boolean whether the cert or the key exists
func ControlPlaneReady ¶
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 ¶
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 ¶
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
Types ¶
This section is empty.