Skip to content

Commit

Permalink
Merge branch 'kubernetes:master' into prachigandhi/azure-getvmss-spot
Browse files Browse the repository at this point in the history
  • Loading branch information
rakechill authored Jul 17, 2024
2 parents 6829c33 + 5077f48 commit d11a9c8
Show file tree
Hide file tree
Showing 77 changed files with 3,542 additions and 411 deletions.
4 changes: 3 additions & 1 deletion cluster-autoscaler/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,11 @@ sub-library. It can be used with custom kubernetes fork, by default it uses
Example execution looks like this:

```
./hack/update-vendor.sh 1.20.0-alpha.1 [email protected]:kubernetes/kubernetes.git
./hack/update-deps.sh v1.30.2 v1.30.2 [email protected]:kubernetes/kubernetes.git
```

The first of two versions denotes k8s dependency of Cluster Autoscaler, the second one refers to the apis/ submodule.

If you need to update vendor to an unreleased commit of Kubernetes, you can use the breakglass script:

```
Expand Down
10 changes: 5 additions & 5 deletions cluster-autoscaler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ target ETA and the actual releases.

| Date | Maintainer Preparing Release | Backup Maintainer | Type |
|------------|------------------------------|-------------------|-------|
| 2024-01-17 | MaciekPytel | gjtempleton | patch |
| 2024-03-13 | gjtempleton | BigDarkClown | patch |
| 2024-04-17 | towca | BigDarkClown | 1.30 |
| 2024-05-22 | BigDarkClown | x13n | patch |
| 2024-07-24 | x13n | MaciekPytel | patch |
| 2024-07-18 | x13n | MaciekPytel | patch |
| 2024-08-21 | MaciekPytel | gjtempleton | 1.31 |
| 2024-09-18 | gjtempleton | towca | patch |
| 2024-11-20 | towca | BigDarkClown | patch |
| 2024-12-18 | BigDarkClown | x13n | 1.32 |
| 2025-01-22 | x13n | MaciekPytel | patch |

Additional patch releases may happen outside of the schedule in case of critical
bugs or vulnerabilities.
Expand Down
1 change: 0 additions & 1 deletion cluster-autoscaler/cloudprovider/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ should be updated to restrict the resources/add conditionals:
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeScalingActivities",
"autoscaling:DescribeTags",
"ec2:DescribeImages",
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions",
Expand Down
174 changes: 157 additions & 17 deletions cluster-autoscaler/cloudprovider/aws/ec2_instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type InstanceType struct {
}

// StaticListLastUpdateTime is a string declaring the last time the static list was updated.
var StaticListLastUpdateTime = "2024-04-08"
var StaticListLastUpdateTime = "2024-07-15"

// InstanceTypes is a map of ec2 resources
var InstanceTypes = map[string]*InstanceType{
Expand Down Expand Up @@ -1110,6 +1110,13 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "arm64",
},
"c7gd.metal": {
InstanceType: "c7gd.metal",
VCPU: 64,
MemoryMb: 131072,
GPU: 0,
Architecture: "arm64",
},
"c7gd.xlarge": {
InstanceType: "c7gd.xlarge",
VCPU: 4,
Expand Down Expand Up @@ -1166,6 +1173,13 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "arm64",
},
"c7gn.metal": {
InstanceType: "c7gn.metal",
VCPU: 64,
MemoryMb: 131072,
GPU: 0,
Architecture: "arm64",
},
"c7gn.xlarge": {
InstanceType: "c7gn.xlarge",
VCPU: 4,
Expand Down Expand Up @@ -1376,20 +1390,6 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "amd64",
},
"g2.2xlarge": {
InstanceType: "g2.2xlarge",
VCPU: 8,
MemoryMb: 15360,
GPU: 1,
Architecture: "amd64",
},
"g2.8xlarge": {
InstanceType: "g2.8xlarge",
VCPU: 32,
MemoryMb: 61440,
GPU: 4,
Architecture: "amd64",
},
"g3.16xlarge": {
InstanceType: "g3.16xlarge",
VCPU: 64,
Expand Down Expand Up @@ -3315,6 +3315,13 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "arm64",
},
"m7gd.metal": {
InstanceType: "m7gd.metal",
VCPU: 64,
MemoryMb: 262144,
GPU: 0,
Architecture: "arm64",
},
"m7gd.xlarge": {
InstanceType: "m7gd.xlarge",
VCPU: 4,
Expand Down Expand Up @@ -3441,13 +3448,27 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "amd64",
},
"mac2-m1ultra.metal": {
InstanceType: "mac2-m1ultra.metal",
VCPU: 20,
MemoryMb: 131072,
GPU: 0,
Architecture: "amd64",
},
"mac2-m2.metal": {
InstanceType: "mac2-m2.metal",
VCPU: 8,
MemoryMb: 24576,
GPU: 0,
Architecture: "amd64",
},
"mac2-m2pro.metal": {
InstanceType: "mac2-m2pro.metal",
VCPU: 12,
MemoryMb: 32768,
GPU: 0,
Architecture: "amd64",
},
"mac2.metal": {
InstanceType: "mac2.metal",
VCPU: 8,
Expand Down Expand Up @@ -4662,7 +4683,7 @@ var InstanceTypes = map[string]*InstanceType{
"r7gd.12xlarge": {
InstanceType: "r7gd.12xlarge",
VCPU: 48,
MemoryMb: 262144,
MemoryMb: 393216,
GPU: 0,
Architecture: "arm64",
},
Expand Down Expand Up @@ -4690,7 +4711,7 @@ var InstanceTypes = map[string]*InstanceType{
"r7gd.8xlarge": {
InstanceType: "r7gd.8xlarge",
VCPU: 32,
MemoryMb: 196608,
MemoryMb: 262144,
GPU: 0,
Architecture: "arm64",
},
Expand All @@ -4708,6 +4729,13 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "arm64",
},
"r7gd.metal": {
InstanceType: "r7gd.metal",
VCPU: 64,
MemoryMb: 524288,
GPU: 0,
Architecture: "arm64",
},
"r7gd.xlarge": {
InstanceType: "r7gd.xlarge",
VCPU: 4,
Expand Down Expand Up @@ -4862,6 +4890,90 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "amd64",
},
"r8g.12xlarge": {
InstanceType: "r8g.12xlarge",
VCPU: 48,
MemoryMb: 393216,
GPU: 0,
Architecture: "arm64",
},
"r8g.16xlarge": {
InstanceType: "r8g.16xlarge",
VCPU: 64,
MemoryMb: 524288,
GPU: 0,
Architecture: "arm64",
},
"r8g.24xlarge": {
InstanceType: "r8g.24xlarge",
VCPU: 96,
MemoryMb: 786432,
GPU: 0,
Architecture: "arm64",
},
"r8g.2xlarge": {
InstanceType: "r8g.2xlarge",
VCPU: 8,
MemoryMb: 65536,
GPU: 0,
Architecture: "arm64",
},
"r8g.48xlarge": {
InstanceType: "r8g.48xlarge",
VCPU: 192,
MemoryMb: 1572864,
GPU: 0,
Architecture: "arm64",
},
"r8g.4xlarge": {
InstanceType: "r8g.4xlarge",
VCPU: 16,
MemoryMb: 131072,
GPU: 0,
Architecture: "arm64",
},
"r8g.8xlarge": {
InstanceType: "r8g.8xlarge",
VCPU: 32,
MemoryMb: 262144,
GPU: 0,
Architecture: "arm64",
},
"r8g.large": {
InstanceType: "r8g.large",
VCPU: 2,
MemoryMb: 16384,
GPU: 0,
Architecture: "arm64",
},
"r8g.medium": {
InstanceType: "r8g.medium",
VCPU: 1,
MemoryMb: 8192,
GPU: 0,
Architecture: "arm64",
},
"r8g.metal-24xl": {
InstanceType: "r8g.metal-24xl",
VCPU: 96,
MemoryMb: 786432,
GPU: 0,
Architecture: "arm64",
},
"r8g.metal-48xl": {
InstanceType: "r8g.metal-48xl",
VCPU: 192,
MemoryMb: 1572864,
GPU: 0,
Architecture: "arm64",
},
"r8g.xlarge": {
InstanceType: "r8g.xlarge",
VCPU: 4,
MemoryMb: 32768,
GPU: 0,
Architecture: "arm64",
},
"t1.micro": {
InstanceType: "t1.micro",
VCPU: 1,
Expand Down Expand Up @@ -5135,6 +5247,34 @@ var InstanceTypes = map[string]*InstanceType{
GPU: 0,
Architecture: "amd64",
},
"u7i-12tb.224xlarge": {
InstanceType: "u7i-12tb.224xlarge",
VCPU: 896,
MemoryMb: 12582912,
GPU: 0,
Architecture: "amd64",
},
"u7in-16tb.224xlarge": {
InstanceType: "u7in-16tb.224xlarge",
VCPU: 896,
MemoryMb: 16777216,
GPU: 0,
Architecture: "amd64",
},
"u7in-24tb.224xlarge": {
InstanceType: "u7in-24tb.224xlarge",
VCPU: 896,
MemoryMb: 25165824,
GPU: 0,
Architecture: "amd64",
},
"u7in-32tb.224xlarge": {
InstanceType: "u7in-32tb.224xlarge",
VCPU: 896,
MemoryMb: 33554432,
GPU: 0,
Architecture: "amd64",
},
"vt1.24xlarge": {
InstanceType: "vt1.24xlarge",
VCPU: 96,
Expand Down
4 changes: 3 additions & 1 deletion cluster-autoscaler/cloudprovider/azure/azure_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"os"
"regexp"
"sort"
"strconv"
Expand Down Expand Up @@ -244,7 +245,8 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private
}

func getUserAgentExtension() string {
return fmt.Sprintf("cluster-autoscaler/v%s", version.ClusterAutoscalerVersion)
suffix := os.Getenv("AZURE_CLUSTER_AUTOSCALER_USER_AGENT_SUFFIX")
return fmt.Sprintf("cluster-autoscaler%s/v%s", suffix, version.ClusterAutoscalerVersion)
}

func configureUserAgent(client *autorest.Client) {
Expand Down
6 changes: 3 additions & 3 deletions cluster-autoscaler/cloudprovider/azure/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ ARTIFACTS?=_artifacts
.PHONY: test-e2e
test-e2e: build-e2e
go run github.com/onsi/ginkgo/v2/ginkgo -v --trace --output-dir "$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" e2e -- \
-resource-group="$$(KUBECONFIG= kubectl get managedclusters -o jsonpath='{.items[0].status.nodeResourceGroup}')" \
-cluster-name="$$(KUBECONFIG= kubectl get cluster -o jsonpath='{.items[0].metadata.name}')" \
-client-id="$$(KUBECONFIG= kubectl get userassignedidentities -o jsonpath='{.items[0].status.clientId}')" \
-resource-group="$$(KUBECONFIG= kubectl get managedclusters -n default -o jsonpath='{.items[0].status.nodeResourceGroup}')" \
-cluster-name="$$(KUBECONFIG= kubectl get cluster -n default -o jsonpath='{.items[0].metadata.name}')" \
-client-id="$$(KUBECONFIG= kubectl get userassignedidentities -n default -o jsonpath='{.items[0].status.clientId}')" \
-cas-namespace="$(CLUSTER_AUTOSCALER_NAMESPACE)" \
-cas-serviceaccount-name="$(CLUSTER_AUTOSCALER_SERVICEACCOUNT_NAME)" \
-cas-image-repository="$(IMAGE)-$(GOARCH)" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ apiVersion: v1
kind: Secret
metadata:
name: ${ASO_CREDENTIAL_SECRET_NAME}
namespace: default
stringData:
AZURE_SUBSCRIPTION_ID: ${AZURE_SUBSCRIPTION_ID}
AZURE_TENANT_ID: ${AZURE_TENANT_ID}
Expand All @@ -276,6 +277,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: capz-${CLUSTER_NAME}
namespace: default
labels:
cluster.x-k8s.io/aggregate-to-capz-manager: "true"
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package clusterapi
import (
"fmt"
"os"
"path"
"strings"
"sync"

Expand Down Expand Up @@ -144,6 +145,7 @@ func indexNodeByProviderID(obj interface{}) ([]string, error) {
return []string{}, nil
}

// findMachine looks up a machine by the ID which is stored in the index as <namespace>/<name>.
func (c *machineController) findMachine(id string) (*unstructured.Unstructured, error) {
return c.findResourceByKey(c.machineInformer.Informer().GetStore(), id)
}
Expand Down Expand Up @@ -333,7 +335,8 @@ func (c *machineController) findMachineByProviderID(providerID normalizedProvide
}

machineID := node.Annotations[machineAnnotationKey]
return c.findMachine(machineID)
ns := node.Annotations[clusterNamespaceAnnotationKey]
return c.findMachine(path.Join(ns, machineID))
}

func isPendingMachineProviderID(providerID normalizedProviderID) bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ func makeLinkedNodeAndMachine(i int, namespace, clusterName string, owner metav1
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-%s-node-%d", namespace, owner.Name, i),
Annotations: map[string]string{
machineAnnotationKey: fmt.Sprintf("%s/%s-%s-machine-%d", namespace, namespace, owner.Name, i),
clusterNameAnnotationKey: clusterName,
clusterNamespaceAnnotationKey: namespace,
machineAnnotationKey: fmt.Sprintf("%s-%s-machine-%d", namespace, owner.Name, i),
},
},
Spec: corev1.NodeSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package clusterapi

import (
"fmt"
"path"
"reflect"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -81,8 +82,9 @@ func (p *provider) NodeGroupForNode(node *corev1.Node) (cloudprovider.NodeGroup,
// HasInstance returns whether a given node has a corresponding instance in this cloud provider
func (p *provider) HasInstance(node *corev1.Node) (bool, error) {
machineID := node.Annotations[machineAnnotationKey]
ns := node.Annotations[clusterNamespaceAnnotationKey]

machine, err := p.controller.findMachine(machineID)
machine, err := p.controller.findMachine(path.Join(ns, machineID))
if machine != nil {
return true, nil
}
Expand Down
Loading

0 comments on commit d11a9c8

Please sign in to comment.