Skip to content

Commit

Permalink
BREAKING: Fix helm ordering of values and set default log encoding to…
Browse files Browse the repository at this point in the history
… `json` (aws#4921)
  • Loading branch information
jonathan-innis authored Oct 25, 2023
1 parent e3923c4 commit f6d1a28
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions charts/karpenter/templates/configmap-logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data:
# https://github.com/uber-go/zap/blob/aa3e73ec0896f8b066ddf668597a02f89628ee50/config.go
zap-logger-config: |
{
"level": "{{ or .Values.logConfig.logLevel.global .Values.logLevel }}",
"level": "{{ .Values.logConfig.logLevel.global }}",
"development": false,
"disableStacktrace": true,
"disableCaller": true,
Expand All @@ -24,7 +24,7 @@ data:
},
"outputPaths": [{{ include "karpenter.outputPathsList" . }}],
"errorOutputPaths": [{{ include "karpenter.errorOutputPathsList" . }}],
"encoding": "{{ or .Values.logConfig.logEncoding .Values.logEncoding }}",
"encoding": "{{ or .Values.logEncoding .Values.logConfig.logEncoding }}",
"encoderConfig": {
"timeKey": "time",
"levelKey": "level",
Expand All @@ -36,6 +36,6 @@ data:
"timeEncoder": "iso8601"
}
}
loglevel.controller: {{ or .Values.logConfig.logLevel.controller .Values.controller.logLevel }}
loglevel.webhook: {{ or .Values.logConfig.logLevel.webhook .Values.webhook.logLevel }}
loglevel.controller: {{ or .Values.controller.logLevel .Values.logConfig.logLevel.controller }}
loglevel.webhook: {{ or .Values.webhook.logLevel .Values.logConfig.logLevel.webhook }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/karpenter/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ data:
aws.reservedENIs: "{{ . }}"
{{- end }}
{{- with .Values.settings.featureGates.driftEnabled }}
featureGates.driftEnabled: "${{ . }}"
featureGates.driftEnabled: "{{ . }}"
{{- end }}

24 changes: 13 additions & 11 deletions charts/karpenter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ spec:
- name: DISABLE_WEBHOOK
value: "true"
{{- end }}
{{- with .Values.logLevel }}
- name: LOG_LEVEL
value: "{{ .Values.logLevel }}"
value: "{{ . }}"
{{- end }}
- name: METRICS_PORT
value: "{{ .Values.controller.metrics.port }}"
- name: HEALTH_PROBE_PORT
Expand All @@ -99,7 +101,7 @@ spec:
divisor: "0"
resource: limits.memory
- name: FEATURE_GATES
value: "Drift={{ or .Values.settings.featureGates.drift .Values.settings.featureGates.driftEnabled }}"
value: "Drift={{ or .Values.settings.featureGates.driftEnabled .Values.settings.featureGates.drift }}"
{{- with .Values.settings.batchMaxDuration }}
- name: BATCH_MAX_DURATION
value: "{{ . }}"
Expand All @@ -108,39 +110,39 @@ spec:
- name: BATCH_IDLE_DURATION
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.assumeRoleARN .Values.settings.aws.assumeRoleARN }}
{{- with or .Values.settings.aws.assumeRoleARN .Values.settings.assumeRoleARN }}
- name: ASSUME_ROLE_ARN
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.assumeRoleDuration .Values.settings.aws.assumeRoleDuration }}
{{- with or .Values.settings.aws.assumeRoleDuration .Values.settings.assumeRoleDuration }}
- name: ASSUME_ROLE_DURATION
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.clusterCABundle .Values.settings.aws.clusterCABundle }}
{{- with or .Values.settings.aws.clusterCABundle .Values.settings.clusterCABundle }}
- name: CLUSTER_CA_BUNDLE
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.clusterName .Values.settings.aws.clusterName }}
{{- with or .Values.settings.aws.clusterName .Values.settings.clusterName }}
- name: CLUSTER_NAME
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.clusterEndpoint .Values.settings.aws.clusterEndpoint }}
{{- with or .Values.settings.aws.clusterEndpoint .Values.settings.clusterEndpoint }}
- name: CLUSTER_ENDPOINT
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.isolatedVPC .Values.settings.aws.isolatedVPC }}
{{- with or .Values.settings.aws.isolatedVPC .Values.settings.isolatedVPC }}
- name: ISOLATED_VPC
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.vmMemoryOverheadPercent .Values.settings.aws.vmMemoryOverheadPercent }}
{{- with or .Values.settings.aws.vmMemoryOverheadPercent .Values.settings.vmMemoryOverheadPercent }}
- name: VM_MEMORY_OVERHEAD_PERCENT
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.interruptionQueue .Values.settings.aws.interruptionQueueName }}
{{- with or .Values.settings.aws.interruptionQueueName .Values.settings.interruptionQueue }}
- name: INTERRUPTION_QUEUE
value: "{{ . }}"
{{- end }}
{{- with or .Values.settings.reservedENIs .Values.settings.aws.reservedENIs }}
{{- with or .Values.settings.aws.reservedENIs .Values.settings.reservedENIs }}
- name: RESERVED_ENIS
value: "{{ . }}"
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ logConfig:
# -- Log errorOutputPaths - defaults to stderr only
errorOutputPaths:
- stderr
# -- Log encoding - defaults to console - must be one of 'json', 'console'
logEncoding: console
# -- Log encoding - defaults to json - must be one of 'json', 'console'
logEncoding: json
# -- Component-based log configuration
logLevel:
# -- Global log level, defaults to 'debug'
Expand Down
1 change: 1 addition & 0 deletions website/content/en/preview/upgrading/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ If you are using some IaC for managing your policy documents attached to the con
* Karpenter now serves the webhook prometheus metrics server on port `8001`. If this port is already in-use on the pod or you are running in `hostNetworking` mode, you may need to change this port value. You can configure this port value through the `WEBHOOK_METRICS_PORT` environment variable or the `webhook.metrics.port` value if installing via Helm.
* Karpenter now exposes the ability to disable webhooks through the `webhook.enabled=false` value. This value will disable the webhook server and will prevent any permissions, mutating or validating webhook configurations from being deployed to the cluster.
* Karpenter now moves all logging configuration for the Zap logger into the `logConfig` values block. Configuring Karpenter logging with this mechanism _is_ deprecated and will be dropped at v1. Karpenter now only surfaces logLevel through the `logLevel` helm value. If you need more advanced configuration due to log parsing constraints, we recommend configuring your log parser to handle Karpenter's Zap JSON logging.
* The default log encoding changed from `console` to `json`. If you were previously not setting the type of log encoding, this default will change with the helm chart. If you were setting the value through `logEncoding`, this value will continue to work until v0.33.x but it is deprecated in favor of `logConfig.logEncoding`

### Upgrading to v0.31.0+

Expand Down

0 comments on commit f6d1a28

Please sign in to comment.