Repository: knative/serving (go)

Issue:
DefaultDomain should be the cluster's domain and not hardcoded to `svc.cluster.local`
Rather than hardcode the default domain I think we should use the cluster's domain from the knative/pkg helper

https://github.com/knative/serving/blob/ea2a6c8c6166d27b3251469400efed33125cac15/pkg/reconciler/route/config/domain.go#L34-L36

and use 
```go
network.GetClusterDomainName()
```

https://github.com/knative/pkg/blob/db8a35330281c41c7e8e90df6059c23a36af0643/network/domain.go#L46

I don't think we catch this in our e2e tests because we use a fake domain name - https://github.com/knative/serving/blob/ea2a6c8c6166d27b3251469400efed33125cac15/test/config/ytt/core/overlay-config-domain.yaml

FYI @psschwei @nak3 

Pull request description:
Set default domain to cluster's domain
Fixes #13955 


## Proposed Changes

* Sets DefaultDomain to cluster's domain instead of hardcoded `svc.cluster.local`


### Release Note
```release-note
Sets DefaultDomain to cluster's domain instead of hardcoded `svc.cluster.local`
```



Patch:
diff --git a/pkg/apis/autoscaling/annotation_validation.go b/pkg/apis/autoscaling/annotation_validation.go
index 101a6ec22..95076a603 100644
--- a/pkg/apis/autoscaling/annotation_validation.go
+++ b/pkg/apis/autoscaling/annotation_validation.go
@@ -58,7 +58,7 @@ func ValidateAnnotations(ctx context.Context, config *autoscalerconfig.Config, a
 		Also(validateWindow(anns)).
 		Also(validateLastPodRetention(anns)).
 		Also(validateScaleDownDelay(anns)).
-		Also(validateMetric(anns)).
+		Also(validateMetric(config, anns)).
 		Also(validateAlgorithm(anns)).
 		Also(validateInitialScale(config, anns))
 }
@@ -234,9 +234,9 @@ func validateMaxScaleWithinLimit(key string, maxScale, maxScaleLimit int32) (err
 	return errs
 }
 
-func validateMetric(m map[string]string) *apis.FieldError {
+func validateMetric(c *autoscalerconfig.Config, m map[string]string) *apis.FieldError {
 	if _, metric, ok := MetricAnnotation.Get(m); ok {
-		classValue := KPA
+		classValue := c.PodAutoscalerClass
 		if _, c, ok := ClassAnnotation.Get(m); ok {
 			classValue = c
 		}
diff --git a/pkg/reconciler/route/config/domain.go b/pkg/reconciler/route/config/domain.go
index ce42abf6d..00a9033ef 100644
--- a/pkg/reconciler/route/config/domain.go
+++ b/pkg/reconciler/route/config/domain.go
@@ -31,9 +31,12 @@ import (
 const (
 	// DomainConfigName is the config map name for the domain configuration.
 	DomainConfigName = "config-domain"
+)
+
+var (
 	// DefaultDomain holds the domain that Route's live under by default
 	// when no label selector-based options apply.
-	DefaultDomain = "svc.cluster.local"
+	DefaultDomain = "svc." + network.GetClusterDomainName()
 )
 
 // LabelSelector represents map of {key,value} pairs. A single {key,value} in the


Test patch:
diff --git a/pkg/apis/autoscaling/annotation_validation_test.go b/pkg/apis/autoscaling/annotation_validation_test.go
index 59412a9ad..4270611b9 100644
--- a/pkg/apis/autoscaling/annotation_validation_test.go
+++ b/pkg/apis/autoscaling/annotation_validation_test.go
@@ -350,6 +350,12 @@ func TestValidateAnnotations(t *testing.T) {
 		name:        "initial scale is zero but cluster doesn't allow",
 		annotations: map[string]string{InitialScaleAnnotationKey: "0"},
 		expectErr:   "invalid value: 0: " + InitialScaleAnnotationKey + "=0 not allowed by cluster",
+	}, {
+		name:        "valid global class HPA with metric CPU",
+		annotations: map[string]string{MetricAnnotationKey: CPU},
+		configMutator: func(c *autoscalerconfig.Config) {
+			c.PodAutoscalerClass = HPA
+		},
 	}, {
 		name: "initial scale is zero and cluster allows",
 		configMutator: func(config *autoscalerconfig.Config) {
@@ -386,5 +392,6 @@ func defaultConfig() *autoscalerconfig.Config {
 	return &autoscalerconfig.Config{
 		AllowZeroInitialScale: false,
 		MaxScaleLimit:         0,
+		PodAutoscalerClass:    KPA,
 	}
 }
diff --git a/third_party/contour-latest/net-contour.yaml b/third_party/contour-latest/net-contour.yaml
index ba1d075b7..c1773e9d8 100644
--- a/third_party/contour-latest/net-contour.yaml
+++ b/third_party/contour-latest/net-contour.yaml
@@ -8,7 +8,7 @@ metadata:
     networking.knative.dev/ingress-provider: contour
     app.kubernetes.io/component: net-contour
     app.kubernetes.io/name: knative-serving
-    app.kubernetes.io/version: "20230508-28c9a48a"
+    app.kubernetes.io/version: "20230512-148554c3"
     serving.knative.dev/controller: "true"
 rules:
   - apiGroups: ["projectcontour.io"]
@@ -38,7 +38,7 @@ metadata:
     networking.knative.dev/ingress-provider: contour
     app.kubernetes.io/component: net-contour
     app.kubernetes.io/name: knative-serving
-    app.kubernetes.io/version: "20230508-28c9a48a"
+    app.kubernetes.io/version: "20230512-148554c3"
 data:
   _example: |
     ################################
@@ -95,7 +95,7 @@ metadata:
     networking.knative.dev/ingress-provider: contour
     app.kubernetes.io/component: net-contour
     app.kubernetes.io/name: knative-serving
-    app.kubernetes.io/version: "20230508-28c9a48a"
+    app.kubernetes.io/version: "20230512-148554c3"
 spec:
   replicas: 1
   selector:
@@ -107,14 +107,14 @@ spec:
         app: net-contour-controller
         app.kubernetes.io/component: net-contour
         app.kubernetes.io/name: knative-serving
-        app.kubernetes.io/version: "20230508-28c9a48a"
+        app.kubernetes.io/version: "20230512-148554c3"
     spec:
       serviceAccountName: controller
       containers:
         - name: controller
           # This is the Go import path for the binary that is containerized
           # and substituted here.
-          image: gcr.io/knative-nightly/knative.dev/net-contour/cmd/controller@sha256:9096ef0ccac3a3f82a9fbbd8d51bff6b46c3893b6208684f7e54a1d9ffca8560
+          image: gcr.io/knative-nightly/knative.dev/net-contour/cmd/controller@sha256:965d12146548ba3033b129ef332a275c32c640228a4aab0152b495427125cf56
           resources:
             requests:
               cpu: 40m
@@ -156,7 +156,7 @@ metadata:
     networking.knative.dev/ingress-provider: contour
     app.kubernetes.io/component: net-contour
     app.kubernetes.io/name: knative-serving
-    app.kubernetes.io/version: "20230508-28c9a48a"
+    app.kubernetes.io/version: "20230512-148554c3"
 spec:
   delegations:
     - secretName: knative-serving-certs
diff --git a/third_party/kourier-latest/kourier.yaml b/third_party/kourier-latest/kourier.yaml
index 73375e4dc..20d0accbf 100644
--- a/third_party/kourier-latest/kourier.yaml
+++ b/third_party/kourier-latest/kourier.yaml
@@ -20,7 +20,7 @@ metadata:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/name: knative-serving
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
 
 ---
 # Copyright 2020 The Knative Authors
@@ -45,7 +45,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 data:
   envoy-bootstrap.yaml: |
@@ -168,7 +168,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 data:
   _example: |
@@ -259,7 +259,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 ---
 apiVersion: rbac.authorization.k8s.io/v1
@@ -269,7 +269,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 rules:
   - apiGroups: [""]
@@ -301,7 +301,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 roleRef:
   apiGroup: rbac.authorization.k8s.io
@@ -335,7 +335,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   strategy:
@@ -357,7 +357,7 @@ spec:
         app: net-kourier-controller
     spec:
       containers:
-        - image: gcr.io/knative-nightly/knative.dev/net-kourier/cmd/kourier@sha256:b96380a8739de3e957e87498f26ddb38e3885eff20b90ba8912441ac6c9b0c94
+        - image: gcr.io/knative-nightly/knative.dev/net-kourier/cmd/kourier@sha256:76d1ca187ecebeedeb632d97b59a06f7e99cde680dcf40de7afdef0c9ab9f59e
           name: controller
           env:
             - name: CERTS_SECRET_NAMESPACE
@@ -415,7 +415,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   ports:
@@ -450,7 +450,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   strategy:
@@ -480,7 +480,7 @@ spec:
             - --log-level info
           command:
             - /usr/local/bin/envoy
-          image: docker.io/envoyproxy/envoy:v1.23-latest
+          image: docker.io/envoyproxy/envoy:v1.24-latest
           name: kourier-gateway
           ports:
             - name: http2-external
@@ -559,7 +559,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   ports:
@@ -583,7 +583,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   ports:
@@ -607,7 +607,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   minReplicas: 1
@@ -633,7 +633,7 @@ metadata:
   labels:
     networking.knative.dev/ingress-provider: kourier
     app.kubernetes.io/component: net-kourier
-    app.kubernetes.io/version: "20230511-62bf5629"
+    app.kubernetes.io/version: "20230512-dbb56bc8"
     app.kubernetes.io/name: knative-serving
 spec:
   minAvailable: 80%