k8s

package
v0.0.0-...-baeb756 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRDAbspath string = "apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/memberships.hub.gke.io"
	CRAbspath         = "apis/hub.gke.io/v1/memberships/membership"
)

Absolute Kubernetes API paths of the exclusivity artifacts

Variables

This section is empty.

Functions

func CreateGCPCredsSecret

func CreateGCPCredsSecret(GCPSAKey string, namespace string) v1.Secret

CreateGCPCredsSecret creates a kubernetes secret with a GCP Service Account key

func DeleteArtifacts

func DeleteArtifacts(ctx context.Context, auth Auth) error

DeleteArtifacts deletes the CRD and CR manifests in the cluster

func GetK8sClusterUUID

func GetK8sClusterUUID(ctx context.Context, auth Auth) (string, error)

GetK8sClusterUUID returns the kube-system namespace UID

func GetMembershipCR

func GetMembershipCR(ctx context.Context, auth Auth) (string, error)

GetMembershipCR get the Membership CR

func GetMembershipCRD

func GetMembershipCRD(ctx context.Context, auth Auth) (string, error)

GetMembershipCRD get the Membership CRD

func InstallExclusivityManifests

func InstallExclusivityManifests(ctx context.Context, auth Auth, CRDManifest string, CRManifest string) error

InstallExclusivityManifests applies the CRD and CR manifests in the cluster This will either install or upgrade them if already present

func InstallOrUpdateGKEConnectAgent

func InstallOrUpdateGKEConnectAgent(ctx context.Context, auth Auth, manifestResponse ConnectManifestResponse, GCPSAKey string, namespace string) error

InstallOrUpdateGKEConnectAgent installs or update a gke-connect agent in a Kubernetes cluster TODO: try to simplify the whole thing using restMapper and dynamic client

func KubeClientSet

func KubeClientSet(auth Auth) (*kubernetes.Clientset, error)

KubeClientSet initializes the kubernetes API client

Types

type Auth

type Auth struct {
	KubeConfigFile string
	KubeContext    string
}

Auth contains authentication info for kubernetes

type ConnectAgentResource

type ConnectAgentResource struct {
	Type     ConnectAgentResourceType `json:"type"`
	Manifest string                   `json:"manifest"`
}

ConnectAgentResource is part of GenerateConnectManifestResponse

type ConnectAgentResourceType

type ConnectAgentResourceType struct {
	Kind       string `json:"kind"`
	APIVersion string `json:"apiVersion"`
}

ConnectAgentResourceType is part of ConnectAgentResource

type ConnectManifestResponse

type ConnectManifestResponse struct {
	Manifest []ConnectAgentResource `json:"manifest"`
}

ConnectManifestResponse contains the connect agent manifest response

Jump to

Keyboard shortcuts

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