cluster

package
v2.34.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeletServerCert = "/var/lib/kubelet/pki/kubelet-server-current.pem"
	KubeletClientCert = "/var/lib/kubelet/pki/kubelet-client-current.pem"

	AggregatorClientCert = "/etc/kubernetes/static-pod-resources/kube-apiserver-certs/configmaps/aggregator-client-ca/ca-bundle.crt"
)

Variables

This section is empty.

Functions

func AddProxyConfigToCluster

func AddProxyConfigToCluster(ctx context.Context, sshRunner *ssh.Runner, ocConfig oc.Config, proxy *httpproxy.ProxyConfig) error

func ApproveCSRAndWaitForCertsRenewal

func ApproveCSRAndWaitForCertsRenewal(ctx context.Context, sshRunner *ssh.Runner, ocConfig oc.Config, client, server bool) error

func CheckCertsValidity

func CheckCertsValidity(sshRunner *ssh.Runner) (map[string]bool, error)

func CheckProxySettingsForOperator

func CheckProxySettingsForOperator(ocConfig oc.Config, proxy *httpproxy.ProxyConfig, deployment, namespace string) (bool, error)

func DeleteMCOLeaderLease

func DeleteMCOLeaderLease(ctx context.Context, ocConfig oc.Config) error

func DeleteOpenshiftAPIServerPods

func DeleteOpenshiftAPIServerPods(ctx context.Context, ocConfig oc.Config) error

func EnsureClusterIDIsNotEmpty

func EnsureClusterIDIsNotEmpty(ctx context.Context, ocConfig oc.Config) error

func EnsureGeneratedClientCAPresentInTheCluster

func EnsureGeneratedClientCAPresentInTheCluster(ctx context.Context, ocConfig oc.Config, sshRunner *ssh.Runner, selfSignedCACert *x509.Certificate, adminCert string) error

func EnsurePullSecretPresentInTheCluster

func EnsurePullSecretPresentInTheCluster(ctx context.Context, ocConfig oc.Config, pullSec PullSecretLoader) error

func EnsureSSHKeyPresentInTheCluster

func EnsureSSHKeyPresentInTheCluster(ctx context.Context, ocConfig oc.Config, sshPublicKeyPath string) error

func ForgetPullSecret

func ForgetPullSecret() error

func GenerateCockpitBearerToken

func GenerateCockpitBearerToken() string

func GenerateKubeAdminUserPassword

func GenerateKubeAdminUserPassword() error

GenerateKubeAdminUserPassword creates and put updated kubeadmin password to ~/.crc/machine/crc/kubeadmin-password

func GenerateRandomPasswordHash

func GenerateRandomPasswordHash(length int) (string, error)

generateRandomPasswordHash generates a hash of a random ASCII password 5char-5char-5char-5char Copied from openshift/installer https://github.com/openshift/installer/blob/master/pkg/asset/password/password.go

func GetCPUUsage

func GetCPUUsage(sshRunner *ssh.Runner) ([]int64, error)

GetCPUUsage return CPU usage array, index correspond to CPU number, value is load % (values between 0 nad 100)

func GetKubeadminPassword

func GetKubeadminPassword() (string, error)

func GetRAMUsage

func GetRAMUsage(sshRunner *ssh.Runner) (int64, int64, error)

GetRAMUsage return RAM size and RAM usage in bytes

func GetRootPartitionUsage

func GetRootPartitionUsage(sshRunner *ssh.Runner) (int64, int64, error)

Return size of disk, used space in bytes and the mountpoint

func RemoveOldRenderedMachineConfig

func RemoveOldRenderedMachineConfig(ocConfig oc.Config) error

func RemovePullSecretFromCluster

func RemovePullSecretFromCluster(ctx context.Context, ocConfig oc.Config, sshRunner *ssh.Runner) error

func StartMonitoring

func StartMonitoring(ocConfig oc.Config) error

func StoreInKeyring

func StoreInKeyring(pullSecret string) error

func UpdateKubeAdminUserPassword

func UpdateKubeAdminUserPassword(ctx context.Context, ocConfig oc.Config, newPassword string) error

UpdateKubeAdminUserPassword updates the htpasswd secret

func WaitForAPIServer

func WaitForAPIServer(ctx context.Context, ocConfig oc.Config) error

func WaitForClusterStable

func WaitForClusterStable(ctx context.Context, ip string, kubeconfigFilePath string, proxy *httpproxy.ProxyConfig) error

WaitForClusterStable checks that the cluster is running a number of consecutive times

func WaitForOpenshiftResource

func WaitForOpenshiftResource(ctx context.Context, ocConfig oc.Config, resource string) error

func WaitForPullSecretPresentOnInstanceDisk

func WaitForPullSecretPresentOnInstanceDisk(ctx context.Context, sshRunner *ssh.Runner) error

func WaitForRequestHeaderClientCaFile

func WaitForRequestHeaderClientCaFile(ctx context.Context, sshRunner *ssh.Runner) error

Types

type PullSecretLoader

type PullSecretLoader interface {
	Value() (string, error)
}

func NewInteractivePullSecretLoader

func NewInteractivePullSecretLoader(config crcConfig.Storage) PullSecretLoader

func NewNonInteractivePullSecretLoader

func NewNonInteractivePullSecretLoader(config crcConfig.Storage, path string) PullSecretLoader

type PullSecretMemoizer

type PullSecretMemoizer struct {
	Getter PullSecretLoader
	// contains filtered or unexported fields
}

func (*PullSecretMemoizer) Value

func (p *PullSecretMemoizer) Value() (string, error)

type Status

type Status struct {
	Available   bool
	Degraded    bool
	Progressing bool
	Disabled    bool
	// contains filtered or unexported fields
}

https://github.com/openshift/cluster-version-operator/blob/master/docs/dev/clusteroperator.md#what-should-an-operator-report-with-clusteroperator-custom-resource

func GetClusterNodeStatus

func GetClusterNodeStatus(ctx context.Context, ip string, kubeconfigFilePath string) (*Status, error)

func GetClusterOperatorsStatus

func GetClusterOperatorsStatus(ctx context.Context, ip string, kubeconfigFilePath string) (*Status, error)

func (*Status) IsReady

func (status *Status) IsReady() bool

func (*Status) String

func (status *Status) String() string

Jump to

Keyboard shortcuts

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