From 24bcaceb66551538c47908129e7da1ffc197d202 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Fri, 24 Jan 2020 11:10:07 -0800 Subject: [PATCH 1/8] Add activator DaemonSet This change switches activator to be run as a daemon set. The changes: - add daemon set - run with smaller footprint - reduce regular HPA to maxSize=1. This permits user to change the value, should the need arive, but will keep the default to a single instance. - also reduce its footprint, to match the DS ones. For #6550 --- config/activator-ds.yaml | 117 +++++++++++++++++++++ config/core/deployments/activator-hpa.yaml | 2 +- config/core/deployments/activator.yaml | 6 +- 3 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 config/activator-ds.yaml diff --git a/config/activator-ds.yaml b/config/activator-ds.yaml new file mode 100644 index 000000000000..3a0b7163a36b --- /dev/null +++ b/config/activator-ds.yaml @@ -0,0 +1,117 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: activator + namespace: knative-serving + labels: + knative.dev/release: devel +spec: + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 10% + selector: + matchLabels: + app: activator + role: activator + template: + metadata: + labels: + app: activator + role: activator + knative.dev/release: devel + spec: + serviceAccountName: controller + containers: + - name: activator + # This is the Go import path for the binary that is containerized + # and substituted here. + image: knative.dev/serving/cmd/activator + + resources: + requests: + cpu: 100m + memory: 60Mi + limits: + cpu: 300m + memory: 200Mi + env: + # Run Activator with GC collection when newly generated memory is 500%. + - name: GOGC + value: "500" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: SYSTEM_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: CONFIG_LOGGING_NAME + value: config-logging + - name: CONFIG_OBSERVABILITY_NAME + value: config-observability + # TODO(https://github.com/knative/pkg/pull/953): Remove stackdriver specific config + - name: METRICS_DOMAIN + value: knative.dev/internal/serving + + securityContext: + allowPrivilegeEscalation: false + + ports: + - name: metrics + containerPort: 9090 + - name: profiling + containerPort: 8008 + - name: http1 + containerPort: 8012 + - name: h2c + containerPort: 8013 + + readinessProbe: &probe + httpGet: + port: 8012 + httpHeaders: + - name: k-kubelet-probe + value: "activator" + livenessProbe: *probe + # The activator (often) sits on the dataplane, and may proxy long (e.g. + # streaming, websockets) requests. We give a long grace period for the + # activator to "lame duck" and drain outstanding requests before we + # forcibly terminate the pod (and outstanding connections). This value + # should be at least as large as the upper bound on the Revision's + # timeoutSeconds property to avoid servicing events disrupting + # connections. + terminationGracePeriodSeconds: 300 + +--- +apiVersion: v1 +kind: Service +metadata: + name: activator-service + namespace: knative-serving + labels: + app: activator + knative.dev/release: devel +spec: + selector: + role: activator + ports: + # Define metrics and profiling for them to be accessible within service meshes. + - name: http-metrics + port: 9090 + targetPort: 9090 + - name: http-profiling + port: 8008 + targetPort: 8008 + - name: http + port: 80 + targetPort: 8012 + - name: http2 + port: 81 + targetPort: 8013 + type: ClusterIP diff --git a/config/core/deployments/activator-hpa.yaml b/config/core/deployments/activator-hpa.yaml index 3930befc4a6e..d97017f7f75f 100644 --- a/config/core/deployments/activator-hpa.yaml +++ b/config/core/deployments/activator-hpa.yaml @@ -21,7 +21,7 @@ metadata: serving.knative.dev/release: devel spec: minReplicas: 1 - maxReplicas: 20 + maxReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: Deployment diff --git a/config/core/deployments/activator.yaml b/config/core/deployments/activator.yaml index 8be66c1f999c..380219e13633 100644 --- a/config/core/deployments/activator.yaml +++ b/config/core/deployments/activator.yaml @@ -44,11 +44,11 @@ spec: # https://github.com/knative/serving/issues/1625#issuecomment-511930023 resources: requests: - cpu: 300m + cpu: 100m memory: 60Mi limits: - cpu: 1000m - memory: 600Mi + cpu: 300m + memory: 200Mi env: # Run Activator with GC collection when newly generated memory is 500%. From 6df633025a2b6ddad0a37054bef12064a4fe763e Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Fri, 24 Jan 2020 11:26:40 -0800 Subject: [PATCH 2/8] licence + remove duplicate --- config/activator-ds.yaml | 41 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/config/activator-ds.yaml b/config/activator-ds.yaml index 3a0b7163a36b..5c2e585c2250 100644 --- a/config/activator-ds.yaml +++ b/config/activator-ds.yaml @@ -1,3 +1,17 @@ +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: apps/v1 kind: DaemonSet metadata: @@ -88,30 +102,3 @@ spec: # connections. terminationGracePeriodSeconds: 300 ---- -apiVersion: v1 -kind: Service -metadata: - name: activator-service - namespace: knative-serving - labels: - app: activator - knative.dev/release: devel -spec: - selector: - role: activator - ports: - # Define metrics and profiling for them to be accessible within service meshes. - - name: http-metrics - port: 9090 - targetPort: 9090 - - name: http-profiling - port: 8008 - targetPort: 8008 - - name: http - port: 80 - targetPort: 8012 - - name: http2 - port: 81 - targetPort: 8013 - type: ClusterIP From 9757e05e6404eac5f560fdcb358b05f259ef4dc9 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Fri, 24 Jan 2020 11:29:50 -0800 Subject: [PATCH 3/8] remove the test patch, since we no longer need it --- test/e2e-common.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/e2e-common.sh b/test/e2e-common.sh index 20f63f98aabc..f48f958c0e78 100644 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -366,10 +366,6 @@ metadata: data: profiling.enable: "true" EOF - - echo ">> Patching activator HPA" - # We set min replicas to 2 for testing multiple activator pods. - kubectl -n knative-serving patch hpa activator --patch '{"spec":{"minReplicas":2}}' || return 1 } # Check if we should use --resolvabledomain. In case the ingress only has From fcb1e337d68c0650a104092b3c0e7d9256585956 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Fri, 24 Jan 2020 14:02:48 -0800 Subject: [PATCH 4/8] make sure the activator DS is in core and aliased --- config/activator-ds.yaml | 105 +--------------------------------- config/core/activator-ds.yaml | 104 +++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 104 deletions(-) mode change 100644 => 120000 config/activator-ds.yaml create mode 100644 config/core/activator-ds.yaml diff --git a/config/activator-ds.yaml b/config/activator-ds.yaml deleted file mode 100644 index 5c2e585c2250..000000000000 --- a/config/activator-ds.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2020 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: activator - namespace: knative-serving - labels: - knative.dev/release: devel -spec: - updateStrategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 10% - selector: - matchLabels: - app: activator - role: activator - template: - metadata: - labels: - app: activator - role: activator - knative.dev/release: devel - spec: - serviceAccountName: controller - containers: - - name: activator - # This is the Go import path for the binary that is containerized - # and substituted here. - image: knative.dev/serving/cmd/activator - - resources: - requests: - cpu: 100m - memory: 60Mi - limits: - cpu: 300m - memory: 200Mi - env: - # Run Activator with GC collection when newly generated memory is 500%. - - name: GOGC - value: "500" - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: SYSTEM_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: CONFIG_LOGGING_NAME - value: config-logging - - name: CONFIG_OBSERVABILITY_NAME - value: config-observability - # TODO(https://github.com/knative/pkg/pull/953): Remove stackdriver specific config - - name: METRICS_DOMAIN - value: knative.dev/internal/serving - - securityContext: - allowPrivilegeEscalation: false - - ports: - - name: metrics - containerPort: 9090 - - name: profiling - containerPort: 8008 - - name: http1 - containerPort: 8012 - - name: h2c - containerPort: 8013 - - readinessProbe: &probe - httpGet: - port: 8012 - httpHeaders: - - name: k-kubelet-probe - value: "activator" - livenessProbe: *probe - # The activator (often) sits on the dataplane, and may proxy long (e.g. - # streaming, websockets) requests. We give a long grace period for the - # activator to "lame duck" and drain outstanding requests before we - # forcibly terminate the pod (and outstanding connections). This value - # should be at least as large as the upper bound on the Revision's - # timeoutSeconds property to avoid servicing events disrupting - # connections. - terminationGracePeriodSeconds: 300 - diff --git a/config/activator-ds.yaml b/config/activator-ds.yaml new file mode 120000 index 000000000000..7ec2494d07ef --- /dev/null +++ b/config/activator-ds.yaml @@ -0,0 +1 @@ +./core/activator-ds.yaml \ No newline at end of file diff --git a/config/core/activator-ds.yaml b/config/core/activator-ds.yaml new file mode 100644 index 000000000000..5c2e585c2250 --- /dev/null +++ b/config/core/activator-ds.yaml @@ -0,0 +1,104 @@ +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: activator + namespace: knative-serving + labels: + knative.dev/release: devel +spec: + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 10% + selector: + matchLabels: + app: activator + role: activator + template: + metadata: + labels: + app: activator + role: activator + knative.dev/release: devel + spec: + serviceAccountName: controller + containers: + - name: activator + # This is the Go import path for the binary that is containerized + # and substituted here. + image: knative.dev/serving/cmd/activator + + resources: + requests: + cpu: 100m + memory: 60Mi + limits: + cpu: 300m + memory: 200Mi + env: + # Run Activator with GC collection when newly generated memory is 500%. + - name: GOGC + value: "500" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: SYSTEM_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: CONFIG_LOGGING_NAME + value: config-logging + - name: CONFIG_OBSERVABILITY_NAME + value: config-observability + # TODO(https://github.com/knative/pkg/pull/953): Remove stackdriver specific config + - name: METRICS_DOMAIN + value: knative.dev/internal/serving + + securityContext: + allowPrivilegeEscalation: false + + ports: + - name: metrics + containerPort: 9090 + - name: profiling + containerPort: 8008 + - name: http1 + containerPort: 8012 + - name: h2c + containerPort: 8013 + + readinessProbe: &probe + httpGet: + port: 8012 + httpHeaders: + - name: k-kubelet-probe + value: "activator" + livenessProbe: *probe + # The activator (often) sits on the dataplane, and may proxy long (e.g. + # streaming, websockets) requests. We give a long grace period for the + # activator to "lame duck" and drain outstanding requests before we + # forcibly terminate the pod (and outstanding connections). This value + # should be at least as large as the upper bound on the Revision's + # timeoutSeconds property to avoid servicing events disrupting + # connections. + terminationGracePeriodSeconds: 300 + From 75ef08247c9cd605fd9ea378c204f19cd9c3a433 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Tue, 28 Jan 2020 11:11:07 -0800 Subject: [PATCH 5/8] TEST --- config/core/deployments/activator-hpa.yaml | 40 +++++++++++----------- config/core/deployments/activator.yaml | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/config/core/deployments/activator-hpa.yaml b/config/core/deployments/activator-hpa.yaml index d97017f7f75f..b0d7f0f521ca 100644 --- a/config/core/deployments/activator-hpa.yaml +++ b/config/core/deployments/activator-hpa.yaml @@ -12,23 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: activator - namespace: knative-serving - labels: - serving.knative.dev/release: devel -spec: - minReplicas: 1 - maxReplicas: 1 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: activator - metrics: - - type: Resource - resource: - name: cpu - # Percentage of the requested CPU - targetAverageUtilization: 100 +# apiVersion: autoscaling/v2beta1 +# kind: HorizontalPodAutoscaler +# metadata: +# name: activator +# namespace: knative-serving +# labels: +# serving.knative.dev/release: devel +# spec: +# minReplicas: 0 +# maxReplicas: 0 +# scaleTargetRef: +# apiVersion: apps/v1 +# kind: Deployment +# name: activator +# metrics: +# - type: Resource +# resource: +# name: cpu +# # Percentage of the requested CPU +# targetAverageUtilization: 100 diff --git a/config/core/deployments/activator.yaml b/config/core/deployments/activator.yaml index 380219e13633..f2b978629ef1 100644 --- a/config/core/deployments/activator.yaml +++ b/config/core/deployments/activator.yaml @@ -20,6 +20,7 @@ metadata: labels: serving.knative.dev/release: devel spec: + replicas: 0 selector: matchLabels: app: activator From d1c45d73faca6b5201b87b5c6e4a5508f373085d Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Tue, 28 Jan 2020 16:27:14 -0800 Subject: [PATCH 6/8] test --- config/core/activator-ds.yaml | 6 +++--- config/core/deployments/activator.yaml | 2 +- pkg/activator/net/revision_backends.go | 2 +- test/e2e/scale.go | 8 +++++++- test/scale/scale_test.go | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/config/core/activator-ds.yaml b/config/core/activator-ds.yaml index 5c2e585c2250..213c4971b778 100644 --- a/config/core/activator-ds.yaml +++ b/config/core/activator-ds.yaml @@ -23,7 +23,7 @@ spec: updateStrategy: type: RollingUpdate rollingUpdate: - maxUnavailable: 10% + maxUnavailable: 50% selector: matchLabels: app: activator @@ -44,10 +44,10 @@ spec: resources: requests: - cpu: 100m + cpu: 300m memory: 60Mi limits: - cpu: 300m + cpu: 500m memory: 200Mi env: # Run Activator with GC collection when newly generated memory is 500%. diff --git a/config/core/deployments/activator.yaml b/config/core/deployments/activator.yaml index f2b978629ef1..e00b1b977754 100644 --- a/config/core/deployments/activator.yaml +++ b/config/core/deployments/activator.yaml @@ -20,7 +20,7 @@ metadata: labels: serving.knative.dev/release: devel spec: - replicas: 0 + replicas: 1 selector: matchLabels: app: activator diff --git a/pkg/activator/net/revision_backends.go b/pkg/activator/net/revision_backends.go index 3f75130ebe72..2f3c9b1312c4 100644 --- a/pkg/activator/net/revision_backends.go +++ b/pkg/activator/net/revision_backends.go @@ -251,7 +251,7 @@ func (rw *revisionWatcher) checkDests(dests sets.String) { // precise load balancing in the throttler. hs, noop, err := rw.probePodIPs(dests) if err != nil { - rw.logger.Errorw("Failed probing", zap.Error(err)) + rw.logger.With(zap.Error(err)).Warnf("Failed probing: %+v", dests) // We dont want to return here as an error still affects health states. } diff --git a/test/e2e/scale.go b/test/e2e/scale.go index 83b8b9ae2259..0e54e09ac25b 100644 --- a/test/e2e/scale.go +++ b/test/e2e/scale.go @@ -90,6 +90,8 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La // Record the overall completion time regardless of success/failure. defer latencies.Add("time-to-done", start) + fmt.Printf("#### 1 %s\n", names.Service) + svc, err := v1a1test.CreateLatestService(t, clients, names, v1alpha1testing.WithResourceRequirements(corev1.ResourceRequirements{ Limits: corev1.ResourceList{ @@ -112,11 +114,12 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La }, }), v1alpha1testing.WithRevisionTimeoutSeconds(10)) - + fmt.Printf("#### 2 %s --> %+V\n", names.Service, err) if err != nil { t.Errorf("CreateLatestService() = %v", err) return fmt.Errorf("CreateLatestService() failed: %w", err) } + // Record the time it took to create the service. latencies.Add("time-to-create", start) names.Route = serviceresourcenames.Route(svc) @@ -137,6 +140,8 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La url = s.Status.URL.URL() return v1a1test.IsServiceReady(s) }, "ServiceUpdatedWithURL") + + fmt.Printf("#### 3 %s ==> %+v\n", names.Service, err) if err != nil { t.Errorf("WaitForServiceState(w/ Domain) = %v", err) return fmt.Errorf("WaitForServiceState(w/ Domain) failed: %w", err) @@ -152,6 +157,7 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText), abortOnTimeout(ctx))), "WaitForEndpointToServeText", test.ServingFlags.ResolvableDomain) + fmt.Printf("#### 4 %s ==> %+v\n", names.Service, err) if err != nil { t.Errorf("WaitForEndpointState(expected text) = %v", err) return fmt.Errorf("WaitForEndpointState(expected text) failed: %w", err) diff --git a/test/scale/scale_test.go b/test/scale/scale_test.go index b58d972261a9..2123cf1b9058 100644 --- a/test/scale/scale_test.go +++ b/test/scale/scale_test.go @@ -52,7 +52,7 @@ const ( // interesting burst of deployments, but low enough to complete in a reasonable window. func TestScaleToN(t *testing.T) { // Run each of these variations. - tests := []int{10, 100} + tests := []int{1, 10, 100} for _, size := range tests { t.Run(fmt.Sprintf("scale-%d", size), func(t *testing.T) { From 144caabd35a83a8e9a995b45cb2aa1f609157771 Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Wed, 29 Jan 2020 09:21:32 -0800 Subject: [PATCH 7/8] test2 --- test/e2e/scale.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/e2e/scale.go b/test/e2e/scale.go index 0e54e09ac25b..ca44e0ae5c15 100644 --- a/test/e2e/scale.go +++ b/test/e2e/scale.go @@ -90,16 +90,14 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La // Record the overall completion time regardless of success/failure. defer latencies.Add("time-to-done", start) - fmt.Printf("#### 1 %s\n", names.Service) - svc, err := v1a1test.CreateLatestService(t, clients, names, v1alpha1testing.WithResourceRequirements(corev1.ResourceRequirements{ Limits: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("10m"), + corev1.ResourceCPU: resource.MustParse("45m"), corev1.ResourceMemory: resource.MustParse("50Mi"), }, Requests: corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("10m"), + corev1.ResourceCPU: resource.MustParse("30m"), corev1.ResourceMemory: resource.MustParse("20Mi"), }, }), @@ -114,7 +112,6 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La }, }), v1alpha1testing.WithRevisionTimeoutSeconds(10)) - fmt.Printf("#### 2 %s --> %+V\n", names.Service, err) if err != nil { t.Errorf("CreateLatestService() = %v", err) return fmt.Errorf("CreateLatestService() failed: %w", err) @@ -141,7 +138,6 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La return v1a1test.IsServiceReady(s) }, "ServiceUpdatedWithURL") - fmt.Printf("#### 3 %s ==> %+v\n", names.Service, err) if err != nil { t.Errorf("WaitForServiceState(w/ Domain) = %v", err) return fmt.Errorf("WaitForServiceState(w/ Domain) failed: %w", err) @@ -157,7 +153,6 @@ func ScaleToWithin(t *testing.T, scale int, duration time.Duration, latencies La v1a1test.RetryingRouteInconsistency(pkgTest.MatchesAllOf(pkgTest.IsStatusOK, pkgTest.MatchesBody(test.HelloWorldText), abortOnTimeout(ctx))), "WaitForEndpointToServeText", test.ServingFlags.ResolvableDomain) - fmt.Printf("#### 4 %s ==> %+v\n", names.Service, err) if err != nil { t.Errorf("WaitForEndpointState(expected text) = %v", err) return fmt.Errorf("WaitForEndpointState(expected text) failed: %w", err) From 0c78da6fcf44775b9c1ac56fba3225542119d9ed Mon Sep 17 00:00:00 2001 From: Victor Agababov Date: Wed, 29 Jan 2020 19:30:13 -0800 Subject: [PATCH 8/8] fix hpa --- config/core/deployments/activator-hpa.yaml | 40 +++++++++++----------- config/core/deployments/activator.yaml | 1 - test/scale/scale_test.go | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/config/core/deployments/activator-hpa.yaml b/config/core/deployments/activator-hpa.yaml index b0d7f0f521ca..d97017f7f75f 100644 --- a/config/core/deployments/activator-hpa.yaml +++ b/config/core/deployments/activator-hpa.yaml @@ -12,23 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -# apiVersion: autoscaling/v2beta1 -# kind: HorizontalPodAutoscaler -# metadata: -# name: activator -# namespace: knative-serving -# labels: -# serving.knative.dev/release: devel -# spec: -# minReplicas: 0 -# maxReplicas: 0 -# scaleTargetRef: -# apiVersion: apps/v1 -# kind: Deployment -# name: activator -# metrics: -# - type: Resource -# resource: -# name: cpu -# # Percentage of the requested CPU -# targetAverageUtilization: 100 +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: activator + namespace: knative-serving + labels: + serving.knative.dev/release: devel +spec: + minReplicas: 1 + maxReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: activator + metrics: + - type: Resource + resource: + name: cpu + # Percentage of the requested CPU + targetAverageUtilization: 100 diff --git a/config/core/deployments/activator.yaml b/config/core/deployments/activator.yaml index e00b1b977754..380219e13633 100644 --- a/config/core/deployments/activator.yaml +++ b/config/core/deployments/activator.yaml @@ -20,7 +20,6 @@ metadata: labels: serving.knative.dev/release: devel spec: - replicas: 1 selector: matchLabels: app: activator diff --git a/test/scale/scale_test.go b/test/scale/scale_test.go index 2123cf1b9058..b58d972261a9 100644 --- a/test/scale/scale_test.go +++ b/test/scale/scale_test.go @@ -52,7 +52,7 @@ const ( // interesting burst of deployments, but low enough to complete in a reasonable window. func TestScaleToN(t *testing.T) { // Run each of these variations. - tests := []int{1, 10, 100} + tests := []int{10, 100} for _, size := range tests { t.Run(fmt.Sprintf("scale-%d", size), func(t *testing.T) {