KuberNetes/졸과

GCP에 쿠버네티스 구축하기-1

브리오 2024. 6. 30. 15:25

목표

  1. GCP Compute Engine으로 VM 인스턴스 생성하기 (총 2개)
  2. 생성한 VM Instnace에 SSH로 접속 가능하게 하기
  3. 생성한 VM Instance 내에 비밀번호 설정하기

프로젝트 생성

Project ID: k8s-demo-428005

Master Node - 1개 - 리눅스 우분투 20.04 LTS - e2-medium(cpu2, 4GB)

Worker Node - 1개 - 리눅스 우분투 20.04 LTS - e2-small(cpu2, 2GB)

VM에 SSH로 내 터미널에서 접속하기

공개키/비밀키 생성

https://skstp35.tistory.com/341

 

메타데이터 사용자 이름 : .

k8s-master 외부 ip : 34...

k8s-worker1 외부 ip : 34...

 

ssh -i 비밀키 이름@외부IP

Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1062-gcp x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

 System information as of Sun Jun 30 06:20:05 UTC 2024

  System load:  0.0               Processes:             99
  Usage of /:   19.3% of 9.51GB   Users logged in:       0
  Memory usage: 11%               IPv4 address for ens4: 10.178.0.3
  Swap usage:   0%

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status


The list of available updates is more than a week old.
To check for new updates run: sudo apt update


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

 

정상적으로 접속한 모습

VM 내 root 계정 비밀번호 설정하기

 

sudo passwd

su -

각 vm에 암호설정 및 root 접속

 

 

 

ref

https://aoc55.tistory.com/51