Skip to content

Commit 4cc9a3d

Browse files
TalShafirrkrmr33
andauthored
change logshipper implementation (#116)
* change logshipper implementation * bump version * gke support --------- Co-authored-by: Roi Kramer <roik@netapp.com>
1 parent 26999cd commit 4cc9a3d

File tree

7 files changed

+71
-30
lines changed

7 files changed

+71
-30
lines changed

charts/ocean-kubernetes-controller/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: ocean-kubernetes-controller
33
description: A Helm chart for Ocean Kubernetes Controller
44
type: application
5-
version: 0.1.32
6-
appVersion: 2.0.52
5+
version: 0.1.33
6+
appVersion: 2.0.53
77
kubeVersion: ">=1.20.0-0"
88
maintainers:
99
- name: spotinst

charts/ocean-kubernetes-controller/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ocean-kubernetes-controller
22

3-
![Version: 0.1.32](https://img.shields.io/badge/Version-0.1.32-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.52](https://img.shields.io/badge/AppVersion-2.0.52-informational?style=flat-square)
3+
![Version: 0.1.33](https://img.shields.io/badge/Version-0.1.33-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.53](https://img.shields.io/badge/AppVersion-2.0.53-informational?style=flat-square)
44

55
A Helm chart for Ocean Kubernetes Controller.
66

@@ -101,10 +101,10 @@ Kubernetes: `>=1.20.0-0`
101101
| livenessProbe.httpGet.port | string | `"readiness"` | |
102102
| livenessProbe.initialDelaySeconds | int | `15` | |
103103
| livenessProbe.periodSeconds | int | `20` | |
104-
| logShipping | object | `{"destination":{"host":"api.spotinst.io","port":443,"tls":true},"enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"public.ecr.aws/aws-observability/aws-for-fluent-bit","tag":"stable"}}` | Log Shipping configuration. |
104+
| logShipping | object | `{"destination":{"host":"api.spotinst.io","port":443,"tls":true},"enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"cr.fluentbit.io/fluent/fluent-bit","tag":"3.0.1"}}` | Log Shipping configuration. |
105105
| logShipping.destination | object | `{"host":"api.spotinst.io","port":443,"tls":true}` | Log shipping destination configuration. |
106106
| logShipping.enabled | bool | `true` | Specifies whether to send the controller logs to Spot for analysis. (Optional) |
107-
| logShipping.image | object | `{"pullPolicy":"IfNotPresent","repository":"public.ecr.aws/aws-observability/aws-for-fluent-bit","tag":"stable"}` | Specifies the log shipping container image. (Optional) |
107+
| logShipping.image | object | `{"pullPolicy":"IfNotPresent","repository":"cr.fluentbit.io/fluent/fluent-bit","tag":"3.0.1"}` | Specifies the log shipping container image. (Optional) |
108108
| metrics-server.args | list | `["--logtostderr"]` | Arguments to pass to metrics-server on start up. (Optional) |
109109
| metrics-server.deployChart | bool | `true` | Specifies whether the metrics-server chart should be deployed. (Optional) |
110110
| metrics-server.image.pullPolicy | string | `"IfNotPresent"` | |
@@ -118,12 +118,13 @@ Kubernetes: `>=1.20.0-0`
118118
| podSecurityContext.runAsGroup | int | `10001` | |
119119
| podSecurityContext.runAsNonRoot | bool | `true` | |
120120
| podSecurityContext.runAsUser | int | `10001` | |
121-
| priorityClassName | string | `"system-cluster-critical"` | |
121+
| priorityClassName | string | `"system-node-critical"` | Priority class name for the controller pod. |
122122
| readinessProbe.httpGet.path | string | `"/readyz"` | |
123123
| readinessProbe.httpGet.port | string | `"readiness"` | |
124124
| readinessProbe.initialDelaySeconds | int | `5` | |
125125
| readinessProbe.periodSeconds | int | `10` | |
126126
| replicas | int | `2` | Configure the amount of replicas for the controller (Optional) |
127+
| resourceQuota | object | `{"enabled":true}` | Resource Quota configuration. Required when running in a namespace other than kube-system in GKE. Ref: https://kubernetes.io/docs/concepts/policy/resource-quotas/ |
127128
| resources | object | `{}` | |
128129
| schedulerName | string | `""` | |
129130
| secret.create | bool | `true` | Controls whether a Secret should be created. (Optional) |
@@ -140,7 +141,7 @@ Kubernetes: `>=1.20.0-0`
140141
| spotinst.clusterIdentifier | string | `""` | Unique identifier used by the Ocean Controller to connect (Required) between the Ocean backend and the Kubernetes cluster. Ref: https://docs.spot.io/ocean/tutorials/spot-kubernetes-controller/ |
141142
| spotinst.disableAutoUpdate | bool | `false` | Disable auto update. (Optional) |
142143
| spotinst.disableAutomaticRightSizing | bool | `false` | Disable automatic RightSizing. (Optional) |
143-
| spotinst.enableCsrApproval | bool | `false` | Enable CSR approval. (Optional) |
144+
| spotinst.enableCsrApproval | bool | `true` | Enable CSR approval. (Optional) |
144145
| spotinst.proxyUrl | string | `""` | Proxy URL. (Optional) |
145146
| spotinst.token | string | `""` | Spot Token. (Required) Ref: https://docs.spot.io/administration/api/create-api-token |
146147
| tolerations | string | `nil` | Tolerations for nodes that have taints on them. (Optional) Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ |

charts/ocean-kubernetes-controller/templates/auto-update/role.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ rules:
5454
resources: [ "rolebindings" ]
5555
resourceNames: [ {{ include "ocean-kubernetes-controller.fullname" . }} ]
5656
verbs: [ "get", "patch" ]
57+
{{- if and (ne .Release.Namespace "kube-system") .Values.resourceQuota.enabled }}
58+
- apiGroups: [ "" ]
59+
resources: [ "resourcequotas" ]
60+
resourceNames: [ {{ include "ocean-kubernetes-controller.fullname" . }} ]
61+
verbs: [ "get", "patch" ]
62+
{{- end }}
5763

5864
# Metrics Server requires
5965
{{- if (index .Values "metrics-server" "deployChart") }}

charts/ocean-kubernetes-controller/templates/clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ rules:
6464
# ---------------------------------------------------------------------------
6565
- apiGroups: ["certificates.k8s.io"]
6666
resources: ["certificatesigningrequests"]
67-
verbs: ["get", "list", "delete", "create"]
67+
verbs: ["get", "list", "delete", "create", "watch"]
6868
- apiGroups: ["certificates.k8s.io"]
6969
resources: ["certificatesigningrequests/approval"]
7070
verbs: ["patch", "update"]

charts/ocean-kubernetes-controller/templates/configmap.yaml

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,50 @@ data:
2626
[INPUT]
2727
Name tail
2828
Path /var/log/controller.logs
29-
Parser klog
29+
Parser json
3030
Buffer_Max_Size 2MB
3131
Skip_Long_Lines On
32+
Skip_Empty_Lines On
33+
Refresh_Interval 10
34+
35+
# rename msg -> message , level -> l
36+
[FILTER]
37+
Name modify
38+
Match *
39+
Rename msg message
40+
Rename level l
41+
42+
# info -> INFO
43+
[FILTER]
44+
Name modify
45+
Match *
46+
47+
Condition Key_Value_Equals l info
48+
SET l INFO
49+
50+
# debug -> DEBUG
51+
[FILTER]
52+
Name modify
53+
Match *
54+
55+
Condition Key_Value_Equals l debug
56+
SET l DEBUG
57+
58+
# trace -> TRACE
59+
[FILTER]
60+
Name modify
61+
Match *
62+
63+
Condition Key_Value_Equals l trace
64+
SET l TRACE
65+
66+
# error -> ERROR
67+
[FILTER]
68+
Name modify
69+
Match *
70+
71+
Condition Key_Value_Equals l error
72+
SET l ERROR
3273
3374
# nest all fields under log key
3475
[FILTER]
@@ -38,13 +79,6 @@ data:
3879
Wildcard *
3980
Nest_Under log
4081
41-
# covert log level (E -> ERROR, I -> INFO)
42-
[FILTER]
43-
Name Lua
44-
Match *
45-
call covert_log_lvl
46-
code function covert_log_lvl(tag, timestamp, record) new_record = record local newLvl = "INFO" if record["log"]["l"] == "E" then newLvl = "ERROR" end new_record["log"]["l"] = newLvl return 1, timestamp, new_record end
47-
4882
# stringify log field
4983
[FILTER]
5084
Name Lua
@@ -64,11 +98,7 @@ data:
6498
Retry_Limit no_retries
6599
parsers.conf: |
66100
[PARSER]
67-
Name klog
68-
Format regex
69-
Time_Key time
70-
Time_Keep true
71-
Time_Format %H:%M:%S.%L
72-
Regex (?<l>\S)(?<month>\d{2})(?<day>\d{2})\s(?<time>\d{2}:\d{2}:\d{2}\.\d{6})\s*(?<thread>\d*)\s(?<file>[^\]]*)\]\s(?<message>.*)
101+
Name json
102+
Format json
73103
{{- end }}
74104
{{- end }}

charts/ocean-kubernetes-controller/templates/deployment.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ spec:
2121
# This will restart the deployment in case of configmap/secret changes
2222
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
2323
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
24+
kubectl.kubernetes.io/default-container: {{ .Chart.Name }}
2425

2526
{{- with .Values.podAnnotations }}
2627
{{- toYaml . | nindent 8 }}
@@ -54,12 +55,9 @@ spec:
5455
- {{ . }}
5556
{{- end }}
5657
{{- if eq (include "ocean-kubernetes-controller.logShipping.enabled" .) "true" }}
58+
- --log_to_file
5759
- --log_file=/var/log/controller.logs
58-
- --logtostderr=false
59-
- --skip_log_headers=true
6060
- --log_file_max_size=1
61-
- --stderrthreshold=INFO
62-
- -v=2
6361
{{- end }}
6462
env:
6563
- name: SPOTINST_TOKEN

charts/ocean-kubernetes-controller/values.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spotinst:
2222
# -- Disable auto update. (Optional)
2323
disableAutoUpdate: false
2424
# -- Enable CSR approval. (Optional)
25-
enableCsrApproval: false
25+
enableCsrApproval: true
2626
# -- Disable automatic RightSizing. (Optional)
2727
disableAutomaticRightSizing: false
2828

@@ -83,7 +83,13 @@ podSecurityContext:
8383
runAsGroup: 10001
8484
fsGroup: 10001
8585

86-
priorityClassName: system-cluster-critical
86+
# -- Priority class name for the controller pod.
87+
priorityClassName: system-node-critical
88+
89+
# -- Resource Quota configuration. Required when running in a namespace other than kube-system in GKE.
90+
# Ref: https://kubernetes.io/docs/concepts/policy/resource-quotas/
91+
resourceQuota:
92+
enabled: true
8793

8894
# Container Security Context
8995
securityContext:
@@ -196,8 +202,8 @@ logShipping:
196202

197203
# -- Specifies the log shipping container image. (Optional)
198204
image:
199-
repository: public.ecr.aws/aws-observability/aws-for-fluent-bit
200-
tag: "stable"
205+
repository: cr.fluentbit.io/fluent/fluent-bit
206+
tag: "3.0.1"
201207
pullPolicy: IfNotPresent
202208

203209
# -- Log shipping destination configuration.

0 commit comments

Comments
 (0)