์ ํ์ด์ง์ repo๋ฑ๋ก์ด ๋์์ด์ผํ๋ค.
helm repo๋ฅผ ์ด์ฉํ์ฌ ์ฑ ์ถ๊ฐ
cert-manager ๋ฅผ ์ฑ์ผ๋ก ๋ฑ๋กํ์.
์ด๋ฐ์์ผ๋ก ์ฑ์ ์ถ๊ฐํ ์ ์๋ค.
yml์ ์ฌ์ฉํ์ฌ ์ฑ ์ถ๊ฐ
add-apps/cert-manager.yml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cert-manager
namespace: argocd
spec:
destination:
name: ''
namespace: cert-manager
server: 'https://kubernetes.default.svc'
source:
path: ''
repoURL: 'https://charts.jetstack.io'
targetRevision: v1.3.1
chart: cert-manager
helm:
parameters:
- name: installCRDs
value: 'true'
project: default
syncPolicy:
syncOptions:
- CreateNamespace=true
saveํ๋ฉด ์ฑ์ด ๋ง๋ค์ด์ง๊ณ sync๋ฅผ ๋๋ฅด๋ฉด ์ค์น๊ฐ ๋๋ค.
command line์ผ๋ก ์ ์ฉ
kubectl apply -f add-apps/cert-manager.yml
nginx์ฑ์ ํ๋ ๋ง๋ค์ด์ ๋ฐฐํฌํด๋ณด์.
mkdir apps/my-webserver
cd apps/my-webserver
---
apiVersion: v1
kind: Service
metadata:
name: www
namespace: www
labels:
app: www
spec:
selector:
app: www
ports:
- name: http
port: 80
targetPort: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: www
namespace: www
labels:
app: www
spec:
replicas: 1
selector:
matchLabels:
app: www
template:
metadata:
labels:
app: www
spec:
containers:
- name: www
image: nginx:latest
ports:
- containerPort: 80
์ด์ ์ปค๋ฐ์ ํ๊ณ app์ ์ถ๊ฐํด ์ฃผ์.
add-apps/my-webserver.yml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-webserver
namespace: my-webserver
spec:
destination:
name: ''
namespace: my-webserver
server: 'https://kubernetes.default.svc'
source:
path: apps/my-webserver
repoURL: 'git@github.com:YOUR/argocd.git'
targetRevision: main
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
kubectl apply -f add-apps/my-webserver.yml