Skip to content

Commit

Permalink
Passthrough new helm values as environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Oct 15, 2023
1 parent f14db29 commit e38ab15
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
20 changes: 20 additions & 0 deletions charts/karpenter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ spec:
containerName: controller
divisor: "0"
resource: limits.memory
- name: BATCH_MAX_DURATION
value: "{{ .Values.settings.batchMaxDuration }}"
- name: BATCH_IDLE_DURATION
value: "{{ .Values.settings.batchIdleDuration }}"
- name: ASSUME_ROLE_ARN
value: "{{ or .Values.settings.assumeRoleARN .Values.settings.aws.assumeRoleARN }}"
- name: ASSUME_ROLE_ARN
value: "{{ or .Values.settings.assumeRoleDuration .Values.settings.aws.assumeRoleDuration }}"
- name: CLUSTER_CA_BUNDLE
value: "{{ or .Values.settings.clusterCABundle .Values.settings.aws.clusterCABundle }}"
- name: CLUSTER_NAME
value: "{{ or .Values.settings.clusterName .Values.settings.aws.clusterName }}"
- name: CLUSTER_ENDPOINT
value: "{{ or .Values.settings.clusterEndpoint .Values.settings.aws.clusterEndpoint }}"
- name: ISOLATED_VPC
value: "{{ or .Values.settings.isolatedVPC .Values.settings.aws.isolatedVPC }}"
- name: VM_MEMORY_OVERHEAD_PERCENT
value: "{{ or .Values.settings.vmMemoryOverheadPercent .Values.settings.aws.vmMemoryOverheadPercent }}"
- name: INTERRUPTION_QUEUE_NAME
value: "{{ or .Values.settings.interruptionQueueName .Values.settings.aws.interruptionQueueName }}"
{{- with .Values.controller.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
22 changes: 20 additions & 2 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ webhook:
logLevel: debug
# -- Global log encoding (Deprecated: Use logConfig.logEncoding instead)
logEncoding: console
# -- Log configuration
# -- Log configuration (Deprecated: Logging configuration will be dropped by v1, use logLevel instead)
logConfig:
# -- Whether to enable provisioning and mounting the log ConfigMap
enabled: true
Expand All @@ -180,7 +180,25 @@ settings:
# faster than this time, the batching window will be extended up to the maxDuration. If they arrive slower, the pods
# will be batched separately.
batchIdleDuration: 1s
# -- AWS-specific configuration values
# -- Role to assume for calling AWS services.
assumeRoleARN: ""
# -- Duration of assumed credentials in minutes. Default value is 15 minutes. Not used unless aws.assumeRoleARN set.
assumeRoleDuration: 15m
# -- Cluster CA bundle for TLS configuration of provisioned nodes. If not set, this is taken from the controller's TLS configuration for the API server.
clusterCABundle: ""
# -- Cluster name.
clusterName: ""
# -- Cluster endpoint. If not set, will be discovered during startup (EKS only)
clusterEndpoint: ""
# -- If true then assume we can't reach AWS services which don't have a VPC endpoint
# This also has the effect of disabling look-ups to the AWS pricing endpoint
isolatedVPC: false
# -- The VM memory overhead as a percent that will be subtracted from the total memory for all instance types
vmMemoryOverheadPercent: 0.075
# -- interruptionQueueName is disabled if not specified. Enabling interruption handling may
# require additional permissions on the controller service account. Additional permissions are outlined in the docs.
interruptionQueueName: ""
# -- AWS-specific configuration values (Deprecated: Use values without the "aws" prefix instead)
aws:
# -- Role to assume for calling AWS services.
assumeRoleARN: ""
Expand Down
2 changes: 2 additions & 0 deletions website/content/en/preview/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ Snapshot releases are tagged with the git commit hash prefixed by the Karpenter

* 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.
* Karpenter now moves all AWS controller-wide configuration settings from the `settings.aws` block into the top-level `settings` block. The previous `settings.aws` block is deprecated and will be dropped at v0.32.0.

### Upgrading to v0.31.0+

Expand Down

0 comments on commit e38ab15

Please sign in to comment.