curl http://192.168.1.156:5000/v2/_catalog
curl http://192.168.1.156:5000/v2/web-site/tags/list
vi /etc/docker/dameon.json
aws configure
- aws ecr 업로드(push)
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
$ unzip awscliv2.zip
$ sudo ./aws/install
$ exit
$ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/w7j5m3h2
$ docker tag 192.168.1.156:5000/web-site:aws public.ecr.aws/z1y5i1x7/web-site:food
$ docker push public.ecr.aws/z1y5i1x7/web-site:food
docker rmi public.ecr.aws/z1y5i1x7/web-site:aws
docker rmi public.ecr.aws/z1y5i1x7/web-site:food
docker run -d -p 8081:80 --name aws-web public.ecr.aws/z1y5i1x7/web-site:aws
docker run -d -p 8082:80 --name aws-web public.ecr.aws/z1y5i1x7/web-site:food
docker pull 192.168.1.156:5000/test-home:v0.0
docker tag 192.168.1.156:5000/test-home:v0.0 public.ecr.aws/z1y5i1x7/test-home:v0.0
docker tag 192.168.1.156:5000/test-home:v1.0 public.ecr.aws/z1y5i1x7/test-home:v1.0
docker tag 192.168.1.156:5000/test-home:v2.0 public.ecr.aws/z1y5i1x7/test-home:v2.0
docker push public.ecr.aws/z1y5i1x7/test-home:v0.0
docker push public.ecr.aws/z1y5i1x7/test-home:v1.0
docker push public.ecr.aws/z1y5i1x7/test-home:v2.0
-> 역할생성
- eks cli
$ aws eks --region ap-northeast-2 update-kubeconfig --name EKS-CLUSTER
$ curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.26.4/2023-05-11/bin/linux/amd64/kubectl
$ chmod +x ./kubectl
$ sudo mv ./kubectl /usr/local/bin
$ source <(kubectl completion bash)
yum install -y bash-completion
$ echo "source <(kubectl completion bash)" >> ~/.bashrc
$ kubectl version --short --client
$ kubectl get svc
이거 3개 권한 정책 추가
$ mkdir test && cd $_
$ vi deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-site-deployment
spec:
replicas: 4
selector:
matchLabels:
app: web-site-deployment
template:
metadata:
name: web-site-deployment
labels:
app: web-site-deployment
spec:
containers:
- name: web-site-deployment-container
image: public.ecr.aws/w7j5m3h2/web-site:aws
$ vi loadbalancer-deployment.yaml
apiVersion: v1
kind: Service
metadata:
name: loadbalancer-service-deployment
spec:
type: LoadBalancer
selector:
app: web-site-deployment
ports:
- protocol: TCP
port: 80
targetPort: 80
k get no
k edit deployments.apps web-site-deployment
pending뜨는거 describe해보면
GUI로 확인해보자 노드 -> 맨위에 거 클릭
4개가 다 사용된것을 볼수있다.
다른것도 열어보면 6개 중에 하나의 노드에는 시스템파드로만 가득차있는게 있는걸 확인할수 있음 걔한테는 배포할수가 없다.
k scale deployment web-site-deployment --replicas 10
apiVersion: v1
kind: Service
metadata:
name: nodeport-service-deployment
spec:
type: NodePort
selector:
app: web-site-deployment2
ports:
- protocol: TCP
port: 80
targetPort: 80
cp nodeport-deployment.yaml clusterip-deployment.yaml
vi clusterip-deployment.yaml 다시 들어가서
publicip중하나로 바꿔준다.
externalIP 에 internalIP를 넣는다.
k delete all --all
ECR - 리포지토리 삭제
두개다 지우기
노드그룹 지워졌으면 클러스터 삭제