forked from clusterpedia-io/clusterpedia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌱 clusterimportpolicy for argocd accessed clusters
Signed-off-by: Yash Khare <[email protected]>
- Loading branch information
1 parent
ec71e29
commit d00694c
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |