Skip to content

Commit 9490556

Browse files
authored
Merge pull request #607 from logzio/feature/global-tolerations
[Feature] Add global tolerations support to sub-charts
2 parents 53fc66d + 21826c0 commit 9490556

30 files changed

+206
-38
lines changed

.github/workflows/logzio-apm-collector-test.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
run: |
4545
kind create cluster --name kind-${{ github.run_id }}-${{ matrix.mode }}
4646
kubectl cluster-info
47-
4847
- name: Deploy Helm Chart
4948
run: |
5049
cd charts/logzio-apm-collector
@@ -56,10 +55,21 @@ jobs:
5655
--set global.logzioSpmToken=${{ secrets.LOGZIO_METRICS_TOKEN }} \
5756
--set global.logzioRegion="us" \
5857
--set global.env_id=${{ env.ENV_ID }} \
58+
--set global.tolerations[0].key="global-key" \
59+
--set global.tolerations[0].operator="Equal" \
60+
--set global.tolerations[0].value="global-value" \
61+
--set global.tolerations[0].effect="NoSchedule" \
5962
logzio-apm-collector .
63+
64+
- name: Verify deployment Status
65+
run: |
6066
kubectl rollout status deployment/logzio-apm-collector --timeout=300s
6167
kubectl rollout status deployment/logzio-apm-collector-spm --timeout=300s
62-
68+
kubectl describe deployment/logzio-apm-collector-spm
69+
kubectl describe deployment/logzio-apm-collector
70+
kubectl get deployment/logzio-apm-collector -o jsonpath='{.spec.template.spec.tolerations}' | grep -q 'global-key'
71+
kubectl get deployment/logzio-apm-collector-spm -o jsonpath='{.spec.template.spec.tolerations}' | grep -q 'global-key'
72+
6373
- name: Run trace generator
6474
run: |
6575
kubectl apply -f tests/resources/tracegen-apm.yaml
@@ -83,7 +93,6 @@ jobs:
8393
go get go.uber.org/zap
8494
go test -v ./tests/traces_e2e_test.go ./tests/common.go
8595
go test -v ./tests/apm_metrics_e2e_test.go ./tests/common.go
86-
8796
- name: Cleanup Environment
8897
run: |
8998
helm uninstall logzio-apm-collector

.github/workflows/logzio-fluentd-test.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,27 @@ jobs:
4545
run: |
4646
kind create cluster --name kind-${{ github.run_id }}
4747
kubectl cluster-info
48-
4948
- name: Deploy Helm Chart
5049
run: |
5150
cd charts/fluentd
5251
helm upgrade --install \
5352
--set global.env_id=${{ env.ENV_ID }} \
53+
--set global.tolerations[0].key="global-key" \
54+
--set global.tolerations[0].operator="Equal" \
55+
--set global.tolerations[0].value="global-value" \
56+
--set global.tolerations[0].effect="NoSchedule" \
5457
--set global.logzioLogsToken=${{ secrets.LOGZIO_LOGS_TOKEN }} \
5558
--set global.logzioRegion=us \
5659
logzio-fluentd .
57-
60+
- name: Verify deployment Status
61+
run: |
62+
kubectl rollout status daemonset/logzio-fluentd --timeout=300s
63+
kubectl get daemonset logzio-fluentd -o jsonpath='{.spec.template.spec.tolerations}' | grep -q 'global-key'
64+
5865
- name: Run log generator
5966
run: |
6067
kubectl apply -f tests/resources/logsgen.yaml
6168
kubectl rollout status deployment/log-generator --timeout=300s
62-
6369
- name: sleep
6470
run: sleep 120
6571

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test `logzio-k8s-events` chart
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Install Kind
16+
run: |
17+
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.1/kind-Linux-amd64"
18+
chmod +x ./kind
19+
mv ./kind /usr/local/bin/kind
20+
21+
- name: Create Kind cluster
22+
run: |
23+
kind create cluster --name kind-${{ github.run_id }}
24+
kubectl cluster-info
25+
26+
- name: Deploy K8S Events Helm Chart
27+
run: |
28+
cd charts/logzio-k8s-events
29+
helm upgrade --install \
30+
--set global.env_id=${{ env.ENV_ID }} \
31+
--set global.tolerations[0].key="global-key" \
32+
--set global.tolerations[0].operator="Equal" \
33+
--set global.tolerations[0].value="global-value" \
34+
--set global.tolerations[0].effect="NoSchedule" \
35+
--set global.logzioLogsToken=${{ secrets.LOGZIO_LOGS_TOKEN }} \
36+
--set global.logzioRegion=us \
37+
logzio-k8s-events .
38+
39+
- name: Verify deployment Status
40+
run: |
41+
kubectl rollout status deployment/logzio-k8s-events --timeout=300s
42+
kubectl get deployment logzio-k8s-events -o json | jq '.status.numberReady == .status.desiredNumberScheduled'
43+
kubectl get deployment logzio-k8s-events -o jsonpath='{.spec.template.spec.tolerations}' | grep -q 'global-key'
44+
45+
- name: Cleanup Environment
46+
run: |
47+
kind delete cluster --name kind-${{ github.run_id }}

.github/workflows/logzio-logs-collector-test.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ jobs:
4444
run: |
4545
kind create cluster --name kind-${{ github.run_id }}
4646
kubectl cluster-info
47-
4847
- name: Deploy Helm Chart
4948
run: |
5049
cd charts/logzio-logs-collector
@@ -53,7 +52,16 @@ jobs:
5352
--set global.logzioLogsToken=${{ secrets.LOGZIO_LOGS_TOKEN }} \
5453
--set global.logzioRegion=us \
5554
--set global.logType=${{ env.ENV_ID }} \
55+
--set global.tolerations[0].key="global-key" \
56+
--set global.tolerations[0].operator="Equal" \
57+
--set global.tolerations[0].value="global-value" \
58+
--set global.tolerations[0].effect="NoSchedule" \
5659
logzio-logs-collector .
60+
61+
- name: Verify deployment Status
62+
run: |
63+
kubectl rollout status daemonset/logzio-logs-collector --timeout=300s
64+
kubectl get daemonset/logzio-logs-collector -o jsonpath='{.spec.template.spec.tolerations}' | grep -q 'global-key'
5765
5866
- name: Run log generator
5967
run: |
@@ -69,7 +77,6 @@ jobs:
6977
run: |
7078
go get go.uber.org/zap
7179
go test -v ./tests/logs_e2e_test.go ./tests/common.go
72-
7380
- name: Cleanup Environment
7481
run: |
7582
helm uninstall logzio-logs-collector

.github/workflows/logzio-telemetry-test.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
run: |
4848
kind create cluster --name kind-${{ github.run_id }}-${{ matrix.mode }}
4949
kubectl cluster-info
50-
5150
- name: Deploy Helm Chart
5251
run: |
5352
cd charts/logzio-telemetry
@@ -57,15 +56,26 @@ jobs:
5756
--set spm.enabled=true \
5857
--set serviceGraph.enabled=true \
5958
--set metrics.enabled=true \
59+
--set global.tolerations[0].key="global-key" \
60+
--set global.tolerations[0].operator="Equal" \
61+
--set global.tolerations[0].value="global-value" \
62+
--set global.tolerations[0].effect="NoSchedule" \
6063
--set global.logzioTracesToken=${{ secrets.LOGZIO_TRACES_TOKEN }} \
6164
--set global.logzioSpmToken=${{ secrets.LOGZIO_METRICS_TOKEN }} \
6265
--set global.logzioMetricsToken=${{ secrets.LOGZIO_METRICS_TOKEN }} \
6366
--set global.logzioRegion=us \
6467
--set global.env_id=${{ env.ENV_ID }} \
6568
--set collector.mode=${{ matrix.mode }} \
6669
logzio-k8s-telemetry .
70+
71+
- name: Verify deployment Status
72+
run: |
6773
kubectl rollout status deployment/logzio-k8s-telemetry-otel-collector-standalone --timeout=300s
6874
kubectl rollout status deployment/logzio-k8s-telemetry-otel-collector-spm --timeout=300s
75+
kubectl describe deployment/logzio-k8s-telemetry-otel-collector-spm
76+
kubectl describe deployment/logzio-k8s-telemetry-otel-collector-standalone
77+
kubectl get deployment/logzio-k8s-telemetry-otel-collector-spm -o jsonpath='{.spec.template.spec.tolerations}' | jq -r '.[] | select(.key=="global-key")'
78+
kubectl get deployment/logzio-k8s-telemetry-otel-collector-standalone -o jsonpath='{.spec.template.spec.tolerations}' | jq -r '.[] | select(.key=="global-key")'
6979
7080
- name: Run trace generator
7181
run: |
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test `logzio-trivy` chart
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Install Kind
16+
run: |
17+
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.1/kind-Linux-amd64"
18+
chmod +x ./kind
19+
mv ./kind /usr/local/bin/kind
20+
21+
- name: Create Kind cluster
22+
run: |
23+
kind create cluster --name kind-${{ github.run_id }}
24+
kubectl cluster-info
25+
26+
- name: Deploy Trivy Helm Chart
27+
run: |
28+
cd charts/logzio-trivy
29+
helm dependency build
30+
helm upgrade --install \
31+
--set global.env_id=${{ env.ENV_ID }} \
32+
--set global.tolerations[0].key="global-key" \
33+
--set global.tolerations[0].operator="Equal" \
34+
--set global.tolerations[0].value="global-value" \
35+
--set global.tolerations[0].effect="NoSchedule" \
36+
--set global.logzioLogsToken=${{ secrets.LOGZIO_LOGS_TOKEN }} \
37+
--set global.logzioRegion=us \
38+
logzio-trivy .
39+
40+
- name: Verify Deployment Status
41+
run: |
42+
kubectl rollout status deployment/logzio-trivy --timeout=300s
43+
kubectl get deployment logzio-trivy -o json | jq '.status.conditions[] | select(.type=="Available" and .status=="True")'
44+
kubectl get deployment logzio-trivy -o jsonpath='{.spec.template.spec.tolerations}' | grep -q 'global-key'
45+
46+
- name: Cleanup Environment
47+
run: |
48+
kind delete cluster --name kind-${{ github.run_id }}

charts/fluentd/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changes by Version
22

33
<!-- next version -->
4+
## 1.0.2
5+
- Add support for `global.tolerations`
46

57
## 1.0.1
68
- Upgrade docker image to `1.5.6`.

charts/fluentd/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A Helm chart for shipping Kubernetes logs via Fluentd.
44
keywords:
55
- logging
66
- fluentd
7-
version: 1.0.1
7+
version: 1.0.2
88
appVersion: 1.5.6
99
maintainers:
1010
- name: Yotam loewenbach

charts/fluentd/templates/daemonset.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ spec:
3333
affinity:
3434
{{ toYaml .Values.daemonset.affinity | indent 8 }}
3535
{{- end }}
36-
{{- if .Values.daemonset.tolerations }}
36+
{{- if or .Values.daemonset.tolerations .Values.global.tolerations }}
37+
{{- $allTolerations := concat (.Values.daemonset.tolerations | default list) (.Values.global.tolerations | default list) }}
3738
tolerations:
38-
{{ toYaml .Values.daemonset.tolerations | indent 6 }}
39+
{{ toYaml $allTolerations | indent 8 }}
3940
{{- end }}
4041
{{- if .Values.daemonset.podSecurityContext }}
4142
securityContext: {{ toYaml .Values.daemonset.podSecurityContext | nindent 8 }}
@@ -212,9 +213,10 @@ spec:
212213
serviceAccount: {{ template "fluentd.serviceAccount" . }}
213214
serviceAccountName: {{ template "fluentd.serviceAccount" . }}
214215
{{- end }}
215-
{{- if .Values.windowsDaemonset.tolerations }}
216+
{{- if or .Values.windowsDaemonset.tolerations .Values.global.tolerations }}
217+
{{- $allWindowsTolerations := concat (.Values.windowsDaemonset.tolerations | default list) (.Values.global.tolerations | default list) }}
216218
tolerations:
217-
{{ toYaml .Values.windowsDaemonset.tolerations | indent 6 }}
219+
{{ toYaml $allWindowsTolerations | indent 8 }}
218220
{{- end }}
219221
{{- with .Values.windowsDaemonset.nodeSelector }}
220222
nodeSelector:

charts/logzio-apm-collector/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changes by Version
22

33
<!-- next version -->
4+
## 1.2.1
5+
- Add support for global tolerations
6+
47
## 1.2.0
58
- Resolve issue preventing APM chart deployment on Fargate
69
- Upgrade OpenTelemetry Collector from `0.117.0` to `0.119.0`

charts/logzio-apm-collector/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: logzio-apm-collector
3-
version: 1.2.0
3+
version: 1.2.1
44
description: Kubernetes APM agent for Logz.io based on OpenTelemetry Collector
55
type: application
66
home: https://logz.io/

charts/logzio-apm-collector/templates/_pod-spm.tpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ nodeSelector:
148148
affinity:
149149
{{- toYaml . | nindent 2 }}
150150
{{- end }}
151-
{{- with .Values.tolerations }}
151+
{{- if or .Values.tolerations .Values.global.tolerations }}
152+
{{- $allTolerations := concat (.Values.tolerations | default list) (.Values.global.tolerations | default list) }}
152153
tolerations:
153-
{{- toYaml . | nindent 2 }}
154+
{{ toYaml $allTolerations | nindent 2 }}
154155
{{- end }}
155156
{{- with .Values.topologySpreadConstraints }}
156157
topologySpreadConstraints:

charts/logzio-apm-collector/templates/_pod.tpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ nodeSelector:
168168
affinity:
169169
{{- toYaml . | nindent 2 }}
170170
{{- end }}
171-
{{- with .Values.tolerations }}
171+
{{- if or .Values.tolerations .Values.global.tolerations }}
172+
{{- $allTolerations := concat (.Values.tolerations | default list) (.Values.global.tolerations | default list) }}
172173
tolerations:
173-
{{- toYaml . | nindent 2 }}
174+
{{ toYaml $allTolerations | nindent 2 }}
174175
{{- end }}
175176
{{- with .Values.topologySpreadConstraints }}
176177
topologySpreadConstraints:

charts/logzio-k8s-events/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changes by Version
22

33
<!-- next version -->
4-
4+
## 1.0.1
5+
- Add support for configuring tolerations
56
## 1.0.0
67
- **Breaking changes:**
78
- Secret values are now global and aligned to prevent duplicate values in the parent chart

charts/logzio-k8s-events/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords:
55
- logging
66
- k8s
77
- kubernetes
8-
version: 1.0.0
8+
version: 1.0.1
99
appVersion: 0.0.4
1010
maintainers:
1111
- name: Raul Gurshumov

charts/logzio-k8s-events/templates/deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ spec:
1818
k8s-app: {{ .Values.k8sApp }}
1919
{{- include "logzio-k8s-events.selectorLabels" . | nindent 8 }}
2020
spec:
21+
{{- if or .Values.tolerations .Values.global.tolerations }}
22+
{{- $allTolerations := concat (.Values.tolerations | default list) (.Values.global.tolerations | default list) }}
23+
tolerations:
24+
{{ toYaml $allTolerations | nindent 8 }}
25+
{{- end }}
2126
affinity:
2227
nodeAffinity:
2328
requiredDuringSchedulingIgnoredDuringExecution:

charts/logzio-k8s-events/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ global:
2626
logzioRegion: "" # Defaults to us
2727
env_id: ""
2828
customLogsEndpoint: "" # Overrides Logz.io listener
29+
tolerations: []
2930

3031
isRBAC: true
3132

@@ -36,6 +37,8 @@ serviceAccount:
3637
# If not set and create is true, a name is generated using the fullname template
3738
name: ""
3839

40+
tolerations: []
41+
3942
resources:
4043
requests:
4144
cpu: 100m

charts/logzio-logs-collector/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changes by Version
22

33
<!-- next version -->
4-
4+
## 2.0.1
5+
- Add support for global tolerations
56
## 2.0.0
67
- **Breaking changes**
78
- Secret values are now global

charts/logzio-logs-collector/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: logzio-logs-collector
3-
version: 2.0.0
3+
version: 2.0.1
44
description: kubernetes logs collection agent for logz.io based on opentelemetry collector
55
type: application
66
home: https://logz.io/

0 commit comments

Comments
 (0)