ArgoCD简单介绍

ArgoCD

参考:

https://zhuanlan.zhihu.com/p/551331656
https://blog.csdn.net/cr7258/article/details/122028096
https://argo-cd.readthedocs.io/en/stable/getting_started/#6-create-an-application-from-a-git-repository

部署 Argo CD

$ kubectl create namespace argocd
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

$ kubectl -n argocd get pod
NAME                                                READY   STATUS    RESTARTS   AGE
argocd-application-controller-0                     1/1     Running   0          19d
argocd-applicationset-controller-689bb49b69-sx8gq   1/1     Running   0          19d
argocd-dex-server-6d448877fb-g2qwm                  1/1     Running   0          19d
argocd-notifications-controller-5d46c4d4-j4fkt      1/1     Running   0          19d
argocd-redis-689cb75c98-h2gph                       1/1     Running   0          19d
argocd-repo-server-6bfc74b68-79dkh                  1/1     Running   0          19d
argocd-server-7dcf9c9b99-28l9v                      1/1     Running   0          19d
$

访问 Argo CD

$ kubectl port-forward svc/argocd-server -n argocd 8080:443
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
$ kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
sF4mIPbkaJoe5MuB

Demo 演示

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - image: nginx
        name: myapp
        ports:
        - containerPort: 80
apiVersion: v1
kind: Service
metadata:
  name: myapp
spec:
  ports:
  - port: 80
    targetPort: 80
    nodePort: 32060
  type: NodePort
  selector:
    app: myapp

$ kubectl get all -n dd
NAME                         READY   STATUS    RESTARTS   AGE
pod/myapp-6746dcc69c-87tdl   1/1     Running   0          22s

NAME            TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/myapp   NodePort   10.106.91.142   <none>        80:32060/TCP   10m

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/myapp   1/1     1            1           10m

NAME                               DESIRED   CURRENT   READY   AGE
replicaset.apps/myapp-6746dcc69c   1         1         1       22s
replicaset.apps/myapp-865f9f464f   0         0         0       10m

ArgoCD简单介绍_第1张图片

你可能感兴趣的:(k8s,argocd,linux,运维)