Single-source/multi-version docs structure
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: dapi-test-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: test-container
|
||||
image: gcr.io/google_containers/busybox
|
||||
command: [ "/bin/sh", "-c", "env" ]
|
||||
env:
|
||||
- name: MY_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: MY_POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: MY_POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
restartPolicy: Never
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,30 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: kubernetes-downwardapi-volume-example
|
||||
labels:
|
||||
zone: us-est-coast
|
||||
cluster: test-cluster1
|
||||
rack: rack-22
|
||||
annotations:
|
||||
build: two
|
||||
builder: john-doe
|
||||
spec:
|
||||
containers:
|
||||
- name: client-container
|
||||
image: gcr.io/google_containers/busybox
|
||||
command: ["sh", "-c", "while true; do if [[ -e /etc/labels ]]; then cat /etc/labels; fi; if [[ -e /etc/annotations ]]; then cat /etc/annotations; fi; sleep 5; done"]
|
||||
volumeMounts:
|
||||
- name: podinfo
|
||||
mountPath: /etc
|
||||
readOnly: false
|
||||
volumes:
|
||||
- name: podinfo
|
||||
downwardAPI:
|
||||
items:
|
||||
- path: "labels"
|
||||
fieldRef:
|
||||
fieldPath: metadata.labels
|
||||
- path: "annotations"
|
||||
fieldRef:
|
||||
fieldPath: metadata.annotations
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: backend-rc
|
||||
labels:
|
||||
type: backend-type
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
type: backend-type
|
||||
spec:
|
||||
containers:
|
||||
- name: backend-container
|
||||
image: gcr.io/google-samples/env-backend:1.1
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: backend-srv
|
||||
labels:
|
||||
type: backend-type
|
||||
spec:
|
||||
ports:
|
||||
- port: 5000
|
||||
protocol: TCP
|
||||
selector:
|
||||
type: backend-type
|
||||
@@ -0,0 +1,2 @@
|
||||
FROM golang:onbuild
|
||||
EXPOSE 8080
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func printInfo(resp http.ResponseWriter, req *http.Request) {
|
||||
name := os.Getenv("POD_NAME")
|
||||
namespace := os.Getenv("POD_NAMESPACE")
|
||||
fmt.Fprintf(resp, "Backend Container\n")
|
||||
fmt.Fprintf(resp, "Backend Pod Name: %v\n", name)
|
||||
fmt.Fprintf(resp, "Backend Namespace: %v\n", namespace)
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", printInfo)
|
||||
log.Fatal(http.ListenAndServe(":5000", nil))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,2 @@
|
||||
FROM golang:onbuild
|
||||
EXPOSE 8080
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func getKubeEnv() (map[string]string, error) {
|
||||
environS := os.Environ()
|
||||
environ := make(map[string]string)
|
||||
for _, val := range environS {
|
||||
split := strings.Split(val, "=")
|
||||
if len(split) != 2 {
|
||||
return environ, fmt.Errorf("Some weird env vars")
|
||||
}
|
||||
environ[split[0]] = split[1]
|
||||
}
|
||||
for key := range environ {
|
||||
if !(strings.HasSuffix(key, "_SERVICE_HOST") ||
|
||||
strings.HasSuffix(key, "_SERVICE_PORT")) {
|
||||
delete(environ, key)
|
||||
}
|
||||
}
|
||||
return environ, nil
|
||||
}
|
||||
|
||||
func printInfo(resp http.ResponseWriter, req *http.Request) {
|
||||
kubeVars, err := getKubeEnv()
|
||||
if err != nil {
|
||||
http.Error(resp, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
backendHost := os.Getenv("BACKEND_SRV_SERVICE_HOST")
|
||||
backendPort := os.Getenv("BACKEND_SRV_SERVICE_PORT")
|
||||
backendRsp, backendErr := http.Get(fmt.Sprintf(
|
||||
"http://%v:%v/",
|
||||
backendHost,
|
||||
backendPort))
|
||||
if backendErr == nil {
|
||||
defer backendRsp.Body.Close()
|
||||
}
|
||||
|
||||
name := os.Getenv("POD_NAME")
|
||||
namespace := os.Getenv("POD_NAMESPACE")
|
||||
fmt.Fprintf(resp, "Pod Name: %v \n", name)
|
||||
fmt.Fprintf(resp, "Pod Namespace: %v \n", namespace)
|
||||
|
||||
envvar := os.Getenv("USER_VAR")
|
||||
fmt.Fprintf(resp, "USER_VAR: %v \n", envvar)
|
||||
|
||||
fmt.Fprintf(resp, "\nKubernetes environment variables\n")
|
||||
var keys []string
|
||||
for key := range kubeVars {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, key := range keys {
|
||||
fmt.Fprintf(resp, "%v = %v \n", key, kubeVars[key])
|
||||
}
|
||||
|
||||
fmt.Fprintf(resp, "\nFound backend ip: %v port: %v\n", backendHost, backendPort)
|
||||
if backendErr == nil {
|
||||
fmt.Fprintf(resp, "Response from backend\n")
|
||||
io.Copy(resp, backendRsp.Body)
|
||||
} else {
|
||||
fmt.Fprintf(resp, "Error from backend: %v", backendErr.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", printInfo)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: show-rc
|
||||
labels:
|
||||
type: show-type
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
type: show-type
|
||||
spec:
|
||||
containers:
|
||||
- name: show-container
|
||||
image: gcr.io/google-samples/env-show:1.1
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: USER_VAR
|
||||
value: important information
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: show-srv
|
||||
labels:
|
||||
type: show-type
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
selector:
|
||||
type: show-type
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: php-apache
|
||||
namespace: default
|
||||
spec:
|
||||
scaleRef:
|
||||
kind: ReplicationController
|
||||
name: php-apache
|
||||
namespace: default
|
||||
minReplicas: 1
|
||||
maxReplicas: 10
|
||||
cpuUtilization:
|
||||
targetPercentage: 50
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM php:5-apache
|
||||
|
||||
ADD index.php /var/www/html/index.php
|
||||
|
||||
RUN chmod a+rx index.php
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$x = 0.0001;
|
||||
for ($i = 0; $i <= 1000000; $i++) {
|
||||
$x += sqrt($x);
|
||||
}
|
||||
echo "OK!";
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: test-ingress
|
||||
spec:
|
||||
backend:
|
||||
serviceName: testsvc
|
||||
servicePort: 80
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: pi
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pi
|
||||
template:
|
||||
metadata:
|
||||
name: pi
|
||||
labels:
|
||||
app: pi
|
||||
spec:
|
||||
containers:
|
||||
- name: pi
|
||||
image: perl
|
||||
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
|
||||
restartPolicy: Never
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,21 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
test: liveness
|
||||
name: liveness-exec
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- echo ok > /tmp/health; sleep 10; rm -rf /tmp/health; sleep 600
|
||||
image: gcr.io/google_containers/busybox
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- cat
|
||||
- /tmp/health
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 1
|
||||
name: liveness
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
test: liveness
|
||||
name: liveness-http
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- /server
|
||||
image: gcr.io/google_containers/liveness
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8080
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 1
|
||||
name: liveness
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM scratch
|
||||
|
||||
ADD server /server
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
all: push
|
||||
|
||||
server: server.go
|
||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./server.go
|
||||
|
||||
container: server
|
||||
docker build -t gcr.io/google_containers/liveness .
|
||||
|
||||
push: container
|
||||
gcloud docker push gcr.io/google_containers/liveness
|
||||
|
||||
clean:
|
||||
rm -f server
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// A simple server that is alive for 10 seconds, then reports unhealthy for
|
||||
// the rest of its (hopefully) short existence.
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
started := time.Now()
|
||||
http.HandleFunc("/started", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(200)
|
||||
data := (time.Now().Sub(started)).String()
|
||||
w.Write([]byte(data))
|
||||
})
|
||||
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
||||
duration := time.Now().Sub(started)
|
||||
if duration.Seconds() > 10 {
|
||||
w.WriteHeader(500)
|
||||
w.Write([]byte(fmt.Sprintf("error: %v", duration.Seconds())))
|
||||
} else {
|
||||
w.WriteHeader(200)
|
||||
w.Write([]byte("ok"))
|
||||
}
|
||||
})
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Makefile for launching synthetic logging sources (any platform)
|
||||
# and for reporting the forwarding rules for the
|
||||
# Elasticsearch and Kibana pods for the GCE platform.
|
||||
# For examples of how to observe the ingested logs please
|
||||
# see the appropriate getting started guide e.g.
|
||||
# Google Cloud Logging: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/logging.md
|
||||
# With Elasticsearch and Kibana logging: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/logging-elasticsearch.md
|
||||
|
||||
.PHONY: up down logger-up logger-down logger10-up logger10-down
|
||||
|
||||
up: logger-up logger10-up
|
||||
|
||||
down: logger-down logger10-down
|
||||
|
||||
logger-up:
|
||||
kubectl create -f synthetic_0_25lps.yaml
|
||||
|
||||
logger-down:
|
||||
kubectl delete pod synthetic-logger-0.25lps-pod
|
||||
|
||||
logger10-up:
|
||||
kubectl create -f synthetic_10lps.yaml
|
||||
|
||||
logger10-down:
|
||||
kubectl delete pod synthetic-logger-10lps-pod
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,30 @@
|
||||
# This pod specification creates an instance of a synthetic logger. The logger
|
||||
# is simply a program that writes out the hostname of the pod, a count which increments
|
||||
# by one on each iteration (to help notice missing log enteries) and the date using
|
||||
# a long format (RFC-3339) to nano-second precision. This program logs at a frequency
|
||||
# of 0.25 lines per second. The shellscript program is given directly to bash as -c argument
|
||||
# and could have been written out as:
|
||||
# i="0"
|
||||
# while true
|
||||
# do
|
||||
# echo -n "`hostname`: $i: "
|
||||
# date --rfc-3339 ns
|
||||
# sleep 4
|
||||
# i=$[$i+1]
|
||||
# done
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
name: synth-logging-source
|
||||
name: synthetic-logger-0.25lps-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: synth-lgr
|
||||
image: ubuntu:14.04
|
||||
args:
|
||||
- bash
|
||||
- -c
|
||||
- 'i="0"; while true; do echo -n "`hostname`: $i: "; date --rfc-3339 ns; sleep
|
||||
4; i=$[$i+1]; done'
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# This pod specification creates an instance of a synthetic logger. The logger
|
||||
# is simply a program that writes out the hostname of the pod, a count which increments
|
||||
# by one on each iteration (to help notice missing log enteries) and the date using
|
||||
# a long format (RFC-3339) to nano-second precision. This program logs at a frequency
|
||||
# of 0.25 lines per second. The shellscript program is given directly to bash as -c argument
|
||||
# and could have been written out as:
|
||||
# i="0"
|
||||
# while true
|
||||
# do
|
||||
# echo -n "`hostname`: $i: "
|
||||
# date --rfc-3339 ns
|
||||
# sleep 4
|
||||
# i=$[$i+1]
|
||||
# done
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
name: synth-logging-source
|
||||
name: synthetic-logger-10lps-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: synth-lgr
|
||||
image: ubuntu:14.04
|
||||
args:
|
||||
- bash
|
||||
- -c
|
||||
- 'i="0"; while true; do echo -n "`hostname`: $i: "; date --rfc-3339 ns; sleep
|
||||
0.1; i=$[$i+1]; done'
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
name: redis
|
||||
redis-sentinel: "true"
|
||||
role: master
|
||||
name: redis-master
|
||||
spec:
|
||||
containers:
|
||||
- name: master
|
||||
image: kubernetes/redis:v1
|
||||
env:
|
||||
- name: MASTER
|
||||
value: "true"
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
resources:
|
||||
limits:
|
||||
cpu: "0.5"
|
||||
volumeMounts:
|
||||
- mountPath: /redis-master-data
|
||||
name: data
|
||||
- name: sentinel
|
||||
image: kubernetes/redis:v1
|
||||
env:
|
||||
- name: SENTINEL
|
||||
value: "true"
|
||||
ports:
|
||||
- containerPort: 26379
|
||||
volumes:
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
labels:
|
||||
name: redis-proxy
|
||||
role: proxy
|
||||
name: redis-proxy
|
||||
spec:
|
||||
containers:
|
||||
- name: proxy
|
||||
image: kubernetes/redis-proxy:v1
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: api
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.9.1
|
||||
ports:
|
||||
- containerPort: 80
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.7.9
|
||||
ports:
|
||||
- containerPort: 80
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
env: test
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
imagePullPolicy: IfNotPresent
|
||||
nodeSelector:
|
||||
disktype: ssd
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,10 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: myclaim-1
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 3Gi
|
||||
@@ -0,0 +1,10 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: myclaim-2
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 8Gi
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"kind": "PersistentVolumeClaim",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "myclaim-3"
|
||||
}, "spec": {
|
||||
"accessModes": [
|
||||
"ReadWriteOnce",
|
||||
"ReadOnlyMany"
|
||||
],
|
||||
"resources": {
|
||||
"requests": {
|
||||
"storage": "10G"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"kind": "Namespace",
|
||||
"apiVersion":"v1",
|
||||
"metadata": {
|
||||
"name": "myns",
|
||||
"labels": {
|
||||
"name": "development"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
kind: Pod
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: mypod
|
||||
labels:
|
||||
name: frontendhttp
|
||||
spec:
|
||||
containers:
|
||||
- name: myfrontend
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: "http-server"
|
||||
volumeMounts:
|
||||
- mountPath: "/var/www/html"
|
||||
name: mypd
|
||||
volumes:
|
||||
- name: mypd
|
||||
persistentVolumeClaim:
|
||||
claimName: myclaim-1
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "frontendservice"
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"protocol": "TCP",
|
||||
"port": 3000,
|
||||
"targetPort": "http-server"
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"name": "frontendhttp"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
kind: PersistentVolume
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: pv0003
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
- ReadOnlyMany
|
||||
gcePersistentDisk:
|
||||
pdName: "abc123"
|
||||
fsType: "ext4"
|
||||
@@ -0,0 +1,13 @@
|
||||
kind: PersistentVolume
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: pv0001
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/tmp/data01"
|
||||
@@ -0,0 +1,14 @@
|
||||
kind: PersistentVolume
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: pv0002
|
||||
labels:
|
||||
type: local
|
||||
spec:
|
||||
capacity:
|
||||
storage: 8Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/tmp/data02"
|
||||
persistentVolumeReclaimPolicy: Recycle
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv0003
|
||||
spec:
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
nfs:
|
||||
path: /tmp
|
||||
server: 172.17.0.2
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
app: nginx
|
||||
template:
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: secret-test-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: test-container
|
||||
image: kubernetes/mounttest:0.1
|
||||
command: [ "/mt", "--file_content=/etc/secret-volume/data-1" ]
|
||||
volumeMounts:
|
||||
# name must match the volume name below
|
||||
- name: secret-volume
|
||||
mountPath: /etc/secret-volume
|
||||
volumes:
|
||||
- name: secret-volume
|
||||
secret:
|
||||
secretName: test-secret
|
||||
restartPolicy: Never
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: test-secret
|
||||
data:
|
||||
data-1: dmFsdWUtMQ0K
|
||||
data-2: dmFsdWUtMg0KDQo=
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
{% include {{page.path | replace: page.version, 'docs'}} %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user