merge master to 1.10, with fixes (#7682)

This commit is contained in:
Jennifer Rondeau
2018-03-08 14:03:55 -05:00
committed by k8s-ci-robot
parent bb8c59a640
commit 44b51d6056
548 changed files with 11634 additions and 318622 deletions
@@ -1,5 +1,5 @@
---
approvers:
reviewers:
- enisoc
- erictune
- foxish
@@ -465,7 +465,7 @@ In one terminal window, patch the `web` StatefulSet to change the container
image again.
```shell
kubectl patch statefulset web --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"k8s.gcr.io/nginx-slim:0.8"}]'
kubectl patch statefulset web --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"gcr.io/google_containers/nginx-slim:0.8"}]'
statefulset "web" patched
```
@@ -1,6 +1,6 @@
---
title: "Example: Deploying Cassandra with Stateful Sets"
approvers:
reviewers:
- ahmetb
---
@@ -11,9 +11,9 @@ Deploying stateful distributed applications, like Cassandra, within a clustered
**Cassandra Docker**
The Pods use the [`gcr.io/google-samples/cassandra:v12`](https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile)
The Pods use the [`gcr.io/google-samples/cassandra:v13`](https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile)
image from Google's [container registry](https://cloud.google.com/container-registry/docs/).
The docker is based on `debian:jessie` and includes OpenJDK 8. This image includes a standard Cassandra installation from the Apache Debian repo. By using environment variables you can change values that are inserted into `cassandra.yaml`.
The docker image above is based on [debian-base](https://github.com/kubernetes/kubernetes/tree/master/build/debian-base) and includes OpenJDK 8. This image includes a standard Cassandra installation from the Apache Debian repo. By using environment variables you can change values that are inserted into `cassandra.yaml`.
| ENV VAR | DEFAULT VALUE |
| ------------- |:-------------: |
@@ -143,7 +143,7 @@ The StatefulSet manifest, included below, creates a Cassandra ring that consists
UN 172.17.0.6 84.74 KiB 32 67.1% a6a1e8c2-3dc5-4417-b1a0-26507af2aaad Rack1-K8Demo
## Modifying the Cassandra StatefulSet
Use `kubectl edit` to modify the size of of a Cassandra StatefulSet.
Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
1. Run the following command:
@@ -15,9 +15,10 @@ spec:
labels:
app: cassandra
spec:
terminationGracePeriodSeconds: 1800
containers:
- name: cassandra
image: gcr.io/google-samples/cassandra:v12
image: gcr.io/google-samples/cassandra:v13
imagePullPolicy: Always
ports:
- containerPort: 7000
@@ -42,7 +43,10 @@ spec:
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"]
command:
- /bin/sh
- -c
- nodetool drain
env:
- name: MAX_HEAP_SIZE
value: 512M
@@ -56,8 +60,6 @@ spec:
value: "DC1-K8Demo"
- name: CASSANDRA_RACK
value: "Rack1-K8Demo"
- name: CASSANDRA_AUTO_BOOTSTRAP
value: "false"
- name: POD_IP
valueFrom:
fieldRef:
@@ -82,10 +84,9 @@ spec:
volumeClaimTemplates:
- metadata:
name: cassandra-data
annotations:
volume.beta.kubernetes.io/storage-class: fast
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: fast
resources:
requests:
storage: 1Gi
@@ -1,6 +1,6 @@
---
title: "Example: Deploying WordPress and MySQL with Persistent Volumes"
approvers:
reviewers:
- ahmetb
---
@@ -1,5 +1,5 @@
---
approvers:
reviewers:
- bprashanth
- enisoc
- erictune
@@ -120,7 +120,7 @@ StatefulSet controller create the StatefulSet's Pods.
kubectl get pods -w -l app=zk
```
Once the `zk-2` Pod is Running and Ready, use `CRTL-C` to terminate kubectl.
Once the `zk-2` Pod is Running and Ready, use `CTRL-C` to terminate kubectl.
```shell
NAME READY STATUS RESTARTS AGE
@@ -365,7 +365,7 @@ Watch the termination of the Pods in the StatefulSet.
kubectl get pods -w -l app=zk
```
When `zk-0` if fully terminated, use `CRTL-C` to terminate kubectl.
When `zk-0` if fully terminated, use `CTRL-C` to terminate kubectl.
```shell
zk-2 1/1 Terminating 0 9m
@@ -396,7 +396,7 @@ Watch the StatefulSet controller recreate the StatefulSet's Pods.
kubectl get pods -w -l app=zk
```
Once the `zk-2` Pod is Running and Ready, use `CRTL-C` to terminate kubectl.
Once the `zk-2` Pod is Running and Ready, use `CTRL-C` to terminate kubectl.
```shell
NAME READY STATUS RESTARTS AGE
@@ -498,11 +498,11 @@ servers' WALs, and all of their snapshots, remain durable.
## Ensuring Consistent Configuration
As noted in the [Facilitating Leader Election](#facilitating-leader-election) and
[Achieving Consensus](#achieving-consensus) sections, the servers in a
ZooKeeper ensemble require consistent configuration in order to elect a leader
[Achieving Consensus](#achieving-consensus) sections, the servers in a
ZooKeeper ensemble require consistent configuration in order to elect a leader
and form a quorum. They also require consistent configuration of the Zab protocol
in order for the protocol to work correctly over a network. In our example we
achieve consistent configuration by embedding the configuration directly into
in order for the protocol to work correctly over a network. In our example we
achieve consistent configuration by embedding the configuration directly into
the manifest.
Get the `zk` StatefulSet.
@@ -798,7 +798,9 @@ The Pod `template` for the `zk` StatefulSet specifies a liveness probe.
livenessProbe:
exec:
command:
- "zkOk.sh"
- sh
- -c
- "zookeeper-ready 2181"
initialDelaySeconds: 15
timeoutSeconds: 5
```
@@ -809,8 +811,7 @@ word to test the server's health.
```bash
ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181}
OK=$(echo ruok | nc 127.0.0.1 $ZK_CLIENT_PORT)
OK=$(echo ruok | nc 127.0.0.1 $1)
if [ "$OK" == "imok" ]; then
exit 0
else
@@ -831,7 +832,7 @@ In another window, delete the `zkOk.sh` script from the file system of Pod `zk-0
```shell
kubectl exec zk-0 -- rm /opt/zookeeper/bin/zkOk.sh
kubectl exec zk-0 -- rm /usr/bin/zookeeper-ready
```
@@ -875,7 +876,9 @@ probe from the `zookeeper.yaml` manifest is identical to the liveness probe.
readinessProbe:
exec:
command:
- "zkOk.sh"
- sh
- -c
- "zookeeper-ready 2181"
initialDelaySeconds: 15
timeoutSeconds: 5
```
@@ -931,12 +934,12 @@ This is because the Pods in the `zk` StatefulSet have a PodAntiAffinity specifie
- key: "app"
operator: In
values:
- zk-headless
- zk-hs
topologyKey: "kubernetes.io/hostname"
```
The `requiredDuringSchedulingIgnoredDuringExecution` field tells the
Kubernetes Scheduler that it should never co-locate two Pods from the `zk-headless`
Kubernetes Scheduler that it should never co-locate two Pods from the `zk-hs`
Service in the domain defined by the `topologyKey`. The `topologyKey`
`kubernetes.io/hostname` indicates that the domain is an individual node. Using
different rules, labels, and selectors, you can extend this technique to spread
@@ -1075,7 +1078,7 @@ There are pending pods when an error occurred: Cannot evict pod as it would viol
pod/zk-2
{% endraw %}```
Use `CRTL-C` to terminate to kubectl.
Use `CTRL-C` to terminate to kubectl.
You can not drain the third node because evicting `zk-2` would violate `zk-budget`. However,
the node will remain cordoned.
@@ -63,7 +63,7 @@ spec:
- key: "app"
operator: In
values:
- zk
- zk-hs
topologyKey: "kubernetes.io/hostname"
containers:
- name: kubernetes-zookeeper