Changes

Google Kubernetes Engine

2,348 bytes added, 00:41, 22 June 2019
no edit summary
=Regisztráció a Google Cloud Platform-ban=
https://console.cloud.google.com
Kubernetes Engine API aktiválása a projektben:
...
A baloldali fő menüben megjelent a Kubernetes Engine menüpont:
:[[File:ClipCapIt-190622-000203.PNG]]
=Google Cloud SDK installálása=
Install google cloud sdk:
 
# sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM
 
 
# dnf install google-cloud-sdk
# gcloud init
..
You must log in to continue. Would you like to log in (Y/n)?
...
browser login
 
# gcloud projects create adamproject1
Create in progress for [https://cloudresourcemanager.googleapis.com/v1/projects/adamproject1].
 
# gcloud projects list
PROJECT_ID NAME PROJECT_NUMBER
adamproject1 adamproject1 206600067398
 
 
# gcloud config set project adamproject1
 
- az új projektet hozzá kell rendeli egy billing account-hoz (amihez a bankszámlát beállítottuk
- be kell rajta kapcsolni a Kubernetes Engine API-t.
https://console.cloud.google.com/apis/library/container.googleapis.com?project=adamproject1
 
Ez a kubctl -t is át fogja állítani a google cloud-ra.
 
 
De ha elindítjuk a minikube-ot, akkor az vissza fogja állítani a kubectl-t saját magára:
<pre>
# minikube start
...
 
# kubectl config current-context
minikube
 
 
# kubectl get node
NAME STATUS ROLES AGE VERSION
minikube Ready master 103d v1.13.4
</pre>
 
 
 
=Klaszter létrehozás=
<pre>
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/europe-west6/adam1?project=adamproject1
NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
adam1 europe-west6 1.12.8-gke.10 34.65.149.13 n1-standard-1 1.12.8-gke.10 3 RUNNING
</pre>
Menjünk a Kubernetes Engine felületre, és itt válasszuk a Cluster menüpontot: https://console.cloud.google.com/kubernetes
:[[File:ClipCapIt-190621-235437.PNG]]
 
 
<pre>
# kubectl get nodes
NAME STATUS ROLES AGE VERSION
gke-adam1-default-pool-b9ed6fb1-d955 Ready <none> 2m11s v1.12.8-gke.10
gke-adam1-default-pool-c1ab468d-slqn Ready <none> 2m8s v1.12.8-gke.10
gke-adam1-default-pool-e3b15f3f-98dl Ready <none> 2m7s v1.12.8-gke.10
</pre>
 
 
<pre>
# gcloud container clusters delete adam1 --region europe-west6
The following clusters will be deleted.
- [adam1] in [europe-west6]
 
Do you want to continue (Y/n)? Y
</pre>