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 -1
View File
@@ -1,5 +1,5 @@
---
approvers:
reviewers:
- stclair
title: AppArmor
---
-43
View File
@@ -1,43 +0,0 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
component: scheduler
tier: control-plane
name: my-scheduler
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
component: scheduler
tier: control-plane
version: second
spec:
containers:
- command:
- /usr/local/bin/kube-scheduler
- --address=0.0.0.0
- --leader-elect=false
- --scheduler-name=my-scheduler
image: gcr.io/my-gcp-project/my-kube-scheduler:1.0
livenessProbe:
httpGet:
path: /healthz
port: 10251
initialDelaySeconds: 15
name: kube-second-scheduler
readinessProbe:
httpGet:
path: /healthz
port: 10251
resources:
requests:
cpu: '0.1'
securityContext:
privileged: false
volumeMounts: []
hostNetwork: false
hostPID: false
volumes: []
@@ -0,0 +1,2 @@
maxmemory 2mb
maxmemory-policy allkeys-lru
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: kubernetes/redis:v1
env:
- name: MASTER
value: "true"
ports:
- containerPort: 6379
resources:
limits:
cpu: "0.1"
volumeMounts:
- mountPath: /redis-master-data
name: data
- mountPath: /redis-master
name: config
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: example-redis-config
items:
- key: redis-config
path: redis.conf
@@ -1,5 +1,5 @@
---
approvers:
reviewers:
- eparis
- pmorie
title: Configuring Redis using a ConfigMap
@@ -34,11 +34,10 @@ This page provides a real world example of how to configure Redis using a Config
You can follow the steps below to configure a Redis cache using data stored in a ConfigMap.
1. Create a ConfigMap from the `docs/user-guide/configmap/redis/redis-config` file:
1. Create a ConfigMap from the `docs/tutorials/configuration/configmap/redis/redis-config` file:
```shell
kubectl create configmap example-redis-config --from-file=docs/user-guide/configmap/redis/redis-config
kubectl create configmap example-redis-config --from-file=https://k8s.io/docs/tutorials/configuration/configmap/redis/redis-config
kubectl get configmap example-redis-config -o yaml
```
@@ -95,7 +94,7 @@ You can follow the steps below to configure a Redis cache using data stored in a
1. Create the pod:
```shell
kubectl create -f docs/user-guide/configmap/redis/redis-pod.yaml
kubectl create -f https://k8s.io/tutorials/configuration/configmap/redis/redis-pod.yaml
```
In the example, the config volume is mounted at `/redis-master`.
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: Example Tutorial Template
approvers:
reviewers:
- chenopis
---
+1 -1
View File
@@ -38,7 +38,7 @@ title: Overview
</div>
</div>
<div class="content__modules">
<div id="basics-modules" class="content__modules">
<h2>Kubernetes Basics Modules</h2>
<div class="row">
<div class="col-md-12">
@@ -0,0 +1,21 @@
---
title: Overview of Kubernetes Online Training
---
{% capture overview %}
Here are some of the sites that offer online training for Kubernetes:
{% endcapture %}
{% capture body %}
* [Scalable Microservices with Kubernetes (Udacity)](https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615)
* [Introduction to Kubernetes (edX)](https://www.edx.org/course/introduction-kubernetes-linuxfoundationx-lfs158x)
{% endcapture %}
{% include templates/concept.md %}
@@ -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
@@ -1,16 +0,0 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 4 # Update the replicas from 2 to 4
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.8
ports:
- containerPort: 80
@@ -1,16 +0,0 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8
ports:
- containerPort: 80
@@ -1,8 +1,11 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template: # create pods using pod definition in this template
metadata:
@@ -1,6 +1,6 @@
---
title: "Example: Deploying PHP Guestbook application with Redis"
approvers:
reviewers:
- ahmetb
---
@@ -28,7 +28,7 @@ spec:
# provide a dns service. As of Kubernetes 1.3, DNS is a built-in
# service launched automatically. However, if the cluster you are using
# does not have a built-in DNS service, you can instead
# instead access an environment variable to find the master
# access an environment variable to find the master
# service's host. To do so, comment out the 'value: dns' line above, and
# uncomment the line below:
# value: env
@@ -30,7 +30,7 @@ spec:
# provide a dns service. As of Kubernetes 1.3, DNS is a built-in
# service launched automatically. However, if the cluster you are using
# does not have a built-in DNS service, you can instead
# instead access an environment variable to find the master
# access an environment variable to find the master
# service's host. To do so, comment out the 'value: dns' line above, and
# uncomment the line below:
# value: env
@@ -76,6 +76,12 @@ Determine whether you can access sites like [https://cloud.google.com/container-
curl --proxy "" https://cloud.google.com/container-registry/
```
Make sure that the Docker daemon is started. You can determine if docker is running by using a command such as:
```shell
docker images
```
If NO proxy is required, start the Minikube cluster:
```shell
@@ -116,6 +122,12 @@ Verify that `kubectl` is configured to communicate with your cluster:
kubectl cluster-info
```
Open the Kubernetes dashboard in a browser:
```shell
minikube dashboard
```
## Create your Node.js application
The next step is to write the application. Save this code in a folder named `hellonode`
@@ -381,6 +393,12 @@ kubectl delete service hello-node
kubectl delete deployment hello-node
```
Optionally, force removal of the Docker images created:
```shell
docker rmi hello-node:v1 hello-node:v2 -f
```
Optionally, stop the Minikube VM:
```shell