Skip to content

Commit

Permalink
🌱 clusterimportpolicy for argocd accessed clusters
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Khare <[email protected]>
  • Loading branch information
khareyash05 committed Nov 4, 2023
1 parent ec71e29 commit d00694c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions kustomize/clusterimportpolicy/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: policy.clusterpedia.io/v1alpha1
kind: ClusterImportPolicy
metadata:
name: argocd
spec:
source:
group: ""
resource: clusters
selectorTemplate: ""
references:
- group: ""
resource: secrets
namespaceTemplate: "{{ .source.spec.authSecretRef.namespace }}"
nameTemplate: "{{ .source.spec.authSecretRef.name }}"
key: authSecret
nameTemplate: "argocd-{{ .source.metadata.name }}"
template: |
spec:
apiserver: "{{ .source.spec.apiEndpoint }}"
caData: "{{ .references.authSecret.data.ca }}"
tokenData: "{{ .references.authSecret.data.token }}"
syncResources:
- group: ""
resources:
- "pods"
- "services"
- "configmaps"
- "secrets"
- "namespaces"
- group: "apps"
resources:
- "*"
syncResourcesRefName: ""
creationCondition: |
{{ if ne .source.spec.apiEndpoint "" }}
{{ range .source.status.conditions }}
{{ if eq .type "Ready" }}
{{ if eq .status "True" }} true {{ end }}
{{ end }}
{{ end }}
{{ end }}

0 comments on commit d00694c

Please sign in to comment.