This exercise demonstrates how to configure Argo CD to use a private Git repository with HTTPS. Follow these steps:
Solution
apiVersion: v1
kind: Secret
metadata:
name: private-repo-https
namespace: argocd
labels:
argocd.argoproj.io/secret-type: repository
stringData:
type: git
url: https://dev.azure.com/mtrainings/ArgoCD/_git/argocd-example-apps
password: <PAT-TOKEN>
username: my-token
kubectl apply -f repo-https.yaml -n argocd
kubectl get secret private-repo-https -n argocd
kubectl port-forward svc/argocd-server -n argocd 8080:443
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
- Go to the settings page.
- Open the repositories page.
- Verify the repo status.
Example Manifest:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-1
namespace: argocd
spec:
destination:
namespace: app-1
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: https://dev.azure.com/mtrainings/ArgoCD/_git/argocd-example-apps
targetRevision: master
syncPolicy:
syncOptions:
- CreateNamespace=true
kubectl apply -f app.yaml -n argocd