Documentation ¶
Index ¶
- Constants
- Variables
- func AddFlags(flags *flag.FlagSet)
- func CreateKotsadmIDConfigMap(kotsadmID string) error
- func DeleteKotsadm(ctx context.Context, clientset *kubernetes.Clientset, namespace string, ...) error
- func FindKotsadm(clientset *kubernetes.Clientset, namespace string) (string, error)
- func FindKotsadmImage(namespace string) (string, error)
- func GenerateBootstrapToken(client kubernetes.Interface, ttl time.Duration) (string, error)
- func GetClientset() (*kubernetes.Clientset, error)
- func GetClusterConfig() (*rest.Config, error)
- func GetCurrentRules(deployOptions kotsadmtypes.DeployOptions, clientset *kubernetes.Clientset) ([]rbacv1.PolicyRule, error)
- func GetK8sVersion() (string, error)
- func GetKotsadmIDConfigMap() (*corev1.ConfigMap, error)
- func GetOpenShiftPodSecurityContext(kotsadmNamespace string) (*corev1.PodSecurityContext, error)
- func GetPodLogs(ctx context.Context, clientset kubernetes.Interface, pod *corev1.Pod, ...) ([]byte, error)
- func InitHelmCapabilities() error
- func IsKotsadmClusterScoped(ctx context.Context, clientset kubernetes.Interface, namespace string) bool
- func IsKotsadmIDConfigMapPresent() (bool, error)
- func IsOpenShift(clientset kubernetes.Interface) bool
- func IsPortAvailable(port int) bool
- func MergeEnvVars(desired []corev1.EnvVar, existing []corev1.EnvVar) []corev1.EnvVar
- func MergeInitContainers(desired []corev1.Container, existing []corev1.Container) []corev1.Container
- func OpenShiftVersion() (string, error)
- func PodsHaveTheSameOwner(pods []corev1.Pod) bool
- func PortForward(localPort int, remotePort int, namespace string, ...) (int, chan error, error)
- func ReadKustomizationFromFile(file string) (*kustomizetypes.Kustomization, error)
- func ScaleDownDeployment(ctx context.Context, clientset kubernetes.Interface, namespace string, ...) error
- func ServiceForward(clientset *kubernetes.Clientset, cfg *rest.Config, localPort int, ...) (chan struct{}, error)
- func UpdateKotsadmIDConfigMap(kotsadmID string) error
- func WaitForDeploymentReady(ctx context.Context, clientset kubernetes.Interface, namespace string, ...) error
- func WaitForKotsadm(clientset *kubernetes.Clientset, namespace string, ...) (string, error)
- func WaitForPod(ctx context.Context, clientset kubernetes.Interface, namespace string, ...) error
- func WaitForStatefulSetReady(ctx context.Context, clientset kubernetes.Interface, namespace string, ...) error
- func WriteKustomizationToFile(kustomization kustomizetypes.Kustomization, file string) error
Constants ¶
const (
KotsadmIDConfigMapName = "kotsadm-id"
)
Variables ¶
var (
ErrWaitForPodTimeout = errors.New("timeout waiting for pod")
)
Functions ¶
func DeleteKotsadm ¶
func FindKotsadm ¶
func FindKotsadm(clientset *kubernetes.Clientset, namespace string) (string, error)
func FindKotsadmImage ¶
func GenerateBootstrapToken ¶
GenerateBootstrapToken will generate a node join token for kubeadm. ttl defines the time to live for this token.
func GetClientset ¶
func GetClientset() (*kubernetes.Clientset, error)
func GetClusterConfig ¶
func GetCurrentRules ¶
func GetCurrentRules(deployOptions kotsadmtypes.DeployOptions, clientset *kubernetes.Clientset) ([]rbacv1.PolicyRule, error)
func GetK8sVersion ¶
func GetKotsadmIDConfigMap ¶
func GetOpenShiftPodSecurityContext ¶
func GetOpenShiftPodSecurityContext(kotsadmNamespace string) (*corev1.PodSecurityContext, error)
GetOpenShiftPodSecurityContext returns a PodSecurityContext object that has: RunAsUser set to the minimum value in the "openshift.io/sa.scc.uid-range" annotation. FSGroup set to the minimum value in the "openshift.io/sa.scc.supplemental-groups" annotation if exists, else falls back to the minimum value in the "openshift.io/sa.scc.uid-range" annotation.
func GetPodLogs ¶
func InitHelmCapabilities ¶
func InitHelmCapabilities() error
func IsKotsadmClusterScoped ¶
func IsKotsadmClusterScoped(ctx context.Context, clientset kubernetes.Interface, namespace string) bool
IsKotsadmClusterScoped will check if kotsadm has cluster scope access or not
func IsOpenShift ¶
func IsOpenShift(clientset kubernetes.Interface) bool
IsOpenShift returns true if the cluster is positively identified as being an openshift cluster
func IsPortAvailable ¶
func MergeEnvVars ¶
copy the env vars from the desired to existing. this could undo a change that the user had. we don't know which env vars we set and which are user edited. this method avoids deleting env vars that the user added, but doesn't handle edited vars
func MergeInitContainers ¶
func OpenShiftVersion ¶
func PodsHaveTheSameOwner ¶
func PortForward ¶
func PortForward(localPort int, remotePort int, namespace string, getPodName func() (string, error), pollForAdditionalPorts bool, stopCh <-chan struct{}, log *logger.CLILogger) (int, chan error, error)
PortForward starts a local port forward to a pod in the cluster if localport is set, it will attempt to use that port locally. always check the port number returned though, because a port conflict could cause a different port to be used
func ReadKustomizationFromFile ¶
func ReadKustomizationFromFile(file string) (*kustomizetypes.Kustomization, error)
func ScaleDownDeployment ¶
func ServiceForward ¶
func WaitForDeploymentReady ¶
func WaitForKotsadm ¶
func WaitForPod ¶
func WaitForStatefulSetReady ¶
func WriteKustomizationToFile ¶
func WriteKustomizationToFile(kustomization kustomizetypes.Kustomization, file string) error
Types ¶
This section is empty.