Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches: [master]
pull_request:
branches: [master]
permissions:
checks: write
contents: read
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# spring-service

## 5.5.0

- Add support for logging annotations

## 5.4.0

- Allow to configure `overwriteRequestRetries`
Expand Down Expand Up @@ -239,6 +243,10 @@ deployment** with a short 503 service disruption due to a [bug in the ingress co

# cronjob

## 3.2.0

- Add support for logging annotations

## 3.1.1

- Remove now unnecessary, confusing Helm chart labels on prom resources
Expand Down
2 changes: 1 addition & 1 deletion charts/cronjob/Chart.yaml
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: 3.1.1
version: 3.2.0
12 changes: 12 additions & 0 deletions charts/cronjob/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "k8s.annotations" }}
{{- $annotations := dict }}
{{- if ne .Values.logging.collect true }}
{{- $_ := set $annotations "com.meisterplan.logs/collect" (printf "%v" .Values.logging.collect) }}
{{- end }}
{{- if ne .Values.logging.retention "default" }}
{{- $_ := set $annotations "com.meisterplan.logs/retention" .Values.logging.retention }}
{{- end }}
{{- if $annotations }}
{{- toYaml $annotations }}
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/cronjob/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ apiVersion: batch/v1
metadata:
name: "{{ required "cronJobName must be set!" .Values.cronJobName }}"
namespace: "{{ required "Namespace must be set!" .Values.namespace }}"
{{- $annotations := include "k8s.annotations" . -}}
{{- if $annotations }}
annotations:
{{- $annotations | nindent 4 }}
{{- end }}
spec:
concurrencyPolicy: "Replace"
schedule: {{ required "Schedule must be set!" .Values.schedule | quote }}
Expand Down
4 changes: 4 additions & 0 deletions charts/cronjob/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ resources:
cpu:
guarantee: 100m

logging:
collect: true # can be toggled to turn off log collection
retention: default # can be set to 'verbose' to shorten retention

env:
fromSecret: {}
# SOME_SECRET:
Expand Down
2 changes: 1 addition & 1 deletion charts/spring-service/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: spring-service
description: A generalized deployment for Meisterplan Spring Boot services in Kubernetes.
version: 5.4.0
version: 5.5.0
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@
{{ $.Values.ingress.public.subDomain }}.{{ required "ingress.clusterDomain must be set!" $.Values.ingress.clusterDomain }}
{{- end -}}
{{- end }}

{{- define "k8s.annotations" }}
{{- $annotations := dict }}
{{- if ne .Values.logging.collect true }}
{{- $_ := set $annotations "com.meisterplan.logs/collect" (printf "%v" .Values.logging.collect) }}
{{- end }}
{{- if ne .Values.logging.retention "default" }}
{{- $_ := set $annotations "com.meisterplan.logs/retention" .Values.logging.retention }}
{{- end }}
{{- if $annotations }}
{{- toYaml $annotations }}
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/spring-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ apiVersion: apps/v1
metadata:
name: "{{ .Values.serviceName }}-{{ required "Image Tag must be set!" .Values.image.tag }}"
namespace: "{{ required "Namespace must be set!" .Values.namespace }}"
{{- $annotations := include "k8s.annotations" . -}}
{{- if $annotations }}
annotations:
{{- $annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
{{- if .Values.timeouts.progressDeadlineSeconds }}
Expand Down
4 changes: 4 additions & 0 deletions charts/spring-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ resources:
cpu:
guarantee: 100m

logging:
collect: true # can be toggled to turn off log collection
retention: default # can be set to 'verbose' to shorten retention

ingress:
clusterDomain: "" # domain of the cluster, e.g. meisterplan.io
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ apiVersion: batch/v1
metadata:
name: "simple-job-staging"
namespace: "team-superpower"
annotations:
com.meisterplan.logs/collect: "false"
spec:
concurrencyPolicy: "Replace"
schedule: "22 */5 * * *"
Expand Down
3 changes: 3 additions & 0 deletions tests/cronjob/service-account-cronjob/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ resources:
cpu:
guarantee: 100m

logging:
collect: false

env:
fromSecret:
AWS_ACCESS_KEY_ID:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ apiVersion: apps/v1
metadata:
name: "myservice-1.30.7"
namespace: "team-supercool"
annotations:
com.meisterplan.logs/retention: verbose
spec:
replicas: 5
selector:
Expand Down
3 changes: 3 additions & 0 deletions tests/spring-service/complex-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ resources:
cpu:
guarantee: 500m

logging:
retention: verbose

ingress:
clusterDomain: "mycompany.tld"
public:
Expand Down