Documentation
¶
Index ¶
Constants ¶
View Source
const ( CRoleKind = "ClusterRole" CRoleRef = "cluster-admin" DefaultRequeueInterval = 10 * time.Minute ServiceAccountName = "greenhouse" )
Variables ¶
This section is empty.
Functions ¶
func GenerateNewClientKubeConfig ¶
func GenerateNewClientKubeConfig(restConfigGetter *clientutil.RestClientGetter, bearerToken string, cluster *greenhousev1alpha1.Cluster) ([]byte, error)
GenerateNewClientKubeConfig generates a kubeconfig for the client to access the cluster from REST config coming from the secret
func NewServiceAccount ¶
func NewServiceAccount(name, namespace string) *corev1.ServiceAccount
Types ¶
type KubeConfigHelper ¶
type KubeConfigHelper struct { Host string CAData []byte BearerToken string Username string Namespace string TLSServerName string ProxyURL string ClientCertData []byte ClientKeyData []byte }
func (*KubeConfigHelper) RestConfigToAPIConfig ¶
func (kubeconfig *KubeConfigHelper) RestConfigToAPIConfig(clusterName string) clientcmdapi.Config
RestConfigToAPIConfig converts a rest config to a clientcmdapi.Config
type TokenHelper ¶
type TokenHelper struct { InClusterClient client.Client RemoteClusterClient client.Client Proxy string RemoteClusterBearerTokenValidity time.Duration RenewRemoteClusterBearerTokenAfter time.Duration SecretType corev1.SecretType OIDCServiceAccount string }
func (*TokenHelper) GenerateTokenRequest ¶
func (t *TokenHelper) GenerateTokenRequest(ctx context.Context, restClientGetter *clientutil.RestClientGetter, cluster *greenhousev1alpha1.Cluster) (*authenticationv1.TokenRequest, error)
GenerateTokenRequest reconciles the service account token for the remote cluster and updates the secret containing the kubeconfig
Click to show internal directories.
Click to hide internal directories.