Skip to content

Commit d3328ec

Browse files
Merge pull request #105 from lberk/scaling-configmap
(fix): Add auto-scaler config map Since v0.4.0 has started to provide the config map samples, its required to add one for the chapter examples Fixes #55
2 parents 62b6403 + d6ede37 commit d3328ec

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: config-autoscaler
5+
labels:
6+
serving.knative.dev/release: devel
7+
data:
8+
scale-to-zero-grace-period: 30s
9+
stable-window: 60s

documentation/modules/ROOT/pages/04-scaling.adoc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,47 @@ include::partial$prereq-cli.adoc[]
1818
== Build Containers
1919
include::partial$build-containers.adoc[tag=greeter]
2020

21+
[#scaling-modify-configmap]
22+
== Setting Configmap Defaults
23+
24+
Knative v0.4.0 changed how the default configuration map values are set and provided.
25+
For the purposes of this section, lets apply a few defaults.
26+
27+
[.text-center]
28+
.link:{github-repo}/{scaling-repo}/knative/autoscaling-configmap.yaml[autoscaling-configmap.yaml]
29+
[source,yaml,linenums]
30+
----
31+
apiVersion: v1
32+
kind: ConfigMap
33+
metadata:
34+
name: config-autoscaler
35+
labels:
36+
serving.knative.dev/release: devel
37+
data:
38+
scale-to-zero-grace-period: 30s
39+
stable-window: 60s
40+
----
41+
Navigate to the tutorial chapter's `Knative` folder:
42+
43+
[source,bash,subs="+macros,+attributes"]
44+
----
45+
cd $TUTORIAL_HOME/03-serving/knative
46+
----
47+
48+
The service can be deployed using the command:
49+
50+
[source,bash,subs="+macros,+attributes"]
51+
----
52+
kubectl apply -n knative-serving -f link:{github-repo}/{serving-repo}/knative/autoscaling-configmap.yaml[autoscaling-configmap.yaml]
53+
----
54+
55+
.(OR)
56+
57+
[source,bash,subs="+macros,+attributes"]
58+
----
59+
oc apply -n knative-serving -f link:{github-repo}/{serving-repo}/knative/autoscaling-configmap.yaml[autoscaling-configmap.yaml]
60+
----
61+
2162
[#scaling-deploy-service]
2263
== Deploy Service
2364

0 commit comments

Comments
 (0)