Documentation ¶
Index ¶
- Constants
- Variables
- func Apply(ctx context.Context, opts *options.ApplyConfig) ([]api.Action, error)
- func CACert(ctx context.Context) *x509.Certificate
- func CAKey(ctx context.Context) *rsa.PrivateKey
- func CheckForUpdates(ctx context.Context, name string) (string, error)
- func CloudManagers() []string
- func ConvertClusterConfigFromV1beta1ToV1alpha3(conf *v1beta1.ClusterConfiguration) *v1alpha3.ClusterConfiguration
- func ConvertInitConfigFromV1bet1ToV1alpha3(conf *v1beta1.InitConfiguration) *v1alpha3.InitConfiguration
- func ConvertJoinConfigFromV1beta1ToV1alpha3(conf *v1beta1.JoinConfiguration) *v1alpha3.JoinConfiguration
- func Create(ctx context.Context, cluster *api.Cluster) (*api.Cluster, error)
- func CreateAdminCertificate(ctx context.Context) (*x509.Certificate, *rsa.PrivateKey, error)
- func CreateCACertificates(ctx context.Context, cluster *api.Cluster) (context.Context, error)
- func CreateCredentialSecret(ctx context.Context, client kubernetes.Interface, cluster *api.Cluster) error
- func CreateNodeGroup(ctx context.Context, cluster *api.Cluster, role, sku string, ...) error
- func CreateSSHKey(ctx context.Context, cluster *api.Cluster) (context.Context, error)
- func CreateValidKubeadmToken(kc kubernetes.Interface, duration time.Duration) (string, error)
- func Delete(ctx context.Context, name string) (*api.Cluster, error)
- func DeleteClusterInstance(ctx context.Context, cluster *api.Cluster, node string) error
- func DeleteClusterInstance2(kc kubernetes.Interface, node string) error
- func DeleteDyanamicVolumes(client kubernetes.Interface) error
- func DeleteLoadBalancers(client kubernetes.Interface) error
- func DeleteNG(ctx context.Context, clusterName, nodeGroupName string) error
- func Env(ctx context.Context) _env.Environment
- func ExecuteSSHCommand(name string, arg []string, stdIn io.Reader) (string, error)
- func ExecuteTCPCommand(command, addr string, config *ssh.ClientConfig) (string, error)
- func FetchFromURL(url string) (string, error)
- func FindMasterNodeGroup(nodeGroups []*api.NodeGroup) (*api.NodeGroup, error)
- func FrontProxyCACert(ctx context.Context) *x509.Certificate
- func FrontProxyCAKey(ctx context.Context) *rsa.PrivateKey
- func Get(ctx context.Context, name string) (*api.Cluster, error)
- func GetAdminCertificate(ctx context.Context, cluster *api.Cluster) (*x509.Certificate, *rsa.PrivateKey, error)
- func GetAdminConfig(ctx context.Context, cluster *api.Cluster) (*api.KubeConfig, error)
- func GetClusterIstance(ctx context.Context, cluster *api.Cluster, nodeGroup string) ([]string, error)
- func GetClusterIstance2(kc kubernetes.Interface, nodeGroup string) ([]string, error)
- func GetExistingContextVersion(ctx context.Context, cluster *api.Cluster, sku string) (int64, error)
- func GetExistingKubeadmToken(kc kubernetes.Interface, duration time.Duration) (string, error)
- func GetKubeadmToken() string
- func GetLatestKubeadmVerson() (string, error)
- func GetSSHConfig(ctx context.Context, nodeName string, cluster *api.Cluster) (*api.SSHConfig, error)
- func HasNoUserApps(client kubernetes.Interface) (bool, error)
- func IsCloudManager(name string) bool
- func KubernetesReleaseVersion(version string) (string, error)
- func List(ctx context.Context, opts metav1.ListOptions) ([]*api.Cluster, error)
- func LoadCACertificates(ctx context.Context, cluster *api.Cluster) (context.Context, error)
- func LoadSSHKey(ctx context.Context, cluster *api.Cluster) (context.Context, error)
- func Logger(ctx context.Context) api.Logger
- func Mutator(ctx context.Context, cluster *api.Cluster, expectedInstance Instance, ...) (int64, error)
- func NameGenerator(ctx context.Context) api.NameGenerator
- func NewAdminClient(ctx context.Context, cluster *api.Cluster) (kubernetes.Interface, error)
- func NewContext(parent context.Context, cfg *api.PharmerConfig, env _env.Environment) context.Context
- func NewStoreProvider(ctx context.Context, cfg *api.PharmerConfig) store.Interface
- func NewStringReader(ss []string) io.Reader
- func NodeCount(nodeGroups []*api.NodeGroup) int64
- func ParseToken(s string) (string, string, error)
- func RandStringRunes(n int) string
- func ReadFileAs(path string, obj interface{}) error
- func RegisterCloudManager(name string, cloud Factory)
- func SSHKey(ctx context.Context) *ssh.SSHKey
- func Store(ctx context.Context) store.Interface
- func UpdateSpec(ctx context.Context, cluster *api.Cluster) (*api.Cluster, error)
- func WaitForReadyMaster(ctx context.Context, client kubernetes.Interface) error
- func WaitForReadyMasterVersion(ctx context.Context, client kubernetes.Interface, ...) error
- func WithEnv(parent context.Context, v _env.Environment) context.Context
- func WithLogger(parent context.Context, v api.Logger) context.Context
- func WithNameGenerator(parent context.Context, v api.NameGenerator) context.Context
- func WithStore(parent context.Context, v store.Interface) context.Context
- type Factory
- type GenericNodeGroupManager
- type GenericUpgradeManager
- func (upm *GenericUpgradeManager) Apply(dryRun bool) (acts []api.Action, err error)
- func (upm *GenericUpgradeManager) ExecuteSSHCommand(command string, node *core.Node) (string, error)
- func (upm *GenericUpgradeManager) GetAvailableUpgrades() ([]*api.Upgrade, error)
- func (upm *GenericUpgradeManager) MasterUpgrade() error
- func (upm *GenericUpgradeManager) NodeGroupUpgrade(ng *api.NodeGroup) (err error)
- func (upm *GenericUpgradeManager) PrintAvailableUpgrades(upgrades []*api.Upgrade)
- type GroupStats
- type HookFunc
- type Instance
- type InstanceController
- type InstanceManager
- type InstanceType
- type Interface
- type KubeVersionGetter
- func (g *KubeVersionGetter) ClusterVersion() (string, *versionutil.Version, error)
- func (g *KubeVersionGetter) DeployedDNSAddon() (string, string, error)
- func (g *KubeVersionGetter) IsUpgradeRequested() (bool, error)
- func (g *KubeVersionGetter) KubeadmVersion() (string, *versionutil.Version, error)
- func (g *KubeVersionGetter) KubeletVersions() (map[string]uint32, error)
- func (g *KubeVersionGetter) VersionFromCILabel(ciVersionLabel, description string) (string, *versionutil.Version, error)
- type NodeDrain
- type NodeGroupManager
- type ProviderKubeConfig
- type SSHGetter
- type StringWriter
- type TemplateData
- func (td TemplateData) ClusterConfigurationYAML() (string, error)
- func (td TemplateData) ForceKubeadmResetFlag() (string, error)
- func (td TemplateData) InitConfigurationYAML() (string, error)
- func (td TemplateData) IsKubeadmV1Alpha3() bool
- func (td TemplateData) IsVersionLessThan(currentVersion string) bool
- func (td TemplateData) IsVersionLessThan1_11() bool
- func (td TemplateData) IsVersionLessThan1_13() bool
- func (td TemplateData) JoinConfigurationYAML() (string, error)
- func (td TemplateData) KubeletExtraArgsStr() string
- func (td TemplateData) PackageList() (string, error)
- func (td TemplateData) PrekVersion() (string, error)
- func (td TemplateData) UseForkedKubeadm_1_8_3() bool
- func (td TemplateData) UseKubeProxy1_11_0() bool
- type UpgradeManager
- type VersionGetter
Constants ¶
const ( RetryInterval = 5 * time.Second RetryTimeout = 15 * time.Minute )
Variables ¶
var ( ErrNotFound = errors.New("node not found") ErrNotImplemented = errors.New("not implemented") ErrNoMasterNG = errors.New("cluster has no master NodeGroup") )
var ( // TokenIDRegexpString defines token's id regular expression pattern TokenIDRegexpString = "^([a-z0-9]{6})$" // TokenIDRegexp is a compiled regular expression of TokenIDRegexpString TokenIDRegexp = regexp.MustCompile(TokenIDRegexpString) // TokenRegexpString defines id.secret regular expression pattern TokenRegexpString = "^([a-z0-9]{6})\\.([a-z0-9]{16})$" // TokenRegexp is a compiled regular expression of TokenRegexpString TokenRegexp = regexp.MustCompile(TokenRegexpString) )
var DefaultWriter = &StringWriter{ data: make([]byte, 0), }
var (
StartupScriptTemplate = template.Must(template.New(api.RoleMaster).Parse(`
{{- template "init-script" }}
# kill apt processes (E: Unable to lock directory /var/lib/apt/lists/)
kill $(ps aux | grep '[a]pt' | awk '{print $2}') || true
{{ template "init-os" . }}
# https://major.io/2016/05/05/preventing-ubuntu-16-04-starting-daemons-package-installed/
echo -e '#!/bin/bash\nexit 101' > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
apt-get update -y
apt-get install -y apt-transport-https curl ca-certificates software-properties-common tzdata
curl -fsSL --retry 5 https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo 'deb http://apt.kubernetes.io/ kubernetes-xenial main' > /etc/apt/sources.list.d/kubernetes.list
exec_until_success 'add-apt-repository -y ppa:gluster/glusterfs-3.10'
apt-get update -y
exec_until_success 'apt-get install -y {{ .PackageList }}'
{{ if .UseForkedKubeadm_1_8_3 }}
curl -fsSL --retry 5 -o kubeadm https://github.com/appscode/kubernetes/releases/download/v1.8.3/kubeadm \
&& chmod +x kubeadm \
&& mv kubeadm /usr/bin/
{{ end }}
curl -fsSL --retry 5 -o pre-k https://cdn.appscode.com/binaries/pre-k/{{ .PrekVersion }}/pre-k-linux-amd64 \
&& chmod +x pre-k \
&& mv pre-k /usr/bin/
timedatectl set-timezone Etc/UTC
{{ template "prepare-host" . }}
{{ template "mount-master-pd" . }}
rm -rf /usr/sbin/policy-rc.d
systemctl enable docker kubelet nfs-utils
systemctl start docker kubelet nfs-utils
kubeadm reset {{ .ForceKubeadmResetFlag }}
{{ template "setup-certs" . }}
mkdir -p /etc/kubernetes/ccm
{{ if .CloudConfig }}
cat > /etc/kubernetes/ccm/cloud-config <<EOF
{{ .CloudConfig }}
EOF
{{ end }}
mkdir -p /etc/kubernetes/kubeadm
{{ template "pre-k" . }}
kubeadm init --config=/etc/kubernetes/kubeadm/config.yaml --skip-token-print
{{ if .UseKubeProxy1_11_0 }}
kubectl apply -f https://raw.githubusercontent.com/pharmer/addons/release-1.11/kube-proxy/v1.11.0/kube-proxy.yaml \
--kubeconfig /etc/kubernetes/admin.conf
{{ end }}
{{ if eq .NetworkProvider "flannel" }}
{{ template "flannel" . }}
{{ else if eq .NetworkProvider "calico" }}
{{ template "calico" . }}
{{ else if eq .NetworkProvider "weavenet" }}
{{ template "weavenet" . }}
{{ end }}
kubectl apply \
-f https://raw.githubusercontent.com/pharmer/addons/release-1.11/kubeadm-probe/installer.yaml \
--kubeconfig /etc/kubernetes/admin.conf
mkdir -p ~/.kube
sudo cp -i /etc/kubernetes/admin.conf ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config
{{ if .ExternalProvider }}
{{ template "ccm" . }}
{{ template "install-storage-plugin" . }}
{{end}}
{{ template "prepare-cluster" . }}
`))
)
Functions ¶
func CloudManagers ¶
func CloudManagers() []string
CloudManagers returns the name of all registered cloud providers in a string slice
func ConvertClusterConfigFromV1beta1ToV1alpha3 ¶
func ConvertClusterConfigFromV1beta1ToV1alpha3(conf *v1beta1.ClusterConfiguration) *v1alpha3.ClusterConfiguration
func ConvertInitConfigFromV1bet1ToV1alpha3 ¶
func ConvertInitConfigFromV1bet1ToV1alpha3(conf *v1beta1.InitConfiguration) *v1alpha3.InitConfiguration
func ConvertJoinConfigFromV1beta1ToV1alpha3 ¶
func ConvertJoinConfigFromV1beta1ToV1alpha3(conf *v1beta1.JoinConfiguration) *v1alpha3.JoinConfiguration
func CreateAdminCertificate ¶
func CreateAdminCertificate(ctx context.Context) (*x509.Certificate, *rsa.PrivateKey, error)
func CreateCACertificates ¶
func CreateCredentialSecret ¶
func CreateNodeGroup ¶
func CreateSSHKey ¶
func CreateValidKubeadmToken ¶
func DeleteClusterInstance ¶
Deprecated
func DeleteClusterInstance2 ¶
func DeleteClusterInstance2(kc kubernetes.Interface, node string) error
func DeleteDyanamicVolumes ¶
func DeleteDyanamicVolumes(client kubernetes.Interface) error
func DeleteLoadBalancers ¶
func DeleteLoadBalancers(client kubernetes.Interface) error
func ExecuteSSHCommand ¶
func ExecuteTCPCommand ¶
func ExecuteTCPCommand(command, addr string, config *ssh.ClientConfig) (string, error)
func FetchFromURL ¶
Internal helper: return content of URL
func FindMasterNodeGroup ¶
func FrontProxyCACert ¶
func FrontProxyCACert(ctx context.Context) *x509.Certificate
func FrontProxyCAKey ¶
func FrontProxyCAKey(ctx context.Context) *rsa.PrivateKey
func GetAdminCertificate ¶
func GetAdminCertificate(ctx context.Context, cluster *api.Cluster) (*x509.Certificate, *rsa.PrivateKey, error)
func GetAdminConfig ¶
func GetClusterIstance ¶
func GetClusterIstance(ctx context.Context, cluster *api.Cluster, nodeGroup string) ([]string, error)
Deprecated
func GetClusterIstance2 ¶
func GetClusterIstance2(kc kubernetes.Interface, nodeGroup string) ([]string, error)
func GetExistingKubeadmToken ¶
func GetKubeadmToken ¶
func GetKubeadmToken() string
func GetLatestKubeadmVerson ¶
func GetSSHConfig ¶
func HasNoUserApps ¶
func HasNoUserApps(client kubernetes.Interface) (bool, error)
func IsCloudManager ¶
IsCloudManager returns true if name corresponds to an already registered cloud provider.
func KubernetesReleaseVersion ¶
KubernetesReleaseVersion is helper function that can fetch available version information from release servers based on label names, like "stable" or "latest".
If argument is already semantic version string, it will return same string.
In case of labels, it tries to fetch from release servers and then return actual semantic version.
Available names on release servers:
stable (latest stable release) stable-1 (latest stable release in 1.x) stable-1.0 (and similarly 1.1, 1.2, 1.3, ...) latest (latest release, including alpha/beta) latest-1 (latest release in 1.x, including alpha/beta) latest-1.0 (and similarly 1.1, 1.2, 1.3, ...)
func LoadCACertificates ¶
func LoadSSHKey ¶
func NameGenerator ¶
func NameGenerator(ctx context.Context) api.NameGenerator
func NewAdminClient ¶
WARNING: Returned KubeClient uses admin client cert. This should only be used for cluster provisioning operations.
func NewContext ¶
func NewContext(parent context.Context, cfg *api.PharmerConfig, env _env.Environment) context.Context
func NewStoreProvider ¶
func NewStringReader ¶
func RandStringRunes ¶
func ReadFileAs ¶
func RegisterCloudManager ¶
RegisterCloudManager registers a cloud.Factory by name. This is expected to happen during app startup.
func WaitForReadyMaster ¶
func WaitForReadyMaster(ctx context.Context, client kubernetes.Interface) error
func WithNameGenerator ¶
Types ¶
type Factory ¶
Factory is a function that returns a cloud.ClusterManager. The config parameter provides an io.Reader handler to the factory in order to load specific configurations. If no configuration is provided the parameter is nil.
type GenericNodeGroupManager ¶
type GenericNodeGroupManager struct {
// contains filtered or unexported fields
}
func (*GenericNodeGroupManager) AddNodes ¶
func (igm *GenericNodeGroupManager) AddNodes(count int64) error
func (*GenericNodeGroupManager) Apply ¶
func (igm *GenericNodeGroupManager) Apply(dryRun bool) (acts []api.Action, err error)
func (*GenericNodeGroupManager) DeleteNodes ¶
func (igm *GenericNodeGroupManager) DeleteNodes(nodes []core.Node) error
type GenericUpgradeManager ¶
type GenericUpgradeManager struct {
// contains filtered or unexported fields
}
func (*GenericUpgradeManager) Apply ¶
func (upm *GenericUpgradeManager) Apply(dryRun bool) (acts []api.Action, err error)
func (*GenericUpgradeManager) ExecuteSSHCommand ¶
func (*GenericUpgradeManager) GetAvailableUpgrades ¶
func (upm *GenericUpgradeManager) GetAvailableUpgrades() ([]*api.Upgrade, error)
func (*GenericUpgradeManager) MasterUpgrade ¶
func (upm *GenericUpgradeManager) MasterUpgrade() error
func (*GenericUpgradeManager) NodeGroupUpgrade ¶
func (upm *GenericUpgradeManager) NodeGroupUpgrade(ng *api.NodeGroup) (err error)
func (*GenericUpgradeManager) PrintAvailableUpgrades ¶
func (upm *GenericUpgradeManager) PrintAvailableUpgrades(upgrades []*api.Upgrade)
printAvailableUpgrades prints a UX-friendly overview of what versions are available to upgrade to TODO look into columnize or some other formatter when time permits instead of using the tabwriter
type GroupStats ¶
type GroupStats struct { Count int64 Extra interface{} }
type Instance ¶
type Instance struct { Type InstanceType Stats GroupStats }
type InstanceController ¶
type InstanceController struct {
Client kubernetes.Interface
}
type InstanceManager ¶
type InstanceType ¶
type InstanceType struct { ContextVersion int64 Sku string SpotInstance bool Master bool DiskType string DiskSize int64 }
func (*InstanceType) String ¶
func (t *InstanceType) String() string
type Interface ¶
type Interface interface { SSHGetter ProviderKubeConfig GetDefaultNodeSpec(cluster *api.Cluster, sku string) (api.NodeSpec, error) SetDefaults(in *api.Cluster) error Apply(in *api.Cluster, dryRun bool) ([]api.Action, error) IsValid(cluster *api.Cluster) (bool, error) }
func GetCloudManager ¶
GetCloudManager creates an instance of the named cloud provider, or nil if the name is not known. The error return is only used if the named provider was known but failed to initialize. The config parameter specifies the io.Reader handler of the configuration file for the cloud provider, or nil for no configuation.
type KubeVersionGetter ¶
type KubeVersionGetter struct {
// contains filtered or unexported fields
}
KubeVersionGetter handles the version-fetching mechanism from external sources
func (*KubeVersionGetter) ClusterVersion ¶
func (g *KubeVersionGetter) ClusterVersion() (string, *versionutil.Version, error)
ClusterVersion gets API server version
func (*KubeVersionGetter) DeployedDNSAddon ¶
func (g *KubeVersionGetter) DeployedDNSAddon() (string, string, error)
DeployedDNSAddon returns the type of DNS addon currently deployed
func (*KubeVersionGetter) IsUpgradeRequested ¶
func (g *KubeVersionGetter) IsUpgradeRequested() (bool, error)
IsUpgradeRequested returns true if cluster.spec.kubernetesVersion is different from version reported from cluster.
func (*KubeVersionGetter) KubeadmVersion ¶
func (g *KubeVersionGetter) KubeadmVersion() (string, *versionutil.Version, error)
MasterKubeadmVersion gets kubeadm version
func (*KubeVersionGetter) KubeletVersions ¶
func (g *KubeVersionGetter) KubeletVersions() (map[string]uint32, error)
KubeletVersions gets the versions of the kubelets in the cluster
func (*KubeVersionGetter) VersionFromCILabel ¶
func (g *KubeVersionGetter) VersionFromCILabel(ciVersionLabel, description string) (string, *versionutil.Version, error)
VersionFromCILabel resolves a version label like "latest" or "stable" to an actual version using the public Kubernetes CI uploads
type NodeDrain ¶
type NodeDrain struct { Node string // contains filtered or unexported fields }
func NewNodeDrain ¶
func (*NodeDrain) DeleteNode ¶
type NodeGroupManager ¶
type NodeGroupManager interface { Apply(dryRun bool) (acts []api.Action, err error) AddNodes(count int64) error DeleteNodes(nodes []core.Node) error }
func NewNodeGroupManager ¶
func NewNodeGroupManager(ctx context.Context, ng *api.NodeGroup, im InstanceManager, kc kubernetes.Interface, cluster *api.Cluster, token string, initHook HookFunc, gcHook HookFunc) NodeGroupManager
type ProviderKubeConfig ¶
type ProviderKubeConfig interface {
GetKubeConfig(cluster *api.Cluster) (*api.KubeConfig, error)
}
type StringWriter ¶
type StringWriter struct {
// contains filtered or unexported fields
}
func (*StringWriter) Flush ¶
func (s *StringWriter) Flush()
func (*StringWriter) Output ¶
func (s *StringWriter) Output() string
type TemplateData ¶
type TemplateData struct { ClusterName string KubernetesVersion string KubeadmToken string CloudCredential map[string]string CAHash string CAKey string FrontProxyKey string APIServerAddress string NetworkProvider string CloudConfig string Provider string NodeName string ExternalProvider bool InitConfiguration *kubeadmapi.InitConfiguration ClusterConfiguration *kubeadmapi.ClusterConfiguration JoinConfiguration *kubeadmapi.JoinConfiguration KubeletExtraArgs map[string]string }
func (TemplateData) ClusterConfigurationYAML ¶
func (td TemplateData) ClusterConfigurationYAML() (string, error)
func (TemplateData) ForceKubeadmResetFlag ¶
func (td TemplateData) ForceKubeadmResetFlag() (string, error)
func (TemplateData) InitConfigurationYAML ¶
func (td TemplateData) InitConfigurationYAML() (string, error)
func (TemplateData) IsKubeadmV1Alpha3 ¶
func (td TemplateData) IsKubeadmV1Alpha3() bool
func (TemplateData) IsVersionLessThan ¶
func (td TemplateData) IsVersionLessThan(currentVersion string) bool
func (TemplateData) IsVersionLessThan1_11 ¶
func (td TemplateData) IsVersionLessThan1_11() bool
func (TemplateData) IsVersionLessThan1_13 ¶
func (td TemplateData) IsVersionLessThan1_13() bool
func (TemplateData) JoinConfigurationYAML ¶
func (td TemplateData) JoinConfigurationYAML() (string, error)
func (TemplateData) KubeletExtraArgsStr ¶
func (td TemplateData) KubeletExtraArgsStr() string
func (TemplateData) PackageList ¶
func (td TemplateData) PackageList() (string, error)
func (TemplateData) PrekVersion ¶
func (td TemplateData) PrekVersion() (string, error)
func (TemplateData) UseForkedKubeadm_1_8_3 ¶
func (td TemplateData) UseForkedKubeadm_1_8_3() bool
Forked kubeadm 1.8.x for: https://github.com/kubernetes/kubernetes/pull/49840
func (TemplateData) UseKubeProxy1_11_0 ¶
func (td TemplateData) UseKubeProxy1_11_0() bool
type UpgradeManager ¶
type UpgradeManager interface { GetAvailableUpgrades() ([]*api.Upgrade, error) PrintAvailableUpgrades([]*api.Upgrade) Apply(dryRun bool) ([]api.Action, error) MasterUpgrade() error NodeGroupUpgrade(ng *api.NodeGroup) error }
func NewUpgradeManager ¶
func NewUpgradeManager(ctx context.Context, ssh SSHGetter, kc kubernetes.Interface, cluster *api.Cluster) UpgradeManager
type VersionGetter ¶
type VersionGetter interface { // IsUpgradeRequested returns true if cluster.spec.kubernetesVersion is different from version reported from cluster. IsUpgradeRequested() (bool, error) // ClusterVersion should return the version of the cluster i.e. the API Server version ClusterVersion() (string, *versionutil.Version, error) // MasterKubeadmVersion should return the version of the kubeadm CLI KubeadmVersion() (string, *versionutil.Version, error) // GetKubeDNSVersion returns the right kube-dns version for a specific k8s version DeployedDNSAddon() (string, string, error) // VersionFromCILabel should resolve CI labels like `latest`, `stable`, `stable-1.8`, etc. to real versions VersionFromCILabel(string, string) (string, *versionutil.Version, error) // KubeletVersions should return a map with a version and a number that describes how many kubelets there are for that version KubeletVersions() (map[string]uint32, error) }
Easy to implement a fake variant of this interface for unit testing
func NewKubeVersionGetter ¶
func NewKubeVersionGetter(client kubernetes.Interface, cluster *api.Cluster) VersionGetter
NewKubeVersionGetter returns a new instance of KubeVersionGetter