Google Kubernetes Engine¶
MICO was developed with the Azure Kubernetes Service but is also tested with the Google Kubernetes Engine.
First steps¶
To connect to the cluster you need two command-line tools:
- kubectl: Install and Set Up kubectl
- Google Cloud SDK gcloud: Google Cloud SDK documentation
Initialization:
Use gcloud init
to get started and to create a new project (e.g. ust-mico
).
Check if the correct project is choosen:
gcloud config list
Set your default project:
gcloud config set project ust-mico
Set your default compute zone:
gcloud config set compute/zone europe-west3
Ensure that billing is enabled for the project: Learn how to enable billing.
Configure kubectl
to connect to the cluster (more information):
gcloud container clusters get-credentials ust-mico-cluster
If you use kubectl
to connect to multiple clusters, it’s useful to use multiple contexts.
To switch to the automatically created context of the MICO cluster, use
kubectl config use-context gke_ust-mico_europe-west3_ust-mico-cluster
Check the current context:
kubectl config current-context
Cluster details¶
Current cluster:
- VM: n1-standard-2 (2 vCPUs, 7.5 GB RAM)
- Nodes: 3 (1 per zone)
- OS Disk Size: 45 GB
- Location: westeurope
- Kubernetes version: 1.12.6
Cluster creation¶
Create cluster:
gcloud container --project "ust-mico" clusters create "ust-mico-cluster" --region "europe-west3" --cluster-version "1.12.6-gke.7" --machine-type "n1-standard-2" --num-nodes "1" --enable-cloud-logging --enable-cloud-monitoring --addons KubernetesDashboard --enable-autoupgrade --enable-autorepair --maintenance-window "02:00"
For more information see Creating a cluster.
Prerequisites for using Role-Based Access Control:
To be able to install MICO, it’s required to grant the user the ability to create roles in Kubernetes. This is a prerequisite to use use role-based access control on GKE. For more information see the GKE instructions.
Grant permission for the current user:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config list account --format "value(core.account)")
Cluster deletion¶
Delete cluster:
gcloud container --project "ust-mico" clusters delete "ust-mico-cluster"
Cluster management¶
Public Access¶
Create static IP address:
For a stable, public access to the MICO dashboard, a static IP address is recommended. This IP address with the name mico-dashboard-ip
was generated by:
gcloud compute addresses create mico-dashboard-ip --region europe-west3
Get the assigned IP address:
gcloud compute addresses describe mico-dashboard-ip --region europe-west3
Public static IP address: 35.246.187.4
Dashboard:
The dashboard of mico-admin
is accessible via http://35.246.187.4/dashboard.