Open 13567436138 opened 1 year ago
applicationSet/appProject-gitlab-https.yaml
kubectl apply -f appProject-gitlab-https.yaml -n argocd
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: project
spec:
clusterResourceWhitelist:
- group: ""
kind: Namespace
sourceRepos:
- https://gitlab.example.com/hxp/argocd-test.git
- https://gitlab.example.com/hxp/argocd-test-2.git
destinations:
- server: https://192.168.229.153:6443
namespace: demo
- server: https://192.168.229.156:6443
namespace: demo
applicationSet/appset-generators-merge-template-ignoreDifferences.yaml
kubectl apply -f appset-generators-merge-template-ignoreDifferences.yaml -n argocd
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: appset
spec:
generators:
- merge:
mergeKeys:
- repository
generators:
- list:
elements:
- serverUrl: https://192.168.229.153:6443
repository: argocd-test
cluster: cluster1
- serverUrl: https://192.168.229.156:6443
repository: argocd-test-2
cluster: cluster2
- scmProvider:
gitlab:
api: https://gitlab.example.com
allBranches: true
includeSubgroups: true
group: hxp
tokenRef:
secretName: gitlab-access-token
key: token
requeueAfterSeconds: 30
cloneProtocol: https
filters:
- repositoryMatch: "^argocd-test.*"
template:
metadata:
labels:
repo: '{{repository}}'
spec:
source:
repoURL: '{{url}}'
targetRevision: '{{ sha }}'
path: demo1
project: project
destination:
server: '{{serverUrl}}'
namespace: demo
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/template/metadata/annotations
- /spec/replica
template:
metadata:
name: 'myapp-{{ repository }}-{{cluster}}'
spec:
source:
repoURL: '{{url}}'
targetRevision: '{{ sha }}'
path: demo1
project: project
destination:
server: '{{serverUrl}}'
namespace: demo
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- RespectIgnoreDifferences=true
[root@mycompany applicationSet]# argocd app list
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS REPO PATH TARGET
argocd/myapp-argocd-test-2-cluster2 https://192.168.229.156:6443 demo project Synced Healthy Auto-Prune <none> https://gitlab.example.com/hxp/argocd-test-2.git demo1 a473f3f0b026a621b7d11cf8e01ab67e40560e4d
argocd/myapp-argocd-test-cluster1 https://192.168.229.153:6443 demo project Synced Healthy Auto-Prune <none> https://gitlab.example.com/hxp/argocd-test.git demo1 fc0905c5d4dd2d010a4b0bc0850c62eba933d50d
[root@member1-153 ~]# kubectl get pod -n demo
NAME READY STATUS RESTARTS AGE
nginx-787f54657b-z4drf 1/1 Running 0 19s
[root@member1-153 ~]# kubectl scale deploy nginx -n demo --replicas=3
deployment.apps/nginx scaled
[root@member1-153 ~]# kubectl get pod -n demo
NAME READY STATUS RESTARTS AGE
nginx-787f54657b-6g5tw 0/1 Terminating 0 2s
nginx-787f54657b-cjls9 0/1 Terminating 0 2s
nginx-787f54657b-z4drf 1/1 Running 0 32s
不支持
this is not supported also
Checklist:
argocd version
.Describe the bug
To Reproduce applicationSet/appProject-gitlab-https.yaml
kubectl apply -f appProject-gitlab-https.yaml -n argocd
applicationSet/appset-generators-matrix-template-ignoreDifferences.yaml
kubectl apply -f appset-generators-matrix-template-ignoreDifferences.yaml -n argocd
Expected behavior
Screenshots
Version
Logs