-
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.
Merge pull request #35 from meisterplan/feature/KNUTH-76836-apolloalp…
…aca-schema-sync-zu- KNUTH-76836 Apolloalpaca Schema sync zu Rolle umziehen
- Loading branch information
Showing
11 changed files
with
181 additions
and
1 deletion.
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
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
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,4 +1,4 @@ | ||
apiVersion: v1 | ||
name: cronjob | ||
description: A generalized cronjob that can access secrets. | ||
version: 1.3.0 | ||
version: 1.4.0 |
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
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,9 @@ | ||
{{- if .Values.podRoleArn }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Values.cronJobName }} | ||
namespace: {{ .Values.namespace }} | ||
annotations: | ||
eks.amazonaws.com/role-arn: '{{ .Values.podRoleArn }}' | ||
{{- end }} |
53 changes: 53 additions & 0 deletions
53
tests/cronjob/service-account-cronjob/expected/cronjob/templates/cronjob.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,53 @@ | ||
--- | ||
# Source: cronjob/templates/cronjob.yaml | ||
kind: CronJob | ||
apiVersion: batch/v1 | ||
metadata: | ||
name: "simple-job-staging" | ||
namespace: "team-superpower" | ||
spec: | ||
concurrencyPolicy: "Replace" | ||
schedule: "22 */5 * * *" | ||
suspend: false | ||
jobTemplate: | ||
spec: | ||
backoffLimit: 0 | ||
parallelism: 1 | ||
completions: 1 | ||
template: | ||
spec: | ||
serviceAccountName: simple-job-staging | ||
restartPolicy: Never | ||
imagePullSecrets: | ||
- name: docker.pkg.github.com | ||
- name: ghcr.io | ||
containers: | ||
- name: "simple-job-staging" | ||
image: "docker.pkg.github.com/my-company/myservice:1.30.7" | ||
args: | ||
- /bin/bash | ||
- echo "42" | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 64Mi | ||
limits: | ||
cpu: 1 | ||
memory: 64Mi | ||
|
||
env: | ||
- name: "AWS_ACCESS_KEY_ID" | ||
valueFrom: | ||
secretKeyRef: | ||
name: "simple-job-staging-external-secret" | ||
key: "AWS_ACCESS_KEY_ID" | ||
- name: "THIRD_PARTY_API_KEY" | ||
valueFrom: | ||
secretKeyRef: | ||
name: "simple-job-staging-external-secret" | ||
key: "THIRD_PARTY_API_KEY" | ||
- name: ENVIRONMENT | ||
value: production | ||
- name: VARIANT | ||
value: staging |
32 changes: 32 additions & 0 deletions
32
.../service-account-cronjob/expected/cronjob/templates/post-deployment/prometheus-rules.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,32 @@ | ||
--- | ||
# Source: cronjob/templates/post-deployment/prometheus-rules.yaml | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
namespace: "team-superpower" | ||
labels: | ||
app: kube-prometheus-stack | ||
release: prometheus | ||
name: "simple-job-staging" | ||
spec: | ||
groups: | ||
- name: "simple-job-staging" | ||
rules: | ||
- alert: "simple-job-staging_MyCronjobFailed" | ||
expr: "absent(cronjob_up)" | ||
for: "5m" | ||
labels: | ||
service: "simple-job-staging" | ||
namespace: "team-superpower" | ||
annotations: | ||
description: "The job {{ $labels.job_name }} has exited with failure exit code." | ||
playbook_url: "https://my-playbook-collection/abc" | ||
- alert: "simple-job-staging_MyCronjobStagingAlert" | ||
expr: "rate(cronjob_executions) < 1000" | ||
for: "5m" | ||
labels: | ||
service: "simple-job-staging" | ||
namespace: "team-superpower" | ||
annotations: | ||
description: "Simple-Job {{ $labels.job_name }} has too few executions" | ||
playbook_url: "https://my-playbook-collection/xyz" |
15 changes: 15 additions & 0 deletions
15
tests/cronjob/service-account-cronjob/expected/cronjob/templates/pre-deployment/secret.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,15 @@ | ||
--- | ||
# Source: cronjob/templates/pre-deployment/secret.yaml | ||
apiVersion: "kubernetes-client.io/v1" | ||
kind: ExternalSecret | ||
metadata: | ||
namespace: team-superpower | ||
name: simple-job-staging-external-secret | ||
spec: | ||
backendType: systemManager | ||
roleArn: arn:aws:iam::1234567890:role/read-secrets-role-staging-team-superpower | ||
data: | ||
- name: "AWS_ACCESS_KEY_ID" | ||
key: "/staging/aws/access-key-id" | ||
- name: "THIRD_PARTY_API_KEY" | ||
key: "/staging/third-party/api-key" |
9 changes: 9 additions & 0 deletions
9
...job/service-account-cronjob/expected/cronjob/templates/pre-deployment/serviceaccount.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,9 @@ | ||
--- | ||
# Source: cronjob/templates/pre-deployment/serviceaccount.yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: simple-job-staging | ||
namespace: team-superpower | ||
annotations: | ||
eks.amazonaws.com/role-arn: 'arn:aws:iam::1234567890:role/role-while-executing-superpower-things-staging-team-superpower' |
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,17 @@ | ||
cronJobName: "simple-job-staging" | ||
podRoleArn: arn:aws:iam::1234567890:role/role-while-executing-superpower-things-staging-team-superpower | ||
|
||
env: | ||
fromSecret: | ||
THIRD_PARTY_API_KEY: | ||
parameterName: third-party/api-key | ||
additional: | ||
VARIANT: | ||
value: staging | ||
|
||
alertingRules: | ||
MyCronjobStagingAlert: | ||
expr: rate(cronjob_executions) < 1000 | ||
for: 5m | ||
description: Simple-Job {{ $labels.job_name }} has too few executions | ||
playbook_url: https://my-playbook-collection/xyz |
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,37 @@ | ||
namespace: team-superpower | ||
cronJobName: save-the-world | ||
|
||
clusterName: staging | ||
secretsRoleArn: arn:aws:iam::1234567890:role/read-secrets-role-staging-team-superpower | ||
|
||
schedule: "22 */5 * * *" | ||
|
||
image: | ||
repository: docker.pkg.github.com/my-company/myservice | ||
tag: "1.30.7" | ||
|
||
args: | ||
- /bin/bash | ||
- echo "42" | ||
|
||
resources: | ||
memory: 64Mi | ||
cpu: | ||
guarantee: 100m | ||
limit: 1 | ||
|
||
env: | ||
fromSecret: | ||
AWS_ACCESS_KEY_ID: | ||
parameterName: aws/access-key-id | ||
additional: | ||
ENVIRONMENT: | ||
value: "production" | ||
|
||
alertingRules: | ||
MyCronjobFailed: | ||
expr: absent(cronjob_up) | ||
for: 5m | ||
summary: The job {{ $labels.job_name }} has failed | ||
description: The job {{ $labels.job_name }} has exited with failure exit code. | ||
playbook_url: https://my-playbook-collection/abc |