Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy: add a decapod app for policies #130

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions templates/argo-cd/create-app-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,33 @@ spec:
- {name: namespace, value: "{{item.namespace}}"}
- {name: target_cluster, value: "{{item.target_cluster}}"}
withParam: "{{inputs.parameters.list}}"

- name: argocd-sync-wait
inputs:
parameters:
- name: cluster_id
- name: appname
container:
name: argocd-sync-wait
image: harbor.taco-cat.xyz/tks/argocd-cli:v2.2.5
command:
- /bin/bash
- '-c'
- |
# log into Argo CD server
./argocd login $ARGO_SERVER --plaintext --insecure --username $ARGO_USERNAME \
--password $ARGO_PASSWORD

app_name={{inputs.parameters.cluster_id}}-{{inputs.parameters.appname}}

# sync app
echo "sync app $app_name"
./argocd app sync $app_name

# wait for sync
./argocd app wait $app_name --sync

envFrom:
- secretRef:
name: "decapod-argocd-config"
activeDeadlineSeconds: 900
6 changes: 6 additions & 0 deletions templates/argo-cd/prepare-argocd-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ spec:
if [[ $? != 0 ]]; then
./argocd proj create admin-tools --dest "*,*" --src "*" --allow-cluster-resource "*/*"
fi

./argocd proj get policy
if [[ $? != 0 ]]; then
./argocd proj create policy --dest "*,*" --src "*" --allow-cluster-resource "*/*"
fi

env:
- name: ARGO_SERVER
value: '{{workflow.parameters.argo_server}}'
Expand Down
1 change: 0 additions & 1 deletion templates/decapod-apps/lma-uniformed-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ spec:
{ "app_group": "lma", "path": "thanos-config", "namespace": "lma", "target_cluster": "" },
{ "app_group": "lma", "path": "fluentbit", "namespace": "lma", "target_cluster": "" },
{ "app_group": "lma", "path": "kubernetes-event-exporter", "namespace": "lma", "target_cluster": "" }

]
dependencies: [lma-operators]

Expand Down