-
Notifications
You must be signed in to change notification settings - Fork 962
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Cherry pick chart change v0.34.x (#7296)
- Loading branch information
Showing
9 changed files
with
130 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION_START="$(cat charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml | yq '.spec.versions.[0] | line')" | ||
VERSION_END="$(cat charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml | yq '.spec.versions.[1] | line')" | ||
VERSION_END=$(($VERSION_END+1)) | ||
TEMP=$(mktemp) | ||
|
||
cat charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml | awk -v n=$VERSION_START 'NR==n {sub(/$/,"\n{{- if .Values.webhook.enabled }}")} 1' \ | ||
| awk -v n=$VERSION_END 'NR==n {sub(/$/,"\n{{- end }}")} 1' > $TEMP | ||
|
||
cat $TEMP > charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml | ||
|
||
echo "{{- if .Values.webhook.enabled }} | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
conversionReviewVersions: | ||
- v1beta1 | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ .Values.webhook.serviceName }} | ||
namespace: {{ .Values.webhook.serviceNamespace | default .Release.Namespace }} | ||
port: {{ .Values.webhook.port }} | ||
{{- end }} | ||
" >> charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION_START="$(cat charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml | yq '.spec.versions.[0] | line')" | ||
VERSION_END="$(cat charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml | yq '.spec.versions.[1] | line')" | ||
VERSION_END=$(($VERSION_END+1)) | ||
TEMP=$(mktemp) | ||
|
||
cat charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml | awk -v n=$VERSION_START 'NR==n {sub(/$/,"\n{{- if .Values.webhook.enabled }}")} 1' \ | ||
| awk -v n=$VERSION_END 'NR==n {sub(/$/,"\n{{- end }}")} 1' > $TEMP | ||
|
||
cat $TEMP > charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml | ||
|
||
echo "{{- if .Values.webhook.enabled }} | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
conversionReviewVersions: | ||
- v1beta1 | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ .Values.webhook.serviceName }} | ||
namespace: {{ .Values.webhook.serviceNamespace | default .Release.Namespace }} | ||
port: {{ .Values.webhook.port }} | ||
{{- end }} | ||
" >> charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION_START="$(cat charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml | yq '.spec.versions.[0] | line')" | ||
VERSION_END="$(cat charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml | yq '.spec.versions.[1] | line')" | ||
VERSION_END=$(($VERSION_END+1)) | ||
TEMP=$(mktemp) | ||
|
||
cat charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml | awk -v n=$VERSION_START 'NR==n {sub(/$/,"\n{{- if .Values.webhook.enabled }}")} 1' \ | ||
| awk -v n=$VERSION_END 'NR==n {sub(/$/,"\n{{- end }}")} 1' > $TEMP | ||
|
||
cat $TEMP > charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml | ||
|
||
echo "{{- if .Values.webhook.enabled }} | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
conversionReviewVersions: | ||
- v1beta1 | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ .Values.webhook.serviceName }} | ||
namespace: {{ .Values.webhook.serviceNamespace | default .Release.Namespace }} | ||
port: {{ .Values.webhook.port }} | ||
{{- end }} | ||
" >> charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
aws eks update-kubeconfig --name "$CLUSTER_NAME" | ||
|
||
# First, conditionally install the webhook stanza and CRDs | ||
if (( "$WEBHOOKS_ENABLED" == false )); then | ||
helm upgrade --install karpenter-crd oci://$ECR_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/karpenter/snapshot/karpenter-crd \ | ||
--namespace kube-system \ | ||
--version "v0-$(git rev-parse HEAD)" \ | ||
--set webhook.enabled=${WEBHOOKS_ENABLED} \ | ||
--wait | ||
fi | ||
|
||
CHART="oci://$ECR_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/karpenter/snapshot/karpenter" | ||
ADDITIONAL_FLAGS="" | ||
|
||
|
||
# Remove service account annotation when dropping support for 1.23 | ||
helm upgrade --install karpenter "${CHART}" \ | ||
-n kube-system \ | ||
--version "v0-$(git rev-parse HEAD)" \ | ||
--set logLevel=debug \ | ||
--set webhook.enabled=${WEBHOOKS_ENABLED} \ | ||
--set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"="arn:aws:iam::$ACCOUNT_ID:role/karpenter-irsa-$CLUSTER_NAME" \ | ||
--set settings.clusterName="$CLUSTER_NAME" \ | ||
--set settings.interruptionQueue="$CLUSTER_NAME" \ | ||
--set settings.featureGates.spotToSpotConsolidation=true \ | ||
--set controller.resources.requests.cpu=3 \ | ||
--set controller.resources.requests.memory=3Gi \ | ||
--set controller.resources.limits.cpu=3 \ | ||
--set controller.resources.limits.memory=3Gi \ | ||
--set serviceMonitor.enabled=true \ | ||
--set serviceMonitor.additionalLabels.scrape=enabled \ | ||
--set "serviceMonitor.endpointConfig.relabelings[0].targetLabel=clusterName" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[0].replacement=$CLUSTER_NAME" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[1].targetLabel=gitRef" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[1].replacement=$(git rev-parse HEAD)" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[2].targetLabel=mostRecentTag" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[2].replacement=$(git describe --abbrev=0 --tags)" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[3].targetLabel=commitsAfterTag" \ | ||
--set "serviceMonitor.endpointConfig.relabelings[3].replacement=\"$(git describe --tags | cut -d '-' -f 2)\"" \ | ||
--wait |