diff --git a/resources/sync-job/base/kustomization.yaml b/resources/sync-job/base/kustomization.yaml new file mode 100644 index 0000000..3cd0c42 --- /dev/null +++ b/resources/sync-job/base/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./pre-sync-job.yaml + - ./post-sync-job.yaml \ No newline at end of file diff --git a/resources/sync-job/base/post-sync-job.yaml b/resources/sync-job/base/post-sync-job.yaml new file mode 100644 index 0000000..cef38f0 --- /dev/null +++ b/resources/sync-job/base/post-sync-job.yaml @@ -0,0 +1,16 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: after + annotations: + argocd.argoproj.io/hook: PostSync + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: sleep + image: alpine:latest + command: ["sleep", "10"] + restartPolicy: Never + backoffLimit: 0 diff --git a/resources/sync-job/base/pre-sync-job.yaml b/resources/sync-job/base/pre-sync-job.yaml new file mode 100644 index 0000000..110ddeb --- /dev/null +++ b/resources/sync-job/base/pre-sync-job.yaml @@ -0,0 +1,16 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: before + annotations: + argocd.argoproj.io/hook: PreSync + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: sleep + image: alpine:latest + command: ["sleep", "10"] + restartPolicy: Never + backoffLimit: 0 diff --git a/resources/sync-job/env/k3s-cluster/config.json b/resources/sync-job/env/k3s-cluster/config.json new file mode 100644 index 0000000..6a1af33 --- /dev/null +++ b/resources/sync-job/env/k3s-cluster/config.json @@ -0,0 +1,11 @@ +{ + "appName": "sync-job", + "userGivenName": "sync-job", + "destNamespace": "argocd", + "destServer": "https://kubernetes.default.svc", + "srcPath": "resources/sync-job/env/k3s-cluster", + "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", + "srcTargetRevision": "", + "labels": null, + "annotations": null +} \ No newline at end of file diff --git a/resources/sync-job/env/k3s-cluster/kustomization.yaml b/resources/sync-job/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..a227ac4 --- /dev/null +++ b/resources/sync-job/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base \ No newline at end of file