Documentation ¶
Index ¶
- Constants
- Variables
- func CreateApiServerAndController() error
- func CreateDefaultStorageClass() error
- func CreateExtApiServerRoleBinding() error
- func CreateIngressController(project string, clusterName string) error
- type GCEClient
- func (gce *GCEClient) Create(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error
- func (gce *GCEClient) CreateIngressControllerServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
- func (gce *GCEClient) CreateMachineController(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine, ...) error
- func (gce *GCEClient) CreateMachineControllerServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
- func (gce *GCEClient) CreateMasterNodeServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
- func (gce *GCEClient) CreateWorkerNodeServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
- func (gce *GCEClient) Delete(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error
- func (gce *GCEClient) DeleteIngressControllerServiceAccount(cluster *clusterv1.Cluster, machines []*clusterv1.Machine) error
- func (gce *GCEClient) DeleteMachineControllerServiceAccount(cluster *clusterv1.Cluster, machines []*clusterv1.Machine) error
- func (gce *GCEClient) DeleteMasterNodeServiceAccount(cluster *clusterv1.Cluster, machines []*clusterv1.Machine) error
- func (gce *GCEClient) DeleteWorkerNodeServiceAccount(cluster *clusterv1.Cluster, machines []*clusterv1.Machine) error
- func (gce *GCEClient) Exists(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (bool, error)
- func (gce *GCEClient) GetDefaultServiceAccountForMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) string
- func (gce *GCEClient) GetIP(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (string, error)
- func (gce *GCEClient) GetKubeConfig(cluster *clusterv1.Cluster, master *clusterv1.Machine) (string, error)
- func (gce *GCEClient) PostCreate(cluster *clusterv1.Cluster, machines []*clusterv1.Machine) error
- func (gce *GCEClient) PostDelete(cluster *clusterv1.Cluster, machines []*clusterv1.Machine) error
- func (gce *GCEClient) ProvisionClusterDependencies(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
- func (gce *GCEClient) Update(cluster *clusterv1.Cluster, goalMachine *clusterv1.Machine) error
- type GCEClientComputeService
- type GCEClientKubeadm
- type GCEClientMachineSetupConfigGetter
- type MachineActuatorParams
- type SshCreds
Constants ¶
View Source
const ( ProjectAnnotationKey = "gcp-project" ZoneAnnotationKey = "gcp-zone" NameAnnotationKey = "gcp-name" BootstrapLabelKey = "boostrap" // This file is a yaml that will be used to create the machine-setup configmap on the machine controller. // It contains the supported machine configurations along with the startup scripts and OS image paths that correspond to each supported configuration. MachineSetupConfigsFilename = "machine_setup_configs.yaml" )
View Source
const ( MasterNodeServiceAccountPrefix = "k8s-master" WorkerNodeServiceAccountPrefix = "k8s-worker" IngressControllerServiceAccountPrefix = "k8s-ingress-controller" MachineControllerServiceAccountPrefix = "k8s-machine-controller" IngressControllerSecret = "glbc-gcp-key" MachineControllerSecret = "machine-controller-credential" ClusterAnnotationPrefix = "gce.clusterapi.k8s.io/service-account-" )
View Source
const ( MachineControllerSshKeySecret = "machine-controller-sshkeys" // Arbitrary name used for SSH. SshUser = "clusterapi" SshKeyFile = "clusterapi-key" SshKeyFilePublic = SshKeyFile + ".pub" SshKeyFilePublicGcloud = SshKeyFilePublic + ".gcloud" )
View Source
const InstanceStatusAnnotationKey = "instance-status"
Variables ¶
View Source
var ( MasterNodeRoles = []string{ "compute.instanceAdmin", "compute.networkAdmin", "compute.securityAdmin", "compute.viewer", "iam.serviceAccountUser", "storage.admin", "storage.objectViewer", } WorkerNodeRoles = []string{} IngressControllerRoles = []string{ "compute.instanceAdmin.v1", "compute.networkAdmin", "compute.securityAdmin", "iam.serviceAccountActor", } MachineControllerRoles = []string{ "compute.instanceAdmin.v1", "iam.serviceAccountActor", } )
Functions ¶
func CreateApiServerAndController ¶
func CreateApiServerAndController() error
func CreateDefaultStorageClass ¶
func CreateDefaultStorageClass() error
func CreateExtApiServerRoleBinding ¶
func CreateExtApiServerRoleBinding() error
TODO: We need to change this when we create dedicated service account for apiserver/controller pod.
func CreateIngressController ¶
Types ¶
type GCEClient ¶
type GCEClient struct {
// contains filtered or unexported fields
}
func NewMachineActuator ¶
func NewMachineActuator(params MachineActuatorParams) (*GCEClient, error)
func (*GCEClient) CreateIngressControllerServiceAccount ¶
func (gce *GCEClient) CreateIngressControllerServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
Creates a GCP service account for the ingress controller
func (*GCEClient) CreateMachineController ¶
func (*GCEClient) CreateMachineControllerServiceAccount ¶
func (gce *GCEClient) CreateMachineControllerServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
Creates a GCP service account for the machine controller, granted the permissions to manage compute instances, and stores its credentials as a Kubernetes secret.
func (*GCEClient) CreateMasterNodeServiceAccount ¶
func (gce *GCEClient) CreateMasterNodeServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
Creates a GCP service account for the master node, granted permissions that allow the control plane to provision disks and networking resources
func (*GCEClient) CreateWorkerNodeServiceAccount ¶
func (gce *GCEClient) CreateWorkerNodeServiceAccount(cluster *clusterv1.Cluster, initialMachines []*clusterv1.Machine) error
Creates a GCP service account for the worker node
func (*GCEClient) DeleteIngressControllerServiceAccount ¶
func (*GCEClient) DeleteMachineControllerServiceAccount ¶
func (*GCEClient) DeleteMasterNodeServiceAccount ¶
func (*GCEClient) DeleteWorkerNodeServiceAccount ¶
func (*GCEClient) GetDefaultServiceAccountForMachine ¶
func (gce *GCEClient) GetDefaultServiceAccountForMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) string
Returns the email address of the service account that should be used as the default service account for this machine
func (*GCEClient) GetKubeConfig ¶
func (*GCEClient) PostCreate ¶
func (*GCEClient) PostDelete ¶
func (*GCEClient) ProvisionClusterDependencies ¶
type GCEClientComputeService ¶
type GCEClientComputeService interface { ImagesGet(project string, image string) (*compute.Image, error) ImagesGetFromFamily(project string, family string) (*compute.Image, error) InstancesDelete(project string, zone string, targetInstance string) (*compute.Operation, error) InstancesGet(project string, zone string, instance string) (*compute.Instance, error) InstancesInsert(project string, zone string, instance *compute.Instance) (*compute.Operation, error) ZoneOperationsGet(project string, zone string, operation string) (*compute.Operation, error) }
type GCEClientKubeadm ¶
type GCEClientKubeadm interface {
TokenCreate(params kubeadm.TokenCreateParams) (string, error)
}
type GCEClientMachineSetupConfigGetter ¶
type GCEClientMachineSetupConfigGetter interface {
GetMachineSetupConfig() (machinesetup.MachineSetupConfig, error)
}
type MachineActuatorParams ¶
type MachineActuatorParams struct { CertificateAuthority *cert.CertificateAuthority ComputeService GCEClientComputeService Kubeadm GCEClientKubeadm V1Alpha1Client client.ClusterV1alpha1Interface MachineSetupConfigGetter GCEClientMachineSetupConfigGetter }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.