Skip to content

Commit d6ede37

Browse files
committed
Fix chapter 3 for knative v0.4.0
Our previous approach for editing the configmap broke because the autoscaler configmap went from defining the defaults to providing examples in the configmap on variables to change. To get around this and keep the changes around this section minimal, we've added a small configmap to apply that will set this defaults explicitly. The remainder of the section (with yq invocations) will work as advertised.
1 parent bdb7bf5 commit d6ede37

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)