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

add default provisioner to helm chart #786

Merged
merged 2 commits into from
Nov 11, 2021
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 .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
karpenter
/karpenter
coverage.out
coverage.html
*.test
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WITH_RELEASE_REPO = KO_DOCKER_REPO=$(RELEASE_REPO)
## Extra helm options
CLUSTER_NAME ?= $(shell kubectl config view --minify -o jsonpath='{.clusters[].name}' | rev | cut -d"/" -f1 | rev)
CLUSTER_ENDPOINT ?= $(shell kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}')
HELM_OPTS ?= --set controller.clusterName=${CLUSTER_NAME} --set controller.clusterEndpoint=${CLUSTER_ENDPOINT}
HELM_OPTS ?= --set defaultProvisioner.create=false --set controller.clusterName=${CLUSTER_NAME} --set controller.clusterEndpoint=${CLUSTER_ENDPOINT}

help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Expand Down Expand Up @@ -50,7 +50,7 @@ licenses: ## Verifies dependency licenses and requires GITHUB_TOKEN to be set
golicense hack/license-config.hcl karpenter

apply: ## Deploy the controller into your ~/.kube/config cluster
helm template karpenter charts/karpenter --namespace karpenter \
helm template --include-crds karpenter charts/karpenter --namespace karpenter \
$(HELM_OPTS) \
--set controller.image=ko://github.com/awslabs/karpenter/cmd/controller \
--set webhook.image=ko://github.com/awslabs/karpenter/cmd/webhook \
Expand Down
29 changes: 29 additions & 0 deletions charts/karpenter/templates/default_provisioner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.defaultProvisioner.create }}
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
name: default
spec:
{{ if .Values.defaultProvisioner.ttlSecondsAfterEmpty }}
ttlSecondsAfterEmpty: {{ .Values.defaultProvisioner.ttlSecondsAfterEmpty }}
{{- end }}
{{ if .Values.defaultProvisioner.ttlSecondsUntilExpired }}
ttlSecondsUntilExpired: {{ .Values.defaultProvisioner.ttlSecondsUntilExpired }}
{{- end }}
{{- with .Values.defaultProvisioner.provider }}
provider:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.defaultProvisioner.taints }}
taints:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.defaultProvisioner.requirements }}
requirements:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.defaultProvisioner.labels }}
labels:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ webhook:
tolerations: []
affinity: {}
image: "public.ecr.aws/karpenter/webhook:v0.4.2@sha256:2d004cd277209242d7e886308be419f86107811b4d0f1ed21c908b77e284202b"
defaultProvisioner:
create: true
bwagner5 marked this conversation as resolved.
Show resolved Hide resolved
ttlSecondsAfterEmpty: 300
#ttlSecondsUntilExpired: 86400
JacobGabrielson marked this conversation as resolved.
Show resolved Hide resolved
provider: {}
requirements: []
taints: []
labels: {}