Skip to content

Commit

Permalink
Merge pull request #130 from openinfradev/policy-serving
Browse files Browse the repository at this point in the history
policy: add a decapod app for policies
  • Loading branch information
intelliguy committed Nov 24, 2023
2 parents ff44906 + ba65ea9 commit 94ff392
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
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 @@ -81,6 +81,12 @@ spec:
if [[ $? != 0 ]]; then
./argocd proj create tks-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

0 comments on commit 94ff392

Please sign in to comment.