Difference between revisions of "Google Kubernetes Engine"
(→SDK init) |
(→Klaszter létrehozás) |
||
Line 87: | Line 87: | ||
minikube Ready master 103d v1.13.4 | minikube Ready master 103d v1.13.4 | ||
</pre> | </pre> | ||
+ | |||
+ | |||
+ | ==Bejelentkezés és kubectl== | ||
+ | |||
+ | <pre> | ||
+ | # gcloud config list | ||
+ | [core] | ||
+ | account = myemail@gmail.com | ||
+ | disable_usage_reporting = True | ||
+ | project = adamproject1 | ||
+ | |||
+ | Your active configuration is: [default] | ||
+ | </pre> | ||
+ | A '''disable_usage_reporting''' anonim adatokat küld a Google-nek, nem a projekthez kapcsolódik. | ||
+ | |||
+ | |||
+ | <pre> | ||
+ | # gcloud config config-helper | ||
+ | configuration: | ||
+ | active_configuration: default | ||
+ | properties: | ||
+ | core: | ||
+ | account: myemail@gmail.com | ||
+ | disable_usage_reporting: 'True' | ||
+ | project: adamproject1 | ||
+ | credential: | ||
+ | access_token: XXXXX | ||
+ | id_token: YYYY | ||
+ | token_expiry: '2019-06-22T08:43:33Z' | ||
+ | sentinels: | ||
+ | config_sentinel: /root/.config/gcloud/config_sentinel | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | |||
=Klaszter létrehozás= | =Klaszter létrehozás= |
Revision as of 09:17, 22 June 2019
Contents
Regisztráció a Google Cloud Platform-ban
https://console.cloud.google.com
Kubernetes Engine API aktiválása a projektben:
Majd a keresőbe írjuk be, hogy Kubernetes. Ekkor bejön
Kattintsunk az Enable-re.
...
A baloldali fő menüben megjelent a Kubernetes Engine menüpont:
Google Cloud SDK beállítása
SDK install
Vegyük fel az új DNF repository-t:
# 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
Installáljuk fel
# dnf install google-cloud-sdk ...
SDK init
Inicializáljuk az sdk-t. Ez meg fog nyitni a root nevében futó böngészőt, ahol be kell jelentkezni a google account-ba.
# gcloud init .. You must log in to continue. Would you like to log in (Y/n)? ...
Harmadik lépésként létre kell hozni egy projektet:
# 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
Válasszuk ki az új projektet
# 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:
# minikube start ... # kubectl config current-context minikube # kubectl get node NAME STATUS ROLES AGE VERSION minikube Ready master 103d v1.13.4
Bejelentkezés és kubectl
# gcloud config list [core] account = myemail@gmail.com disable_usage_reporting = True project = adamproject1 Your active configuration is: [default]
A disable_usage_reporting anonim adatokat küld a Google-nek, nem a projekthez kapcsolódik.
# gcloud config config-helper configuration: active_configuration: default properties: core: account: myemail@gmail.com disable_usage_reporting: 'True' project: adamproject1 credential: access_token: XXXXX id_token: YYYY token_expiry: '2019-06-22T08:43:33Z' sentinels: config_sentinel: /root/.config/gcloud/config_sentinel
Klaszter létrehozás
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/europe-west6/adam1?project=adamproject1 kubeconfig entry generated for adam1. 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
Menjünk a Kubernetes Engine felületre, és itt válasszuk a Cluster menüpontot: https://console.cloud.google.com/kubernetes
# 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
# 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