1. AKS 노드확인
- az login 으로 로그인
- AKS Cluster에 연결하는 구성 정보가 필요 아래의 명령어를 통해 kubeconfig 파일을 가져옴
- az aks get-credentials --resource-group [name] --name [aksclustername]
kubectl get nodes 를 통해 node 확인

2. AKS Cluster에 ACR접근 권한 할당
- ACR 접근
- IAM에서 ACR Pull 권한을 AKS Cluster 에 지정해준다

3. ingress 컨트롤러 생성
- 새로운 네임스페이스 생성

- Helm CLI 설치(맥기준)
brew install helm
- 아래 명령 순차적으로 실행
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
Welcome - NGINX Ingress Controller
Overview This is the documentation for the Ingress NGINX Controller. It is built around the Kubernetes Ingress resource, using a ConfigMap to store the controller configuration. You can learn more about using Ingress in the official Kubernetes documentatio
kubernetes.github.io
helm repo update
helm install nginx-ingress ingress-nginx/ingress-nginx --namespace ingress --set controller.replicaCount=2 --set controller.nodeSelector."beta\.kubernetes\.io/os"=linux --set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux --set controller.replicaCount=2 --set controller.nodeSelector."beta\.kubernetes\.io/os"=linux --set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux
NAME: nginx-ingress
kubectl get svc -n ingress 서비스확인

ymal 파일 작성
$ cat nginx01.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx01
  namespace: ingress
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx01
  template:
    metadata:
      labels:
        app: nginx01
    spec:
      containers:
      - name: nginx01
        image: tpcable127/nginx01:v1
        ports:
        - containerPort: 80
        env:
        - name: TITLE
          value: "AKS"
---
apiVersion: v1
kind: Service
metadata:
  name: nginx01
  namespace: ingress
spec:
  type: ClusterIP
  ports:
  - port: 80
  selector:
    app: nginx01
$ cat nginx02.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx02
  namespace: ingress
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx02
  template:
    metadata:
      labels:
        app: nginx02
    spec:
      containers:
      - name: nginx02
        image: tpcable127/nginx02:v1
        ports:
        - containerPort: 80
        env:
        - name: TITLE
          value: "AKS"
---
apiVersion: v1
kind: Service
metadata:
  name: nginx02
  namespace: ingress
spec:
  type: ClusterIP
  ports:
  - port: 80
  selector:
    app: nginx02
'Cloud > Azure' 카테고리의 다른 글
| [Azure] Flexible DB에 대해 (0) | 2024.02.26 | 
|---|---|
| AKS 구성(1) (0) | 2022.03.23 | 
| Azure AppService plan 정리 (0) | 2022.03.04 | 
| [Azure] 네트워크 구성 설정 (0) | 2021.11.01 | 
| [Azure] AZ-500: Microsoft Azure Security Technologies 정리 (0) | 2021.10.06 |