
HTTPS 인증서를 생성하고 ARN 값을 복사
Service를 생성해서 배포
로드밸런서에 도메인을 연결
yachae1101.com
backend.yachae1101.com


nginx_deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
deployment 배포
kubectl apply -f nginx_deployment.yaml
nginx_service.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx-service
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: <자신의 ARN 값>
service.beta.kubernetes.io/aws-load-balancer-type: classic
spec:
type: LoadBalancer
selector:
app: nginx
ports:
- protocol: TCP
port: 443
targetPort: 80
name: https
kubectl apply -f nginx_service.yamlbackend.yachae1101.com
