Skip to content

Commit d592a7e

Browse files
committed
Some fixes
1 parent b139c2c commit d592a7e

File tree

8 files changed

+28
-18
lines changed

8 files changed

+28
-18
lines changed

advanced/ElasticScale/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
autoscaler

advanced/ElasticScale/README.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ IMPORTANT: The instructions have not been written/finished, but you can already
88
# Start Minikiube with 8GB of RAM
99
minikube start --memory 4096
1010
11-
# Enable metrics-server for measuring
11+
# Enable metrics-server and heapster for measuring
1212
minikube addons enable metrics-server
13+
minikube addons enable heapster
1314
1415
# Create deployment for out random service
1516
kubectl create -f deployment.yml
@@ -18,10 +19,10 @@ kubectl create -f deployment.yml
1819
kubectl autoscale deployment random-generator --min=1 --max=10 --cpu-percent=50
1920
2021
# Same for V2
21-
kubectl create -f deployment.yml
22+
kubectl create -f hpa.yml
2223
2324
# Put some load on the system
24-
port=$(kubectl get svc random-generator-np -o jsonpath={.spec.ports[0].nodePort})
25+
port=$(kubectl get svc random-generator -o jsonpath={.spec.ports[0].nodePort})
2526
while true; do curl -s http://$(minikube ip):port?burn=10000 >/dev/null; done
2627
2728
# In other terminal:

advanced/ElasticScale/hpa.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
apiVersion: autoscaling/v2beta2
22
kind: HorizontalPodAutoscaler
33
metadata:
4-
creationTimestamp: "2019-02-09T17:18:38Z"
54
name: random-generator
6-
namespace: default
7-
resourceVersion: "796"
8-
selfLink: /apis/autoscaling/v2beta2/namespaces/default/horizontalpodautoscalers/random-generator
9-
uid: bd57a211-2c8e-11e9-86e0-080027613e7d
105
spec:
116
scaleTargetRef:
12-
apiVersion: extensions/v1beta1
7+
apiVersion: apps/v1
138
kind: Deployment
149
name: random-generator
1510
maxReplicas: 20

advanced/ElasticScale/vpa.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
apiVersion: "autoscaling.k8s.io/v1beta1"
1+
apiVersion: "autoscaling.k8s.io/v1beta2"
22
kind: VerticalPodAutoscaler
33
metadata:
44
name: random-generator
55
spec:
66
updatePolicy:
77
updateMode: Recreate
8-
selector:
9-
matchLabels:
10-
app: random-generator
8+
targetRef:
9+
apiVersion: "apps/v1"
10+
kind: Deployment
11+
name: random-generator

behavorial/BatchJob/README.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ To access the PersistentVolume used in this demo, let's mount a local directory
1414
minikube start --mount --mount-string="$(pwd)/logs:/example"
1515
----
1616

17+
Alternatively, you can mount the directory on the fly in the background
18+
19+
[source,bash]
20+
----
21+
minikube mount $(pwd)/logs:/example
22+
----
23+
1724
This makes this directory available within the Minikube VM at the path `/example`.
1825

1926
Let's create now the PersistentVolume along with a PVC which can be mounted into our Job later:

behavorial/DaemonService/daemonset.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DaemonSet resource
22
---
3-
apiVersion: extensions/v1beta1
3+
apiVersion: apps/v1
44
kind: DaemonSet
55
metadata:
66
name: random-refresher

behavorial/SingletonService/pdb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ spec:
99
matchLabels:
1010
# Used for counting active Pods for which this PDB is used
1111
app: random-generator
12-
# At least two need to be available all the time
12+
# At least four need to be available all the time
1313
minAvailable: 4

behavorial/StatefulService/README.adoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
== Stateful Service
22

3-
IMPORTANT: The instructions have not been written/finished, but the resource file has been verified. Instructions will be added soon.
4-
5-
In this example we will examine how a _Statefule Service_ can implemented with the help of a StatefulSet resource.
3+
In this example we will examine how a _Stateful Service_ can implemented with the help of a StatefulSet resource.
64

75
This example assumes a Kubernetes installation available.
86
For the moment we are using Minikube as we need some support for PersistentVolumes.
@@ -15,6 +13,13 @@ To access the PersistentVolume used in this demo, let's mount a local directory
1513
minikube start --mount --mount-string="$(pwd)/logs:/tmp/example"
1614
----
1715

16+
Alternatively start the mount after your minikube is running
17+
[source, bash]
18+
----
19+
minikube mount $(pwd)/logs:/tmp/example
20+
----
21+
22+
1823
This makes this directory available within the Minikube VM at the path `/tmp/example`.
1924

2025
NOTE: Some virtual machine drivers of Minikube doesn't support host mounts like this (like the `vmware` driver). You can verify this by entering the VM after startup with `minikube ssh` and check whether you see the local directories `1` and `2` in `ls /tmp/example/*`, too.

0 commit comments

Comments
 (0)