[Book] [OK!] 7.6 Deploy from a Private Git Repository


Делаю:
2024.04.07


  1. Создаю private git repository https://github.com/wildmakaka/gitops-cookbook-sc-private.git

  2. Добавляю в него https://github.com/gitops-cookbook/gitops-cookbook-sc.git


$ argocd repo add [email protected]:wildmakaka/gitops-cookbook-sc-private.git \
  --ssh-private-key-path ~/.ssh/wildmakaka


$ cat << 'EOF' | kubectl create -f -
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: bgd-app
  namespace: argocd
spec:
  destination:
    namespace: bgd
    server: https://kubernetes.default.svc
  project: default
  source:
    repoURL: [email protected]:wildmakaka/gitops-cookbook-sc-private.git
    path: ch07/bgd
    targetRevision: main
EOF


$ argocd app list


$ argocd app sync bgd-app


$ kubectl get pods -n bgd
NAME                 READY   STATUS    RESTARTS   AGE
bgd-547cbdc7-ffcjh   1/1     Running   0          69s


$ minikube --profile ${PROFILE} ip
192.168.49.2


$ kubectl get services -n bgd
NAME   TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
bgd    ClusterIP   10.100.85.97   <none>        8080/TCP   92s


$ kubectl patch svc bgd -n bgd -p '{"spec": {"type": "NodePort"}}'


$ kubectl get services -n bgd
NAME   TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
bgd    NodePort   10.100.85.97   <none>        8080:31050/TCP   111s


// [OK!]
http://192.168.49.2:31050