Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sesamy-gtm): bump deps & add schema #46

Merged
merged 1 commit into from
Nov 16, 2024
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ schema:
@echo "--- schema ---------------------------------------"
helm-schema -n -c charts/beam
helm-schema -n -c charts/namespace
helm-schema -n -c charts/sesamy-gtm
helm-schema -n -c charts/squadron-keel-server
helm-schema -n -c charts/squadron-keel-cronjob
helm-schema -n -c charts/squadron-nextjs-server
helm schema-gen charts/contentserver/values.yaml > charts/contentserver/values.schema.json
helm schema-gen charts/csp-reporter/values.yaml > charts/csp-reporter/values.schema.json
helm schema-gen charts/gateway-crds/values.yaml > charts/gateway-crds/values.schema.json
helm schema-gen charts/sesamy-gtm/values.yaml > charts/sesamy-gtm/values.schema.json
helm schema-gen charts/sesamy-umami/values.yaml > charts/sesamy-umami/values.schema.json
#@set -e; for dir in ./charts/* ; do \
# helm-schema -n -c $${dir} ;\
Expand Down
6 changes: 0 additions & 6 deletions charts/sesamy-gtm/Chart.lock

This file was deleted.

8 changes: 1 addition & 7 deletions charts/sesamy-gtm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@ annotations:
url: https://github.com/foomo/helm-charts
- name: GTM Changelog
url: https://developers.google.com/tag-platform/tag-manager/server-side/release-notes
dependencies:
- name: loki
alias: loki
version: 6.6.1
repository: https://grafana.github.io/helm-charts
condition: loki.enabled
version: 0.0.6
version: 0.1.0
appVersion: 2.4.0
294 changes: 156 additions & 138 deletions charts/sesamy-gtm/README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions charts/sesamy-gtm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "sesamy.gtm.chart-revision" -}}
{{- printf "%s-%s-%d" .Chart.Name .Chart.Version .Release.Revision | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
Expand Down
69 changes: 30 additions & 39 deletions charts/sesamy-gtm/templates/collect/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ metadata:
{{- include "sesamy.gtm.collect.labels" . | nindent 4 }}
namespace: {{ include "sesamy.gtm.namespace" . }}
spec:
{{- if not .Values.collect.autoscaling.enabled }}
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.collect.replicaCount }}
{{- end }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
strategy:
type: {{ .Values.updateStrategy }}
selector:
matchLabels:
{{- include "sesamy.gtm.collect.selectorLabels" . | nindent 6 }}
Expand All @@ -22,25 +24,22 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- if .Values.collect.roll }}
rollme: {{ randAlphaNum 5 | quote }}
{{- if .Values.collect.image.recreate }}
helm.sh/chart: {{ include "sesamy.gtm.chart-revision" . }}
{{- end }}
{{- with .Values.collect.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "sesamy.gtm.serviceAccountName" . }}
{{- with .Values.collect.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
imagePullSecrets: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.collect.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
hostAliases: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.collect.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: gtm-collect
Expand All @@ -49,8 +48,7 @@ spec:
imagePullPolicy: {{ .pullPolicy }}
{{- end }}
{{- with .Values.collect.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- range $name, $port := $.Values.collect.service.ports }}
Expand All @@ -62,51 +60,44 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
env: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
envFrom: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.startupProbe }}
startupProbe:
{{- toYaml . | nindent 12 }}
startupProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
readinessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.resources }}
resources:
{{- toYaml . | nindent 12 }}
resources: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
volumeMounts: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.collect.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- if .Values.scheduling.enabled }}
{{- with .Values.scheduling.priorityClass }}
priorityClassName: {{ . }}
{{- end }}
{{- with .Values.collect.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- with .Values.scheduling.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.collect.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- with .Values.scheduling.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.scheduling.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.collect.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.collect.extraVolumes }}
volumes: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.collect.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
41 changes: 41 additions & 0 deletions charts/sesamy-gtm/templates/collect/horizontalpodautoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.collect.enabled }}
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "sesamy.gtm.collect.fullname" . }}
labels:
{{- include "sesamy.gtm.collect.labels" . | nindent 4 }}
namespace: {{ include "sesamy.gtm.namespace" . }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "sesamy.gtm.collect.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPU }}
{{- end }}
{{- if .Values.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- end }}
{{- with .Values.autoscaling.additionalMetrics }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.autoscaling.behavior }}
behavior: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
47 changes: 0 additions & 47 deletions charts/sesamy-gtm/templates/collect/hpa.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion charts/sesamy-gtm/templates/collect/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ spec:
selector:
matchLabels:
{{- include "sesamy.gtm.collect.selectorLabels" . | nindent 6 }}
{{- with .Values.collect.maxUnavailable }}
{{- with .Values.autoscaling.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with .Values.autoscaling.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/sesamy-gtm/templates/collect/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ metadata:
spec:
type: {{ .Values.collect.service.type }}
ports:
{{- if .Values.serviceMonitor.enabled }}
- name: prometheus
port: 9200
targetPort: 9200
{{- end }}
{{- range $name, $port := $.Values.collect.service.ports }}
- name: {{ $name }}
port: {{ $port }}
Expand Down
40 changes: 11 additions & 29 deletions charts/sesamy-gtm/templates/collect/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,41 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "sesamy.gtm.collect.fullname" $ }}
{{- with .Values.serviceMonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "sesamy.gtm.collect.labels" $ | nindent 4 }}
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- else }}
namespace: {{ include "sesamy.gtm.namespace" . }}
{{- with .Values.serviceMonitor.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ include "sesamy.gtm.namespace" . }}
spec:
{{- with .Values.serviceMonitor.namespaceSelector }}
namespaceSelector:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "sesamy.gtm.collect.selectorLabels" $ | nindent 6 }}
{{- with .Values.serviceMonitor.matchExpressions }}
matchExpressions:
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "sesamy.gtm.namespace" . }}
{{- end }}
endpoints:
- port: http
- port: prometheus
path: /metrics
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
relabelings: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.scheme }}
scheme: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
metricRelabelings: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.targetLabels }}
targetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 0 additions & 22 deletions charts/sesamy-gtm/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
{{- if .Values.networkPolicy.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "sesamy.gtm.name" . }}-namespace-only
labels:
{{- include "sesamy.gtm.labels" . | nindent 4 }}
namespace: {{ include "sesamy.gtm.namespace" . }}
spec:
policyTypes:
- Ingress
- Egress
podSelector: {}
egress:
- to:
- podSelector: {}
ingress:
- from:
- podSelector: {}

---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -39,7 +18,6 @@ spec:
protocol: UDP
to:
- namespaceSelector: {}

---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down
Loading
Loading