Skip to content

Commit

Permalink
Merge branch 'aws:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
craiglink authored Aug 16, 2024
2 parents 571075e + 79dea10 commit 5b9e82b
Show file tree
Hide file tree
Showing 127 changed files with 6,231 additions and 2,114 deletions.
4 changes: 2 additions & 2 deletions charts/karpenter-crd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: karpenter-crd
description: A Helm chart for Karpenter Custom Resource Definitions (CRDs).
type: application
version: 0.37.0
appVersion: 0.37.0
version: 1.0.0
appVersion: 1.0.0
keywords:
- cluster
- node
Expand Down
4 changes: 2 additions & 2 deletions charts/karpenter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: karpenter
description: A Helm chart for Karpenter, an open-source node provisioning project built for Kubernetes.
type: application
version: 0.37.0
appVersion: 0.37.0
version: 1.0.0
appVersion: 1.0.0
keywords:
- cluster
- node
Expand Down
18 changes: 10 additions & 8 deletions charts/karpenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Helm chart for Karpenter, an open-source node provisioning project built for Kubernetes.

![Version: 0.37.0](https://img.shields.io/badge/Version-0.37.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.37.0](https://img.shields.io/badge/AppVersion-0.37.0-informational?style=flat-square)
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)

## Documentation

Expand All @@ -15,7 +15,7 @@ You can follow the detailed installation instruction in the [documentation](http
```bash
helm upgrade --install --namespace karpenter --create-namespace \
karpenter oci://public.ecr.aws/karpenter/karpenter \
--version 0.37.0 \
--version 1.0.0 \
--set "serviceAccount.annotations.eks\.amazonaws\.com/role-arn=${KARPENTER_IAM_ROLE_ARN}" \
--set settings.clusterName=${CLUSTER_NAME} \
--set settings.interruptionQueue=${CLUSTER_NAME} \
Expand All @@ -27,13 +27,13 @@ helm upgrade --install --namespace karpenter --create-namespace \
As the OCI Helm chart is signed by [Cosign](https://github.com/sigstore/cosign) as part of the release process you can verify the chart before installing it by running the following command.

```shell
cosign verify public.ecr.aws/karpenter/karpenter:0.37.0 \
cosign verify public.ecr.aws/karpenter/karpenter:1.0.0 \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
--certificate-identity-regexp='https://github\.com/aws/karpenter-provider-aws/\.github/workflows/release\.yaml@.+' \
--certificate-github-workflow-repository=aws/karpenter-provider-aws \
--certificate-github-workflow-name=Release \
--certificate-github-workflow-ref=refs/tags/v0.37.0 \
--annotations version=0.37.0
--certificate-github-workflow-ref=refs/tags/v1.0.0 \
--annotations version=1.0.0
```

## Values
Expand All @@ -48,9 +48,9 @@ cosign verify public.ecr.aws/karpenter/karpenter:0.37.0 \
| controller.envFrom | list | `[]` | |
| controller.extraVolumeMounts | list | `[]` | Additional volumeMounts for the controller pod. |
| controller.healthProbe.port | int | `8081` | The container port to use for http health probe. |
| controller.image.digest | string | `"sha256:157f478f5db1fe999f5e2d27badcc742bf51cc470508b3cebe78224d0947674f"` | SHA256 digest of the controller image. |
| controller.image.digest | string | `"sha256:1eb1073b9f4ed804634aabf320e4d6e822bb61c0f5ecfd9c3a88f05f1ca4c5c5"` | SHA256 digest of the controller image. |
| controller.image.repository | string | `"public.ecr.aws/karpenter/controller"` | Repository path to the controller image. |
| controller.image.tag | string | `"0.37.0"` | Tag of the controller image. |
| controller.image.tag | string | `"1.0.0"` | Tag of the controller image. |
| controller.metrics.port | int | `8080` | The container port to use for metrics. |
| controller.resources | object | `{}` | Resources for the controller pod. |
| controller.sidecarContainer | list | `[]` | Additional sidecarContainer config |
Expand All @@ -72,7 +72,9 @@ cosign verify public.ecr.aws/karpenter/karpenter:0.37.0 \
| podDisruptionBudget.name | string | `"karpenter"` | |
| podLabels | object | `{}` | Additional labels for the pod. |
| podSecurityContext | object | `{"fsGroup":65532}` | SecurityContext for the pod. |
| postInstallHook.image | string | `public.ecr.aws/bitnami/kubectl:1.30` | The image to run the post-install hook. This minimally needs to have `kubectl` installed |
| postInstallHook.image.digest | string | `"sha256:13a2ad1bd37ce42ee2a6f1ab0d30595f42eb7fe4a90d6ec848550524104a1ed6"` | SHA256 digest of the post-install hook image. |
| postInstallHook.image.repository | string | `"public.ecr.aws/bitnami/kubectl"` | Repository path to the post-install hook. This minimally needs to have `kubectl` installed |
| postInstallHook.image.tag | string | `"1.30"` | Tag of the post-install hook image. |
| priorityClassName | string | `"system-cluster-critical"` | PriorityClass name for the pod. |
| replicas | int | `2` | Number of replicas. |
| revisionHistoryLimit | int | `10` | The number of old ReplicaSets to retain to allow rollback. |
Expand Down
6 changes: 3 additions & 3 deletions charts/karpenter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ controller:
# -- Repository path to the controller image.
repository: public.ecr.aws/karpenter/controller
# -- Tag of the controller image.
tag: 0.37.0
tag: 1.0.0
# -- SHA256 digest of the controller image.
digest: sha256:157f478f5db1fe999f5e2d27badcc742bf51cc470508b3cebe78224d0947674f
digest: sha256:1eb1073b9f4ed804634aabf320e4d6e822bb61c0f5ecfd9c3a88f05f1ca4c5c5
# -- Additional environment variables for the controller pod.
env: []
# - name: AWS_REGION
Expand Down Expand Up @@ -137,7 +137,7 @@ controller:
healthProbe:
# -- The container port to use for http health probe.
port: 8081
postInstallHook:
postInstallHook:
image:
# -- Repository path to the post-install hook. This minimally needs to have `kubectl` installed
repository: public.ecr.aws/bitnami/kubectl
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ require (
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/karpenter v0.37.1-0.20240812180459-92547d1f9c20
sigs.k8s.io/controller-runtime v0.18.5
sigs.k8s.io/karpenter v1.0.1-0.20240815170320-bb7468a3a758
sigs.k8s.io/yaml v1.4.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,12 @@ knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd/go.mod h1:36cYnaOVHkzmhgybmYX
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw=
sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk=
sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/karpenter v0.37.1-0.20240812180459-92547d1f9c20 h1:HA+J1LbKlvFWUT7w7EDvVmhBeAoqqPeRbqGp8NUnLnw=
sigs.k8s.io/karpenter v0.37.1-0.20240812180459-92547d1f9c20/go.mod h1:3NLmsnHHw8p4VutpjTOPUZyhE3qH6yGTs8O94Lsu8uw=
sigs.k8s.io/karpenter v1.0.1-0.20240815170320-bb7468a3a758 h1:VEibnW+C/lW8QVgGlsZadhhTPXwhkR2CQj828zHu8Ao=
sigs.k8s.io/karpenter v1.0.1-0.20240815170320-bb7468a3a758/go.mod h1:SGH7B5ZSeaCXBnwvj4cSmIPC6TqRq7kPZmQyJRdxC6k=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
Expand Down
3 changes: 3 additions & 0 deletions hack/docs/compatibilitymatrix_gen/compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ compatibility:
maxK8sVersion: 1.29
- appVersion: 0.37.0
minK8sVersion: 1.23
maxK8sVersion: 1.30
- appVersion: 1.0.0
minK8sVersion: 1.25
maxK8sVersion: 1.30
4 changes: 4 additions & 0 deletions pkg/cloudprovider/cloudprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ func (c *CloudProvider) Delete(ctx context.Context, nodeClaim *karpv1.NodeClaim)
return c.instanceProvider.Delete(ctx, id)
}

func (c *CloudProvider) DisruptionReasons() []karpv1.DisruptionReason {
return nil
}

func (c *CloudProvider) IsDrifted(ctx context.Context, nodeClaim *karpv1.NodeClaim) (cloudprovider.DriftReason, error) {
// Not needed when GetInstanceTypes removes nodepool dependency
nodePoolName, ok := nodeClaim.Labels[karpv1.NodePoolLabelKey]
Expand Down
4 changes: 4 additions & 0 deletions pkg/fake/cloudprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func (c *CloudProvider) Delete(context.Context, *karpv1.NodeClaim) error {
return nil
}

func (c *CloudProvider) DisruptionReasons() []karpv1.DisruptionReason {
return nil
}

// Name returns the CloudProvider implementation name.
func (c *CloudProvider) Name() string {
return "fake"
Expand Down
15 changes: 8 additions & 7 deletions test/hack/resource/clean/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,20 @@ func main() {
if err != nil {
resourceLogger.Errorf("%v", err)
}
cleaned := []string{}
resourceLogger.With("ids", ids, "count", len(ids)).Infof("discovered resourceTypes")
if len(ids) > 0 {
cleaned, err := resourceTypes[i].Cleanup(ctx, ids)
cleaned, err = resourceTypes[i].Cleanup(ctx, ids)
if err != nil {
resourceLogger.Errorf("%v", err)
}
// Should only fire metrics if the resource have expired
if lo.FromPtr(clusterName) == "" {
if err = metricsClient.FireMetric(ctx, sweeperCleanedResourcesTableName, fmt.Sprintf("%sDeleted", resourceTypes[i].String()), float64(len(cleaned)), lo.Ternary(resourceTypes[i].Global(), "global", cfg.Region)); err != nil {
resourceLogger.Errorf("%v", err)
}
}
resourceLogger.With("ids", cleaned, "count", len(cleaned)).Infof("deleted resourceTypes")
}
// Should only fire metrics if the resource have expired
if lo.FromPtr(clusterName) == "" {
if err = metricsClient.FireMetric(ctx, sweeperCleanedResourcesTableName, fmt.Sprintf("%sDeleted", resourceTypes[i].String()), float64(len(cleaned)), lo.Ternary(resourceTypes[i].Global(), "global", cfg.Region)); err != nil {
resourceLogger.Errorf("%v", err)
}
}
}
}
Loading

0 comments on commit 5b9e82b

Please sign in to comment.