- vừa được xem lúc

Deploy Kubernetes in Google Cloud Plaform

0 0 20

Người đăng: Do Nhu Vy

Theo Viblo Asia

Create new project

You can use Google Cloud CLI, download at https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe

Enable Compute Engine API

https://cloud.google.com/compute/docs/regions-zones

You can use asia-southeast1-a : Jurong West, Singapore, APAC (code 30)

asia-southeast1-b : Jurong West, Singapore, APAC

asia-southeast1-c : Jurong West, Singapore, APAC

Create network

Create filewall rules for internal connection

Create filewall rules for external connection

Create kubernetes controller

Get public IP address

Mapping kubernetes controller with public IP

Run commands

gcloud auth login
gcloud config set compute/region asia-southeast1
gcloud config set compute/zone asia-southeast1-a
gcloud config set project my-project-337503 gcloud compute networks create kubernetes-cluster --subnet-mode custom
gcloud compute networks subnets create kubernetes --network kubernetes-cluster --range 10.240.0.0/24 gcloud compute firewall-rules create kubernetes-cluster-allow-internal --allow tcp,udp,icmp --network kubernetes-cluster --source-ranges 10.240.0.0/24,10.244.0.0/16
gcloud compute firewall-rules create kubernetes-cluster-allow-external --allow tcp:22,tcp:6443,icmp --network kubernetes-cluster --source-ranges 0.0.0.0/0
gcloud compute addresses create kubernetes-controller --region $(gcloud config get-value compute/region) gcloud compute addresses create kubernetes-controller --region asia-southeast1
gcloud compute address list
gcloud compute instances create controller --async --boot-disk-size 200GB --can-ip-forward --image-family ubuntu-2004-lts --image-project ubuntu-os-cloud --machine-type n1-standard-1 --private-network-ip 10.240.0.10 --scopes compute-rw,storage-ro,service-management,service-control,logging-write,monitoring --subnet kubernetes --address 34.124.180.248 for i in 0 1; do gcloud compute instances create worker-${i} --async --boot-disk-size 200GB --can-ip-forward --image-family ubuntu-2004-lts --image-project ubuntu-os-cloud --machine-type n1-standard-1 --private-network-ip 10.240.0.2${i} --scopes compute-rw,storage-ro,service-management,servicecontrol,logging-write,monitoring --subnet kubernetes;
done

If you catch error

Install Docker

Install Docker

gcloud compute ssh controller sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-propertiescommon
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-cache madison docker-ce
sudo apt-get update && sudo apt-get install -y docker-ce=5:20.10.12~3-0~ubuntu-focal docker-ce-cli=5:20.10.12~3-0~ubuntu-focal

Bình luận

Bài viết tương tự

- vừa được xem lúc

STACKDRIVER - GETTING STARTED

1. Overview.

0 0 38

- vừa được xem lúc

Set Up Network and HTTP Load Balancers

1. Overview. There are two types of load balancers in Google Cloud Platform:. .

0 0 29

- vừa được xem lúc

Deploying A Containerized Web Application On Kubernetes

1. Overview. Kubernetes is an open source project (available on kubernetes.io) which can run on many different environments, from laptops to high-availability multi-node clusters; from public clouds to on-premise deployments; from virtual machines to bare metal.

0 0 26

- vừa được xem lúc

Tạo VPS free trên Google Cloud Platform

Lời nói đầu . .

0 0 190

- vừa được xem lúc

Hướng dẫn deploy API service trên Google Compute Engine

Trong bài viết này mình sẽ hướng dẫn các bạn deploy một api service cơ bản trên GCP thông qua Google Compute Engine:. .

0 0 21

- vừa được xem lúc

Một số phương pháp và công cụ hữu ích cho điều tra số trên môi trường Google Cloud (GCP)

Google Cloud Platform (GCP) là một nền tảng điện toán đám mây phổ biến cung cấp nhiều loại dịch vụ và công cụ để xây dựng, triển khai và quản lý các ứng dụng cũng như cơ sở hạ tầng. Khi ngày càng có n

0 0 11