forked from dbca-wa/it-assets
-
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.
Refactor Kustomize cronjob template and overlays.
- Loading branch information
Showing
27 changed files
with
542 additions
and
276 deletions.
There are no files selected for viewing
9 changes: 2 additions & 7 deletions
9
kustomize/overlays/prod/cronjobs/ascender-csv-upload/kustomization.yaml
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../../template | ||
- ../../../../template | ||
nameSuffix: -ascender-csv-upload | ||
patches: | ||
- target: | ||
group: batch | ||
version: v1 | ||
kind: CronJob | ||
name: itassets-cronjob | ||
path: patch.yaml | ||
- path: patch.yaml |
50 changes: 44 additions & 6 deletions
50
kustomize/overlays/prod/cronjobs/ascender-csv-upload/patch.yaml
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 |
---|---|---|
@@ -1,6 +1,44 @@ | ||
- op: replace | ||
path: /spec/schedule | ||
value: "22 18 * * 1-5" | ||
- op: replace | ||
path: /spec/jobTemplate/spec/template/spec/containers/0/args | ||
value: ["manage.py", "department_users_upload_ascender_sftp", "--help"] | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: itassets-cronjob | ||
spec: | ||
schedule: "22 18 * * 1-5" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: itassets-cronjob | ||
args: ["manage.py", "department_users_upload_ascender_sftp"] | ||
env: | ||
- name: DATABASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: DATABASE_URL | ||
- name: ASCENDER_SFTP_HOSTNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_SFTP_HOSTNAME | ||
- name: ASCENDER_SFTP_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_SFTP_PORT | ||
- name: ASCENDER_SFTP_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_SFTP_USERNAME | ||
- name: ASCENDER_SFTP_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_SFTP_PASSWORD | ||
- name: ASCENDER_SFTP_DIRECTORY | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_SFTP_DIRECTORY |
9 changes: 2 additions & 7 deletions
9
kustomize/overlays/prod/cronjobs/deptusers-audit-email/kustomization.yaml
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../../template | ||
- ../../../../template | ||
nameSuffix: -deptusers-audit-email | ||
patches: | ||
- target: | ||
group: batch | ||
version: v1 | ||
kind: CronJob | ||
name: itassets-cronjob | ||
path: patch.yaml | ||
- path: patch.yaml |
45 changes: 39 additions & 6 deletions
45
kustomize/overlays/prod/cronjobs/deptusers-audit-email/patch.yaml
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 |
---|---|---|
@@ -1,6 +1,39 @@ | ||
- op: replace | ||
path: /spec/schedule | ||
value: "7 19 * * 1-5" | ||
- op: replace | ||
path: /spec/jobTemplate/spec/template/spec/containers/0/args | ||
value: ["manage.py", "department_users_audit_emails", "--help"] | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: itassets-cronjob | ||
spec: | ||
schedule: "7 19 * * 1-5" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: itassets-cronjob | ||
args: ["manage.py", "department_users_audit_emails"] | ||
env: | ||
- name: DATABASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: DATABASE_URL | ||
- name: AZURE_TENANT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: AZURE_TENANT_ID | ||
- name: MS_GRAPH_API_CLIENT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: MS_GRAPH_API_CLIENT_ID | ||
- name: MS_GRAPH_API_CLIENT_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: MS_GRAPH_API_CLIENT_SECRET | ||
- name: AZURE_CONNECTION_STRING | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: AZURE_CONNECTION_STRING |
7 changes: 7 additions & 0 deletions
7
kustomize/overlays/prod/cronjobs/deptusers-audit-employeeid/kustomization.yaml
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,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../../template | ||
nameSuffix: -deptusers-audit-employeeid | ||
patches: | ||
- path: patch.yaml |
59 changes: 59 additions & 0 deletions
59
kustomize/overlays/prod/cronjobs/deptusers-audit-employeeid/patch.yaml
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,59 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: itassets-cronjob | ||
spec: | ||
schedule: "33 18 * * 1-5" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: itassets-cronjob | ||
args: ["manage.py", "department_users_audit_employee_ids"] | ||
env: | ||
- name: DATABASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: DATABASE_URL | ||
- name: FOREIGN_DB_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_HOST | ||
- name: FOREIGN_DB_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_PORT | ||
- name: FOREIGN_DB_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_NAME | ||
- name: FOREIGN_DB_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_USERNAME | ||
- name: FOREIGN_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_PASSWORD | ||
- name: FOREIGN_SCHEMA | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_SCHEMA | ||
- name: FOREIGN_SERVER | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_SERVER | ||
- name: FOREIGN_TABLE | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_TABLE |
9 changes: 2 additions & 7 deletions
9
kustomize/overlays/prod/cronjobs/deptusers-check-ascender/kustomization.yaml
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../../template | ||
- ../../../../template | ||
nameSuffix: -deptusers-check-ascender | ||
patches: | ||
- target: | ||
group: batch | ||
version: v1 | ||
kind: CronJob | ||
name: itassets-cronjob | ||
path: patch.yaml | ||
- path: patch.yaml |
100 changes: 94 additions & 6 deletions
100
kustomize/overlays/prod/cronjobs/deptusers-check-ascender/patch.yaml
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 |
---|---|---|
@@ -1,6 +1,94 @@ | ||
- op: replace | ||
path: /spec/schedule | ||
value: "10,40 8-18 * * 1-5" | ||
- op: replace | ||
path: /spec/jobTemplate/spec/template/spec/containers/0/args | ||
value: ["manage.py", "check_ascender_accounts", "--help"] | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: itassets-cronjob | ||
spec: | ||
schedule: "10,40 8-18 * * 1-5" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: itassets-cronjob | ||
args: ["manage.py", "check_ascender_accounts"] | ||
env: | ||
- name: DATABASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: DATABASE_URL | ||
- name: EMAIL_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: EMAIL_HOST | ||
- name: ADMIN_EMAILS | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ADMIN_EMAILS | ||
- name: ASCENDER_CREATE_AZURE_AD | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_CREATE_AZURE_AD | ||
- name: ASCENDER_CREATE_AZURE_AD_LIMIT_DAYS | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: ASCENDER_CREATE_AZURE_AD_LIMIT_DAYS | ||
- name: FOREIGN_DB_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_HOST | ||
- name: FOREIGN_DB_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_PORT | ||
- name: FOREIGN_DB_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_NAME | ||
- name: FOREIGN_DB_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_USERNAME | ||
- name: FOREIGN_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_DB_PASSWORD | ||
- name: FOREIGN_SCHEMA | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_SCHEMA | ||
- name: FOREIGN_SERVER | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_SERVER | ||
- name: FOREIGN_TABLE | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: FOREIGN_TABLE | ||
- name: AZURE_TENANT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: AZURE_TENANT_ID | ||
- name: MS_GRAPH_API_CLIENT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: MS_GRAPH_API_CLIENT_ID | ||
- name: MS_GRAPH_API_CLIENT_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: MS_GRAPH_API_CLIENT_SECRET |
9 changes: 2 additions & 7 deletions
9
kustomize/overlays/prod/cronjobs/deptusers-check-azure/kustomization.yaml
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../../template | ||
- ../../../../template | ||
nameSuffix: -deptusers-check-azure | ||
patches: | ||
- target: | ||
group: batch | ||
version: v1 | ||
kind: CronJob | ||
name: itassets-cronjob | ||
path: patch.yaml | ||
- path: patch.yaml |
45 changes: 39 additions & 6 deletions
45
kustomize/overlays/prod/cronjobs/deptusers-check-azure/patch.yaml
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 |
---|---|---|
@@ -1,6 +1,39 @@ | ||
- op: replace | ||
path: /spec/schedule | ||
value: "15,45 8-18 * * 1-5" | ||
- op: replace | ||
path: /spec/jobTemplate/spec/template/spec/containers/0/args | ||
value: ["manage.py", "check_azure_accounts", "--help"] | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: itassets-cronjob | ||
spec: | ||
schedule: "15,45 8-18 * * 1-5" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: itassets-cronjob | ||
args: ["manage.py", "check_azure_accounts"] | ||
env: | ||
- name: DATABASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: DATABASE_URL | ||
- name: AZURE_TENANT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: AZURE_TENANT_ID | ||
- name: MS_GRAPH_API_CLIENT_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: MS_GRAPH_API_CLIENT_ID | ||
- name: MS_GRAPH_API_CLIENT_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: MS_GRAPH_API_CLIENT_SECRET | ||
- name: AZURE_CONNECTION_STRING | ||
valueFrom: | ||
secretKeyRef: | ||
name: itassets-env-prod | ||
key: AZURE_CONNECTION_STRING |
9 changes: 2 additions & 7 deletions
9
kustomize/overlays/prod/cronjobs/deptusers-check-onprem/kustomization.yaml
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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../../../template | ||
- ../../../../template | ||
nameSuffix: -deptusers-check-onprem | ||
patches: | ||
- target: | ||
group: batch | ||
version: v1 | ||
kind: CronJob | ||
name: itassets-cronjob | ||
path: patch.yaml | ||
- path: patch.yaml |
Oops, something went wrong.