실습 2탄 = 3/11
명령서버(EC2 or Cloud9) 이해
Helm 이해
Helm은 패키지 관리 툴이다.
리눅스의 yum 같은 툴이다.
구성?
개발자--------명령서버(EC2 or Cloud9, Heml설치,EKS 어플리케이션 관리)--------EKS사용
1
명령서버인 EC2서버 로그인
sudo su -
curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
버전 확인 ?
helm version --short
v3.13.1+g3547a4b
2
차트 저장소 생성 ?
stable로 생성함
helm repo add stable https://charts.helm.sh/stable
"stable" has been added to your repositories
3
설치 가능한 차트 나열 ?
helm search repo stable
NAME CHART VERSION APP VERSION DESCRIPTION
stable/acs-engine-autoscaler 2.2.2 2.1.1 DEPRECATED Scales worker nodes within agent pools
stable/aerospike 0.3.5 v4.5.0.5 DEPRECATED A Helm chart for Aerospike in Kubern...
stable/airflow 7.13.3 1.10.12 DEPRECATED - please use: https://github.com/air...
stable/ambassador 5.3.2 0.86.1 DEPRECATED A Helm chart for Datawire Ambassador
4
bash 설정 ?
helm completion bash >> ~/.bash_completion
. /etc/profile.d/bash_completion.sh
. ~/.bash_completion
source <(helm completion bash)
5
helm 업데이트 ?
# first, add the default repository, then update
helm repo add stable https://charts.helm.sh/stable
helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
6
모든 차트 나열?
helm search repo
7
nginx 검색?
helm search repo nginx
NAME CHART VERSION APP VERSION DESCRIPTION
stable/nginx-ingress 1.41.3 v0.34.1 DEPRECATED! An nginx Ingress controller that us...
stable/nginx-ldapauth-proxy 0.1.6 1.13.5 DEPRECATED - nginx proxy with ldapauth
stable/nginx-lego 0.3.1 Chart for nginx-ingress-controller and kube-lego
stable/gcloud-endpoints 0.1.2 1 DEPRECATED Develop, deploy, protect and monitor...
8
btnami 차트 리포지토리도 추가?
helm repo add bitnami https://charts.bitnami.com/bitnami
9
helm search repo bitnami
10
nginx 다시 검색?
helm search repo nginx
NAME CHART VERSION APP VERSION DESCRIPTION
bitnami/nginx 9.3.6 1.21.1 Chart for the nginx server
bitnami/nginx-ingress-controller 7.6.13 0.47.0 Chart for the nginx Ingress controller stable/nginx-ingress 1.41.3 v0.34.1 DEPRECATED! An nginx Ingress controller that us...
stable/nginx-ldapauth-proxy 0.1.6 1.13.5 DEPRECATED - nginx proxy with ldapauth
stable/nginx-lego 0.3.1 Chart for nginx-ingress-controller and kube-lego
bitnami/kong 3.7.8 2.4.1 Kong is a scalable, open source API layer (aka ...
stable/gcloud-endpoints 0.1.2 1 DEPRECATED Develop, deploy, protect and monitor...
// 2개 모두 나옴
11
bitnami/nginx 검색?
helm search repo bitnami/nginx
NAME CHART VERSION APP VERSION DESCRIPTION
bitnami/nginx 9.3.6 1.21.1 Chart for the nginx server
bitnami/nginx-ingress-controller 7.6.13 0.47.0 Chart for the nginx Ingress controller
12
설치?
# mywebserver 라는 이름으로 설치해보자.
helm install mywebserver bitnami/nginx
NAME: mywebserver
LAST DEPLOYED: Thu Jul 8 10:40:33 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **
NGINX can be accessed through the following DNS name from within your cluster:
mywebserver-nginx.default.svc.cluster.local (port 80)
To access NGINX from outside the cluster, follow the steps below:
1. Get the NGINX URL by running these commands:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace default -w mywebserver-nginx'
export SERVICE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].port}" services mywebserver-nginx)
export SERVICE_IP=$(kubectl get svc --namespace default mywebserver-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "http://${SERVICE_IP}:${SERVICE_PORT}"
13
서비스, pod , 디플로이먼트 확인?
kubectl get svc,po,deploy
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.100.0.1 <none> 443/TCP 24h
service/mywebserver-nginx LoadBalancer 10.100.185.253
a8xxxxxx42.us-west-2.elb.amazonaws.com 80:32304/TCP 32s
NAME READY STATUS RESTARTS AGE
pod/mywebserver-nginx-dxddd-8bzrb 1/1 Running 0 31s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/mywebserver-nginx 1/1 1 1 32s
14
디플로이먼트 자세히 확인 ?
kubectl describe deployment mywebserver
15
Pod 확인?
kubectl get pods -l app.kubernetes.io/name=nginx
NAME READY STATUS RESTARTS AGE
mywebserver-nginx-d57766ddd-8bzrb 1/1 Running 0 2m27s
16
상세히 확인 , URL 확인?
kubectl get service mywebserver-nginx -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
mywebserver-nginx LoadBalancer 10.100.185.253 a37252d730239409bbc4e08632528fc4-766156842.us-west-2.elb.amazonaws.com 80:32304/TCP 3m10s app.kubernetes.io/instance=mywebserver,app.kubernetes.io/name=nginx
(3분 소요)
17
외부 IP 로 브라우저로 접속 확인?
잘 된다.
1
Helm 리스트 확인?
helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
mywebserver default 1 2021-07-08 10:40:33.89 +0000 UTC deployed nginx-9.3.6 1.21.1
2
삭제 ?
helm uninstall mywebserver
3
Pod 확인?
kubectl get pods -l app.kubernetes.io/name=nginx
pod는 없음
No resources found in default namespace.
4
서비스 리소스 확인?
kubectl get service mywebserver-nginx -o wide
서비스는 있음
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
mywebserver-nginx LoadBalancer 10.100.185.253 a37252d730239409bbc4e08632528fc4-766156842.us-west-2.elb.amazonaws.com 80:32304/TCP 8m37s app.kubernetes.io/instance=mywebserver,app.kubernetes.io/name=nginx
https://brunch.co.kr/@topasvga/1695
https://brunch.co.kr/@topasvga/1882
https://brunch.co.kr/@topasvga/1679
감사합니다.