diff --git a/build/lib/release.sh b/build/lib/release.sh index e595385957..dc1a1f0d9c 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -481,7 +481,6 @@ EOF mkdir -p "${release_stage}/hack" cp -R "${KUBE_ROOT}/hack/lib" "${release_stage}/hack/" - cp -R "${KUBE_ROOT}/examples" "${release_stage}/" cp -R "${KUBE_ROOT}/docs" "${release_stage}/" cp "${KUBE_ROOT}/README.md" "${release_stage}/" cp "${KUBE_ROOT}/Godeps/LICENSES" "${release_stage}/" diff --git a/build/release-tars/BUILD b/build/release-tars/BUILD index 55426a574d..e9f379a7dd 100644 --- a/build/release-tars/BUILD +++ b/build/release-tars/BUILD @@ -193,7 +193,6 @@ pkg_tar( "//:version", "//cluster:all-srcs", "//docs:all-srcs", - "//examples:all-srcs", "//hack/lib:all-srcs", ], extension = "tar.gz", diff --git a/build/root/BUILD.root b/build/root/BUILD.root index 1e7cc4853d..f7a0b34f00 100644 --- a/build/root/BUILD.root +++ b/build/root/BUILD.root @@ -64,7 +64,6 @@ filegroup( "//cluster:all-srcs", "//cmd:all-srcs", "//docs:all-srcs", - "//examples:all-srcs", "//hack:all-srcs", "//pkg:all-srcs", "//plugin:all-srcs", diff --git a/build/visible_to/README.md b/build/visible_to/README.md index 9daa99a0fc..3caf0a14b2 100644 --- a/build/visible_to/README.md +++ b/build/visible_to/README.md @@ -115,7 +115,7 @@ visibility = ["//visible_to:client_foo,//visible_to:server_foo"], ``` bazel build --check_visibility --nobuild \ //cmd/... //pkg/... //plugin/... \ - //third_party/... //examples/... //test/... //vendor/k8s.io/... + //third_party/... //test/... //vendor/k8s.io/... ``` #### Who depends on target _q_? diff --git a/examples/BUILD b/examples/BUILD deleted file mode 100644 index 65c8be3a6c..0000000000 --- a/examples/BUILD +++ /dev/null @@ -1,70 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -filegroup( - name = "config", - srcs = glob([ - "**/*.yaml", - "**/*.yml", - "**/*.json", - ]) + [ - "pod", - ], -) - -go_library( - name = "go_default_library", - srcs = ["doc.go"], - importpath = "k8s.io/kubernetes/examples", -) - -go_test( - name = "go_default_xtest", - srcs = ["examples_test.go"], - tags = ["manual"], # this test is broken and examples in-tree is deprecated - deps = [ - "//pkg/api/testapi:go_default_library", - "//pkg/apis/apps:go_default_library", - "//pkg/apis/apps/validation:go_default_library", - "//pkg/apis/batch:go_default_library", - "//pkg/apis/core:go_default_library", - "//pkg/apis/core/validation:go_default_library", - "//pkg/apis/extensions:go_default_library", - "//pkg/apis/extensions/validation:go_default_library", - "//pkg/capabilities:go_default_library", - "//pkg/registry/batch/job:go_default_library", - "//pkg/scheduler/api:go_default_library", - "//pkg/scheduler/api/latest:go_default_library", - "//pkg/scheduler/api/validation:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//examples/explorer:all-srcs", - "//examples/guestbook-go:all-srcs", - "//examples/https-nginx:all-srcs", - "//examples/sharing-clusters:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/examples/OWNERS b/examples/OWNERS deleted file mode 100644 index 315623ca8b..0000000000 --- a/examples/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -reviewers: - - brendandburns - - thockin - - zmerlynn - - zouyee -approvers: - - brendandburns - - eparis - - thockin - - zmerlynn diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 6ea45f7007..0000000000 --- a/examples/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/README.md](https://github.com/kubernetes/examples/blob/master/README.md) diff --git a/examples/cloud-controller-manager/persistent-volume-label-initializer-config.yaml b/examples/cloud-controller-manager/persistent-volume-label-initializer-config.yaml deleted file mode 100644 index 4a2576cc2a..0000000000 --- a/examples/cloud-controller-manager/persistent-volume-label-initializer-config.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: InitializerConfiguration -apiVersion: admissionregistration.k8s.io/v1alpha1 -metadata: - name: pvlabel.kubernetes.io -initializers: - - name: pvlabel.kubernetes.io - rules: - - apiGroups: - - "" - apiVersions: - - "*" - resources: - - persistentvolumes diff --git a/examples/cluster-dns/README.md b/examples/cluster-dns/README.md deleted file mode 100644 index c7b23c6271..0000000000 --- a/examples/cluster-dns/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/cluster-dns/README.md](https://github.com/kubernetes/examples/blob/master/staging/cluster-dns/README.md) diff --git a/examples/cluster-dns/dns-backend-rc.yaml b/examples/cluster-dns/dns-backend-rc.yaml deleted file mode 100644 index 4af1b0dcba..0000000000 --- a/examples/cluster-dns/dns-backend-rc.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: dns-backend - labels: - name: dns-backend -spec: - replicas: 1 - selector: - name: dns-backend - template: - metadata: - labels: - name: dns-backend - spec: - containers: - - name: dns-backend - image: k8s.gcr.io/example-dns-backend:v1 - ports: - - name: backend-port - containerPort: 8000 diff --git a/examples/cluster-dns/dns-backend-service.yaml b/examples/cluster-dns/dns-backend-service.yaml deleted file mode 100644 index 0a814ce189..0000000000 --- a/examples/cluster-dns/dns-backend-service.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: dns-backend -spec: - ports: - - port: 8000 - selector: - name: dns-backend diff --git a/examples/cluster-dns/dns-frontend-pod.yaml b/examples/cluster-dns/dns-frontend-pod.yaml deleted file mode 100644 index 4a7695f113..0000000000 --- a/examples/cluster-dns/dns-frontend-pod.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: dns-frontend - labels: - name: dns-frontend -spec: - containers: - - name: dns-frontend - image: k8s.gcr.io/example-dns-frontend:v1 - command: - - python - - client.py - - http://dns-backend.development.svc.cluster.local:8000 - imagePullPolicy: Always - restartPolicy: Never diff --git a/examples/cluster-dns/images/backend/Dockerfile b/examples/cluster-dns/images/backend/Dockerfile deleted file mode 100644 index c2a4e7cf6c..0000000000 --- a/examples/cluster-dns/images/backend/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM python:2.7-slim - -COPY . /dns-backend -WORKDIR /dns-backend - -CMD ["python", "server.py"] diff --git a/examples/cluster-dns/images/backend/Makefile b/examples/cluster-dns/images/backend/Makefile deleted file mode 100644 index bac8c89876..0000000000 --- a/examples/cluster-dns/images/backend/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -TAG = v1 -PREFIX = staging-k8s.gcr.io -IMAGE = example-dns-backend - -all: push - -image: - docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) . - -push: image - gcloud docker -- push $(PREFIX)/$(IMAGE) - -clean: diff --git a/examples/cluster-dns/images/backend/server.py b/examples/cluster-dns/images/backend/server.py deleted file mode 100644 index 5dcfb93b98..0000000000 --- a/examples/cluster-dns/images/backend/server.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer - -PORT_NUMBER = 8000 - -# This class will handles any incoming request. -class HTTPHandler(BaseHTTPRequestHandler): - # Handler for the GET requests - def do_GET(self): - self.send_response(200) - self.send_header('Content-type','text/html') - self.end_headers() - self.wfile.write("Hello World!") - -try: - # Create a web server and define the handler to manage the incoming request. - server = HTTPServer(('', PORT_NUMBER), HTTPHandler) - print 'Started httpserver on port ' , PORT_NUMBER - server.serve_forever() -except KeyboardInterrupt: - print '^C received, shutting down the web server' - server.socket.close() diff --git a/examples/cluster-dns/images/frontend/Dockerfile b/examples/cluster-dns/images/frontend/Dockerfile deleted file mode 100644 index 56da6eb715..0000000000 --- a/examples/cluster-dns/images/frontend/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM python:2.7-slim - -RUN pip install requests - -COPY . /dns-frontend -WORKDIR /dns-frontend - -CMD ["python", "client.py"] diff --git a/examples/cluster-dns/images/frontend/Makefile b/examples/cluster-dns/images/frontend/Makefile deleted file mode 100644 index 4c17fb59f5..0000000000 --- a/examples/cluster-dns/images/frontend/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -TAG = v1 -PREFIX = staging-k8s.gcr.io -IMAGE = example-dns-frontend - -all: push - -image: - docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) . - -push: image - gcloud docker -- push $(PREFIX)/$(IMAGE) - -clean: diff --git a/examples/cluster-dns/images/frontend/client.py b/examples/cluster-dns/images/frontend/client.py deleted file mode 100644 index 1a56df5043..0000000000 --- a/examples/cluster-dns/images/frontend/client.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -import argparse -import requests -import socket - -from urlparse import urlparse - - -def CheckServiceAddress(address): - hostname = urlparse(address).hostname - service_address = socket.gethostbyname(hostname) - print service_address - - -def GetServerResponse(address): - print 'Send request to:', address - response = requests.get(address) - print response - print response.content - - -def Main(): - parser = argparse.ArgumentParser() - parser.add_argument('address') - args = parser.parse_args() - CheckServiceAddress(args.address) - GetServerResponse(args.address) - - -if __name__ == "__main__": - Main() diff --git a/examples/cluster-dns/namespace-dev.yaml b/examples/cluster-dns/namespace-dev.yaml deleted file mode 100644 index 149c2f6659..0000000000 --- a/examples/cluster-dns/namespace-dev.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "development" - labels: - name: "development" diff --git a/examples/cluster-dns/namespace-prod.yaml b/examples/cluster-dns/namespace-prod.yaml deleted file mode 100644 index 04bb44c1d0..0000000000 --- a/examples/cluster-dns/namespace-prod.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "production" - labels: - name: "production" diff --git a/examples/cockroachdb/OWNERS b/examples/cockroachdb/OWNERS deleted file mode 100644 index 9b4cd15cbc..0000000000 --- a/examples/cockroachdb/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -reviewers: - - a-robinson -approvers: - - a-robinson diff --git a/examples/cockroachdb/README.md b/examples/cockroachdb/README.md deleted file mode 100644 index 23ffcbdce0..0000000000 --- a/examples/cockroachdb/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/cockroachdb/README.md](https://github.com/kubernetes/examples/blob/master/staging/cockroachdb/README.md) diff --git a/examples/cockroachdb/cockroachdb-statefulset.yaml b/examples/cockroachdb/cockroachdb-statefulset.yaml deleted file mode 100644 index 0afdef391e..0000000000 --- a/examples/cockroachdb/cockroachdb-statefulset.yaml +++ /dev/null @@ -1,171 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - # This service is meant to be used by clients of the database. It exposes a ClusterIP that will - # automatically load balance connections to the different database pods. - name: cockroachdb-public - labels: - app: cockroachdb -spec: - ports: - # The main port, served by gRPC, serves Postgres-flavor SQL, internode - # traffic and the cli. - - port: 26257 - targetPort: 26257 - name: grpc - # The secondary port serves the UI as well as health and debug endpoints. - - port: 8080 - targetPort: 8080 - name: http - selector: - app: cockroachdb ---- -apiVersion: v1 -kind: Service -metadata: - # This service only exists to create DNS entries for each pod in the stateful - # set such that they can resolve each other's IP addresses. It does not - # create a load-balanced ClusterIP and should not be used directly by clients - # in most circumstances. - name: cockroachdb - labels: - app: cockroachdb - annotations: - # This is needed to make the peer-finder work properly and to help avoid - # edge cases where instance 0 comes up after losing its data and needs to - # decide whether it should create a new cluster or try to join an existing - # one. If it creates a new cluster when it should have joined an existing - # one, we'd end up with two separate clusters listening at the same service - # endpoint, which would be very bad. - service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" - # Enable automatic monitoring of all instances when Prometheus is running in the cluster. - prometheus.io/scrape: "true" - prometheus.io/path: "_status/vars" - prometheus.io/port: "8080" -spec: - ports: - - port: 26257 - targetPort: 26257 - name: grpc - - port: 8080 - targetPort: 8080 - name: http - clusterIP: None - selector: - app: cockroachdb ---- -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: cockroachdb-budget - labels: - app: cockroachdb -spec: - selector: - matchLabels: - app: cockroachdb - minAvailable: 67% ---- -apiVersion: apps/v1beta1 -kind: StatefulSet -metadata: - name: cockroachdb -spec: - serviceName: "cockroachdb" - replicas: 3 - template: - metadata: - labels: - app: cockroachdb - spec: - # Init containers are run only once in the lifetime of a pod, before - # it's started up for the first time. It has to exit successfully - # before the pod's main containers are allowed to start. - # This particular init container does a DNS lookup for other pods in - # the set to help determine whether or not a cluster already exists. - # If any other pods exist, it creates a file in the cockroach-data - # directory to pass that information along to the primary container that - # has to decide what command-line flags to use when starting CockroachDB. - # This only matters when a pod's persistent volume is empty - if it has - # data from a previous execution, that data will always be used. - # - # If your Kubernetes cluster uses a custom DNS domain, you will have - # to add an additional arg to this pod: "-domain=" - initContainers: - - name: bootstrap - image: cockroachdb/cockroach-k8s-init:0.2 - imagePullPolicy: IfNotPresent - args: - - "-on-start=/on-start.sh" - - "-service=cockroachdb" - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: datadir - mountPath: "/cockroach/cockroach-data" - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - cockroachdb - topologyKey: kubernetes.io/hostname - containers: - - name: cockroachdb - image: cockroachdb/cockroach:v1.1.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 26257 - name: grpc - - containerPort: 8080 - name: http - volumeMounts: - - name: datadir - mountPath: /cockroach/cockroach-data - command: - - "/bin/bash" - - "-ecx" - - | - # The use of qualified `hostname -f` is crucial: - # Other nodes aren't able to look up the unqualified hostname. - CRARGS=("start" "--logtostderr" "--insecure" "--host" "$(hostname -f)" "--http-host" "0.0.0.0") - # We only want to initialize a new cluster (by omitting the join flag) - # if we're sure that we're the first node (i.e. index 0) and that - # there aren't any other nodes running as part of the cluster that - # this is supposed to be a part of (which indicates that a cluster - # already exists and we should make sure not to create a new one). - # It's fine to run without --join on a restart if there aren't any - # other nodes. - if [ ! "$(hostname)" == "cockroachdb-0" ] || \ - [ -e "/cockroach/cockroach-data/cluster_exists_marker" ] - then - # We don't join cockroachdb in order to avoid a node attempting - # to join itself, which currently doesn't work - # (https://github.com/cockroachdb/cockroach/issues/9625). - CRARGS+=("--join" "cockroachdb-public") - fi - exec /cockroach/cockroach ${CRARGS[*]} - # No pre-stop hook is required, a SIGTERM plus some time is all that's - # needed for graceful shutdown of a node. - terminationGracePeriodSeconds: 60 - volumes: - - name: datadir - persistentVolumeClaim: - claimName: datadir - volumeClaimTemplates: - - metadata: - name: datadir - spec: - accessModes: - - "ReadWriteOnce" - resources: - requests: - storage: 1Gi diff --git a/examples/cockroachdb/demo.sh b/examples/cockroachdb/demo.sh deleted file mode 100755 index f96f54277d..0000000000 --- a/examples/cockroachdb/demo.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -set -euo pipefail - -function sql() { - # TODO(knz): Why does the more idiomatic read from stdin not produce any - # output? - kubectl exec "cockroachdb-${1}" -- /cockroach/cockroach sql \ - --host "cockroachdb-${1}.cockroachdb" \ - --insecure \ - -e "$(cat /dev/stdin)" -} - -function kill() { - ! kubectl exec -t "cockroachdb-${1}" -- /bin/bash -c "while true; do kill 1; done" &> /dev/null -} - -# Create database on second node (idempotently for convenience). -cat <= 1 CPU - shared.yaml | >= 1 CPU - exclusive-1.yaml | >= 2 CPU - exclusive-2.yaml | >= 3 CPU - exclusive-3.yaml | >= 4 CPU - exclusive-4.yaml | >= 5 CPU -``` - -### Example - -Run a pod with a single container in the shared pool, and another pod -with a single container in an exclusive cpuset with one CPU. - -``` -$ kubectl create -f examples/cpu-manager/shared.yaml -$ kubectl create -f examples/cpu-manager/exclusive-1.yaml -``` - -To list IP addresses of the pods running in the local cluster, do: - -``` -$ watch ./examples/cpu-manager/pod-ips -exclusive-1 http://172.17.0.4 -shared http://172.17.0.3 -``` - -#### Sample cpuset-visualizer output - -![Sample cpuset-visualizer output](https://user-images.githubusercontent.com/379372/28648573-974693ce-7223-11e7-84ed-17cce11910ff.png) diff --git a/examples/cpu-manager/be.yaml b/examples/cpu-manager/be.yaml deleted file mode 100644 index 05d34a122b..0000000000 --- a/examples/cpu-manager/be.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: be -spec: - containers: - - image: quay.io/connordoyle/cpuset-visualizer - name: be diff --git a/examples/cpu-manager/exclusive-1.yaml b/examples/cpu-manager/exclusive-1.yaml deleted file mode 100644 index 98dd57c810..0000000000 --- a/examples/cpu-manager/exclusive-1.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: exclusive-1 -spec: - containers: - - image: quay.io/connordoyle/cpuset-visualizer - name: exclusive-1 - resources: - requests: - cpu: 1 - memory: "256M" - limits: - cpu: 1 - memory: "256M" diff --git a/examples/cpu-manager/exclusive-2.yaml b/examples/cpu-manager/exclusive-2.yaml deleted file mode 100644 index 6003be0dd6..0000000000 --- a/examples/cpu-manager/exclusive-2.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: exclusive-2 -spec: - containers: - - image: quay.io/connordoyle/cpuset-visualizer - name: exclusive-2 - resources: - requests: - cpu: 2 - memory: "256M" - limits: - cpu: 2 - memory: "256M" diff --git a/examples/cpu-manager/exclusive-3.yaml b/examples/cpu-manager/exclusive-3.yaml deleted file mode 100644 index 25234fffe8..0000000000 --- a/examples/cpu-manager/exclusive-3.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: exclusive-3 -spec: - containers: - - image: quay.io/connordoyle/cpuset-visualizer - name: exclusive-3 - resources: - requests: - cpu: 3 - memory: "256M" - limits: - cpu: 3 - memory: "256M" diff --git a/examples/cpu-manager/exclusive-4.yaml b/examples/cpu-manager/exclusive-4.yaml deleted file mode 100644 index da342acd2d..0000000000 --- a/examples/cpu-manager/exclusive-4.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: exclusive-4 -spec: - containers: - - image: quay.io/connordoyle/cpuset-visualizer - name: exclusive-4 - resources: - requests: - cpu: 4 - memory: "256M" - limits: - cpu: 4 - memory: "256M" diff --git a/examples/cpu-manager/pod-ips b/examples/cpu-manager/pod-ips deleted file mode 100755 index 66ee355095..0000000000 --- a/examples/cpu-manager/pod-ips +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -# Requires `jq`. See https://stedolan.github.io/jq/download - -set -o nounset -o pipefail -o errexit - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -KUBECTL="$DIR/../../cluster/kubectl.sh" -export KUBECONFIG="${KUBECONFIG:-/var/run/kubernetes/admin.kubeconfig}" - -$KUBECTL get pods -o json | \ - jq -r '.items[] | "\(.metadata.name) http://\(.status.podIP)"' diff --git a/examples/cpu-manager/shared.yaml b/examples/cpu-manager/shared.yaml deleted file mode 100644 index 0f09d0c99f..0000000000 --- a/examples/cpu-manager/shared.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: shared -spec: - containers: - - image: quay.io/connordoyle/cpuset-visualizer - name: shared - resources: - requests: - cpu: 100m diff --git a/examples/doc.go b/examples/doc.go deleted file mode 100644 index 85b3b214b8..0000000000 --- a/examples/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -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. -*/ - -// Examples contains sample applications for trying out the concepts in Kubernetes. -package examples // import "k8s.io/kubernetes/examples" diff --git a/examples/elasticsearch/README.md b/examples/elasticsearch/README.md deleted file mode 100644 index 75ecfe69ae..0000000000 --- a/examples/elasticsearch/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/elasticsearch/README.md](https://github.com/kubernetes/examples/blob/master/staging/elasticsearch/README.md) diff --git a/examples/examples_test.go b/examples/examples_test.go deleted file mode 100644 index beac4cc91d..0000000000 --- a/examples/examples_test.go +++ /dev/null @@ -1,466 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -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 examples_test - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "regexp" - "strings" - "testing" - - "github.com/golang/glog" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apimachinery/pkg/util/yaml" - "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/apis/apps" - appsvalidation "k8s.io/kubernetes/pkg/apis/apps/validation" - "k8s.io/kubernetes/pkg/apis/batch" - api "k8s.io/kubernetes/pkg/apis/core" - "k8s.io/kubernetes/pkg/apis/core/validation" - "k8s.io/kubernetes/pkg/apis/extensions" - expvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation" - "k8s.io/kubernetes/pkg/capabilities" - "k8s.io/kubernetes/pkg/registry/batch/job" - schedulerapi "k8s.io/kubernetes/pkg/scheduler/api" - schedulerapilatest "k8s.io/kubernetes/pkg/scheduler/api/latest" - schedulerapivalidation "k8s.io/kubernetes/pkg/scheduler/api/validation" -) - -func validateObject(obj runtime.Object) (errors field.ErrorList) { - switch t := obj.(type) { - case *api.ReplicationController: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidateReplicationController(t) - case *api.ReplicationControllerList: - for i := range t.Items { - errors = append(errors, validateObject(&t.Items[i])...) - } - case *api.Service: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidateService(t) - case *api.ServiceList: - for i := range t.Items { - errors = append(errors, validateObject(&t.Items[i])...) - } - case *api.Pod: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidatePod(t) - case *api.PodList: - for i := range t.Items { - errors = append(errors, validateObject(&t.Items[i])...) - } - case *api.PersistentVolume: - errors = validation.ValidatePersistentVolume(t) - case *api.PersistentVolumeClaim: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidatePersistentVolumeClaim(t) - case *api.PodTemplate: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidatePodTemplate(t) - case *api.Endpoints: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidateEndpoints(t) - case *api.Namespace: - errors = validation.ValidateNamespace(t) - case *api.Secret: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidateSecret(t) - case *api.LimitRange: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidateLimitRange(t) - case *api.ResourceQuota: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = validation.ValidateResourceQuota(t) - case *extensions.Deployment: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = expvalidation.ValidateDeployment(t) - case *batch.Job: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - // Job needs generateSelector called before validation, and job.Validate does this. - // See: https://github.com/kubernetes/kubernetes/issues/20951#issuecomment-187787040 - t.ObjectMeta.UID = types.UID("fakeuid") - errors = job.Strategy.Validate(nil, t) - case *extensions.Ingress: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = expvalidation.ValidateIngress(t) - case *extensions.DaemonSet: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = expvalidation.ValidateDaemonSet(t) - case *apps.StatefulSet: - if t.Namespace == "" { - t.Namespace = metav1.NamespaceDefault - } - errors = appsvalidation.ValidateStatefulSet(t) - default: - errors = field.ErrorList{} - errors = append(errors, field.InternalError(field.NewPath(""), fmt.Errorf("no validation defined for %#v", obj))) - } - return errors -} - -func validateschedulerpolicy(obj runtime.Object) error { - switch t := obj.(type) { - case *schedulerapi.Policy: - return schedulerapivalidation.ValidatePolicy(*t) - default: - return fmt.Errorf("obj type is not schedulerapi.Policy") - } -} - -func walkJSONFiles(inDir string, fn func(name, path string, data []byte)) error { - return filepath.Walk(inDir, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - if info.IsDir() && path != inDir { - return filepath.SkipDir - } - - file := filepath.Base(path) - if ext := filepath.Ext(file); ext == ".json" || ext == ".yaml" { - glog.Infof("Testing %s", path) - data, err := ioutil.ReadFile(path) - if err != nil { - return err - } - name := strings.TrimSuffix(file, ext) - - if ext == ".yaml" { - out, err := yaml.ToJSON(data) - if err != nil { - return fmt.Errorf("%s: %v", path, err) - } - data = out - } - - fn(name, path, data) - } - return nil - }) -} - -func TestExampleObjectSchemas(t *testing.T) { - cases := map[string]map[string]runtime.Object{ - "../examples/guestbook": { - "frontend-deployment": &extensions.Deployment{}, - "redis-slave-deployment": &extensions.Deployment{}, - "redis-master-deployment": &extensions.Deployment{}, - "frontend-service": &api.Service{}, - "redis-master-service": &api.Service{}, - "redis-slave-service": &api.Service{}, - }, - "../examples/guestbook/legacy": { - "frontend-controller": &api.ReplicationController{}, - "redis-slave-controller": &api.ReplicationController{}, - "redis-master-controller": &api.ReplicationController{}, - }, - "../examples/guestbook-go": { - "guestbook-controller": &api.ReplicationController{}, - "redis-slave-controller": &api.ReplicationController{}, - "redis-master-controller": &api.ReplicationController{}, - "guestbook-service": &api.Service{}, - "redis-master-service": &api.Service{}, - "redis-slave-service": &api.Service{}, - }, - "../examples/volumes/iscsi": { - "chap-secret": &api.Secret{}, - "iscsi": &api.Pod{}, - "iscsi-chap": &api.Pod{}, - }, - "../examples/volumes/glusterfs": { - "glusterfs-pod": &api.Pod{}, - "glusterfs-endpoints": &api.Endpoints{}, - "glusterfs-service": &api.Service{}, - }, - "../examples": { - "scheduler-policy-config": &schedulerapi.Policy{}, - "scheduler-policy-config-with-extender": &schedulerapi.Policy{}, - }, - "../examples/volumes/rbd/secret": { - "ceph-secret": &api.Secret{}, - }, - "../examples/volumes/rbd": { - "rbd": &api.Pod{}, - "rbd-with-secret": &api.Pod{}, - }, - "../examples/cluster-dns": { - "dns-backend-rc": &api.ReplicationController{}, - "dns-backend-service": &api.Service{}, - "dns-frontend-pod": &api.Pod{}, - "namespace-dev": &api.Namespace{}, - "namespace-prod": &api.Namespace{}, - }, - "../examples/explorer": { - "pod": &api.Pod{}, - }, - "../examples/storage/hazelcast": { - "hazelcast-deployment": &extensions.Deployment{}, - "hazelcast-service": &api.Service{}, - }, - "../examples/meteor": { - "meteor-controller": &api.ReplicationController{}, - "meteor-service": &api.Service{}, - "mongo-pod": &api.Pod{}, - "mongo-service": &api.Service{}, - }, - "../examples/mysql-wordpress-pd": { - "gce-volumes": &api.PersistentVolume{}, - "local-volumes": &api.PersistentVolume{}, - "mysql-deployment": &api.Service{}, - "wordpress-deployment": &api.Service{}, - }, - "../examples/volumes/nfs": { - "nfs-busybox-rc": &api.ReplicationController{}, - "nfs-server-rc": &api.ReplicationController{}, - "nfs-server-service": &api.Service{}, - "nfs-pv": &api.PersistentVolume{}, - "nfs-pvc": &api.PersistentVolumeClaim{}, - "nfs-web-rc": &api.ReplicationController{}, - "nfs-web-service": &api.Service{}, - }, - "../examples/openshift-origin": { - "openshift-origin-namespace": &api.Namespace{}, - "openshift-controller": &extensions.Deployment{}, - "openshift-service": &api.Service{}, - "etcd-controller": &extensions.Deployment{}, - "etcd-service": &api.Service{}, - "etcd-discovery-controller": &extensions.Deployment{}, - "etcd-discovery-service": &api.Service{}, - "secret": nil, - }, - "../examples/phabricator": { - "phabricator-controller": &api.ReplicationController{}, - "phabricator-service": &api.Service{}, - }, - "../examples/storage/redis": { - "redis-controller": &api.ReplicationController{}, - "redis-master": &api.Pod{}, - "redis-sentinel-controller": &api.ReplicationController{}, - "redis-sentinel-service": &api.Service{}, - }, - "../examples/storage/rethinkdb": { - "admin-pod": &api.Pod{}, - "admin-service": &api.Service{}, - "driver-service": &api.Service{}, - "rc": &api.ReplicationController{}, - }, - "../examples/spark": { - "namespace-spark-cluster": &api.Namespace{}, - "spark-master-controller": &api.ReplicationController{}, - "spark-master-service": &api.Service{}, - "spark-ui-proxy-controller": &api.ReplicationController{}, - "spark-ui-proxy-service": &api.Service{}, - "spark-worker-controller": &api.ReplicationController{}, - "zeppelin-controller": &api.ReplicationController{}, - "zeppelin-service": &api.Service{}, - }, - "../examples/spark/spark-gluster": { - "spark-master-service": &api.Service{}, - "spark-master-controller": &api.ReplicationController{}, - "spark-worker-controller": &api.ReplicationController{}, - "glusterfs-endpoints": &api.Endpoints{}, - }, - "../examples/storm": { - "storm-nimbus-service": &api.Service{}, - "storm-nimbus": &api.Pod{}, - "storm-worker-controller": &api.ReplicationController{}, - "zookeeper-service": &api.Service{}, - "zookeeper": &api.Pod{}, - }, - "../examples/volumes/cephfs/": { - "cephfs": &api.Pod{}, - "cephfs-with-secret": &api.Pod{}, - }, - "../examples/volumes/fibre_channel": { - "fc": &api.Pod{}, - }, - "../examples/javaweb-tomcat-sidecar": { - "javaweb": &api.Pod{}, - "javaweb-2": &api.Pod{}, - }, - "../examples/volumes/azure_file": { - "azure": &api.Pod{}, - }, - "../examples/volumes/azure_disk": { - "azure": &api.Pod{}, - }, - } - - capabilities.SetForTests(capabilities.Capabilities{ - AllowPrivileged: true, - }) - - for path, expected := range cases { - tested := 0 - err := walkJSONFiles(path, func(name, path string, data []byte) { - expectedType, found := expected[name] - if !found { - t.Errorf("%s: %s does not have a test case defined", path, name) - return - } - tested++ - if expectedType == nil { - t.Logf("skipping : %s/%s\n", path, name) - return - } - if strings.Contains(name, "scheduler-policy-config") { - if err := runtime.DecodeInto(schedulerapilatest.Codec, data, expectedType); err != nil { - t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data)) - return - } - if err := validateschedulerpolicy(expectedType); err != nil { - t.Errorf("%s did not validate correctly: %v\n%s", path, err, string(data)) - return - } - } else { - codec, err := testapi.GetCodecForObject(expectedType) - if err != nil { - t.Errorf("Could not get codec for %s: %s", expectedType, err) - } - if err := runtime.DecodeInto(codec, data, expectedType); err != nil { - t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data)) - return - } - if errors := validateObject(expectedType); len(errors) > 0 { - t.Errorf("%s did not validate correctly: %v", path, errors) - } - } - }) - if err != nil { - t.Errorf("Expected no error, Got %v", err) - } - if tested != len(expected) { - t.Errorf("Directory %v: Expected %d examples, Got %d", path, len(expected), tested) - } - } -} - -// This regex is tricky, but it works. For future me, here is the decode: -// -// Flags: (?ms) = multiline match, allow . to match \n -// 1) Look for a line that starts with ``` (a markdown code block) -// 2) (?: ... ) = non-capturing group -// 3) (P) = capture group as "name" -// 4) Look for #1 followed by either: -// 4a) "yaml" followed by any word-characters followed by a newline (e.g. ```yamlfoo\n) -// 4b) "any word-characters followed by a newline (e.g. ```json\n) -// 5) Look for either: -// 5a) #4a followed by one or more characters (non-greedy) -// 5b) #4b followed by { followed by one or more characters (non-greedy) followed by } -// 6) Look for #5 followed by a newline followed by ``` (end of the code block) -// -// This could probably be simplified, but is already too delicate. Before any -// real changes, we should have a testscase that just tests this regex. -var sampleRegexp = regexp.MustCompile("(?ms)^```(?:(?Pyaml)\\w*\\n(?P.+?)|\\w*\\n(?P\\{.+?\\}))\\n^```") -var subsetRegexp = regexp.MustCompile("(?ms)\\.{3}") - -func TestReadme(t *testing.T) { - paths := []struct { - file string - expectedType []runtime.Object - }{ - {"../README.md", []runtime.Object{&api.Pod{}}}, - {"../examples/volumes/iscsi/README.md", []runtime.Object{&api.Secret{}}}, - } - - for _, path := range paths { - data, err := ioutil.ReadFile(path.file) - if err != nil { - t.Errorf("Unable to read file %s: %v", path, err) - continue - } - - matches := sampleRegexp.FindAllStringSubmatch(string(data), -1) - if matches == nil { - continue - } - ix := 0 - for _, match := range matches { - var content, subtype string - for i, name := range sampleRegexp.SubexpNames() { - if name == "type" { - subtype = match[i] - } - if name == "content" && match[i] != "" { - content = match[i] - } - } - if subtype == "yaml" && subsetRegexp.FindString(content) != "" { - t.Logf("skipping (%s): \n%s", subtype, content) - continue - } - - var expectedType runtime.Object - if len(path.expectedType) == 1 { - expectedType = path.expectedType[0] - } else { - expectedType = path.expectedType[ix] - ix++ - } - json, err := yaml.ToJSON([]byte(content)) - if err != nil { - t.Errorf("%s could not be converted to JSON: %v\n%s", path, err, string(content)) - } - if err := runtime.DecodeInto(testapi.Default.Codec(), json, expectedType); err != nil { - t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(content)) - continue - } - if errors := validateObject(expectedType); len(errors) > 0 { - t.Errorf("%s did not validate correctly: %v", path, errors) - } - _, err = runtime.Encode(testapi.Default.Codec(), expectedType) - if err != nil { - t.Errorf("Could not encode object: %v", err) - continue - } - } - } -} diff --git a/examples/explorer/BUILD b/examples/explorer/BUILD deleted file mode 100644 index 680d702ecf..0000000000 --- a/examples/explorer/BUILD +++ /dev/null @@ -1,32 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "explorer", - embed = [":go_default_library"], -) - -go_library( - name = "go_default_library", - srcs = ["explorer.go"], - importpath = "k8s.io/kubernetes/examples/explorer", - deps = ["//vendor/github.com/davecgh/go-spew/spew:go_default_library"], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/examples/explorer/Dockerfile b/examples/explorer/Dockerfile deleted file mode 100644 index 71c686c567..0000000000 --- a/examples/explorer/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM scratch -ADD explorer explorer -ADD README.md README.md -EXPOSE 8080 -ENTRYPOINT ["/explorer"] diff --git a/examples/explorer/Makefile b/examples/explorer/Makefile deleted file mode 100644 index f550a15a15..0000000000 --- a/examples/explorer/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -all: push - -# Keep this one version ahead, so no one accidentally blows away the latest published version. -TAG = 1.1 - -explorer: explorer.go - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' ./explorer.go - -container: explorer - docker build --pull -t staging-k8s.gcr.io/explorer:$(TAG) . - -push: container - gcloud docker -- push staging-k8s.gcr.io/explorer:$(TAG) - -clean: - rm -f explorer diff --git a/examples/explorer/README.md b/examples/explorer/README.md deleted file mode 100644 index 5451e2b30c..0000000000 --- a/examples/explorer/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/explorer/README.md](https://github.com/kubernetes/examples/blob/master/staging/explorer/README.md) diff --git a/examples/explorer/explorer.go b/examples/explorer/explorer.go deleted file mode 100644 index cdba95f546..0000000000 --- a/examples/explorer/explorer.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -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 tiny web server for viewing the environment kubernetes creates for your -// containers. It exposes the filesystem and environment variables via http -// server. -package main - -import ( - "flag" - "fmt" - "log" - "net" - "net/http" - "os" - - "github.com/davecgh/go-spew/spew" -) - -var ( - port = flag.Int("port", 8080, "Port number to serve at.") -) - -func main() { - flag.Parse() - hostname, err := os.Hostname() - if err != nil { - log.Fatalf("Error getting hostname: %v", err) - } - - links := []struct { - link, desc string - }{ - {"/fs/", "Complete file system as seen by this container."}, - {"/vars/", "Environment variables as seen by this container."}, - {"/hostname/", "Hostname as seen by this container."}, - {"/dns?q=google.com", "Explore DNS records seen by this container."}, - {"/quit", "Cause this container to exit."}, - } - - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, " Kubernetes environment explorer

") - for _, v := range links { - fmt.Fprintf(w, `%v: %v
`, v.link, v.link, v.desc) - } - }) - - http.Handle("/fs/", http.StripPrefix("/fs/", http.FileServer(http.Dir("/")))) - http.HandleFunc("/vars/", func(w http.ResponseWriter, r *http.Request) { - for _, v := range os.Environ() { - fmt.Fprintf(w, "%v\n", v) - } - }) - http.HandleFunc("/hostname/", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, hostname) - }) - http.HandleFunc("/quit", func(w http.ResponseWriter, r *http.Request) { - os.Exit(0) - }) - http.HandleFunc("/dns", dns) - - go log.Fatal(http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", *port), nil)) - - select {} -} - -func dns(w http.ResponseWriter, r *http.Request) { - q := r.URL.Query().Get("q") - // Note that the below is NOT safe from input attacks, but that's OK - // because this is just for debugging. - fmt.Fprintf(w, ` -
- - -
-

`, q)
-	{
-		res, err := net.LookupNS(q)
-		spew.Fprintf(w, "LookupNS(%v):\nResult: %#v\nError: %v\n\n", q, res, err)
-	}
-	{
-		res, err := net.LookupTXT(q)
-		spew.Fprintf(w, "LookupTXT(%v):\nResult: %#v\nError: %v\n\n", q, res, err)
-	}
-	{
-		cname, res, err := net.LookupSRV("", "", q)
-		spew.Fprintf(w, `LookupSRV("", "", %v):
-cname: %v
-Result: %#v
-Error: %v
-
-`, q, cname, res, err)
-	}
-	{
-		res, err := net.LookupHost(q)
-		spew.Fprintf(w, "LookupHost(%v):\nResult: %#v\nError: %v\n\n", q, res, err)
-	}
-	{
-		res, err := net.LookupIP(q)
-		spew.Fprintf(w, "LookupIP(%v):\nResult: %#v\nError: %v\n\n", q, res, err)
-	}
-	{
-		res, err := net.LookupMX(q)
-		spew.Fprintf(w, "LookupMX(%v):\nResult: %#v\nError: %v\n\n", q, res, err)
-	}
-	fmt.Fprintf(w, `
- -`) -} diff --git a/examples/explorer/pod.yaml b/examples/explorer/pod.yaml deleted file mode 100644 index 0437a24922..0000000000 --- a/examples/explorer/pod.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: explorer -spec: - containers: - - name: explorer - image: k8s.gcr.io/explorer:1.0 - args: ["-port=8080"] - ports: - - containerPort: 8080 - protocol: TCP - volumeMounts: - - mountPath: "/mount/test-volume" - name: test-volume - volumes: - - name: test-volume - emptyDir: {} diff --git a/examples/guestbook-go/.gitignore b/examples/guestbook-go/.gitignore deleted file mode 100644 index a45a95c2f1..0000000000 --- a/examples/guestbook-go/.gitignore +++ /dev/null @@ -1 +0,0 @@ -guestbook_bin diff --git a/examples/guestbook-go/BUILD b/examples/guestbook-go/BUILD deleted file mode 100644 index 66bc4f93a4..0000000000 --- a/examples/guestbook-go/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "guestbook-go", - embed = [":go_default_library"], -) - -go_library( - name = "go_default_library", - srcs = ["main.go"], - importpath = "k8s.io/kubernetes/examples/guestbook-go", - deps = [ - "//vendor/github.com/codegangsta/negroni:go_default_library", - "//vendor/github.com/gorilla/mux:go_default_library", - "//vendor/github.com/xyproto/simpleredis:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/examples/guestbook-go/Dockerfile b/examples/guestbook-go/Dockerfile deleted file mode 100644 index a58ebae382..0000000000 --- a/examples/guestbook-go/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM busybox:ubuntu-14.04 - -ADD ./guestbook_bin /app/guestbook -ADD ./public/index.html /app/public/index.html -ADD ./public/script.js /app/public/script.js -ADD ./public/style.css /app/public/style.css - -WORKDIR /app -CMD ["./guestbook"] -EXPOSE 3000 diff --git a/examples/guestbook-go/Makefile b/examples/guestbook-go/Makefile deleted file mode 100644 index ce17d07e80..0000000000 --- a/examples/guestbook-go/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -# Build the guestbook-go example - -# Usage: -# [VERSION=v3] [REGISTRY="staging-k8s.gcr.io"] make build -VERSION?=v3 -REGISTRY?=staging-k8s.gcr.io - -release: clean build push clean - -# builds a docker image that builds the app and packages it into a minimal docker image -build: - @cp ../../bazel-bin/examples/guestbook-go/guestbook-go guestbook_bin - docker build --pull --rm --force-rm -t ${REGISTRY}/guestbook-builder . - docker run --rm ${REGISTRY}/guestbook-builder | docker build --pull -t "${REGISTRY}/guestbook:${VERSION}" - - -# push the image to an registry -push: - gcloud docker -- push ${REGISTRY}/guestbook:${VERSION} - -# remove previous images and containers -clean: - rm -f guestbook_bin - docker rm -f ${REGISTRY}/guestbook-builder 2> /dev/null || true - docker rmi -f ${REGISTRY}/guestbook-builder || true - docker rmi -f "${REGISTRY}/guestbook:${VERSION}" || true - -.PHONY: release clean build push diff --git a/examples/guestbook-go/README.md b/examples/guestbook-go/README.md deleted file mode 100644 index 5125039317..0000000000 --- a/examples/guestbook-go/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/guestbook-go/README.md](https://github.com/kubernetes/examples/blob/master/guestbook-go/README.md) diff --git a/examples/guestbook-go/guestbook-controller.json b/examples/guestbook-go/guestbook-controller.json deleted file mode 100644 index 0e3553c865..0000000000 --- a/examples/guestbook-go/guestbook-controller.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "kind":"ReplicationController", - "apiVersion":"v1", - "metadata":{ - "name":"guestbook", - "labels":{ - "app":"guestbook" - } - }, - "spec":{ - "replicas":3, - "selector":{ - "app":"guestbook" - }, - "template":{ - "metadata":{ - "labels":{ - "app":"guestbook" - } - }, - "spec":{ - "containers":[ - { - "name":"guestbook", - "image":"k8s.gcr.io/guestbook:v3", - "ports":[ - { - "name":"http-server", - "containerPort":3000 - } - ] - } - ] - } - } - } -} diff --git a/examples/guestbook-go/guestbook-page.png b/examples/guestbook-go/guestbook-page.png deleted file mode 100644 index 776835fd2d..0000000000 Binary files a/examples/guestbook-go/guestbook-page.png and /dev/null differ diff --git a/examples/guestbook-go/guestbook-service.json b/examples/guestbook-go/guestbook-service.json deleted file mode 100644 index cc7640e4c7..0000000000 --- a/examples/guestbook-go/guestbook-service.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "kind":"Service", - "apiVersion":"v1", - "metadata":{ - "name":"guestbook", - "labels":{ - "app":"guestbook" - } - }, - "spec":{ - "ports": [ - { - "port":3000, - "targetPort":"http-server" - } - ], - "selector":{ - "app":"guestbook" - }, - "type": "LoadBalancer" - } -} diff --git a/examples/guestbook-go/main.go b/examples/guestbook-go/main.go deleted file mode 100644 index c6e8cf187e..0000000000 --- a/examples/guestbook-go/main.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -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 ( - "encoding/json" - "net/http" - "os" - "strings" - - "github.com/codegangsta/negroni" - "github.com/gorilla/mux" - "github.com/xyproto/simpleredis" -) - -var ( - masterPool *simpleredis.ConnectionPool - slavePool *simpleredis.ConnectionPool -) - -func ListRangeHandler(rw http.ResponseWriter, req *http.Request) { - key := mux.Vars(req)["key"] - list := simpleredis.NewList(slavePool, key) - members := HandleError(list.GetAll()).([]string) - membersJSON := HandleError(json.MarshalIndent(members, "", " ")).([]byte) - rw.Write(membersJSON) -} - -func ListPushHandler(rw http.ResponseWriter, req *http.Request) { - key := mux.Vars(req)["key"] - value := mux.Vars(req)["value"] - list := simpleredis.NewList(masterPool, key) - HandleError(nil, list.Add(value)) - ListRangeHandler(rw, req) -} - -func InfoHandler(rw http.ResponseWriter, req *http.Request) { - info := HandleError(masterPool.Get(0).Do("INFO")).([]byte) - rw.Write(info) -} - -func EnvHandler(rw http.ResponseWriter, req *http.Request) { - environment := make(map[string]string) - for _, item := range os.Environ() { - splits := strings.Split(item, "=") - key := splits[0] - val := strings.Join(splits[1:], "=") - environment[key] = val - } - - envJSON := HandleError(json.MarshalIndent(environment, "", " ")).([]byte) - rw.Write(envJSON) -} - -func HandleError(result interface{}, err error) (r interface{}) { - if err != nil { - panic(err) - } - return result -} - -func main() { - masterPool = simpleredis.NewConnectionPoolHost("redis-master:6379") - defer masterPool.Close() - slavePool = simpleredis.NewConnectionPoolHost("redis-slave:6379") - defer slavePool.Close() - - r := mux.NewRouter() - r.Path("/lrange/{key}").Methods("GET").HandlerFunc(ListRangeHandler) - r.Path("/rpush/{key}/{value}").Methods("GET").HandlerFunc(ListPushHandler) - r.Path("/info").Methods("GET").HandlerFunc(InfoHandler) - r.Path("/env").Methods("GET").HandlerFunc(EnvHandler) - - n := negroni.Classic() - n.UseHandler(r) - n.Run(":3000") -} diff --git a/examples/guestbook-go/public/index.html b/examples/guestbook-go/public/index.html deleted file mode 100644 index f525f4b76a..0000000000 --- a/examples/guestbook-go/public/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - Guestbook - - - - -
-

Waiting for database connection...

-
- -
-
- - Submit -
-
- -
-

-

/env - /info

-
- - - - diff --git a/examples/guestbook-go/public/script.js b/examples/guestbook-go/public/script.js deleted file mode 100644 index a0a545b056..0000000000 --- a/examples/guestbook-go/public/script.js +++ /dev/null @@ -1,46 +0,0 @@ -$(document).ready(function() { - var headerTitleElement = $("#header h1"); - var entriesElement = $("#guestbook-entries"); - var formElement = $("#guestbook-form"); - var submitElement = $("#guestbook-submit"); - var entryContentElement = $("#guestbook-entry-content"); - var hostAddressElement = $("#guestbook-host-address"); - - var appendGuestbookEntries = function(data) { - entriesElement.empty(); - $.each(data, function(key, val) { - entriesElement.append("

" + val + "

"); - }); - } - - var handleSubmission = function(e) { - e.preventDefault(); - var entryValue = entryContentElement.val() - if (entryValue.length > 0) { - entriesElement.append("

...

"); - $.getJSON("rpush/guestbook/" + entryValue, appendGuestbookEntries); - } - return false; - } - - // colors = purple, blue, red, green, yellow - var colors = ["#549", "#18d", "#d31", "#2a4", "#db1"]; - var randomColor = colors[Math.floor(5 * Math.random())]; - (function setElementsColor(color) { - headerTitleElement.css("color", color); - entryContentElement.css("box-shadow", "inset 0 0 0 2px " + color); - submitElement.css("background-color", color); - })(randomColor); - - submitElement.click(handleSubmission); - formElement.submit(handleSubmission); - hostAddressElement.append(document.URL); - - // Poll every second. - (function fetchGuestbook() { - $.getJSON("lrange/guestbook").done(appendGuestbookEntries).always( - function() { - setTimeout(fetchGuestbook, 1000); - }); - })(); -}); diff --git a/examples/guestbook-go/public/style.css b/examples/guestbook-go/public/style.css deleted file mode 100644 index fd1c393fb0..0000000000 --- a/examples/guestbook-go/public/style.css +++ /dev/null @@ -1,61 +0,0 @@ -body, input { - color: #123; - font-family: "Gill Sans", sans-serif; -} - -div { - overflow: hidden; - padding: 1em 0; - position: relative; - text-align: center; -} - -h1, h2, p, input, a { - font-weight: 300; - margin: 0; -} - -h1 { - color: #BDB76B; - font-size: 3.5em; -} - -h2 { - color: #999; -} - -form { - margin: 0 auto; - max-width: 50em; - text-align: center; -} - -input { - border: 0; - border-radius: 1000px; - box-shadow: inset 0 0 0 2px #BDB76B; - display: inline; - font-size: 1.5em; - margin-bottom: 1em; - outline: none; - padding: .5em 5%; - width: 55%; -} - -form a { - background: #BDB76B; - border: 0; - border-radius: 1000px; - color: #FFF; - font-size: 1.25em; - font-weight: 400; - padding: .75em 2em; - text-decoration: none; - text-transform: uppercase; - white-space: normal; -} - -p { - font-size: 1.5em; - line-height: 1.5; -} diff --git a/examples/guestbook-go/redis-master-controller.json b/examples/guestbook-go/redis-master-controller.json deleted file mode 100644 index 4ffe53a721..0000000000 --- a/examples/guestbook-go/redis-master-controller.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "kind":"ReplicationController", - "apiVersion":"v1", - "metadata":{ - "name":"redis-master", - "labels":{ - "app":"redis", - "role":"master" - } - }, - "spec":{ - "replicas":1, - "selector":{ - "app":"redis", - "role":"master" - }, - "template":{ - "metadata":{ - "labels":{ - "app":"redis", - "role":"master" - } - }, - "spec":{ - "containers":[ - { - "name":"redis-master", - "image":"redis:2.8.23", - "ports":[ - { - "name":"redis-server", - "containerPort":6379 - } - ] - } - ] - } - } - } -} diff --git a/examples/guestbook-go/redis-master-service.json b/examples/guestbook-go/redis-master-service.json deleted file mode 100644 index 3a7426ead0..0000000000 --- a/examples/guestbook-go/redis-master-service.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "kind":"Service", - "apiVersion":"v1", - "metadata":{ - "name":"redis-master", - "labels":{ - "app":"redis", - "role":"master" - } - }, - "spec":{ - "ports": [ - { - "port":6379, - "targetPort":"redis-server" - } - ], - "selector":{ - "app":"redis", - "role":"master" - } - } -} diff --git a/examples/guestbook-go/redis-slave-controller.json b/examples/guestbook-go/redis-slave-controller.json deleted file mode 100644 index eec652afa8..0000000000 --- a/examples/guestbook-go/redis-slave-controller.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "kind":"ReplicationController", - "apiVersion":"v1", - "metadata":{ - "name":"redis-slave", - "labels":{ - "app":"redis", - "role":"slave" - } - }, - "spec":{ - "replicas":2, - "selector":{ - "app":"redis", - "role":"slave" - }, - "template":{ - "metadata":{ - "labels":{ - "app":"redis", - "role":"slave" - } - }, - "spec":{ - "containers":[ - { - "name":"redis-slave", - "image":"kubernetes/redis-slave:v2", - "ports":[ - { - "name":"redis-server", - "containerPort":6379 - } - ] - } - ] - } - } - } -} diff --git a/examples/guestbook-go/redis-slave-service.json b/examples/guestbook-go/redis-slave-service.json deleted file mode 100644 index 7e8f49a6ae..0000000000 --- a/examples/guestbook-go/redis-slave-service.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "kind":"Service", - "apiVersion":"v1", - "metadata":{ - "name":"redis-slave", - "labels":{ - "app":"redis", - "role":"slave" - } - }, - "spec":{ - "ports": [ - { - "port":6379, - "targetPort":"redis-server" - } - ], - "selector":{ - "app":"redis", - "role":"slave" - } - } -} diff --git a/examples/guestbook/README.md b/examples/guestbook/README.md deleted file mode 100644 index baee2f834c..0000000000 --- a/examples/guestbook/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/guestbook/README.md](https://github.com/kubernetes/examples/blob/master/guestbook/README.md) diff --git a/examples/guestbook/all-in-one/frontend.yaml b/examples/guestbook/all-in-one/frontend.yaml deleted file mode 100644 index edcaa5c5d4..0000000000 --- a/examples/guestbook/all-in-one/frontend.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: frontend - labels: - app: guestbook - tier: frontend -spec: - # if your cluster supports it, uncomment the following to automatically create - # an external load-balanced IP for the frontend service. - # type: LoadBalancer - ports: - - port: 80 - selector: - app: guestbook - tier: frontend ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: frontend -spec: - replicas: 3 - template: - metadata: - labels: - app: guestbook - tier: frontend - spec: - containers: - - name: php-redis - image: gcr.io/google-samples/gb-frontend:v4 - resources: - requests: - cpu: 100m - memory: 100Mi - env: - - name: GET_HOSTS_FROM - value: dns - # If your cluster config does not include a dns service, then to - # instead access environment variables to find service host - # info, comment out the 'value: dns' line above, and uncomment the - # line below: - # value: env - ports: - - containerPort: 80 diff --git a/examples/guestbook/all-in-one/guestbook-all-in-one.yaml b/examples/guestbook/all-in-one/guestbook-all-in-one.yaml deleted file mode 100644 index a3415d6a99..0000000000 --- a/examples/guestbook/all-in-one/guestbook-all-in-one.yaml +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: redis-master - labels: - app: redis - tier: backend - role: master -spec: - ports: - - port: 6379 - targetPort: 6379 - selector: - app: redis - tier: backend - role: master ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: redis-master -spec: - replicas: 1 - template: - metadata: - labels: - app: redis - role: master - tier: backend - spec: - containers: - - name: master - image: k8s.gcr.io/redis:e2e # or just image: redis - resources: - requests: - cpu: 100m - memory: 100Mi - ports: - - containerPort: 6379 ---- -apiVersion: v1 -kind: Service -metadata: - name: redis-slave - labels: - app: redis - tier: backend - role: slave -spec: - ports: - - port: 6379 - selector: - app: redis - tier: backend - role: slave ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: redis-slave -spec: - replicas: 2 - template: - metadata: - labels: - app: redis - role: slave - tier: backend - spec: - containers: - - name: slave - image: gcr.io/google_samples/gb-redisslave:v1 - resources: - requests: - cpu: 100m - memory: 100Mi - env: - - name: GET_HOSTS_FROM - value: dns - # If your cluster config does not include a dns service, then to - # instead access an environment variable to find the master - # service's host, comment out the 'value: dns' line above, and - # uncomment the line below: - # value: env - ports: - - containerPort: 6379 ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend - labels: - app: guestbook - tier: frontend -spec: - # if your cluster supports it, uncomment the following to automatically create - # an external load-balanced IP for the frontend service. - # type: LoadBalancer - ports: - - port: 80 - selector: - app: guestbook - tier: frontend ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: frontend -spec: - replicas: 3 - template: - metadata: - labels: - app: guestbook - tier: frontend - spec: - containers: - - name: php-redis - image: gcr.io/google-samples/gb-frontend:v4 - resources: - requests: - cpu: 100m - memory: 100Mi - env: - - name: GET_HOSTS_FROM - value: dns - # If your cluster config does not include a dns service, then to - # instead access environment variables to find service host - # info, comment out the 'value: dns' line above, and uncomment the - # line below: - # value: env - ports: - - containerPort: 80 diff --git a/examples/guestbook/all-in-one/redis-slave.yaml b/examples/guestbook/all-in-one/redis-slave.yaml deleted file mode 100644 index c076b084c0..0000000000 --- a/examples/guestbook/all-in-one/redis-slave.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: redis-slave - labels: - app: redis - role: slave - tier: backend -spec: - ports: - - port: 6379 - selector: - app: redis - role: slave - tier: backend ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: redis-slave -spec: - replicas: 2 - template: - metadata: - labels: - app: redis - role: slave - tier: backend - spec: - containers: - - name: slave - image: gcr.io/google_samples/gb-redisslave:v1 - resources: - requests: - cpu: 100m - memory: 100Mi - env: - - name: GET_HOSTS_FROM - value: dns - # If your cluster config does not include a dns service, then to - # instead access an environment variable to find the master - # service's host, comment out the 'value: dns' line above, and - # uncomment the line below: - # value: env - ports: - - containerPort: 6379 diff --git a/examples/guestbook/frontend-deployment.yaml b/examples/guestbook/frontend-deployment.yaml deleted file mode 100644 index 1888836b3c..0000000000 --- a/examples/guestbook/frontend-deployment.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: frontend -spec: - replicas: 3 - template: - metadata: - labels: - app: guestbook - tier: frontend - spec: - containers: - - name: php-redis - image: gcr.io/google-samples/gb-frontend:v4 - resources: - requests: - cpu: 100m - memory: 100Mi - env: - - name: GET_HOSTS_FROM - value: dns - # If your cluster config does not include a dns service, then to - # instead access environment variables to find service host - # info, comment out the 'value: dns' line above, and uncomment the - # line below: - # value: env - ports: - - containerPort: 80 diff --git a/examples/guestbook/frontend-service.yaml b/examples/guestbook/frontend-service.yaml deleted file mode 100644 index ee50fd847c..0000000000 --- a/examples/guestbook/frontend-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: frontend - labels: - app: guestbook - tier: frontend -spec: - # if your cluster supports it, uncomment the following to automatically create - # an external load-balanced IP for the frontend service. - # type: LoadBalancer - ports: - - port: 80 - selector: - app: guestbook - tier: frontend diff --git a/examples/guestbook/php-redis/Dockerfile b/examples/guestbook/php-redis/Dockerfile deleted file mode 100644 index e6f5a2f847..0000000000 --- a/examples/guestbook/php-redis/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM php:5-apache - -RUN apt-get update -RUN apt-get install -y php-pear -RUN pear channel-discover pear.nrk.io -RUN pear install nrk/Predis - -# If the container's stdio is connected to systemd-journald, -# /proc/self/fd/{1,2} are Unix sockets and apache will not be able to open() -# them. Use "cat" to write directly to the already opened fds without opening -# them again. -RUN sed -i 's#ErrorLog /proc/self/fd/2#ErrorLog "|$/bin/cat 1>\&2"#' /etc/apache2/apache2.conf -RUN sed -i 's#CustomLog /proc/self/fd/1 combined#CustomLog "|/bin/cat" combined#' /etc/apache2/apache2.conf - -ADD guestbook.php /var/www/html/guestbook.php -ADD controllers.js /var/www/html/controllers.js -ADD index.html /var/www/html/index.html diff --git a/examples/guestbook/php-redis/controllers.js b/examples/guestbook/php-redis/controllers.js deleted file mode 100644 index 1e4b550424..0000000000 --- a/examples/guestbook/php-redis/controllers.js +++ /dev/null @@ -1,29 +0,0 @@ -var redisApp = angular.module('redis', ['ui.bootstrap']); - -/** - * Constructor - */ -function RedisController() {} - -RedisController.prototype.onRedis = function() { - this.scope_.messages.push(this.scope_.msg); - this.scope_.msg = ""; - var value = this.scope_.messages.join(); - this.http_.get("guestbook.php?cmd=set&key=messages&value=" + value) - .success(angular.bind(this, function(data) { - this.scope_.redisResponse = "Updated."; - })); -}; - -redisApp.controller('RedisCtrl', function ($scope, $http, $location) { - $scope.controller = new RedisController(); - $scope.controller.scope_ = $scope; - $scope.controller.location_ = $location; - $scope.controller.http_ = $http; - - $scope.controller.http_.get("guestbook.php?cmd=get&key=messages") - .success(function(data) { - console.log(data); - $scope.messages = data.data.split(","); - }); -}); diff --git a/examples/guestbook/php-redis/guestbook.php b/examples/guestbook/php-redis/guestbook.php deleted file mode 100644 index ee0670ee69..0000000000 --- a/examples/guestbook/php-redis/guestbook.php +++ /dev/null @@ -1,41 +0,0 @@ - 'tcp', - 'host' => $host, - 'port' => 6379, - ]); - - $client->set($_GET['key'], $_GET['value']); - print('{"message": "Updated"}'); - } else { - $host = 'redis-slave'; - if (getenv('GET_HOSTS_FROM') == 'env') { - $host = getenv('REDIS_SLAVE_SERVICE_HOST'); - } - $client = new Predis\Client([ - 'scheme' => 'tcp', - 'host' => $host, - 'port' => 6379, - ]); - - $value = $client->get($_GET['key']); - print('{"data": "' . $value . '"}'); - } -} else { - phpinfo(); -} ?> diff --git a/examples/guestbook/php-redis/index.html b/examples/guestbook/php-redis/index.html deleted file mode 100644 index 4ffb4ed2ab..0000000000 --- a/examples/guestbook/php-redis/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - Guestbook - - - - - - -
-

Guestbook

-
-
-
- -
-
-
-
- {{msg}} -
-
-
- - diff --git a/examples/guestbook/redis-master-deployment.yaml b/examples/guestbook/redis-master-deployment.yaml deleted file mode 100644 index d457a09934..0000000000 --- a/examples/guestbook/redis-master-deployment.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: redis-master -spec: - replicas: 1 - template: - metadata: - labels: - app: redis - role: master - tier: backend - spec: - containers: - - name: master - image: k8s.gcr.io/redis:e2e # or just image: redis - resources: - requests: - cpu: 100m - memory: 100Mi - ports: - - containerPort: 6379 diff --git a/examples/guestbook/redis-master-service.yaml b/examples/guestbook/redis-master-service.yaml deleted file mode 100644 index a484014f1f..0000000000 --- a/examples/guestbook/redis-master-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: redis-master - labels: - app: redis - role: master - tier: backend -spec: - ports: - - port: 6379 - targetPort: 6379 - selector: - app: redis - role: master - tier: backend diff --git a/examples/guestbook/redis-slave-deployment.yaml b/examples/guestbook/redis-slave-deployment.yaml deleted file mode 100644 index 2bea4a5134..0000000000 --- a/examples/guestbook/redis-slave-deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: redis-slave -spec: - replicas: 2 - template: - metadata: - labels: - app: redis - role: slave - tier: backend - spec: - containers: - - name: slave - image: gcr.io/google_samples/gb-redisslave:v1 - resources: - requests: - cpu: 100m - memory: 100Mi - env: - - name: GET_HOSTS_FROM - value: dns - # If your cluster config does not include a dns service, then to - # instead access an environment variable to find the master - # service's host, comment out the 'value: dns' line above, and - # uncomment the line below: - # value: env - ports: - - containerPort: 6379 diff --git a/examples/guestbook/redis-slave-service.yaml b/examples/guestbook/redis-slave-service.yaml deleted file mode 100644 index 238fd63fb6..0000000000 --- a/examples/guestbook/redis-slave-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: redis-slave - labels: - app: redis - role: slave - tier: backend -spec: - ports: - - port: 6379 - selector: - app: redis - role: slave - tier: backend diff --git a/examples/guestbook/redis-slave/Dockerfile b/examples/guestbook/redis-slave/Dockerfile deleted file mode 100644 index e90b225884..0000000000 --- a/examples/guestbook/redis-slave/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM redis - -ADD run.sh /run.sh - -RUN chmod a+x /run.sh - -CMD /run.sh diff --git a/examples/guestbook/redis-slave/run.sh b/examples/guestbook/redis-slave/run.sh deleted file mode 100755 index d9037d48c4..0000000000 --- a/examples/guestbook/redis-slave/run.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Copyright 2014 The Kubernetes Authors. -# -# 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. - -if [[ ${GET_HOSTS_FROM:-dns} == "env" ]]; then - redis-server --slaveof ${REDIS_MASTER_SERVICE_HOST} 6379 -else - redis-server --slaveof redis-master 6379 -fi diff --git a/examples/guidelines.md b/examples/guidelines.md deleted file mode 100644 index c4a99c5607..0000000000 --- a/examples/guidelines.md +++ /dev/null @@ -1,88 +0,0 @@ -# Example Guidelines - -## An Example Is - -An example demonstrates running an application/framework/workload on -Kubernetes in a meaningful way. It is educational and informative. - -Examples are not: - -* Full app deployments, ready to use, with no explanation. These - belong to [Helm charts](https://github.com/kubernetes/charts). -* Simple toys to show how to use a Kubernetes feature. These belong in - the [user guide](https://kubernetes.io/docs/user-guide/). -* Demos that follow a script to show a Kubernetes feature in - action. Example: killing a node to demonstrate controller - self-healing. -* A tutorial which guides the user through multiple progressively more - complex deployments to arrive at the final solution. An example - should just demonstrate how to setup the correct deployment - -## An Example Includes - -### Up front - -* Has a "this is what you'll learn" section. -* Has a Table of Contents. -* Has a section that brings up the app in the fewest number of - commands (TL;DR / quickstart), without cloning the repo (kubectl - apply -f http://...). -* Points to documentation of prerequisites. - * [Create a cluster](https://kubernetes.io/docs/getting-started-guides/) (e.g., single-node docker). - * [Setup kubectl](https://kubernetes.io/docs/user-guide/prereqs.md). - * etc. -* Should specify which release of Kubernetes is required and any other - prerequisites, such as DNS, a cloudprovider with PV provisioning, a - cloudprovider with external load balancers, etc. - * Point to general documentation about alternatives for those - mechanisms rather than present the alternatives in each example. - * Tries to balance between using using new features, and being - compatible across environments. - -### Throughout - -* Should point to documentation on first mention: - [kubectl](https://kubernetes.io/docs/user-guide/kubectl-overview.md), - [pods](https://kubernetes.io/docs/user-guide/pods.md), - [services](https://kubernetes.io/docs/user-guide/services.md), - [deployments](https://kubernetes.io/docs/user-guide/deployments.md), - [replication controllers](https://kubernetes.io/docs/user-guide/replication-controller.md), - [jobs](https://kubernetes.io/docs/user-guide/jobs.md), - [labels](https://kubernetes.io/docs/user-guide/labels.md), - [persistent volumes](https://kubernetes.io/docs/user-guide/persistent-volumes.md), - etc. -* Most examples should be cloudprovider-independent (e.g., using PVCs, not PDs). - * Other examples with cloudprovider-specific bits could be somewhere else. -* Actually show the app working -- console output, and or screenshots. - * Ascii animations and screencasts are recommended. -* Follows [config best practices](https://kubernetes.io/docs/user-guide/config-best-practices.md). -* Shouldn't duplicate the [thorough walk-through](https://kubernetes.io/docs/user-guide/#thorough-walkthrough). -* Docker images are pre-built, and source is contained in a subfolder. - * Source is the Dockerfile and any custom files needed beyond the - upstream app being packaged. - * Images are pushed to `gcr.io/google-samples`. Contact @jeffmendoza - to have an image pushed - * Images are tagged with a version (not latest) that is referenced - in the example config. -* Only use the code highlighting types - [supported by Rouge](https://github.com/jneen/rouge/wiki/list-of-supported-languages-and-lexers), - as this is what GitHub Pages uses. -* Commands to be copied use the `shell` syntax highlighting type, and - do not include any kind of prompt. -* Example output is in a separate block quote to distinguish it from - the command (which doesn't have a prompt). -* When providing an example command or config for which the user is - expected to substitute text with something specific to them, use - angle brackets: `` for the text to be substituted. -* Use `kubectl` instead of `cluster\kubectl.sh` for example cli - commands. - -### At the end - -* Should have a section suggesting what to look at next, both in terms - of "additional resources" and "what example to look at next". - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/guidelines.md?pixel)]() - diff --git a/examples/https-nginx/BUILD b/examples/https-nginx/BUILD deleted file mode 100644 index b82ab738cd..0000000000 --- a/examples/https-nginx/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "https-nginx", - embed = [":go_default_library"], -) - -go_library( - name = "go_default_library", - srcs = ["make_secret.go"], - importpath = "k8s.io/kubernetes/examples/https-nginx", - deps = [ - "//pkg/api/legacyscheme:go_default_library", - "//pkg/apis/core:go_default_library", - "//pkg/apis/core/install:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/examples/https-nginx/Dockerfile b/examples/https-nginx/Dockerfile deleted file mode 100644 index f584088618..0000000000 --- a/examples/https-nginx/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM nginx - - -COPY index2.html /usr/share/nginx/html/index2.html -RUN chmod +r /usr/share/nginx/html/index2.html -COPY auto-reload-nginx.sh /home/auto-reload-nginx.sh -RUN chmod +x /home/auto-reload-nginx.sh - -# install inotify -RUN apt-get update && apt-get install -y inotify-tools diff --git a/examples/https-nginx/Makefile b/examples/https-nginx/Makefile deleted file mode 100644 index f8203dcac6..0000000000 --- a/examples/https-nginx/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -all: - -TAG = 1.0 -PREFIX = bprashanth/nginxhttps -KEY = /tmp/nginx.key -CERT = /tmp/nginx.crt -SECRET = /tmp/secret.json - -keys: - # The CName used here is specific to the service specified in nginx-app.yaml. - openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $(KEY) -out $(CERT) -subj "/CN=nginxsvc/O=nginxsvc" - -secret: - go run make_secret.go -crt $(CERT) -key $(KEY) > $(SECRET) - -container: - docker build --pull -t $(PREFIX):$(TAG) . - -push: container - docker push $(PREFIX):$(TAG) - -clean: - rm $(KEY) - rm $(CERT) diff --git a/examples/https-nginx/README.md b/examples/https-nginx/README.md deleted file mode 100644 index 6ce72378cc..0000000000 --- a/examples/https-nginx/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/https-nginx/README.md](https://github.com/kubernetes/examples/blob/master/staging/https-nginx/README.md) diff --git a/examples/https-nginx/auto-reload-nginx.sh b/examples/https-nginx/auto-reload-nginx.sh deleted file mode 100755 index 78144b059e..0000000000 --- a/examples/https-nginx/auto-reload-nginx.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -nginx "$@" -oldcksum=`cksum /etc/nginx/conf.d/default.conf` - -inotifywait -e modify,move,create,delete -mr --timefmt '%d/%m/%y %H:%M' --format '%T' \ -/etc/nginx/conf.d/ | while read date time; do - - newcksum=`cksum /etc/nginx/conf.d/default.conf` - if [ "$newcksum" != "$oldcksum" ]; then - echo "At ${time} on ${date}, config file update detected." - oldcksum=$newcksum - nginx -s reload - fi - -done diff --git a/examples/https-nginx/default.conf b/examples/https-nginx/default.conf deleted file mode 100644 index d91a5ba6d7..0000000000 --- a/examples/https-nginx/default.conf +++ /dev/null @@ -1,17 +0,0 @@ -server { - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; - - listen 443 ssl; - - root /usr/share/nginx/html; - index index.html; - - server_name localhost; - ssl_certificate /etc/nginx/ssl/nginx.crt; - ssl_certificate_key /etc/nginx/ssl/nginx.key; - - location / { - try_files $uri $uri/ =404; - } -} diff --git a/examples/https-nginx/index2.html b/examples/https-nginx/index2.html deleted file mode 100644 index 99a96085f4..0000000000 --- a/examples/https-nginx/index2.html +++ /dev/null @@ -1,28 +0,0 @@ - - - -Nginx reloaded! - - - -

Nginx has been reloaded!

-

If you see this page, the nginx web server has been automatically reloaded, since the config file has been updated using Kubernetes.

- - -

For online documentation and support please refer to -kubernetes.io.

- -

For online documentation and support please refer to -nginx.org.
-Commercial support is available at -nginx.com.

- -

Thank you for using nginx.

- - diff --git a/examples/https-nginx/make_secret.go b/examples/https-nginx/make_secret.go deleted file mode 100644 index e85838ee74..0000000000 --- a/examples/https-nginx/make_secret.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -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 small script that converts the given open ssl public/private keys to -// a secret that it writes to stdout as json. Most common use case is to -// create a secret from self signed certificates used to authenticate with -// a devserver. Usage: go run make_secret.go -crt ca.crt -key priv.key > secret.json -package main - -import ( - "flag" - "fmt" - "io/ioutil" - "log" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/pkg/api/legacyscheme" - api "k8s.io/kubernetes/pkg/apis/core" - - // This installs the legacy v1 API - _ "k8s.io/kubernetes/pkg/apis/core/install" -) - -// TODO: -// Add a -o flag that writes to the specified destination file. -// Teach the script to create crt and key if -crt and -key aren't specified. -var ( - crt = flag.String("crt", "", "path to nginx certificates.") - key = flag.String("key", "", "path to nginx private key.") -) - -func read(file string) []byte { - b, err := ioutil.ReadFile(file) - if err != nil { - log.Fatalf("Cannot read file %v, %v", file, err) - } - return b -} - -func main() { - flag.Parse() - if *crt == "" || *key == "" { - log.Fatalf("Need to specify -crt -key and -template") - } - nginxCrt := read(*crt) - nginxKey := read(*key) - secret := &api.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "nginxsecret", - }, - Data: map[string][]byte{ - "nginx.crt": nginxCrt, - "nginx.key": nginxKey, - }, - } - fmt.Printf(runtime.EncodeOrDie(legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.EnabledVersions()...), secret)) -} diff --git a/examples/https-nginx/nginx-app.yaml b/examples/https-nginx/nginx-app.yaml deleted file mode 100644 index a5ce0bd375..0000000000 --- a/examples/https-nginx/nginx-app.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: nginxsvc - labels: - app: nginx -spec: - type: NodePort - ports: - - port: 80 - protocol: TCP - name: http - - port: 443 - protocol: TCP - name: https - selector: - app: nginx ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: my-nginx -spec: - replicas: 1 - template: - metadata: - labels: - app: nginx - spec: - volumes: - - name: secret-volume - secret: - secretName: nginxsecret - - name: configmap-volume - configMap: - name: nginxconfigmap - containers: - - name: nginxhttps - image: ymqytw/nginxhttps:1.5 - command: ["/home/auto-reload-nginx.sh"] - ports: - - containerPort: 443 - - containerPort: 80 - livenessProbe: - httpGet: - path: /index.html - port: 80 - initialDelaySeconds: 30 - timeoutSeconds: 1 - volumeMounts: - - mountPath: /etc/nginx/ssl - name: secret-volume - - mountPath: /etc/nginx/conf.d - name: configmap-volume diff --git a/examples/javaee/README.md b/examples/javaee/README.md deleted file mode 100644 index 1fcd411acc..0000000000 --- a/examples/javaee/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/javaee/README.md](https://github.com/kubernetes/examples/blob/master/staging/javaee/README.md) diff --git a/examples/javaee/mysql-pod.yaml b/examples/javaee/mysql-pod.yaml deleted file mode 100644 index b8884f386b..0000000000 --- a/examples/javaee/mysql-pod.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: mysql-pod - labels: - name: mysql-pod - context: docker-k8s-lab -spec: - containers: - - - name: mysql - image: mysql:latest - env: - - - name: "MYSQL_USER" - value: "mysql" - - - name: "MYSQL_PASSWORD" - value: "mysql" - - - name: "MYSQL_DATABASE" - value: "sample" - - - name: "MYSQL_ROOT_PASSWORD" - value: "supersecret" - ports: - - - containerPort: 3306 diff --git a/examples/javaee/mysql-service.yaml b/examples/javaee/mysql-service.yaml deleted file mode 100644 index 0cbb329a82..0000000000 --- a/examples/javaee/mysql-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mysql-service - labels: - name: mysql-pod - context: docker-k8s-lab -spec: - ports: - # the port that this service should serve on - - port: 3306 - # label keys and values that must match in order to receive traffic for this service - selector: - name: mysql-pod - context: docker-k8s-lab diff --git a/examples/javaee/wildfly-rc.yaml b/examples/javaee/wildfly-rc.yaml deleted file mode 100644 index 303b63f8db..0000000000 --- a/examples/javaee/wildfly-rc.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: wildfly-rc - labels: - name: wildfly - context: docker-k8s-lab -spec: - replicas: 1 - template: - metadata: - labels: - name: wildfly - spec: - containers: - - name: wildfly-rc-pod - image: arungupta/wildfly-mysql-javaee7:k8s - ports: - - containerPort: 8080 \ No newline at end of file diff --git a/examples/javaweb-tomcat-sidecar/README.md b/examples/javaweb-tomcat-sidecar/README.md deleted file mode 100644 index 2537a86fde..0000000000 --- a/examples/javaweb-tomcat-sidecar/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/javaweb-tomcat-sidecar/README.md](https://github.com/kubernetes/examples/blob/master/staging/javaweb-tomcat-sidecar/README.md) diff --git a/examples/javaweb-tomcat-sidecar/javaweb-2.yaml b/examples/javaweb-tomcat-sidecar/javaweb-2.yaml deleted file mode 100644 index b34d5ab6e2..0000000000 --- a/examples/javaweb-tomcat-sidecar/javaweb-2.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: javaweb-2 -spec: - containers: - - image: resouer/sample:v2 - name: war - lifecycle: - postStart: - exec: - command: - - "cp" - - "/sample.war" - - "/app" - volumeMounts: - - mountPath: /app - name: app-volume - - image: resouer/mytomcat:7.0 - name: tomcat - command: ["sh","-c","/root/apache-tomcat-7.0.42-v2/bin/start.sh"] - volumeMounts: - - mountPath: /root/apache-tomcat-7.0.42-v2/webapps - name: app-volume - ports: - - containerPort: 8080 - hostPort: 8001 - volumes: - - name: app-volume - emptyDir: {} - diff --git a/examples/javaweb-tomcat-sidecar/javaweb.yaml b/examples/javaweb-tomcat-sidecar/javaweb.yaml deleted file mode 100644 index d77f6a727e..0000000000 --- a/examples/javaweb-tomcat-sidecar/javaweb.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: javaweb -spec: - containers: - - image: resouer/sample:v1 - name: war - volumeMounts: - - mountPath: /app - name: app-volume - - image: resouer/mytomcat:7.0 - name: tomcat - command: ["sh","-c","/root/apache-tomcat-7.0.42-v2/bin/start.sh"] - volumeMounts: - - mountPath: /root/apache-tomcat-7.0.42-v2/webapps - name: app-volume - ports: - - containerPort: 8080 - hostPort: 8001 - volumes: - - name: app-volume - emptyDir: {} - diff --git a/examples/javaweb-tomcat-sidecar/workflow.png b/examples/javaweb-tomcat-sidecar/workflow.png deleted file mode 100644 index 7be56d082e..0000000000 Binary files a/examples/javaweb-tomcat-sidecar/workflow.png and /dev/null differ diff --git a/examples/job/expansions/README.md b/examples/job/expansions/README.md deleted file mode 100644 index 4346ab2531..0000000000 --- a/examples/job/expansions/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/job/expansions/README.md](https://github.com/kubernetes/examples/blob/master/staging/job/expansions/README.md) diff --git a/examples/job/work-queue-1/README.md b/examples/job/work-queue-1/README.md deleted file mode 100644 index 8ac3051cfe..0000000000 --- a/examples/job/work-queue-1/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/job/work-queue-1/README.md](https://github.com/kubernetes/examples/blob/master/staging/job/work-queue-1/README.md) diff --git a/examples/job/work-queue-2/README.md b/examples/job/work-queue-2/README.md deleted file mode 100644 index f0e175d83f..0000000000 --- a/examples/job/work-queue-2/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/job/work-queue-2/README.md](https://github.com/kubernetes/examples/blob/master/staging/job/work-queue-2/README.md) diff --git a/examples/kubectl-container/.gitignore b/examples/kubectl-container/.gitignore deleted file mode 100644 index 50a4a06fd1..0000000000 --- a/examples/kubectl-container/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -kubectl -.tag diff --git a/examples/kubectl-container/Dockerfile b/examples/kubectl-container/Dockerfile deleted file mode 100644 index add0569c0b..0000000000 --- a/examples/kubectl-container/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM scratch -ADD kubectl kubectl -ENTRYPOINT ["/kubectl"] diff --git a/examples/kubectl-container/Makefile b/examples/kubectl-container/Makefile deleted file mode 100644 index a4094ff8bf..0000000000 --- a/examples/kubectl-container/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -# Use: -# -# `make kubectl` will build kubectl. -# `make tag` will suggest a tag. -# `make container` will build a container-- you must supply a tag. -# `make push` will push the container-- you must supply a tag. - -GOARCH?=$(shell go env GOARCH) -GOOS?=$(shell go env GOOS) - -kubectl: - make -C ../../ WHAT=cmd/kubectl KUBE_STATIC_OVERRIDES="kubectl"; \ - cp ../../_output/local/bin/$(GOOS)/$(GOARCH)/kubectl . - -.tag: kubectl - ./kubectl version --client | grep -o 'GitVersion:"[^"]*"' | sed 's/[^"]*"\([^"+]*\).*/\1/' > .tag - -tag: .tag - @echo "Suggest using TAG=$(shell cat .tag)" - @echo "$$ make container TAG=$(shell cat .tag)" - @echo "or" - @echo "$$ make push TAG=$(shell cat .tag)" - -container: - $(if $(TAG),,$(error TAG is not defined. Use 'make tag' to see a suggestion)) - docker build --pull -t staging-k8s.gcr.io/kubectl:$(TAG) . - -push: container - $(if $(TAG),,$(error TAG is not defined. Use 'make tag' to see a suggestion)) - gcloud docker -- push staging-k8s.gcr.io/kubectl:$(TAG) - -clean: - rm -f kubectl - rm -f .tag diff --git a/examples/kubectl-container/README.md b/examples/kubectl-container/README.md deleted file mode 100644 index bb2c3d2eb8..0000000000 --- a/examples/kubectl-container/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/kubectl-container/README.md](https://github.com/kubernetes/examples/blob/master/staging/kubectl-container/README.md) diff --git a/examples/kubectl-container/pod.json b/examples/kubectl-container/pod.json deleted file mode 100644 index 540715a6c5..0000000000 --- a/examples/kubectl-container/pod.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "kubectl-tester" - }, - "spec": { - "containers": [ - { - "name": "bb", - "image": "k8s.gcr.io/busybox", - "command": [ - "sh", "-c", "sleep 5; wget -O - ${KUBERNETES_RO_SERVICE_HOST}:${KUBERNETES_RO_SERVICE_PORT}/api/v1/pods/; sleep 10000" - ], - "ports": [ - { - "containerPort": 8080 - } - ], - "env": [ - { - "name": "KUBERNETES_RO_SERVICE_HOST", - "value": "127.0.0.1" - }, - { - "name": "KUBERNETES_RO_SERVICE_PORT", - "value": "8001" - } - ], - "volumeMounts": [ - { - "name": "test-volume", - "mountPath": "/mount/test-volume" - } - ] - }, - { - "name": "kubectl", - "image": "k8s.gcr.io/kubectl:v0.18.0-120-gaeb4ac55ad12b1-dirty", - "imagePullPolicy": "Always", - "args": [ - "proxy", "-p", "8001" - ] - } - ], - "volumes": [ - { - "name": "test-volume", - "emptyDir": {} - } - ] - } -} diff --git a/examples/meteor/README.md b/examples/meteor/README.md deleted file mode 100644 index 81f4d9fd4d..0000000000 --- a/examples/meteor/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/meteor/README.md](https://github.com/kubernetes/examples/blob/master/staging/meteor/README.md) diff --git a/examples/meteor/dockerbase/Dockerfile b/examples/meteor/dockerbase/Dockerfile deleted file mode 100644 index 708e2cb437..0000000000 --- a/examples/meteor/dockerbase/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM node:0.10 - -ONBUILD WORKDIR /appsrc -ONBUILD COPY . /appsrc - -ONBUILD RUN curl https://install.meteor.com/ | sh && \ - meteor build ../app --directory --architecture os.linux.x86_64 && \ - rm -rf /appsrc -# TODO rm meteor so it doesn't take space in the image? - -ONBUILD WORKDIR /app/bundle - -ONBUILD RUN (cd programs/server && npm install) -EXPOSE 8080 -CMD [] -ENV PORT 8080 -ENTRYPOINT MONGO_URL=mongodb://$MONGO_SERVICE_HOST:$MONGO_SERVICE_PORT /usr/local/bin/node main.js diff --git a/examples/meteor/dockerbase/README.md b/examples/meteor/dockerbase/README.md deleted file mode 100644 index 2a90269486..0000000000 --- a/examples/meteor/dockerbase/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/meteor/dockerbase/README.md](https://github.com/kubernetes/examples/blob/master/staging/meteor/dockerbase/README.md) diff --git a/examples/meteor/meteor-controller.json b/examples/meteor/meteor-controller.json deleted file mode 100644 index fa85afdcba..0000000000 --- a/examples/meteor/meteor-controller.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "kind": "ReplicationController", - "apiVersion": "v1", - "metadata": { - "name": "meteor-controller", - "labels": { - "name": "meteor" - } - }, - "spec": { - "replicas": 2, - "template": { - "metadata": { - "labels": { - "name": "meteor" - } - }, - "spec": { - "containers": [ - { - "name": "meteor", - "image": "chees/meteor-gke-example:latest", - "ports": [ - { - "name": "http-server", - "containerPort": 8080 - } - ] - } - ] - } - } - } -} diff --git a/examples/meteor/meteor-service.json b/examples/meteor/meteor-service.json deleted file mode 100644 index 2e494c0a2c..0000000000 --- a/examples/meteor/meteor-service.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "meteor" - }, - "spec": { - "ports": [ - { - "port": 80, - "targetPort": "http-server" - } - ], - "selector": { - "name": "meteor" - }, - "sessionAffinity": "ClientIP", - "sessionAffinityConfig": { - "clientIP": { - "timeoutSeconds": 90 - } - }, - "type": "LoadBalancer" - } -} diff --git a/examples/meteor/mongo-pod.json b/examples/meteor/mongo-pod.json deleted file mode 100644 index a5b80ac5de..0000000000 --- a/examples/meteor/mongo-pod.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "mongo", - "labels": { - "name": "mongo", - "role": "mongo" - } - }, - "spec": { - "volumes": [ - { - "name": "mongo-disk", - "gcePersistentDisk": { - "pdName": "mongo-disk", - "fsType": "ext4" - } - } - ], - "containers": [ - { - "name": "mongo", - "image": "mongo:latest", - "ports": [ - { - "name": "mongo", - "containerPort": 27017 - } - ], - "volumeMounts": [ - { - "name": "mongo-disk", - "mountPath": "/data/db" - } - ] - } - ] - } -} diff --git a/examples/meteor/mongo-service.json b/examples/meteor/mongo-service.json deleted file mode 100644 index bec687e990..0000000000 --- a/examples/meteor/mongo-service.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "mongo", - "labels": { - "name": "mongo" - } - }, - "spec": { - "ports": [ - { - "port": 27017, - "targetPort": "mongo" - } - ], - "selector": { - "name": "mongo", - "role": "mongo" - } - } -} diff --git a/examples/mysql-cinder-pd/README.md b/examples/mysql-cinder-pd/README.md deleted file mode 100644 index ac84d00fe9..0000000000 --- a/examples/mysql-cinder-pd/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/mysql-cinder-pd/README.md](https://github.com/kubernetes/examples/blob/master/staging/mysql-cinder-pd/README.md) diff --git a/examples/mysql-cinder-pd/mysql-service.yaml b/examples/mysql-cinder-pd/mysql-service.yaml deleted file mode 100644 index 6e2c019ac3..0000000000 --- a/examples/mysql-cinder-pd/mysql-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - name: mysql - name: mysql -spec: - ports: - # the port that this service should serve on - - port: 3306 - # label keys and values that must match in order to receive traffic for this service - selector: - name: mysql \ No newline at end of file diff --git a/examples/mysql-cinder-pd/mysql.yaml b/examples/mysql-cinder-pd/mysql.yaml deleted file mode 100644 index e224d0afe1..0000000000 --- a/examples/mysql-cinder-pd/mysql.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: mysql - labels: - name: mysql -spec: - containers: - - resources: - limits : - cpu: 0.5 - image: mysql - name: mysql - args: - - "--ignore-db-dir" - - "lost+found" - env: - - name: MYSQL_ROOT_PASSWORD - # change this - value: yourpassword - ports: - - containerPort: 3306 - name: mysql - volumeMounts: - # name must match the volume name below - - name: mysql-persistent-storage - # mount path within the container - mountPath: /var/lib/mysql - volumes: - - name: mysql-persistent-storage - cinder: - volumeID: bd82f7e2-wece-4c01-a505-4acf60b07f4a - fsType: ext4 diff --git a/examples/mysql-wordpress-pd/OWNERS b/examples/mysql-wordpress-pd/OWNERS deleted file mode 100644 index d349c8eebc..0000000000 --- a/examples/mysql-wordpress-pd/OWNERS +++ /dev/null @@ -1,20 +0,0 @@ -approvers: -- jeffmendoza -reviewers: -- thockin -- lavalamp -- brendandburns -- caesarxuchao -- mikedanese -- davidopp -- pmorie -- dchen1107 -- janetkuo -- roberthbailey -- eparis -- mwielgus -- jlowdermilk -- david-mcmahon -- jeffvance -- jeffmendoza -- RichieEscarez diff --git a/examples/mysql-wordpress-pd/README.md b/examples/mysql-wordpress-pd/README.md deleted file mode 100644 index 48601ec813..0000000000 --- a/examples/mysql-wordpress-pd/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/mysql-wordpress-pd/README.md](https://github.com/kubernetes/examples/blob/master/mysql-wordpress-pd/README.md) diff --git a/examples/mysql-wordpress-pd/WordPress.png b/examples/mysql-wordpress-pd/WordPress.png deleted file mode 100644 index cabcd09a61..0000000000 Binary files a/examples/mysql-wordpress-pd/WordPress.png and /dev/null differ diff --git a/examples/mysql-wordpress-pd/gce-volumes.yaml b/examples/mysql-wordpress-pd/gce-volumes.yaml deleted file mode 100644 index 17aeb0596d..0000000000 --- a/examples/mysql-wordpress-pd/gce-volumes.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: wordpress-pv-1 -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - gcePersistentDisk: - pdName: wordpress-1 - fsType: ext4 ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: wordpress-pv-2 -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - gcePersistentDisk: - pdName: wordpress-2 - fsType: ext4 diff --git a/examples/mysql-wordpress-pd/local-volumes.yaml b/examples/mysql-wordpress-pd/local-volumes.yaml deleted file mode 100644 index 8964113336..0000000000 --- a/examples/mysql-wordpress-pd/local-volumes.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-1 - labels: - type: local -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - hostPath: - path: /tmp/data/pv-1 ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: local-pv-2 - labels: - type: local -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - hostPath: - path: /tmp/data/pv-2 diff --git a/examples/mysql-wordpress-pd/mysql-deployment.yaml b/examples/mysql-wordpress-pd/mysql-deployment.yaml deleted file mode 100644 index 2dafc08f0a..0000000000 --- a/examples/mysql-wordpress-pd/mysql-deployment.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: wordpress-mysql - labels: - app: wordpress -spec: - ports: - - port: 3306 - selector: - app: wordpress - tier: mysql - clusterIP: None ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: mysql-pv-claim - labels: - app: wordpress -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: wordpress-mysql - labels: - app: wordpress -spec: - strategy: - type: Recreate - template: - metadata: - labels: - app: wordpress - tier: mysql - spec: - containers: - - image: mysql:5.6 - name: mysql - env: - # $ kubectl create secret generic mysql-pass --from-file=password.txt - # make sure password.txt does not have a trailing newline - - name: MYSQL_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: mysql-pass - key: password.txt - ports: - - containerPort: 3306 - name: mysql - volumeMounts: - - name: mysql-persistent-storage - mountPath: /var/lib/mysql - volumes: - - name: mysql-persistent-storage - persistentVolumeClaim: - claimName: mysql-pv-claim diff --git a/examples/mysql-wordpress-pd/wordpress-deployment.yaml b/examples/mysql-wordpress-pd/wordpress-deployment.yaml deleted file mode 100644 index a631361f22..0000000000 --- a/examples/mysql-wordpress-pd/wordpress-deployment.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: wordpress - labels: - app: wordpress -spec: - ports: - - port: 80 - selector: - app: wordpress - tier: frontend - type: LoadBalancer ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: wp-pv-claim - labels: - app: wordpress -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: wordpress - labels: - app: wordpress -spec: - strategy: - type: Recreate - template: - metadata: - labels: - app: wordpress - tier: frontend - spec: - containers: - - image: wordpress:4.8.0-apache - name: wordpress - env: - - name: WORDPRESS_DB_HOST - value: wordpress-mysql - - name: WORDPRESS_DB_PASSWORD - valueFrom: - secretKeyRef: - name: mysql-pass - key: password.txt - ports: - - containerPort: 80 - name: wordpress - volumeMounts: - - name: wordpress-persistent-storage - mountPath: /var/www/html - volumes: - - name: wordpress-persistent-storage - persistentVolumeClaim: - claimName: wp-pv-claim diff --git a/examples/newrelic-infrastructure/.gitignore b/examples/newrelic-infrastructure/.gitignore deleted file mode 100644 index 2ad9294d5d..0000000000 --- a/examples/newrelic-infrastructure/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.local diff --git a/examples/newrelic-infrastructure/README.md b/examples/newrelic-infrastructure/README.md deleted file mode 100644 index c86a194d0f..0000000000 --- a/examples/newrelic-infrastructure/README.md +++ /dev/null @@ -1,146 +0,0 @@ -## New Relic Infrastructure Server Monitoring Agent Example - -This example shows how to run a New Relic Infrastructure server monitoring agent as a pod in a DaemonSet on an existing Kubernetes cluster. - -This example will create a DaemonSet which places the New Relic Infrastructure monitoring agent on every node in the cluster. It's also fairly trivial to exclude specific Kubernetes nodes from the DaemonSet to just monitor specific servers. (The prior nrsysmond has been deprecated.) - -### Step 0: Prerequisites - -This process will create privileged containers which have full access to the host system for logging. Beware of the security implications of this. - -DaemonSets must be enabled on your cluster. Instructions for enabling DaemonSet can be found [here](../../docs/api.md#enabling-the-extensions-group). - -### Step 1: Configure New Relic Infrastructure Agent - -The New Relic Infrastructure agent is configured via environment variables. We will configure these environment variables in a sourced bash script, encode the environment file data, and store it in a secret which will be loaded at container runtime. (Reread this sentence a few times, it's *HOW* the entire container works.) - -The [New Relic Linux Infrastructure Server configuration page](https://docs.newrelic.com/docs/servers/new-relic-servers-linux/installation-configuration/configuring-servers-linux) lists all the other settings for the Infrastructure process. - -To create an environment variable for a setting, prepend NRIA_ to its name and capitalize all of the env variable. For example, - -```console -log_file=/var/log/nr-infra.log -``` - -translates to - -```console -NRIA_LOG_FILE=/var/log/nr-infra.log -``` - -Edit examples/newrelic-infrastructure/nrconfig.env and configure relevant environment variables for your NewRelic Infrastructure agent. There are a few defaults defined, but the only required variable is the New Relic license key. - -Now, let's vendor the config into a secret. - -```console -$ cd examples/newrelic-infrastructure/ -$ ./config-to-secret.sh -``` - - - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: newrelic-config -type: Opaque -data: - config: {{config_data}} -``` - -[Download example](newrelic-config-template.yaml?raw=true) - - -The script will encode the config file and write it to `newrelic-config.yaml`. - -Finally, submit the config to the cluster: - -```console -$ kubectl create -f examples/newrelic-infrastructure/newrelic-config.yaml -``` - -### Step 2: Create the DaemonSet definition. - -The DaemonSet definition instructs Kubernetes to place a newrelic Infrastructure agent on each Kubernetes node. - - - -```yaml -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: newrelic-infra-agent - labels: - tier: monitoring - app: newrelic-infra-agent - version: v1 -spec: - template: - metadata: - labels: - name: newrelic - spec: - # Filter to specific nodes: - # nodeSelector: - # app: newrelic - hostPID: true - hostIPC: true - hostNetwork: true - containers: - - resources: - requests: - cpu: 0.15 - securityContext: - privileged: true - image: newrelic/infrastructure - name: newrelic - command: [ "bash", "-c", "source /etc/kube-nr-infra/config && /usr/bin/newrelic-infra" ] - volumeMounts: - - name: newrelic-config - mountPath: /etc/kube-nr-infra - readOnly: true - - name: dev - mountPath: /dev - - name: run - mountPath: /var/run/docker.sock - - name: log - mountPath: /var/log - - name: host-root - mountPath: /host - readOnly: true - volumes: - - name: newrelic-config - secret: - secretName: newrelic-config - - name: dev - hostPath: - path: /dev - - name: run - hostPath: - path: /var/run/docker.sock - - name: log - hostPath: - path: /var/log - - name: host-root - hostPath: - path: / -``` - -[Download example](newrelic-infra-daemonset.yaml?raw=true) - - -The daemonset instructs Kubernetes to spawn pods on each node, mapping /dev/, /run/, and /var/log to the container. It also maps the entire kube node / to /host/ in the container with a read-only mount. It also maps the secrets we set up earlier to /etc/kube-newrelic/config, and sources them in the startup script, configuring the agent properly. - -#### DaemonSet customization - -- There are more environment variables for fine tuning the infrastructure agent's operation (or a yaml file that you'd have to construct). See [Infrastructure Agent Environment Variables][(https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/configure-infrastructure-agent) for the full list. - - -### Known issues - -It's a bit cludgy to define the environment variables like we do here in these config files. There is [another issue](https://github.com/kubernetes/kubernetes/issues/4710) to discuss adding mapping secrets to environment variables in Kubernetes. (Personally I don't like that method and prefer to use the config secrets.) - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/newrelic/README.md?pixel)]() - diff --git a/examples/newrelic-infrastructure/config-to-secret.sh b/examples/newrelic-infrastructure/config-to-secret.sh deleted file mode 100755 index 520c71990b..0000000000 --- a/examples/newrelic-infrastructure/config-to-secret.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Copyright 2014 The Kubernetes Authors. -# -# 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. - -# Encodes the environment variables into a Kubernetes secret. - -BASE64_ENC=$(cat nrconfig.env | base64 | tr -d '\n') -sed -e "s#{{config_data}}#${BASE64_ENC}#g" ./newrelic-config-template.yaml > newrelic-config.yaml diff --git a/examples/newrelic-infrastructure/newrelic-config-template.yaml b/examples/newrelic-infrastructure/newrelic-config-template.yaml deleted file mode 100644 index 361a307924..0000000000 --- a/examples/newrelic-infrastructure/newrelic-config-template.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: newrelic-config -type: Opaque -data: - config: {{config_data}} diff --git a/examples/newrelic-infrastructure/newrelic-infra-daemonset.yaml b/examples/newrelic-infrastructure/newrelic-infra-daemonset.yaml deleted file mode 100644 index 395ab97223..0000000000 --- a/examples/newrelic-infrastructure/newrelic-infra-daemonset.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: newrelic-infra-agent - labels: - tier: monitoring - app: newrelic-infra-agent - version: v1 -spec: - template: - metadata: - labels: - name: newrelic - spec: - # Filter to specific nodes: - # nodeSelector: - # app: newrelic - hostPID: true - hostIPC: true - hostNetwork: true - containers: - - resources: - requests: - cpu: 0.15 - securityContext: - privileged: true - image: newrelic/infrastructure - name: newrelic - command: [ "bash", "-c", "source /etc/kube-nr-infra/config && /usr/bin/newrelic-infra" ] - volumeMounts: - - name: newrelic-config - mountPath: /etc/kube-nr-infra - readOnly: true - - name: dev - mountPath: /dev - - name: run - mountPath: /var/run/docker.sock - - name: log - mountPath: /var/log - - name: host-root - mountPath: /host - readOnly: true - volumes: - - name: newrelic-config - secret: - secretName: newrelic-config - - name: dev - hostPath: - path: /dev - - name: run - hostPath: - path: /var/run/docker.sock - - name: log - hostPath: - path: /var/log - - name: host-root - hostPath: - path: / diff --git a/examples/newrelic-infrastructure/nrconfig.env b/examples/newrelic-infrastructure/nrconfig.env deleted file mode 100644 index ced09727ca..0000000000 --- a/examples/newrelic-infrastructure/nrconfig.env +++ /dev/null @@ -1,9 +0,0 @@ -#--REQUIRED-- -# Put your license key in this variable -export NRIA_LICENSE_KEY=REPLACE_LICENSE_KEY_HERE -# -#--OPTIONAL-- -# Set to 1 for debug output in the log -export NRIA_VERBOSE=0 -# Can log to any file, but will not create directories -export NRIA_LOG_FILE=/var/log/nr-infra.log diff --git a/examples/newrelic/README.md b/examples/newrelic/README.md deleted file mode 100644 index e5c429c766..0000000000 --- a/examples/newrelic/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/newrelic/README.md](https://github.com/kubernetes/examples/blob/master/staging/newrelic/README.md) diff --git a/examples/newrelic/config-to-secret.sh b/examples/newrelic/config-to-secret.sh deleted file mode 100755 index 520c71990b..0000000000 --- a/examples/newrelic/config-to-secret.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Copyright 2014 The Kubernetes Authors. -# -# 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. - -# Encodes the environment variables into a Kubernetes secret. - -BASE64_ENC=$(cat nrconfig.env | base64 | tr -d '\n') -sed -e "s#{{config_data}}#${BASE64_ENC}#g" ./newrelic-config-template.yaml > newrelic-config.yaml diff --git a/examples/newrelic/newrelic-config-template.yaml b/examples/newrelic/newrelic-config-template.yaml deleted file mode 100644 index 361a307924..0000000000 --- a/examples/newrelic/newrelic-config-template.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: newrelic-config -type: Opaque -data: - config: {{config_data}} diff --git a/examples/newrelic/newrelic-config.yaml b/examples/newrelic/newrelic-config.yaml deleted file mode 100644 index d2b551aa69..0000000000 --- a/examples/newrelic/newrelic-config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# This file should be overwritten by ./config-to-secret.sh -# This file is in place to satisfy the kubernetes documentation tests. - -# apiVersion: v1 -# kind: Secret -# metadata: -# name: newrelic-config -# type: Opaque -# data: -# config: base64 encoded diff --git a/examples/newrelic/newrelic-daemonset.yaml b/examples/newrelic/newrelic-daemonset.yaml deleted file mode 100644 index fd46972204..0000000000 --- a/examples/newrelic/newrelic-daemonset.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: newrelic-agent - labels: - tier: monitoring - app: newrelic-agent - version: v1 -spec: - template: - metadata: - labels: - name: newrelic - spec: - # Filter to specific nodes: - # nodeSelector: - # app: newrelic - hostPID: true - hostIPC: true - hostNetwork: true - containers: - - resources: - requests: - cpu: 0.15 - securityContext: - privileged: true - env: - - name: NRSYSMOND_logfile - value: "/var/log/nrsysmond.log" - image: newrelic/nrsysmond - name: newrelic - command: [ "bash", "-c", "source /etc/kube-newrelic/config && /usr/sbin/nrsysmond -E -F" ] - volumeMounts: - - name: newrelic-config - mountPath: /etc/kube-newrelic - readOnly: true - - name: dev - mountPath: /dev - - name: run - mountPath: /var/run/docker.sock - - name: sys - mountPath: /sys - - name: log - mountPath: /var/log - volumes: - - name: newrelic-config - secret: - secretName: newrelic-config - - name: dev - hostPath: - path: /dev - - name: run - hostPath: - path: /var/run/docker.sock - type: Socket - - name: sys - hostPath: - path: /sys - - name: log - hostPath: - path: /var/log diff --git a/examples/newrelic/nrconfig.env b/examples/newrelic/nrconfig.env deleted file mode 100644 index ddce85294d..0000000000 --- a/examples/newrelic/nrconfig.env +++ /dev/null @@ -1,2 +0,0 @@ -export NRSYSMOND_loglevel=debug -export NRSYSMOND_license_key=REPLACE_LICENSE_KEY_HERE diff --git a/examples/nodesjs-mongodb/README.md b/examples/nodesjs-mongodb/README.md deleted file mode 100644 index 7f84108b39..0000000000 --- a/examples/nodesjs-mongodb/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/nodesjs-mongodb/README.md](https://github.com/kubernetes/examples/blob/master/staging/nodesjs-mongodb/README.md) diff --git a/examples/nodesjs-mongodb/mongo-controller.yaml b/examples/nodesjs-mongodb/mongo-controller.yaml deleted file mode 100644 index e9288151de..0000000000 --- a/examples/nodesjs-mongodb/mongo-controller.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - labels: - name: mongo - name: mongo-controller -spec: - replicas: 1 - template: - metadata: - labels: - name: mongo - spec: - containers: - - image: mongo - name: mongo - ports: - - name: mongo - containerPort: 27017 - hostPort: 27017 - volumeMounts: - - name: mongo-persistent-storage - mountPath: /data/db - volumes: - - name: mongo-persistent-storage - gcePersistentDisk: - pdName: mongo-disk - fsType: ext4 \ No newline at end of file diff --git a/examples/nodesjs-mongodb/mongo-service.yaml b/examples/nodesjs-mongodb/mongo-service.yaml deleted file mode 100644 index 81785d5b85..0000000000 --- a/examples/nodesjs-mongodb/mongo-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - name: mongo - name: mongo -spec: - ports: - - port: 27017 - targetPort: 27017 - selector: - name: mongo \ No newline at end of file diff --git a/examples/nodesjs-mongodb/web-controller-demo.yaml b/examples/nodesjs-mongodb/web-controller-demo.yaml deleted file mode 100644 index 5fa8ef84ee..0000000000 --- a/examples/nodesjs-mongodb/web-controller-demo.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - labels: - name: web - name: web-controller -spec: - replicas: 2 - selector: - name: web - template: - metadata: - labels: - name: web - spec: - containers: - - image: node:0.10.40 - command: ['/bin/sh', '-c'] - args: ['cd /home && git clone https://github.com/ijason/NodeJS-Sample-App.git demo && cd demo/EmployeeDB/ && npm install && sed -i -- ''s/localhost/mongo/g'' app.js && node app.js'] - name: web - ports: - - containerPort: 3000 - name: http-server \ No newline at end of file diff --git a/examples/nodesjs-mongodb/web-controller.yaml b/examples/nodesjs-mongodb/web-controller.yaml deleted file mode 100644 index 6541380998..0000000000 --- a/examples/nodesjs-mongodb/web-controller.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - labels: - name: web - name: web-controller -spec: - replicas: 2 - selector: - name: web - template: - metadata: - labels: - name: web - spec: - containers: - - image: - name: web - ports: - - containerPort: 3000 - name: http-server \ No newline at end of file diff --git a/examples/nodesjs-mongodb/web-service.yaml b/examples/nodesjs-mongodb/web-service.yaml deleted file mode 100644 index 4cef05b33b..0000000000 --- a/examples/nodesjs-mongodb/web-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: web - labels: - name: web -spec: - type: LoadBalancer - ports: - - port: 80 - targetPort: 3000 - protocol: TCP - selector: - name: web \ No newline at end of file diff --git a/examples/oms/README.md b/examples/oms/README.md deleted file mode 100644 index 096e03af23..0000000000 --- a/examples/oms/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/oms/README.md](https://github.com/kubernetes/examples/blob/master/staging/oms/README.md) diff --git a/examples/oms/images/connected-resources.png b/examples/oms/images/connected-resources.png deleted file mode 100644 index 32bd05791f..0000000000 Binary files a/examples/oms/images/connected-resources.png and /dev/null differ diff --git a/examples/oms/images/oms-container-solution.png b/examples/oms/images/oms-container-solution.png deleted file mode 100644 index 1bc90d11d0..0000000000 Binary files a/examples/oms/images/oms-container-solution.png and /dev/null differ diff --git a/examples/oms/images/oms-portal.png b/examples/oms/images/oms-portal.png deleted file mode 100644 index 300114e1f4..0000000000 Binary files a/examples/oms/images/oms-portal.png and /dev/null differ diff --git a/examples/oms/omsagent-daemonset.yaml b/examples/oms/omsagent-daemonset.yaml deleted file mode 100644 index 8ab523f060..0000000000 --- a/examples/oms/omsagent-daemonset.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: omsagent -spec: - template: - metadata: - labels: - app: omsagent - spec: - containers: - - env: - - name: WSID - value: - - name: KEY - value: - image: microsoft/oms - name: omsagent - ports: - - containerPort: 25225 - protocol: TCP - securityContext: - privileged: true - volumeMounts: - - mountPath: /var/run/docker.sock - name: docker-sock - volumes: - - name: docker-sock - hostPath: - path: /var/run/docker.sock - type: Socket diff --git a/examples/openshift-origin/.gitignore b/examples/openshift-origin/.gitignore deleted file mode 100644 index f733c4b5fb..0000000000 --- a/examples/openshift-origin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -config/ diff --git a/examples/openshift-origin/README.md b/examples/openshift-origin/README.md deleted file mode 100644 index c01effb2b0..0000000000 --- a/examples/openshift-origin/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/openshift-origin/README.md](https://github.com/kubernetes/examples/blob/master/staging/openshift-origin/README.md) diff --git a/examples/openshift-origin/cleanup.sh b/examples/openshift-origin/cleanup.sh deleted file mode 100755 index a2c931571b..0000000000 --- a/examples/openshift-origin/cleanup.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Copyright 2014 The Kubernetes Authors. -# -# 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. - -# Cleans up resources from the example, assumed to be run from Kubernetes repo root -echo -echo -export OPENSHIFT_EXAMPLE=$(pwd)/examples/openshift-origin -export OPENSHIFT_CONFIG=${OPENSHIFT_EXAMPLE}/config - -echo "===> Removing the OpenShift namespace:" -kubectl delete namespace openshift-origin -echo - -echo "===> Removing local files:" -rm -rf ${OPENSHIFT_CONFIG} -rm ${OPENSHIFT_EXAMPLE}/openshift-startup.log -rm ${OPENSHIFT_EXAMPLE}/secret.json -touch ${OPENSHIFT_EXAMPLE}/secret.json -echo - -echo "===> Restoring changed YAML specifcations:" -if [ -f "${OPENSHIFT_EXAMPLE}/etcd-controller.yaml.bak" ]; then - rm ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml - mv -v ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml.bak ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml -else - echo "No changed specifications found." -fi -echo - -echo Done. diff --git a/examples/openshift-origin/create.sh b/examples/openshift-origin/create.sh deleted file mode 100755 index 717df61b7f..0000000000 --- a/examples/openshift-origin/create.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -# Copyright 2014 The Kubernetes Authors. -# -# 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. - -set -e - -# Creates resources from the example, assumed to be run from Kubernetes repo root -echo -echo "===> Initializing:" -if [ ! $(which python) ] -then - echo "Python is a prerequisite for running this script. Please install Python and try running again." - exit 1 -fi - -if [ ! $(which gcloud) ] -then - echo "gcloud is a prerequisite for running this script. Please install gcloud and try running again." - exit 1 -fi - -gcloud_instances=$(gcloud compute instances list | grep "\-master") -if [ -z "$gcloud_instances" ] || [ -z "${KUBE_GCE_INSTANCE_PREFIX}" ] -then - echo "This script is only able to supply the necessary serviceaccount key if you are running on Google" - echo "Compute Engine using a cluster/kube-up.sh script with KUBE_GCE_INSTANCE_PREFIX set. If this is not" - echo "the case, be ready to supply a path to the serviceaccount public key." - if [ -z "${KUBE_GCE_INSTANCE_PREFIX}" ] - then - echo "Please provide your KUBE_GCE_INSTANCE_PREFIX now:" - read KUBE_GCE_INSTANCE_PREFIX - fi -fi - -export OPENSHIFT_EXAMPLE=$(pwd)/examples/openshift-origin -echo Set OPENSHIFT_EXAMPLE=${OPENSHIFT_EXAMPLE} -export OPENSHIFT_CONFIG=${OPENSHIFT_EXAMPLE}/config -echo Set OPENSHIFT_CONFIG=${OPENSHIFT_CONFIG} -mkdir ${OPENSHIFT_CONFIG} -echo Made dir ${OPENSHIFT_CONFIG} -echo - -echo "===> Setting up OpenShift-Origin namespace:" -kubectl create -f ${OPENSHIFT_EXAMPLE}/openshift-origin-namespace.yaml -echo - -echo "===> Setting up etcd-discovery:" -# A token etcd uses to generate unique cluster ID and member ID. Conforms to [a-z0-9]{40} -export ETCD_INITIAL_CLUSTER_TOKEN=$(python -c "import string; import random; print(''.join(random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(40)))") - -# A unique token used by the discovery service. Conforms to etcd-cluster-[a-z0-9]{5} -export ETCD_DISCOVERY_TOKEN=$(python -c "import string; import random; print(\"etcd-cluster-\" + ''.join(random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(5)))") -sed -i.bak -e "s/INSERT_ETCD_INITIAL_CLUSTER_TOKEN/\"${ETCD_INITIAL_CLUSTER_TOKEN}\"/g" -e "s/INSERT_ETCD_DISCOVERY_TOKEN/\"${ETCD_DISCOVERY_TOKEN}\"/g" ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml - -kubectl create -f ${OPENSHIFT_EXAMPLE}/etcd-discovery-controller.yaml --namespace='openshift-origin' -kubectl create -f ${OPENSHIFT_EXAMPLE}/etcd-discovery-service.yaml --namespace='openshift-origin' -echo - -echo "===> Setting up etcd:" -kubectl create -f ${OPENSHIFT_EXAMPLE}/etcd-controller.yaml --namespace='openshift-origin' -kubectl create -f ${OPENSHIFT_EXAMPLE}/etcd-service.yaml --namespace='openshift-origin' -echo - -echo "===> Setting up openshift-origin:" -kubectl config view --output=yaml --flatten=true --minify=true > ${OPENSHIFT_CONFIG}/kubeconfig -kubectl create -f ${OPENSHIFT_EXAMPLE}/openshift-service.yaml --namespace='openshift-origin' -echo - -export PUBLIC_OPENSHIFT_IP="" -echo "===> Waiting for public IP to be set for the OpenShift Service." -echo "Mistakes in service setup can cause this to loop infinitely if an" -echo "external IP is never set. Ensure that the OpenShift service" -echo "is set to use an external load balancer. This process may take" -echo "a few minutes. Errors can be found in the log file found at:" -echo ${OPENSHIFT_EXAMPLE}/openshift-startup.log -echo "" > ${OPENSHIFT_EXAMPLE}/openshift-startup.log -while [ ${#PUBLIC_OPENSHIFT_IP} -lt 1 ]; do - echo -n . - sleep 1 - { - export PUBLIC_OPENSHIFT_IP=$(kubectl get services openshift --namespace="openshift-origin" --template="{{ index .status.loadBalancer.ingress 0 \"ip\" }}") - } >> ${OPENSHIFT_EXAMPLE}/openshift-startup.log 2>&1 - if [[ ! ${PUBLIC_OPENSHIFT_IP} =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then - export PUBLIC_OPENSHIFT_IP="" - fi -done -echo -echo "Public OpenShift IP set to: ${PUBLIC_OPENSHIFT_IP}" -echo - -echo "===> Configuring OpenShift:" -docker run --privileged -v ${OPENSHIFT_CONFIG}:/config openshift/origin start master --write-config=/config --kubeconfig=/config/kubeconfig --master=https://localhost:8443 --public-master=https://${PUBLIC_OPENSHIFT_IP}:8443 --etcd=http://etcd:2379 -sudo -E chown -R ${USER} ${OPENSHIFT_CONFIG} - -# The following assumes GCE and that KUBE_GCE_INSTANCE_PREFIX is set -export ZONE=$(gcloud compute instances list | grep "${KUBE_GCE_INSTANCE_PREFIX}\-master" | awk '{print $2}' | head -1) -echo "sudo cat /srv/kubernetes/server.key; exit;" | gcloud compute ssh ${KUBE_GCE_INSTANCE_PREFIX}-master --zone ${ZONE} | grep -Ex "(^\-.*\-$|^\S+$)" > ${OPENSHIFT_CONFIG}/serviceaccounts.private.key -# The following insertion will fail if indentation changes -sed -i -e 's/publicKeyFiles:.*$/publicKeyFiles:/g' -e '/publicKeyFiles:/a \ \ - serviceaccounts.private.key' ${OPENSHIFT_CONFIG}/master-config.yaml - -docker run -it --privileged -e="KUBECONFIG=/config/admin.kubeconfig" -v ${OPENSHIFT_CONFIG}:/config openshift/origin cli secrets new openshift-config /config -o json &> ${OPENSHIFT_EXAMPLE}/secret.json -kubectl create -f ${OPENSHIFT_EXAMPLE}/secret.json --namespace='openshift-origin' -echo - -echo "===> Running OpenShift Master:" -kubectl create -f ${OPENSHIFT_EXAMPLE}/openshift-controller.yaml --namespace='openshift-origin' -echo - -echo Done. diff --git a/examples/openshift-origin/etcd-controller.yaml b/examples/openshift-origin/etcd-controller.yaml deleted file mode 100644 index 419c57dbdb..0000000000 --- a/examples/openshift-origin/etcd-controller.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: etcd -spec: - strategy: - type: Recreate - replicas: 3 - selector: - matchLabels: - name: etcd - template: - metadata: - labels: - name: etcd - spec: - containers: - - name: member - image: openshift/etcd-20-centos7 - ports: - - containerPort: 2379 - protocol: TCP - - containerPort: 2380 - protocol: TCP - env: - # ETCD_NUM_MEMBERS is the maximum number of members to launch (have to match with # of replicas) - - name: ETCD_NUM_MEMBERS - value: "3" - - name: ETCD_INITIAL_CLUSTER_STATE - value: "new" - # ETCD_INITIAL_CLUSTER_TOKEN is a token etcd uses to generate unique cluster ID and member ID. Conforms to [a-z0-9]{40} - - name: ETCD_INITIAL_CLUSTER_TOKEN - value: INSERT_ETCD_INITIAL_CLUSTER_TOKEN - # ETCD_DISCOVERY_TOKEN is a unique token used by the discovery service. Conforms to etcd-cluster-[a-z0-9]{5} - - name: ETCD_DISCOVERY_TOKEN - value: INSERT_ETCD_DISCOVERY_TOKEN - # ETCD_DISCOVERY_URL connects etcd instances together by storing a list of peer addresses, - # metadata and the initial size of the cluster under a unique address - - name: ETCD_DISCOVERY_URL - value: "http://etcd-discovery:2379" - - name: ETCDCTL_PEERS - value: "http://etcd:2379" - resources: {} - terminationMessagePath: "/dev/termination-log" - imagePullPolicy: IfNotPresent - securityContext: - capabilities: {} - privileged: false - restartPolicy: Always - dnsPolicy: ClusterFirst - serviceAccount: '' -status: {} diff --git a/examples/openshift-origin/etcd-discovery-controller.yaml b/examples/openshift-origin/etcd-discovery-controller.yaml deleted file mode 100644 index 33f593ac7f..0000000000 --- a/examples/openshift-origin/etcd-discovery-controller.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: etcd-discovery -spec: - strategy: - type: Recreate - replicas: 1 - selector: - matchLabels: - name: etcd-discovery - template: - metadata: - labels: - name: etcd-discovery - spec: - containers: - - name: discovery - image: openshift/etcd-20-centos7 - args: - - etcd-discovery.sh - ports: - - containerPort: 2379 - protocol: TCP - resources: {} - terminationMessagePath: "/dev/termination-log" - imagePullPolicy: IfNotPresent - securityContext: - capabilities: {} - privileged: false - restartPolicy: Always - dnsPolicy: ClusterFirst - serviceAccount: '' -status: {} diff --git a/examples/openshift-origin/etcd-discovery-service.yaml b/examples/openshift-origin/etcd-discovery-service.yaml deleted file mode 100644 index 99f464716c..0000000000 --- a/examples/openshift-origin/etcd-discovery-service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: etcd-discovery - labels: - name: etcd-discovery -spec: - ports: - - protocol: TCP - port: 2379 - targetPort: 2379 - nodePort: 0 - selector: - name: etcd-discovery - sessionAffinity: None - type: ClusterIP -status: - loadBalancer: {} diff --git a/examples/openshift-origin/etcd-service.yaml b/examples/openshift-origin/etcd-service.yaml deleted file mode 100644 index 00bc56ef07..0000000000 --- a/examples/openshift-origin/etcd-service.yaml +++ /dev/null @@ -1,24 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: etcd - labels: - name: etcd -spec: - ports: - - name: client - protocol: TCP - port: 2379 - targetPort: 2379 - nodePort: 0 - - name: server - protocol: TCP - port: 2380 - targetPort: 2380 - nodePort: 0 - selector: - name: etcd - sessionAffinity: None - type: ClusterIP -status: - loadBalancer: {} diff --git a/examples/openshift-origin/openshift-controller.yaml b/examples/openshift-origin/openshift-controller.yaml deleted file mode 100644 index 1844a70ccd..0000000000 --- a/examples/openshift-origin/openshift-controller.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - name: openshift - name: openshift -spec: - replicas: 1 - selector: - matchLabels: - name: openshift - template: - metadata: - labels: - name: openshift - spec: - containers: - - args: - - start - - master - - --config=/config/master-config.yaml - image: "openshift/origin" - name: origin - ports: - - containerPort: 8443 - name: openshift - volumeMounts: - - mountPath: /config - name: config - readOnly: true - volumes: - - name: config - secret: - secretName: openshift-config \ No newline at end of file diff --git a/examples/openshift-origin/openshift-origin-namespace.yaml b/examples/openshift-origin/openshift-origin-namespace.yaml deleted file mode 100644 index 1596417f6c..0000000000 --- a/examples/openshift-origin/openshift-origin-namespace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Namespace -apiVersion: v1 -metadata: - name: "openshift-origin" - labels: - name: "openshift-origin" \ No newline at end of file diff --git a/examples/openshift-origin/openshift-service.yaml b/examples/openshift-origin/openshift-service.yaml deleted file mode 100644 index a8d599da61..0000000000 --- a/examples/openshift-origin/openshift-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: openshift -spec: - ports: - - name: openshift - port: 8443 - targetPort: 8443 - selector: - name: openshift - type: LoadBalancer diff --git a/examples/openshift-origin/secret.json b/examples/openshift-origin/secret.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/persistent-volume-provisioning/README.md b/examples/persistent-volume-provisioning/README.md deleted file mode 100644 index df49ca3b5c..0000000000 --- a/examples/persistent-volume-provisioning/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/persistent-volume-provisioning/README.md](https://github.com/kubernetes/examples/blob/master/staging/persistent-volume-provisioning/README.md) diff --git a/examples/persistent-volume-provisioning/aws-ebs.yaml b/examples/persistent-volume-provisioning/aws-ebs.yaml deleted file mode 100644 index 4fc5ba9242..0000000000 --- a/examples/persistent-volume-provisioning/aws-ebs.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: slow -provisioner: kubernetes.io/aws-ebs -parameters: - type: io1 - zone: us-east-1d - iopsPerGB: "10" diff --git a/examples/persistent-volume-provisioning/cinder/cinder-storage-class.yaml b/examples/persistent-volume-provisioning/cinder/cinder-storage-class.yaml deleted file mode 100644 index 3dc066cd5a..0000000000 --- a/examples/persistent-volume-provisioning/cinder/cinder-storage-class.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: gold -provisioner: kubernetes.io/cinder -parameters: - type: fast - availability: nova diff --git a/examples/persistent-volume-provisioning/cinder/example-pod.yaml b/examples/persistent-volume-provisioning/cinder/example-pod.yaml deleted file mode 100644 index bc14b12054..0000000000 --- a/examples/persistent-volume-provisioning/cinder/example-pod.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: server -spec: - replicas: 1 - selector: - role: server - template: - metadata: - labels: - role: server - spec: - containers: - - name: server - image: nginx - volumeMounts: - - mountPath: /var/lib/www/html - name: cinderpvc - volumes: - - name: cinderpvc - persistentVolumeClaim: - claimName: claim1 diff --git a/examples/persistent-volume-provisioning/claim1.json b/examples/persistent-volume-provisioning/claim1.json deleted file mode 100644 index 75c71a669c..0000000000 --- a/examples/persistent-volume-provisioning/claim1.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "kind": "PersistentVolumeClaim", - "apiVersion": "v1", - "metadata": { - "name": "claim1" - }, - "spec": { - "accessModes": [ - "ReadWriteOnce" - ], - "resources": { - "requests": { - "storage": "3Gi" - } - }, - "storageClassName": "slow" - } -} diff --git a/examples/persistent-volume-provisioning/gce-pd.yaml b/examples/persistent-volume-provisioning/gce-pd.yaml deleted file mode 100644 index 3d8e134bac..0000000000 --- a/examples/persistent-volume-provisioning/gce-pd.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: slow -provisioner: kubernetes.io/gce-pd -parameters: - type: pd-standard - zone: us-central1-a diff --git a/examples/persistent-volume-provisioning/glusterfs/glusterfs-secret.yaml b/examples/persistent-volume-provisioning/glusterfs/glusterfs-secret.yaml deleted file mode 100644 index bb9c806a26..0000000000 --- a/examples/persistent-volume-provisioning/glusterfs/glusterfs-secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: heketi-secret - namespace: default -data: - # base64 encoded password. E.g.: echo -n "mypassword" | base64 - key: bXlwYXNzd29yZA== -type: kubernetes.io/glusterfs diff --git a/examples/persistent-volume-provisioning/glusterfs/glusterfs-storageclass.yaml b/examples/persistent-volume-provisioning/glusterfs/glusterfs-storageclass.yaml deleted file mode 100644 index b42eabe7de..0000000000 --- a/examples/persistent-volume-provisioning/glusterfs/glusterfs-storageclass.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: fast -provisioner: kubernetes.io/glusterfs -parameters: - resturl: "http://127.0.0.1:8081" - clusterid: "630372ccdc720a92c681fb928f27b53f" - restuser: "admin" - secretNamespace: "default" - secretName: "heketi-secret" - gidMin: "40000" - gidMax: "50000" - volumetype: "replicate:3" - volumeoptions: "client.ssl on, server.ssl on" - volumenameprefix: "dept-dev" diff --git a/examples/persistent-volume-provisioning/quobyte/example-pod.yaml b/examples/persistent-volume-provisioning/quobyte/example-pod.yaml deleted file mode 100644 index eb814f552a..0000000000 --- a/examples/persistent-volume-provisioning/quobyte/example-pod.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: server -spec: - replicas: 1 - selector: - role: server - template: - metadata: - labels: - role: server - spec: - containers: - - name: server - image: nginx - volumeMounts: - - mountPath: /var/lib/www/html - name: quobytepvc - volumes: - - name: quobytepvc - persistentVolumeClaim: - claimName: claim1 diff --git a/examples/persistent-volume-provisioning/quobyte/quobyte-admin-secret.yaml b/examples/persistent-volume-provisioning/quobyte/quobyte-admin-secret.yaml deleted file mode 100644 index 24cc767738..0000000000 --- a/examples/persistent-volume-provisioning/quobyte/quobyte-admin-secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: quobyte-admin-secret -type: "kubernetes.io/quobyte" -data: - password: cXVvYnl0ZQ== - user: YWRtaW4= -type: kubernetes.io/quobyte diff --git a/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml b/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml deleted file mode 100644 index b9679d61df..0000000000 --- a/examples/persistent-volume-provisioning/quobyte/quobyte-storage-class.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: storage.k8s.io/v1 -kind: StorageClass -metadata: - name: slow -provisioner: kubernetes.io/quobyte -parameters: - quobyteAPIServer: "http://138.68.74.142:7860" - registry: "138.68.74.142:7861" - adminSecretName: "quobyte-admin-secret" - adminSecretNamespace: "kube-system" - user: "root" - group: "root" - quobyteConfig: "BASE" - quobyteTenant: "DEFAULT" - createQuota: "False" diff --git a/examples/persistent-volume-provisioning/rbd/ceph-secret-admin.yaml b/examples/persistent-volume-provisioning/rbd/ceph-secret-admin.yaml deleted file mode 100644 index 894a9df6b4..0000000000 --- a/examples/persistent-volume-provisioning/rbd/ceph-secret-admin.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: ceph-secret-admin -type: "kubernetes.io/rbd" -data: -#Please note this value is base64 encoded. - key: QVFEQ1pMdFhPUnQrSmhBQUFYaERWNHJsZ3BsMmNjcDR6RFZST0E9PQ== diff --git a/examples/persistent-volume-provisioning/rbd/ceph-secret-user.yaml b/examples/persistent-volume-provisioning/rbd/ceph-secret-user.yaml deleted file mode 100644 index e538dcafb5..0000000000 --- a/examples/persistent-volume-provisioning/rbd/ceph-secret-user.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: ceph-secret-user -type: "kubernetes.io/rbd" -data: -#Please note this value is base64 encoded. - key: QVFBTWdYaFZ3QkNlRGhBQTlubFBhRnlmVVNhdEdENGRyRldEdlE9PQ== diff --git a/examples/persistent-volume-provisioning/rbd/pod.yaml b/examples/persistent-volume-provisioning/rbd/pod.yaml deleted file mode 100644 index 6eea26f94f..0000000000 --- a/examples/persistent-volume-provisioning/rbd/pod.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: server -spec: - replicas: 1 - selector: - role: server - template: - metadata: - labels: - role: server - spec: - containers: - - name: server - image: nginx - volumeMounts: - - mountPath: /var/lib/www/html - name: mypvc - volumes: - - name: mypvc - persistentVolumeClaim: - claimName: claim1 diff --git a/examples/phabricator/README.md b/examples/phabricator/README.md deleted file mode 100644 index b33ddb2557..0000000000 --- a/examples/phabricator/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/phabricator/README.md](https://github.com/kubernetes/examples/blob/master/staging/phabricator/README.md) diff --git a/examples/phabricator/phabricator-controller.json b/examples/phabricator/phabricator-controller.json deleted file mode 100644 index b13103e11d..0000000000 --- a/examples/phabricator/phabricator-controller.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "kind": "ReplicationController", - "apiVersion": "v1", - "metadata": { - "name": "phabricator-controller", - "labels": { - "name": "phabricator" - } - }, - "spec": { - "replicas": 1, - "selector": { - "name": "phabricator" - }, - "template": { - "metadata": { - "labels": { - "name": "phabricator" - } - }, - "spec": { - "containers": [ - { - "name": "phabricator", - "image": "fgrzadkowski/example-php-phabricator", - "ports": [ - { - "name": "http-server", - "containerPort": 80 - } - ], - "env": [ - { - "name": "MYSQL_SERVICE_IP", - "value": "1.2.3.4" - }, - { - "name": "MYSQL_SERVICE_PORT", - "value": "3306" - }, - { - "name": "MYSQL_PASSWORD", - "value": "1234" - } - ] - } - ] - } - } - } -} diff --git a/examples/phabricator/phabricator-service.json b/examples/phabricator/phabricator-service.json deleted file mode 100644 index b2ec74cf4e..0000000000 --- a/examples/phabricator/phabricator-service.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "phabricator" - }, - "spec": { - "ports": [ - { - "port": 80, - "targetPort": "http-server" - } - ], - "selector": { - "name": "phabricator" - }, - "type": "LoadBalancer" - } -} diff --git a/examples/phabricator/php-phabricator/000-default.conf b/examples/phabricator/php-phabricator/000-default.conf deleted file mode 100644 index 2ec64d6879..0000000000 --- a/examples/phabricator/php-phabricator/000-default.conf +++ /dev/null @@ -1,12 +0,0 @@ - - Require all granted - - - - DocumentRoot /home/www-data/phabricator/webroot - - RewriteEngine on - RewriteRule ^/rsrc/(.*) - [L,QSA] - RewriteRule ^/favicon.ico - [L,QSA] - RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA] - diff --git a/examples/phabricator/php-phabricator/Dockerfile b/examples/phabricator/php-phabricator/Dockerfile deleted file mode 100644 index 779e799ce6..0000000000 --- a/examples/phabricator/php-phabricator/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM ubuntu:14.04 - -# Install all the required packages. -RUN apt-get update && \ - apt-get -y install \ - git apache2 dpkg-dev python-pygments \ - php5 php5-mysql php5-gd php5-dev php5-curl php-apc php5-cli php5-json php5-xhprof && \ - apt-get -y clean autoclean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -#Configure php -RUN a2enmod rewrite && \ - apt-get source php5 && \ - (cd `ls -1F | grep '^php5-.*/$'`/ext/pcntl && phpize && ./configure && make && sudo make install) - -# Load code source. -RUN mkdir /home/www-data -RUN cd /home/www-data && git clone https://github.com/phacility/libphutil.git && \ - cd /home/www-data && git clone https://github.com/phacility/arcanist.git && \ - cd /home/www-data && git clone https://github.com/phacility/phabricator.git && \ - chown -R www-data /home/www-data && \ - chgrp -R www-data /home/www-data - -ADD 000-default.conf /etc/apache2/sites-available/000-default.conf -ADD run.sh /run.sh -RUN chmod a+x /*.sh - -# Run Apache2. -EXPOSE 80 -CMD ["/run.sh"] diff --git a/examples/phabricator/php-phabricator/run.sh b/examples/phabricator/php-phabricator/run.sh deleted file mode 100755 index 1f2b8387f4..0000000000 --- a/examples/phabricator/php-phabricator/run.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -echo "MySQL host IP ${MYSQL_SERVICE_IP} port ${MYSQL_SERVICE_PORT}." -/home/www-data/phabricator/bin/config set mysql.host $MYSQL_SERVICE_IP -/home/www-data/phabricator/bin/config set mysql.port $MYSQL_SERVICE_PORT -/home/www-data/phabricator/bin/config set mysql.pass $MYSQL_PASSWORD - -echo "Running storage upgrade" -/home/www-data/phabricator/bin/storage --force upgrade || exit 1 - -source /etc/apache2/envvars -echo "Starting Apache2" -apache2 -D FOREGROUND - diff --git a/examples/phabricator/setup.sh b/examples/phabricator/setup.sh deleted file mode 100755 index 588b1f5f93..0000000000 --- a/examples/phabricator/setup.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -echo "Create Phabricator replication controller" && kubectl create -f phabricator-controller.json -echo "Create Phabricator service" && kubectl create -f phabricator-service.json -echo "Create firewall rule" && gcloud compute firewall-rules create phabricator-node-80 --allow=tcp:80 --target-tags kubernetes-node - diff --git a/examples/phabricator/teardown.sh b/examples/phabricator/teardown.sh deleted file mode 100755 index 266313912b..0000000000 --- a/examples/phabricator/teardown.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -echo "Deleting Phabricator service" && kubectl delete -f phabricator-service.json -echo "Deleting Phabricator replication controller" && kubectl delete rc phabricator-controller -echo "Delete firewall rule" && gcloud compute firewall-rules delete -q phabricator-node-80 - diff --git a/examples/podsecuritypolicy/OWNERS b/examples/podsecuritypolicy/OWNERS deleted file mode 100644 index 63eee4bb6d..0000000000 --- a/examples/podsecuritypolicy/OWNERS +++ /dev/null @@ -1,11 +0,0 @@ -approvers: - - deads2k - - ericchiang - - liggitt - - tallclair -reviewers: - - deads2k - - ericchiang - - liggitt - - php-coder - - tallclair diff --git a/examples/podsecuritypolicy/rbac/README.md b/examples/podsecuritypolicy/rbac/README.md deleted file mode 100644 index 66af1b7c1e..0000000000 --- a/examples/podsecuritypolicy/rbac/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/podsecuritypolicy/rbac/README.md](https://github.com/kubernetes/examples/blob/master/staging/podsecuritypolicy/rbac/README.md) diff --git a/examples/podsecuritypolicy/rbac/bindings.yaml b/examples/podsecuritypolicy/rbac/bindings.yaml deleted file mode 100644 index f61b73b21a..0000000000 --- a/examples/podsecuritypolicy/rbac/bindings.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# privileged-psp-users gives the privileged-psp-user role -# to the group privileged-psp-users. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: privileged-psp-users -subjects: -- kind: Group - apiGroup: rbac.authorization.k8s.io - name: privileged-psp-users -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: privileged-psp-user ---- -# restricted-psp-users grants the restricted-psp-user role to -# the groups restricted-psp-users and privileged-psp-users. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: restricted-psp-users -subjects: -- kind: Group - apiGroup: rbac.authorization.k8s.io - name: restricted-psp-users -- kind: Group - apiGroup: rbac.authorization.k8s.io - name: privileged-psp-users -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: restricted-psp-user ---- -# edit grants edit role to the groups -# restricted-psp-users and privileged-psp-users. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: edit -subjects: -- kind: Group - apiGroup: rbac.authorization.k8s.io - name: privileged-psp-users -- kind: Group - apiGroup: rbac.authorization.k8s.io - name: restricted-psp-users -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: edit diff --git a/examples/podsecuritypolicy/rbac/pod.yaml b/examples/podsecuritypolicy/rbac/pod.yaml deleted file mode 100644 index 5b7b1efdcb..0000000000 --- a/examples/podsecuritypolicy/rbac/pod.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: nginx - labels: - name: nginx -spec: - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 diff --git a/examples/podsecuritypolicy/rbac/pod_priv.yaml b/examples/podsecuritypolicy/rbac/pod_priv.yaml deleted file mode 100644 index 6c638c4499..0000000000 --- a/examples/podsecuritypolicy/rbac/pod_priv.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: nginx - labels: - name: nginx -spec: - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 - securityContext: - privileged: true diff --git a/examples/podsecuritypolicy/rbac/policies.yaml b/examples/podsecuritypolicy/rbac/policies.yaml deleted file mode 100644 index d8c0ca0636..0000000000 --- a/examples/podsecuritypolicy/rbac/policies.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: privileged -spec: - fsGroup: - rule: RunAsAny - privileged: true - runAsUser: - rule: RunAsAny - seLinux: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - volumes: - - '*' - allowedCapabilities: - - '*' - hostPID: true - hostIPC: true - hostNetwork: true - hostPorts: - - min: 1 - max: 65536 ---- -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: restricted -spec: - privileged: false - fsGroup: - rule: RunAsAny - runAsUser: - rule: MustRunAsNonRoot - seLinux: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - volumes: - - 'emptyDir' - - 'secret' - - 'downwardAPI' - - 'configMap' - - 'persistentVolumeClaim' - - 'projected' - hostPID: false - hostIPC: false - hostNetwork: false diff --git a/examples/podsecuritypolicy/rbac/roles.yaml b/examples/podsecuritypolicy/rbac/roles.yaml deleted file mode 100644 index 55d591d5dd..0000000000 --- a/examples/podsecuritypolicy/rbac/roles.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# restricted-psp-user grants access to use the restricted PSP. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: restricted-psp-user -rules: -- apiGroups: - - policy - resources: - - podsecuritypolicies - resourceNames: - - restricted - verbs: - - use ---- -# privileged-psp-user grants access to use the privileged PSP. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: privileged-psp-user -rules: -- apiGroups: - - policy - resources: - - podsecuritypolicies - resourceNames: - - privileged - verbs: - - use - - diff --git a/examples/runtime-constraints/README.md b/examples/runtime-constraints/README.md deleted file mode 100644 index 3f245a12d4..0000000000 --- a/examples/runtime-constraints/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/runtime-constraints/README.md](https://github.com/kubernetes/examples/blob/master/staging/runtime-constraints/README.md) diff --git a/examples/scheduler-policy-config-with-extender.json b/examples/scheduler-policy-config-with-extender.json deleted file mode 100644 index cc1a9bd6fb..0000000000 --- a/examples/scheduler-policy-config-with-extender.json +++ /dev/null @@ -1,30 +0,0 @@ -{ -"kind" : "Policy", -"apiVersion" : "v1", -"predicates" : [ - {"name" : "PodFitsHostPorts"}, - {"name" : "PodFitsResources"}, - {"name" : "NoDiskConflict"}, - {"name" : "MatchNodeSelector"}, - {"name" : "HostName"} - ], -"priorities" : [ - {"name" : "LeastRequestedPriority", "weight" : 1}, - {"name" : "BalancedResourceAllocation", "weight" : 1}, - {"name" : "ServiceSpreadingPriority", "weight" : 1}, - {"name" : "EqualPriority", "weight" : 1} - ], -"extenders" : [ - { - "urlPrefix": "http://127.0.0.1:12346/scheduler", - "filterVerb": "filter", - "bindVerb": "bind", - "prioritizeVerb": "prioritize", - "weight": 5, - "enableHttps": false, - "nodeCacheCapable": false - } - ], -"hardPodAffinitySymmetricWeight" : 10, -"alwaysCheckAllPredicates" : false -} diff --git a/examples/scheduler-policy-config.json b/examples/scheduler-policy-config.json deleted file mode 100644 index 048299e5e3..0000000000 --- a/examples/scheduler-policy-config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ -"kind" : "Policy", -"apiVersion" : "v1", -"predicates" : [ - {"name" : "PodFitsHostPorts"}, - {"name" : "PodFitsResources"}, - {"name" : "NoDiskConflict"}, - {"name" : "NoVolumeZoneConflict"}, - {"name" : "MatchNodeSelector"}, - {"name" : "HostName"} - ], -"priorities" : [ - {"name" : "LeastRequestedPriority", "weight" : 1}, - {"name" : "BalancedResourceAllocation", "weight" : 1}, - {"name" : "ServiceSpreadingPriority", "weight" : 1}, - {"name" : "EqualPriority", "weight" : 1} - ], -"hardPodAffinitySymmetricWeight" : 10, -"alwaysCheckAllPredicates" : false -} diff --git a/examples/selenium/README.md b/examples/selenium/README.md deleted file mode 100644 index e365937118..0000000000 --- a/examples/selenium/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/selenium/README.md](https://github.com/kubernetes/examples/blob/master/staging/selenium/README.md) diff --git a/examples/selenium/selenium-hub-rc.yaml b/examples/selenium/selenium-hub-rc.yaml deleted file mode 100644 index f48510e1ce..0000000000 --- a/examples/selenium/selenium-hub-rc.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: selenium-hub - labels: - app: selenium-hub -spec: - replicas: 1 - selector: - app: selenium-hub - template: - metadata: - labels: - app: selenium-hub - spec: - containers: - - name: selenium-hub - image: selenium/hub:2.53.0 - ports: - - containerPort: 4444 - resources: - limits: - memory: "1000Mi" - cpu: ".5" - livenessProbe: - httpGet: - path: /grid/console - port: 4444 - initialDelaySeconds: 30 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: /grid/console - port: 4444 - initialDelaySeconds: 30 - timeoutSeconds: 5 diff --git a/examples/selenium/selenium-hub-svc.yaml b/examples/selenium/selenium-hub-svc.yaml deleted file mode 100644 index 0b252ede37..0000000000 --- a/examples/selenium/selenium-hub-svc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: selenium-hub - labels: - app: selenium-hub -spec: - ports: - - port: 4444 - targetPort: 4444 - name: port0 - selector: - app: selenium-hub - type: NodePort - sessionAffinity: None diff --git a/examples/selenium/selenium-node-chrome-rc.yaml b/examples/selenium/selenium-node-chrome-rc.yaml deleted file mode 100644 index 3c49c1b43d..0000000000 --- a/examples/selenium/selenium-node-chrome-rc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: selenium-node-chrome - labels: - app: selenium-node-chrome -spec: - replicas: 2 - selector: - app: selenium-node-chrome - template: - metadata: - labels: - app: selenium-node-chrome - spec: - containers: - - name: selenium-node-chrome - image: selenium/node-chrome-debug:2.53.0 - ports: - - containerPort: 5900 - env: - - name: HUB_PORT_4444_TCP_ADDR - value: "selenium-hub" - - name: HUB_PORT_4444_TCP_PORT - value: "4444" - resources: - limits: - memory: "1000Mi" - cpu: ".5" diff --git a/examples/selenium/selenium-node-firefox-rc.yaml b/examples/selenium/selenium-node-firefox-rc.yaml deleted file mode 100644 index d6f6657858..0000000000 --- a/examples/selenium/selenium-node-firefox-rc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: selenium-node-firefox - labels: - app: selenium-node-firefox -spec: - replicas: 2 - selector: - app: selenium-node-firefox - template: - metadata: - labels: - app: selenium-node-firefox - spec: - containers: - - name: selenium-node-firefox - image: selenium/node-firefox-debug:2.53.0 - ports: - - containerPort: 5900 - env: - - name: HUB_PORT_4444_TCP_ADDR - value: "selenium-hub" - - name: HUB_PORT_4444_TCP_PORT - value: "4444" - resources: - limits: - memory: "1000Mi" - cpu: ".5" diff --git a/examples/selenium/selenium-test.py b/examples/selenium/selenium-test.py deleted file mode 100644 index 80d598a3b1..0000000000 --- a/examples/selenium/selenium-test.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -from selenium import webdriver -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities - -def check_browser(browser): - driver = webdriver.Remote( - command_executor='http://selenium-hub:4444/wd/hub', - desired_capabilities=getattr(DesiredCapabilities, browser) - ) - driver.get("http://google.com") - assert "google" in driver.page_source - driver.close() - print("Browser %s checks out!" % browser) - - -check_browser("FIREFOX") -check_browser("CHROME") - diff --git a/examples/sharing-clusters/BUILD b/examples/sharing-clusters/BUILD deleted file mode 100644 index bc1611f874..0000000000 --- a/examples/sharing-clusters/BUILD +++ /dev/null @@ -1,37 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "sharing-clusters", - embed = [":go_default_library"], -) - -go_library( - name = "go_default_library", - srcs = ["make_secret.go"], - importpath = "k8s.io/kubernetes/examples/sharing-clusters", - deps = [ - "//pkg/api/legacyscheme:go_default_library", - "//pkg/apis/core:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/examples/sharing-clusters/README.md b/examples/sharing-clusters/README.md deleted file mode 100644 index ffd44e29a6..0000000000 --- a/examples/sharing-clusters/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/sharing-clusters/README.md](https://github.com/kubernetes/examples/blob/master/staging/sharing-clusters/README.md) diff --git a/examples/sharing-clusters/make_secret.go b/examples/sharing-clusters/make_secret.go deleted file mode 100644 index ece55eab33..0000000000 --- a/examples/sharing-clusters/make_secret.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -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 tiny script to help conver a given kubeconfig into a secret. -package main - -import ( - "flag" - "fmt" - "io/ioutil" - "log" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/pkg/api/legacyscheme" - api "k8s.io/kubernetes/pkg/apis/core" -) - -// TODO: -// Add a -o flag that writes to the specified destination file. -var ( - kubeconfig = flag.String("kubeconfig", "", "path to kubeconfig file.") - name = flag.String("name", "kubeconfig", "name to use in the metadata of the secret.") - ns = flag.String("ns", "default", "namespace of the secret.") -) - -func read(file string) []byte { - b, err := ioutil.ReadFile(file) - if err != nil { - log.Fatalf("Cannot read file %v, %v", file, err) - } - return b -} - -func main() { - flag.Parse() - if *kubeconfig == "" { - log.Fatalf("Need to specify --kubeconfig") - } - cfg := read(*kubeconfig) - secret := &api.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: *name, - Namespace: *ns, - }, - Data: map[string][]byte{ - "config": cfg, - }, - } - fmt.Printf(runtime.EncodeOrDie(legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.EnabledVersions()...), secret)) -} diff --git a/examples/simple-nginx.md b/examples/simple-nginx.md deleted file mode 100644 index 4d9bb95147..0000000000 --- a/examples/simple-nginx.md +++ /dev/null @@ -1,62 +0,0 @@ -## Running your first containers in Kubernetes - -Ok, you've run one of the [getting started guides](https://kubernetes.io/docs/getting-started-guides/) and you have -successfully turned up a Kubernetes cluster. Now what? This guide will help you get oriented -to Kubernetes and running your first containers on the cluster. - -### Running a container (simple version) - -From this point onwards, it is assumed that `kubectl` is on your path from one of the getting started guides. - -The [`kubectl run`](https://kubernetes.io/docs/user-guide/kubectl/kubectl_run.md) line below will create two [nginx](https://registry.hub.docker.com/_/nginx/) [pods](https://kubernetes.io/docs/user-guide/pods.md) listening on port 80. It will also create a [deployment](https://kubernetes.io/docs/user-guide/deployments.md) named `my-nginx` to ensure that there are always two pods running. - -```bash -kubectl run my-nginx --image=nginx --replicas=2 --port=80 -``` - -Once the pods are created, you can list them to see what is up and running: - -```bash -kubectl get pods -``` - -You can also see the deployment that was created: - -```bash -kubectl get deployment -``` - -### Exposing your pods to the internet. - -On some platforms (for example Google Compute Engine) the kubectl command can integrate with your cloud provider to add a [public IP address](https://kubernetes.io/docs/user-guide/services.md#publishing-services---service-types) for the pods, -to do this run: - -```bash -kubectl expose deployment my-nginx --port=80 --type=LoadBalancer -``` - -This should print the service that has been created, and map an external IP address to the service. Where to find this external IP address will depend on the environment you run in. For instance, for Google Compute Engine the external IP address is listed as part of the newly created service and can be retrieved by running - -```bash -kubectl get services -``` - -In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a firewall to allow traffic on port 80. - -### Cleanup - -To delete the two replicated containers, delete the deployment: - -```bash -kubectl delete deployment my-nginx -``` - -### Next: Configuration files - -Most people will eventually want to use declarative configuration files for creating/modifying their applications. A [simplified introduction](https://kubernetes.io/docs/user-guide/deploying-applications.md) -is given in a different document. - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/simple-nginx.md?pixel)]() - diff --git a/examples/spark/README.md b/examples/spark/README.md deleted file mode 100644 index edfe3efd23..0000000000 --- a/examples/spark/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/spark/README.md](https://github.com/kubernetes/examples/blob/master/staging/spark/README.md) diff --git a/examples/spark/namespace-spark-cluster.yaml b/examples/spark/namespace-spark-cluster.yaml deleted file mode 100644 index 1f3dce83cf..0000000000 --- a/examples/spark/namespace-spark-cluster.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "spark-cluster" - labels: - name: "spark-cluster" diff --git a/examples/spark/spark-gluster/README.md b/examples/spark/spark-gluster/README.md deleted file mode 100644 index 07d2a8d0f3..0000000000 --- a/examples/spark/spark-gluster/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/spark/spark-gluster/README.md](https://github.com/kubernetes/examples/blob/master/staging/spark/spark-gluster/README.md) diff --git a/examples/spark/spark-gluster/glusterfs-endpoints.yaml b/examples/spark/spark-gluster/glusterfs-endpoints.yaml deleted file mode 100644 index 357fdb7664..0000000000 --- a/examples/spark/spark-gluster/glusterfs-endpoints.yaml +++ /dev/null @@ -1,14 +0,0 @@ -kind: Endpoints -apiVersion: v1 -metadata: - name: glusterfs-cluster - namespace: spark-cluster -subsets: - - addresses: - - ip: 192.168.30.104 - ports: - - port: 1 - - addresses: - - ip: 192.168.30.105 - ports: - - port: 1 diff --git a/examples/spark/spark-gluster/spark-master-controller.yaml b/examples/spark/spark-gluster/spark-master-controller.yaml deleted file mode 100644 index 28cb6ac3fb..0000000000 --- a/examples/spark/spark-gluster/spark-master-controller.yaml +++ /dev/null @@ -1,34 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: spark-master-controller - namespace: spark-cluster - labels: - component: spark-master -spec: - replicas: 1 - selector: - component: spark-master - template: - metadata: - labels: - component: spark-master - spec: - containers: - - name: spark-master - image: k8s.gcr.io/spark:1.5.2_v1 - command: ["/start-master"] - ports: - - containerPort: 7077 - volumeMounts: - - mountPath: /mnt/glusterfs - name: glusterfsvol - resources: - requests: - cpu: 100m - volumes: - - name: glusterfsvol - glusterfs: - endpoints: glusterfs-cluster - path: MyVolume - readOnly: false diff --git a/examples/spark/spark-gluster/spark-master-service.yaml b/examples/spark/spark-gluster/spark-master-service.yaml deleted file mode 100644 index 2f5bdb15dc..0000000000 --- a/examples/spark/spark-gluster/spark-master-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: spark-master - namespace: spark-cluster - labels: - component: spark-master-service -spec: - ports: - - port: 7077 - targetPort: 7077 - selector: - component: spark-master diff --git a/examples/spark/spark-gluster/spark-worker-controller.yaml b/examples/spark/spark-gluster/spark-worker-controller.yaml deleted file mode 100644 index 0030d8a667..0000000000 --- a/examples/spark/spark-gluster/spark-worker-controller.yaml +++ /dev/null @@ -1,35 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: spark-gluster-worker-controller - namespace: spark-cluster - labels: - component: spark-worker -spec: - replicas: 2 - selector: - component: spark-worker - template: - metadata: - labels: - component: spark-worker - uses: spark-master - spec: - containers: - - name: spark-worker - image: k8s.gcr.io/spark:1.5.2_v1 - command: ["/start-worker"] - ports: - - containerPort: 8888 - volumeMounts: - - mountPath: /mnt/glusterfs - name: glusterfsvol - resources: - requests: - cpu: 100m - volumes: - - name: glusterfsvol - glusterfs: - endpoints: glusterfs-cluster - path: MyVolume - readOnly: false diff --git a/examples/spark/spark-master-controller.yaml b/examples/spark/spark-master-controller.yaml deleted file mode 100644 index ceaef078d2..0000000000 --- a/examples/spark/spark-master-controller.yaml +++ /dev/null @@ -1,23 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: spark-master-controller -spec: - replicas: 1 - selector: - component: spark-master - template: - metadata: - labels: - component: spark-master - spec: - containers: - - name: spark-master - image: k8s.gcr.io/spark:1.5.2_v1 - command: ["/start-master"] - ports: - - containerPort: 7077 - - containerPort: 8080 - resources: - requests: - cpu: 100m diff --git a/examples/spark/spark-master-service.yaml b/examples/spark/spark-master-service.yaml deleted file mode 100644 index 794147d287..0000000000 --- a/examples/spark/spark-master-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: spark-master -spec: - ports: - - port: 7077 - targetPort: 7077 - name: spark - - port: 8080 - targetPort: 8080 - name: http - selector: - component: spark-master diff --git a/examples/spark/spark-ui-proxy-controller.yaml b/examples/spark/spark-ui-proxy-controller.yaml deleted file mode 100644 index 3bd0566cd0..0000000000 --- a/examples/spark/spark-ui-proxy-controller.yaml +++ /dev/null @@ -1,29 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: spark-ui-proxy-controller -spec: - replicas: 1 - selector: - component: spark-ui-proxy - template: - metadata: - labels: - component: spark-ui-proxy - spec: - containers: - - name: spark-ui-proxy - image: elsonrodriguez/spark-ui-proxy:1.0 - ports: - - containerPort: 80 - resources: - requests: - cpu: 100m - args: - - spark-master:8080 - livenessProbe: - httpGet: - path: / - port: 80 - initialDelaySeconds: 120 - timeoutSeconds: 5 diff --git a/examples/spark/spark-ui-proxy-service.yaml b/examples/spark/spark-ui-proxy-service.yaml deleted file mode 100644 index ebd6b7c94c..0000000000 --- a/examples/spark/spark-ui-proxy-service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: spark-ui-proxy -spec: - ports: - - port: 80 - targetPort: 80 - selector: - component: spark-ui-proxy - type: LoadBalancer diff --git a/examples/spark/spark-worker-controller.yaml b/examples/spark/spark-worker-controller.yaml deleted file mode 100644 index 3e5ed50ce0..0000000000 --- a/examples/spark/spark-worker-controller.yaml +++ /dev/null @@ -1,23 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: spark-worker-controller -spec: - replicas: 2 - selector: - component: spark-worker - template: - metadata: - labels: - component: spark-worker - spec: - containers: - - name: spark-worker - image: k8s.gcr.io/spark:1.5.2_v1 - command: ["/start-worker"] - ports: - - containerPort: 8081 - resources: - requests: - cpu: 100m - diff --git a/examples/spark/zeppelin-controller.yaml b/examples/spark/zeppelin-controller.yaml deleted file mode 100644 index 2f578fcfc2..0000000000 --- a/examples/spark/zeppelin-controller.yaml +++ /dev/null @@ -1,21 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: zeppelin-controller -spec: - replicas: 1 - selector: - component: zeppelin - template: - metadata: - labels: - component: zeppelin - spec: - containers: - - name: zeppelin - image: k8s.gcr.io/zeppelin:v0.5.6_v1 - ports: - - containerPort: 8080 - resources: - requests: - cpu: 100m diff --git a/examples/spark/zeppelin-service.yaml b/examples/spark/zeppelin-service.yaml deleted file mode 100644 index f2c7838ad0..0000000000 --- a/examples/spark/zeppelin-service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: zeppelin -spec: - ports: - - port: 80 - targetPort: 8080 - selector: - component: zeppelin - type: LoadBalancer diff --git a/examples/storage/cassandra/README.md b/examples/storage/cassandra/README.md deleted file mode 100644 index 52b4a9e554..0000000000 --- a/examples/storage/cassandra/README.md +++ /dev/null @@ -1 +0,0 @@ -This example has been moved to [https://github.com/kubernetes/examples/blob/master/cassandra](https://github.com/kubernetes/examples/blob/master/cassandra) diff --git a/examples/storage/hazelcast/README.md b/examples/storage/hazelcast/README.md deleted file mode 100644 index fd46e27573..0000000000 --- a/examples/storage/hazelcast/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storage/hazelcast/README.md](https://github.com/kubernetes/examples/blob/master/staging/storage/hazelcast/README.md) diff --git a/examples/storage/hazelcast/hazelcast-deployment.yaml b/examples/storage/hazelcast/hazelcast-deployment.yaml deleted file mode 100644 index bbf61b092c..0000000000 --- a/examples/storage/hazelcast/hazelcast-deployment.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: hazelcast - labels: - name: hazelcast -spec: - template: - metadata: - labels: - name: hazelcast - spec: - containers: - - name: hazelcast - image: quay.io/pires/hazelcast-kubernetes:3.8_1 - imagePullPolicy: Always - env: - - name: "DNS_DOMAIN" - value: "cluster.local" - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - ports: - - name: hazelcast - containerPort: 5701 diff --git a/examples/storage/hazelcast/hazelcast-service.yaml b/examples/storage/hazelcast/hazelcast-service.yaml deleted file mode 100644 index 0c9dc55da5..0000000000 --- a/examples/storage/hazelcast/hazelcast-service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - name: hazelcast - name: hazelcast -spec: - ports: - - port: 5701 - selector: - name: hazelcast diff --git a/examples/storage/minio/README.md b/examples/storage/minio/README.md deleted file mode 100644 index 43b3a6e6b9..0000000000 --- a/examples/storage/minio/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storage/minio/README.md](https://github.com/kubernetes/examples/blob/master/staging/storage/minio/README.md) diff --git a/examples/storage/minio/minio-distributed-headless-service.yaml b/examples/storage/minio/minio-distributed-headless-service.yaml deleted file mode 100644 index a822d76eba..0000000000 --- a/examples/storage/minio/minio-distributed-headless-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: minio - labels: - app: minio -spec: - clusterIP: None - ports: - - port: 9000 - name: minio - selector: - app: minio diff --git a/examples/storage/minio/minio-distributed-service.yaml b/examples/storage/minio/minio-distributed-service.yaml deleted file mode 100644 index 60514a8636..0000000000 --- a/examples/storage/minio/minio-distributed-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: minio-service -spec: - type: LoadBalancer - ports: - - port: 9000 - targetPort: 9000 - protocol: TCP - selector: - app: minio diff --git a/examples/storage/minio/minio-distributed-statefulset.yaml b/examples/storage/minio/minio-distributed-statefulset.yaml deleted file mode 100644 index de6eef0a9f..0000000000 --- a/examples/storage/minio/minio-distributed-statefulset.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: apps/v1beta2 -kind: StatefulSet -metadata: - name: minio -spec: - selector: - matchLabels: - app: minio - serviceName: minio - replicas: 4 - template: - metadata: - annotations: - pod.alpha.kubernetes.io/initialized: "true" - labels: - app: minio - spec: - containers: - - name: minio - env: - - name: MINIO_ACCESS_KEY - value: "minio" - - name: MINIO_SECRET_KEY - value: "minio123" - image: minio/minio:latest - args: - - server - - http://minio-0.minio.default.svc.cluster.local/data - - http://minio-1.minio.default.svc.cluster.local/data - - http://minio-2.minio.default.svc.cluster.local/data - - http://minio-3.minio.default.svc.cluster.local/data - ports: - - containerPort: 9000 - hostPort: 9000 - # These volume mounts are persistent. Each pod in the StatefulSet - # gets a volume mounted based on this field. - volumeMounts: - - name: data - mountPath: /data - # These are converted to volume claims by the controller - # and mounted at the paths mentioned above. - volumeClaimTemplates: - - metadata: - name: data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi diff --git a/examples/storage/minio/minio-standalone-deployment.yaml b/examples/storage/minio/minio-standalone-deployment.yaml deleted file mode 100644 index a6dee7d03c..0000000000 --- a/examples/storage/minio/minio-standalone-deployment.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - # This name uniquely identifies the Deployment - name: minio-deployment -spec: - selector: - matchLabels: - app: minio - strategy: - type: Recreate - template: - metadata: - labels: - # Label is used as selector in the service. - app: minio - spec: - # Refer to the PVC created earlier - volumes: - - name: storage - persistentVolumeClaim: - # Name of the PVC created earlier - claimName: minio-pv-claim - containers: - - name: minio - # Pulls the default Minio image from Docker Hub - image: minio/minio:latest - args: - - server - - /storage - env: - # Minio access key and secret key - - name: MINIO_ACCESS_KEY - value: "minio" - - name: MINIO_SECRET_KEY - value: "minio123" - ports: - - containerPort: 9000 - hostPort: 9000 - # Mount the volume into the pod - volumeMounts: - - name: storage # must match the volume name, above - mountPath: "/storage" diff --git a/examples/storage/minio/minio-standalone-pvc.yaml b/examples/storage/minio/minio-standalone-pvc.yaml deleted file mode 100644 index 66b1c9800f..0000000000 --- a/examples/storage/minio/minio-standalone-pvc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - # This name uniquely identifies the PVC. Will be used in deployment below. - name: minio-pv-claim - labels: - app: minio-storage-claim -spec: - # Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes - accessModes: - - ReadWriteOnce - resources: - # This is the request for storage. Should be available in the cluster. - requests: - storage: 10Gi diff --git a/examples/storage/minio/minio-standalone-service.yaml b/examples/storage/minio/minio-standalone-service.yaml deleted file mode 100644 index 60514a8636..0000000000 --- a/examples/storage/minio/minio-standalone-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: minio-service -spec: - type: LoadBalancer - ports: - - port: 9000 - targetPort: 9000 - protocol: TCP - selector: - app: minio diff --git a/examples/storage/mysql-galera/README.md b/examples/storage/mysql-galera/README.md deleted file mode 100644 index 1930bad244..0000000000 --- a/examples/storage/mysql-galera/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storage/mysql-galera/README.md](https://github.com/kubernetes/examples/blob/master/staging/storage/mysql-galera/README.md) diff --git a/examples/storage/mysql-galera/image/Dockerfile b/examples/storage/mysql-galera/image/Dockerfile deleted file mode 100644 index 53a068c8c9..0000000000 --- a/examples/storage/mysql-galera/image/Dockerfile +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM ubuntu:trusty - -# add our user and group first to make sure their IDs get assigned -# consistently, regardless of whatever dependencies get added -RUN groupadd -r mysql && useradd -r -g mysql mysql - -ENV PERCONA_XTRADB_VERSION 5.6 -ENV MYSQL_VERSION 5.6 -ENV TERM linux - -RUN apt-get update -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* - -RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 8507EFA5 - -RUN echo "deb http://repo.percona.com/apt trusty main" > /etc/apt/sources.list.d/percona.list -RUN echo "deb-src http://repo.percona.com/apt trusty main" >> /etc/apt/sources.list.d/percona.list - -# the "/var/lib/mysql" stuff here is because the mysql-server -# postinst doesn't have an explicit way to disable the -# mysql_install_db codepath besides having a database already -# "configured" (ie, stuff in /var/lib/mysql/mysql) -# also, we set debconf keys to make APT a little quieter -RUN { \ - echo percona-server-server-5.6 percona-server-server/data-dir select ''; \ - echo percona-server-server-5.6 percona-server-server/root_password password ''; \ - } | debconf-set-selections \ - && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y percona-xtradb-cluster-client-"${MYSQL_VERSION}" \ - percona-xtradb-cluster-common-"${MYSQL_VERSION}" percona-xtradb-cluster-server-"${MYSQL_VERSION}" \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql && chown -R mysql:mysql /var/lib/mysql - -VOLUME /var/lib/mysql - -COPY my.cnf /etc/mysql/my.cnf -COPY cluster.cnf /etc/mysql/conf.d/cluster.cnf - -COPY docker-entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] - -EXPOSE 3306 4444 4567 4568 -CMD ["mysqld"] diff --git a/examples/storage/mysql-galera/image/cluster.cnf b/examples/storage/mysql-galera/image/cluster.cnf deleted file mode 100644 index 87d70442a5..0000000000 --- a/examples/storage/mysql-galera/image/cluster.cnf +++ /dev/null @@ -1,12 +0,0 @@ -[mysqld] - -wsrep_provider=/usr/lib/libgalera_smm.so -wsrep_cluster_address=gcomm:// -binlog_format=ROW -default_storage_engine=InnoDB -innodb_autoinc_lock_mode=2 - -wsrep_sst_method=xtrabackup-v2 -wsrep_node_address=127.0.0.1 -wsrep_cluster_name=galera_kubernetes -wsrep_sst_auth=sstuser:changethis diff --git a/examples/storage/mysql-galera/image/docker-entrypoint.sh b/examples/storage/mysql-galera/image/docker-entrypoint.sh deleted file mode 100755 index 50185562f7..0000000000 --- a/examples/storage/mysql-galera/image/docker-entrypoint.sh +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# -# This script does the following: -# -# 1. Sets up database privileges by building an SQL script -# 2. MySQL is initially started with this script a first time -# 3. Modify my.cnf and cluster.cnf to reflect available nodes to join -# - -# if NUM_NODES not passed, default to 3 -if [ -z "$NUM_NODES" ]; then - NUM_NODES=3 -fi - -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -# if the command passed is 'mysqld' via CMD, then begin processing. -if [ "$1" = 'mysqld' ]; then - # read DATADIR from the MySQL config - DATADIR="$("$@" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" - - # only check if system tables not created from mysql_install_db and permissions - # set with initial SQL script before proceeding to build SQL script - if [ ! -d "$DATADIR/mysql" ]; then - # fail if user didn't supply a root password - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' - echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' - exit 1 - fi - - # mysql_install_db installs system tables - echo 'Running mysql_install_db ...' - mysql_install_db --datadir="$DATADIR" - echo 'Finished mysql_install_db' - - # this script will be run once when MySQL first starts to set up - # prior to creating system tables and will ensure proper user permissions - tempSqlFile='/tmp/mysql-first-time.sql' - cat > "$tempSqlFile" <<-EOSQL -DELETE FROM mysql.user ; -CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; -GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; -EOSQL - - if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" - fi - - if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" >> "$tempSqlFile" - - if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" >> "$tempSqlFile" - fi - fi - - # Add SST (Single State Transfer) user if Clustering is turned on - if [ -n "$GALERA_CLUSTER" ]; then - # this is the Single State Transfer user (SST, initial dump or xtrabackup user) - WSREP_SST_USER=${WSREP_SST_USER:-"sst"} - if [ -z "$WSREP_SST_PASSWORD" ]; then - echo >&2 'error: Galera cluster is enabled and WSREP_SST_PASSWORD is not set' - echo >&2 ' Did you forget to add -e WSREP_SST__PASSWORD=... ?' - exit 1 - fi - # add single state transfer (SST) user privileges - echo "CREATE USER '${WSREP_SST_USER}'@'localhost' IDENTIFIED BY '${WSREP_SST_PASSWORD}';" >> "$tempSqlFile" - echo "GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '${WSREP_SST_USER}'@'localhost';" >> "$tempSqlFile" - fi - - echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" - - # Add the SQL file to mysqld's command line args - set -- "$@" --init-file="$tempSqlFile" - fi - - chown -R mysql:mysql "$DATADIR" -fi - -# if cluster is turned on, then proceed to build cluster setting strings -# that will be interpolated into the config files -if [ -n "$GALERA_CLUSTER" ]; then - # this is the Single State Transfer user (SST, initial dump or xtrabackup user) - WSREP_SST_USER=${WSREP_SST_USER:-"sst"} - if [ -z "$WSREP_SST_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and WSREP_SST_PASSWORD not set' - echo >&2 ' Did you forget to add -e WSREP_SST_PASSWORD=xxx ?' - exit 1 - fi - - # user/password for SST user - sed -i -e "s|^wsrep_sst_auth=sstuser:changethis|wsrep_sst_auth=${WSREP_SST_USER}:${WSREP_SST_PASSWORD}|" /etc/mysql/conf.d/cluster.cnf - - # set nodes own address - WSREP_NODE_ADDRESS=`ip addr show | grep -E '^[ ]*inet' | grep -m1 global | awk '{ print $2 }' | sed -e 's/\/.*//'` - if [ -n "$WSREP_NODE_ADDRESS" ]; then - sed -i -e "s|^wsrep_node_address=.*$|wsrep_node_address=${WSREP_NODE_ADDRESS}|" /etc/mysql/conf.d/cluster.cnf - fi - - # if the string is not defined or it only is 'gcomm://', this means bootstrap - if [ -z "$WSREP_CLUSTER_ADDRESS" -o "$WSREP_CLUSTER_ADDRESS" == "gcomm://" ]; then - # if empty, set to 'gcomm://' - # NOTE: this list does not imply membership. - # It only means "obtain SST and join from one of these..." - if [ -z "$WSREP_CLUSTER_ADDRESS" ]; then - WSREP_CLUSTER_ADDRESS="gcomm://" - fi - - # loop through number of nodes - for NUM in `seq 1 $NUM_NODES`; do - NODE_SERVICE_HOST="PXC_NODE${NUM}_SERVICE_HOST" - - # if set - if [ -n "${!NODE_SERVICE_HOST}" ]; then - # if not its own IP, then add it - if [ $(expr "$HOSTNAME" : "pxc-node${NUM}") -eq 0 ]; then - # if not the first bootstrap node add comma - if [ $WSREP_CLUSTER_ADDRESS != "gcomm://" ]; then - WSREP_CLUSTER_ADDRESS="${WSREP_CLUSTER_ADDRESS}," - fi - # append - # if user specifies USE_IP, use that - if [ -n "${USE_IP}" ]; then - WSREP_CLUSTER_ADDRESS="${WSREP_CLUSTER_ADDRESS}"${!NODE_SERVICE_HOST} - # otherwise use DNS - else - WSREP_CLUSTER_ADDRESS="${WSREP_CLUSTER_ADDRESS}pxc-node${NUM}" - fi - fi - fi - done - fi - - # WSREP_CLUSTER_ADDRESS is now complete and will be interpolated into the - # cluster address string (wsrep_cluster_address) in the cluster - # configuration file, cluster.cnf - if [ -n "$WSREP_CLUSTER_ADDRESS" -a "$WSREP_CLUSTER_ADDRESS" != "gcomm://" ]; then - sed -i -e "s|^wsrep_cluster_address=gcomm://|wsrep_cluster_address=${WSREP_CLUSTER_ADDRESS}|" /etc/mysql/conf.d/cluster.cnf - fi -fi - -# random server ID needed -sed -i -e "s/^server\-id=.*$/server-id=${RANDOM}/" /etc/mysql/my.cnf - -# finally, start mysql -exec "$@" diff --git a/examples/storage/mysql-galera/image/my.cnf b/examples/storage/mysql-galera/image/my.cnf deleted file mode 100644 index 078bd6fe63..0000000000 --- a/examples/storage/mysql-galera/image/my.cnf +++ /dev/null @@ -1,55 +0,0 @@ -[client] -port=3306 -socket=/var/run/mysqld/mysqld.sock - -[mysqld_safe] -socket=/var/run/mysqld/mysqld.sock -nice=0 - -[mysqld] -user=mysql -pid-file=/var/run/mysqld/mysqld.pid -socket=/var/run/mysqld/mysqld.sock -port=3306 -basedir=/usr -datadir=/var/lib/mysql -tmpdir=/tmp -lc-messages-dir=/usr/share/mysql -skip-external-locking - -key_buffer=16M -max_allowed_packet=16M -thread_stack=192K -thread_cache_size=8 - -myisam-recover=BACKUP -#max_connections=100 -query_cache_limit=1M -query_cache_size=16M -slow_query_log=1 -slow_query_log_file=/var/log/mysql/mysql-slow.log -long_query_time=2 -log-queries-not-using-indexes - -server-id=12345 -log_bin=/var/log/mysql/mysql-bin.log -expire_logs_days=4 -max_binlog_size=100M - -default_storage_engine=InnoDB -innodb_file_per_table -innodb_log_file_size=100M -innodb_log_buffer_size=10M -innodb_log_files_in_group=2 -innodb_buffer_pool_instances=4 -innodb_buffer_pool_size=100M - -[mysqldump] -quick -quote-names -max_allowed_packet=16M - -[isamchk] -key_buffer=16M - -!includedir /etc/mysql/conf.d/ diff --git a/examples/storage/mysql-galera/pxc-cluster-service.yaml b/examples/storage/mysql-galera/pxc-cluster-service.yaml deleted file mode 100644 index f0bfd5e9a8..0000000000 --- a/examples/storage/mysql-galera/pxc-cluster-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: pxc-cluster - labels: - unit: pxc-cluster -spec: - ports: - - port: 3306 - name: mysql - selector: - unit: pxc-cluster \ No newline at end of file diff --git a/examples/storage/mysql-galera/pxc-node1.yaml b/examples/storage/mysql-galera/pxc-node1.yaml deleted file mode 100644 index fa1163bdcb..0000000000 --- a/examples/storage/mysql-galera/pxc-node1.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: pxc-node1 - labels: - node: pxc-node1 -spec: - ports: - - port: 3306 - name: mysql - - port: 4444 - name: state-snapshot-transfer - - port: 4567 - name: replication-traffic - - port: 4568 - name: incremental-state-transfer - selector: - node: pxc-node1 ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: pxc-node1 -spec: - replicas: 1 - template: - metadata: - labels: - node: pxc-node1 - unit: pxc-cluster - spec: - containers: - - resources: - limits: - cpu: 0.3 - image: capttofu/percona_xtradb_cluster_5_6:beta - name: pxc-node1 - ports: - - containerPort: 3306 - - containerPort: 4444 - - containerPort: 4567 - - containerPort: 4568 - env: - - name: GALERA_CLUSTER - value: "true" - - name: WSREP_CLUSTER_ADDRESS - value: gcomm:// - - name: WSREP_SST_USER - value: sst - - name: WSREP_SST_PASSWORD - value: sst - - name: MYSQL_USER - value: mysql - - name: MYSQL_PASSWORD - value: mysql - - name: MYSQL_ROOT_PASSWORD - value: c-krit diff --git a/examples/storage/mysql-galera/pxc-node2.yaml b/examples/storage/mysql-galera/pxc-node2.yaml deleted file mode 100644 index ead3675d74..0000000000 --- a/examples/storage/mysql-galera/pxc-node2.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: pxc-node2 - labels: - node: pxc-node2 -spec: - ports: - - port: 3306 - name: mysql - - port: 4444 - name: state-snapshot-transfer - - port: 4567 - name: replication-traffic - - port: 4568 - name: incremental-state-transfer - selector: - node: pxc-node2 - ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: pxc-node2 -spec: - replicas: 1 - template: - metadata: - labels: - node: pxc-node2 - unit: pxc-cluster - spec: - containers: - - resources: - limits: - cpu: 0.3 - image: capttofu/percona_xtradb_cluster_5_6:beta - name: pxc-node2 - ports: - - containerPort: 3306 - - containerPort: 4444 - - containerPort: 4567 - - containerPort: 4568 - env: - - name: GALERA_CLUSTER - value: "true" - - name: WSREP_CLUSTER_ADDRESS - value: gcomm:// - - name: WSREP_SST_USER - value: sst - - name: WSREP_SST_PASSWORD - value: sst - - name: MYSQL_USER - value: mysql - - name: MYSQL_PASSWORD - value: mysql - - name: MYSQL_ROOT_PASSWORD - value: c-krit diff --git a/examples/storage/mysql-galera/pxc-node3.yaml b/examples/storage/mysql-galera/pxc-node3.yaml deleted file mode 100644 index fbb368b27d..0000000000 --- a/examples/storage/mysql-galera/pxc-node3.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: pxc-node3 - labels: - node: pxc-node3 -spec: - ports: - - port: 3306 - name: mysql - - port: 4444 - name: state-snapshot-transfer - - port: 4567 - name: replication-traffic - - port: 4568 - name: incremental-state-transfer - selector: - node: pxc-node3 - ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: pxc-node3 -spec: - replicas: 1 - template: - metadata: - labels: - node: pxc-node3 - unit: pxc-cluster - spec: - containers: - - resources: - limits: - cpu: 0.3 - image: capttofu/percona_xtradb_cluster_5_6:beta - name: pxc-node3 - ports: - - containerPort: 3306 - - containerPort: 4444 - - containerPort: 4567 - - containerPort: 4568 - env: - - name: GALERA_CLUSTER - value: "true" - - name: WSREP_CLUSTER_ADDRESS - value: gcomm:// - - name: WSREP_SST_USER - value: sst - - name: WSREP_SST_PASSWORD - value: sst - - name: MYSQL_USER - value: mysql - - name: MYSQL_PASSWORD - value: mysql - - name: MYSQL_ROOT_PASSWORD - value: c-krit diff --git a/examples/storage/redis/README.md b/examples/storage/redis/README.md deleted file mode 100644 index c24b9702f5..0000000000 --- a/examples/storage/redis/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storage/redis/README.md](https://github.com/kubernetes/examples/blob/master/staging/storage/redis/README.md) diff --git a/examples/storage/redis/image/Dockerfile b/examples/storage/redis/image/Dockerfile deleted file mode 100644 index 9f619a5ade..0000000000 --- a/examples/storage/redis/image/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM alpine:3.4 - -RUN apk add --no-cache redis sed bash - -COPY redis-master.conf /redis-master/redis.conf -COPY redis-slave.conf /redis-slave/redis.conf -COPY run.sh /run.sh - -CMD [ "/run.sh" ] - -ENTRYPOINT [ "bash", "-c" ] diff --git a/examples/storage/redis/image/redis-master.conf b/examples/storage/redis/image/redis-master.conf deleted file mode 100644 index 29ae1bb412..0000000000 --- a/examples/storage/redis/image/redis-master.conf +++ /dev/null @@ -1,828 +0,0 @@ -# Redis configuration file example - -# Note on units: when memory size is needed, it is possible to specify -# it in the usual form of 1k 5GB 4M and so forth: -# -# 1k => 1000 bytes -# 1kb => 1024 bytes -# 1m => 1000000 bytes -# 1mb => 1024*1024 bytes -# 1g => 1000000000 bytes -# 1gb => 1024*1024*1024 bytes -# -# units are case insensitive so 1GB 1Gb 1gB are all the same. - -################################## INCLUDES ################################### - -# Include one or more other config files here. This is useful if you -# have a standard template that goes to all Redis servers but also need -# to customize a few per-server settings. Include files can include -# other files, so use this wisely. -# -# Notice option "include" won't be rewritten by command "CONFIG REWRITE" -# from admin or Redis Sentinel. Since Redis always uses the last processed -# line as value of a configuration directive, you'd better put includes -# at the beginning of this file to avoid overwriting config change at runtime. -# -# If instead you are interested in using includes to override configuration -# options, it is better to use include as the last line. -# -# include /path/to/local.conf -# include /path/to/other.conf - -################################ GENERAL ##################################### - -# By default Redis does not run as a daemon. Use 'yes' if you need it. -# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. -daemonize no - -# When running daemonized, Redis writes a pid file in /var/run/redis.pid by -# default. You can specify a custom pid file location here. -pidfile /var/run/redis.pid - -# Accept connections on the specified port, default is 6379. -# If port 0 is specified Redis will not listen on a TCP socket. -port 6379 - -# TCP listen() backlog. -# -# In high requests-per-second environments you need an high backlog in order -# to avoid slow clients connections issues. Note that the Linux kernel -# will silently truncate it to the value of /proc/sys/net/core/somaxconn so -# make sure to raise both the value of somaxconn and tcp_max_syn_backlog -# in order to get the desired effect. -tcp-backlog 511 - -# By default Redis listens for connections from all the network interfaces -# available on the server. It is possible to listen to just one or multiple -# interfaces using the "bind" configuration directive, followed by one or -# more IP addresses. -# -# Examples: -# -# bind 192.168.1.100 10.0.0.1 - -bind 0.0.0.0 - -# Specify the path for the Unix socket that will be used to listen for -# incoming connections. There is no default, so Redis will not listen -# on a unix socket when not specified. -# -# unixsocket /tmp/redis.sock -# unixsocketperm 700 - -# Close the connection after a client is idle for N seconds (0 to disable) -timeout 0 - -# TCP keepalive. -# -# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence -# of communication. This is useful for two reasons: -# -# 1) Detect dead peers. -# 2) Take the connection alive from the point of view of network -# equipment in the middle. -# -# On Linux, the specified value (in seconds) is the period used to send ACKs. -# Note that to close the connection the double of the time is needed. -# On other kernels the period depends on the kernel configuration. -# -# A reasonable value for this option is 60 seconds. -tcp-keepalive 60 - -# Specify the server verbosity level. -# This can be one of: -# debug (a lot of information, useful for development/testing) -# verbose (many rarely useful info, but not a mess like the debug level) -# notice (moderately verbose, what you want in production probably) -# warning (only very important / critical messages are logged) -loglevel notice - -# Specify the log file name. Also the empty string can be used to force -# Redis to log on the standard output. Note that if you use standard -# output for logging but daemonize, logs will be sent to /dev/null -logfile "" - -# To enable logging to the system logger, just set 'syslog-enabled' to yes, -# and optionally update the other syslog parameters to suit your needs. -# syslog-enabled no - -# Specify the syslog identity. -# syslog-ident redis - -# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. -# syslog-facility local0 - -# Set the number of databases. The default database is DB 0, you can select -# a different one on a per-connection basis using SELECT where -# dbid is a number between 0 and 'databases'-1 -databases 16 - -################################ SNAPSHOTTING ################################ -# -# Save the DB on disk: -# -# save -# -# Will save the DB if both the given number of seconds and the given -# number of write operations against the DB occurred. -# -# In the example below the behaviour will be to save: -# after 900 sec (15 min) if at least 1 key changed -# after 300 sec (5 min) if at least 10 keys changed -# after 60 sec if at least 10000 keys changed -# -# Note: you can disable saving completely by commenting out all "save" lines. -# -# It is also possible to remove all the previously configured save -# points by adding a save directive with a single empty string argument -# like in the following example: -# -# save "" - -save 900 1 -save 300 10 -save 60 10000 - -# By default Redis will stop accepting writes if RDB snapshots are enabled -# (at least one save point) and the latest background save failed. -# This will make the user aware (in a hard way) that data is not persisting -# on disk properly, otherwise chances are that no one will notice and some -# disaster will happen. -# -# If the background saving process will start working again Redis will -# automatically allow writes again. -# -# However if you have setup your proper monitoring of the Redis server -# and persistence, you may want to disable this feature so that Redis will -# continue to work as usual even if there are problems with disk, -# permissions, and so forth. -stop-writes-on-bgsave-error yes - -# Compress string objects using LZF when dump .rdb databases? -# For default that's set to 'yes' as it's almost always a win. -# If you want to save some CPU in the saving child set it to 'no' but -# the dataset will likely be bigger if you have compressible values or keys. -rdbcompression yes - -# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. -# This makes the format more resistant to corruption but there is a performance -# hit to pay (around 10%) when saving and loading RDB files, so you can disable it -# for maximum performances. -# -# RDB files created with checksum disabled have a checksum of zero that will -# tell the loading code to skip the check. -rdbchecksum yes - -# The filename where to dump the DB -dbfilename dump.rdb - -# The working directory. -# -# The DB will be written inside this directory, with the filename specified -# above using the 'dbfilename' configuration directive. -# -# The Append Only File will also be created inside this directory. -# -# Note that you must specify a directory here, not a file name. -dir /redis-master-data - -################################# REPLICATION ################################# - -# Master-Slave replication. Use slaveof to make a Redis instance a copy of -# another Redis server. A few things to understand ASAP about Redis replication. -# -# 1) Redis replication is asynchronous, but you can configure a master to -# stop accepting writes if it appears to be not connected with at least -# a given number of slaves. -# 2) Redis slaves are able to perform a partial resynchronization with the -# master if the replication link is lost for a relatively small amount of -# time. You may want to configure the replication backlog size (see the next -# sections of this file) with a sensible value depending on your needs. -# 3) Replication is automatic and does not need user intervention. After a -# network partition slaves automatically try to reconnect to masters -# and resynchronize with them. -# -# slaveof - -# If the master is password protected (using the "requirepass" configuration -# directive below) it is possible to tell the slave to authenticate before -# starting the replication synchronization process, otherwise the master will -# refuse the slave request. -# -# masterauth - -# When a slave loses its connection with the master, or when the replication -# is still in progress, the slave can act in two different ways: -# -# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will -# still reply to client requests, possibly with out of date data, or the -# data set may just be empty if this is the first synchronization. -# -# 2) if slave-serve-stale-data is set to 'no' the slave will reply with -# an error "SYNC with master in progress" to all the kind of commands -# but to INFO and SLAVEOF. -# -slave-serve-stale-data yes - -# You can configure a slave instance to accept writes or not. Writing against -# a slave instance may be useful to store some ephemeral data (because data -# written on a slave will be easily deleted after resync with the master) but -# may also cause problems if clients are writing to it because of a -# misconfiguration. -# -# Since Redis 2.6 by default slaves are read-only. -# -# Note: read only slaves are not designed to be exposed to untrusted clients -# on the internet. It's just a protection layer against misuse of the instance. -# Still a read only slave exports by default all the administrative commands -# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve -# security of read only slaves using 'rename-command' to shadow all the -# administrative / dangerous commands. -slave-read-only yes - -# Replication SYNC strategy: disk or socket. -# -# ------------------------------------------------------- -# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY -# ------------------------------------------------------- -# -# New slaves and reconnecting slaves that are not able to continue the replication -# process just receiving differences, need to do what is called a "full -# synchronization". An RDB file is transmitted from the master to the slaves. -# The transmission can happen in two different ways: -# -# 1) Disk-backed: The Redis master creates a new process that writes the RDB -# file on disk. Later the file is transferred by the parent -# process to the slaves incrementally. -# 2) Diskless: The Redis master creates a new process that directly writes the -# RDB file to slave sockets, without touching the disk at all. -# -# With disk-backed replication, while the RDB file is generated, more slaves -# can be queued and served with the RDB file as soon as the current child producing -# the RDB file finishes its work. With diskless replication instead once -# the transfer starts, new slaves arriving will be queued and a new transfer -# will start when the current one terminates. -# -# When diskless replication is used, the master waits a configurable amount of -# time (in seconds) before starting the transfer in the hope that multiple slaves -# will arrive and the transfer can be parallelized. -# -# With slow disks and fast (large bandwidth) networks, diskless replication -# works better. -repl-diskless-sync no - -# When diskless replication is enabled, it is possible to configure the delay -# the server waits in order to spawn the child that trnasfers the RDB via socket -# to the slaves. -# -# This is important since once the transfer starts, it is not possible to serve -# new slaves arriving, that will be queued for the next RDB transfer, so the server -# waits a delay in order to let more slaves arrive. -# -# The delay is specified in seconds, and by default is 5 seconds. To disable -# it entirely just set it to 0 seconds and the transfer will start ASAP. -repl-diskless-sync-delay 5 - -# Slaves send PINGs to server in a predefined interval. It's possible to change -# this interval with the repl_ping_slave_period option. The default value is 10 -# seconds. -# -# repl-ping-slave-period 10 - -# The following option sets the replication timeout for: -# -# 1) Bulk transfer I/O during SYNC, from the point of view of slave. -# 2) Master timeout from the point of view of slaves (data, pings). -# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). -# -# It is important to make sure that this value is greater than the value -# specified for repl-ping-slave-period otherwise a timeout will be detected -# every time there is low traffic between the master and the slave. -# -# repl-timeout 60 - -# Disable TCP_NODELAY on the slave socket after SYNC? -# -# If you select "yes" Redis will use a smaller number of TCP packets and -# less bandwidth to send data to slaves. But this can add a delay for -# the data to appear on the slave side, up to 40 milliseconds with -# Linux kernels using a default configuration. -# -# If you select "no" the delay for data to appear on the slave side will -# be reduced but more bandwidth will be used for replication. -# -# By default we optimize for low latency, but in very high traffic conditions -# or when the master and slaves are many hops away, turning this to "yes" may -# be a good idea. -repl-disable-tcp-nodelay no - -# Set the replication backlog size. The backlog is a buffer that accumulates -# slave data when slaves are disconnected for some time, so that when a slave -# wants to reconnect again, often a full resync is not needed, but a partial -# resync is enough, just passing the portion of data the slave missed while -# disconnected. -# -# The bigger the replication backlog, the longer the time the slave can be -# disconnected and later be able to perform a partial resynchronization. -# -# The backlog is only allocated once there is at least a slave connected. -# -# repl-backlog-size 1mb - -# After a master has no longer connected slaves for some time, the backlog -# will be freed. The following option configures the amount of seconds that -# need to elapse, starting from the time the last slave disconnected, for -# the backlog buffer to be freed. -# -# A value of 0 means to never release the backlog. -# -# repl-backlog-ttl 3600 - -# The slave priority is an integer number published by Redis in the INFO output. -# It is used by Redis Sentinel in order to select a slave to promote into a -# master if the master is no longer working correctly. -# -# A slave with a low priority number is considered better for promotion, so -# for instance if there are three slaves with priority 10, 100, 25 Sentinel will -# pick the one with priority 10, that is the lowest. -# -# However a special priority of 0 marks the slave as not able to perform the -# role of master, so a slave with priority of 0 will never be selected by -# Redis Sentinel for promotion. -# -# By default the priority is 100. -slave-priority 100 - -# It is possible for a master to stop accepting writes if there are less than -# N slaves connected, having a lag less or equal than M seconds. -# -# The N slaves need to be in "online" state. -# -# The lag in seconds, that must be <= the specified value, is calculated from -# the last ping received from the slave, that is usually sent every second. -# -# This option does not GUARANTEE that N replicas will accept the write, but -# will limit the window of exposure for lost writes in case not enough slaves -# are available, to the specified number of seconds. -# -# For example to require at least 3 slaves with a lag <= 10 seconds use: -# -# min-slaves-to-write 3 -# min-slaves-max-lag 10 -# -# Setting one or the other to 0 disables the feature. -# -# By default min-slaves-to-write is set to 0 (feature disabled) and -# min-slaves-max-lag is set to 10. - -################################## SECURITY ################################### - -# Require clients to issue AUTH before processing any other -# commands. This might be useful in environments in which you do not trust -# others with access to the host running redis-server. -# -# This should stay commented out for backward compatibility and because most -# people do not need auth (e.g. they run their own servers). -# -# Warning: since Redis is pretty fast an outside user can try up to -# 150k passwords per second against a good box. This means that you should -# use a very strong password otherwise it will be very easy to break. -# -# requirepass foobared - -# Command renaming. -# -# It is possible to change the name of dangerous commands in a shared -# environment. For instance the CONFIG command may be renamed into something -# hard to guess so that it will still be available for internal-use tools -# but not available for general clients. -# -# Example: -# -# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 -# -# It is also possible to completely kill a command by renaming it into -# an empty string: -# -# rename-command CONFIG "" -# -# Please note that changing the name of commands that are logged into the -# AOF file or transmitted to slaves may cause problems. - -################################### LIMITS #################################### - -# Set the max number of connected clients at the same time. By default -# this limit is set to 10000 clients, however if the Redis server is not -# able to configure the process file limit to allow for the specified limit -# the max number of allowed clients is set to the current file limit -# minus 32 (as Redis reserves a few file descriptors for internal uses). -# -# Once the limit is reached Redis will close all the new connections sending -# an error 'max number of clients reached'. -# -# maxclients 10000 - -# Don't use more memory than the specified amount of bytes. -# When the memory limit is reached Redis will try to remove keys -# according to the eviction policy selected (see maxmemory-policy). -# -# If Redis can't remove keys according to the policy, or if the policy is -# set to 'noeviction', Redis will start to reply with errors to commands -# that would use more memory, like SET, LPUSH, and so on, and will continue -# to reply to read-only commands like GET. -# -# This option is usually useful when using Redis as an LRU cache, or to set -# a hard memory limit for an instance (using the 'noeviction' policy). -# -# WARNING: If you have slaves attached to an instance with maxmemory on, -# the size of the output buffers needed to feed the slaves are subtracted -# from the used memory count, so that network problems / resyncs will -# not trigger a loop where keys are evicted, and in turn the output -# buffer of slaves is full with DELs of keys evicted triggering the deletion -# of more keys, and so forth until the database is completely emptied. -# -# In short... if you have slaves attached it is suggested that you set a lower -# limit for maxmemory so that there is some free RAM on the system for slave -# output buffers (but this is not needed if the policy is 'noeviction'). -# -# maxmemory - -# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory -# is reached. You can select among five behaviors: -# -# volatile-lru -> remove the key with an expire set using an LRU algorithm -# allkeys-lru -> remove any key according to the LRU algorithm -# volatile-random -> remove a random key with an expire set -# allkeys-random -> remove a random key, any key -# volatile-ttl -> remove the key with the nearest expire time (minor TTL) -# noeviction -> don't expire at all, just return an error on write operations -# -# Note: with any of the above policies, Redis will return an error on write -# operations, when there are no suitable keys for eviction. -# -# At the date of writing these commands are: set setnx setex append -# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd -# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby -# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby -# getset mset msetnx exec sort -# -# The default is: -# -# maxmemory-policy volatile-lru - -# LRU and minimal TTL algorithms are not precise algorithms but approximated -# algorithms (in order to save memory), so you can select as well the sample -# size to check. For instance for default Redis will check three keys and -# pick the one that was used less recently, you can change the sample size -# using the following configuration directive. -# -# maxmemory-samples 3 - -############################## APPEND ONLY MODE ############################### - -# By default Redis asynchronously dumps the dataset on disk. This mode is -# good enough in many applications, but an issue with the Redis process or -# a power outage may result into a few minutes of writes lost (depending on -# the configured save points). -# -# The Append Only File is an alternative persistence mode that provides -# much better durability. For instance using the default data fsync policy -# (see later in the config file) Redis can lose just one second of writes in a -# dramatic event like a server power outage, or a single write if something -# wrong with the Redis process itself happens, but the operating system is -# still running correctly. -# -# AOF and RDB persistence can be enabled at the same time without problems. -# If the AOF is enabled on startup Redis will load the AOF, that is the file -# with the better durability guarantees. -# -# Please check http://redis.io/topics/persistence for more information. - -appendonly yes - -# The name of the append only file (default: "appendonly.aof") - -appendfilename "appendonly.aof" - -# The fsync() call tells the Operating System to actually write data on disk -# instead of waiting for more data in the output buffer. Some OS will really flush -# data on disk, some other OS will just try to do it ASAP. -# -# Redis supports three different modes: -# -# no: don't fsync, just let the OS flush the data when it wants. Faster. -# always: fsync after every write to the append only log. Slow, Safest. -# everysec: fsync only one time every second. Compromise. -# -# The default is "everysec", as that's usually the right compromise between -# speed and data safety. It's up to you to understand if you can relax this to -# "no" that will let the operating system flush the output buffer when -# it wants, for better performances (but if you can live with the idea of -# some data loss consider the default persistence mode that's snapshotting), -# or on the contrary, use "always" that's very slow but a bit safer than -# everysec. -# -# More details please check the following article: -# http://antirez.com/post/redis-persistence-demystified.html -# -# If unsure, use "everysec". - -# appendfsync always -appendfsync everysec -# appendfsync no - -# When the AOF fsync policy is set to always or everysec, and a background -# saving process (a background save or AOF log background rewriting) is -# performing a lot of I/O against the disk, in some Linux configurations -# Redis may block too long on the fsync() call. Note that there is no fix for -# this currently, as even performing fsync in a different thread will block -# our synchronous write(2) call. -# -# In order to mitigate this problem it's possible to use the following option -# that will prevent fsync() from being called in the main process while a -# BGSAVE or BGREWRITEAOF is in progress. -# -# This means that while another child is saving, the durability of Redis is -# the same as "appendfsync none". In practical terms, this means that it is -# possible to lose up to 30 seconds of log in the worst scenario (with the -# default Linux settings). -# -# If you have latency problems turn this to "yes". Otherwise leave it as -# "no" that is the safest pick from the point of view of durability. - -no-appendfsync-on-rewrite no - -# Automatic rewrite of the append only file. -# Redis is able to automatically rewrite the log file implicitly calling -# BGREWRITEAOF when the AOF log size grows by the specified percentage. -# -# This is how it works: Redis remembers the size of the AOF file after the -# latest rewrite (if no rewrite has happened since the restart, the size of -# the AOF at startup is used). -# -# This base size is compared to the current size. If the current size is -# bigger than the specified percentage, the rewrite is triggered. Also -# you need to specify a minimal size for the AOF file to be rewritten, this -# is useful to avoid rewriting the AOF file even if the percentage increase -# is reached but it is still pretty small. -# -# Specify a percentage of zero in order to disable the automatic AOF -# rewrite feature. - -auto-aof-rewrite-percentage 100 -auto-aof-rewrite-min-size 64mb - -# An AOF file may be found to be truncated at the end during the Redis -# startup process, when the AOF data gets loaded back into memory. -# This may happen when the system where Redis is running -# crashes, especially when an ext4 filesystem is mounted without the -# data=ordered option (however this can't happen when Redis itself -# crashes or aborts but the operating system still works correctly). -# -# Redis can either exit with an error when this happens, or load as much -# data as possible (the default now) and start if the AOF file is found -# to be truncated at the end. The following option controls this behavior. -# -# If aof-load-truncated is set to yes, a truncated AOF file is loaded and -# the Redis server starts emitting a log to inform the user of the event. -# Otherwise if the option is set to no, the server aborts with an error -# and refuses to start. When the option is set to no, the user requires -# to fix the AOF file using the "redis-check-aof" utility before to restart -# the server. -# -# Note that if the AOF file will be found to be corrupted in the middle -# the server will still exit with an error. This option only applies when -# Redis will try to read more data from the AOF file but not enough bytes -# will be found. -aof-load-truncated yes - -################################ LUA SCRIPTING ############################### - -# Max execution time of a Lua script in milliseconds. -# -# If the maximum execution time is reached Redis will log that a script is -# still in execution after the maximum allowed time and will start to -# reply to queries with an error. -# -# When a long running script exceeds the maximum execution time only the -# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be -# used to stop a script that did not yet called write commands. The second -# is the only way to shut down the server in the case a write command was -# already issued by the script but the user doesn't want to wait for the natural -# termination of the script. -# -# Set it to 0 or a negative value for unlimited execution without warnings. -lua-time-limit 5000 - -################################## SLOW LOG ################################### - -# The Redis Slow Log is a system to log queries that exceeded a specified -# execution time. The execution time does not include the I/O operations -# like talking with the client, sending the reply and so forth, -# but just the time needed to actually execute the command (this is the only -# stage of command execution where the thread is blocked and can not serve -# other requests in the meantime). -# -# You can configure the slow log with two parameters: one tells Redis -# what is the execution time, in microseconds, to exceed in order for the -# command to get logged, and the other parameter is the length of the -# slow log. When a new command is logged the oldest one is removed from the -# queue of logged commands. - -# The following time is expressed in microseconds, so 1000000 is equivalent -# to one second. Note that a negative number disables the slow log, while -# a value of zero forces the logging of every command. -slowlog-log-slower-than 10000 - -# There is no limit to this length. Just be aware that it will consume memory. -# You can reclaim memory used by the slow log with SLOWLOG RESET. -slowlog-max-len 128 - -################################ LATENCY MONITOR ############################## - -# The Redis latency monitoring subsystem samples different operations -# at runtime in order to collect data related to possible sources of -# latency of a Redis instance. -# -# Via the LATENCY command this information is available to the user that can -# print graphs and obtain reports. -# -# The system only logs operations that were performed in a time equal or -# greater than the amount of milliseconds specified via the -# latency-monitor-threshold configuration directive. When its value is set -# to zero, the latency monitor is turned off. -# -# By default latency monitoring is disabled since it is mostly not needed -# if you don't have latency issues, and collecting data has a performance -# impact, that while very small, can be measured under big load. Latency -# monitoring can easily be enabled at runtime using the command -# "CONFIG SET latency-monitor-threshold " if needed. -latency-monitor-threshold 0 - -############################# Event notification ############################## - -# Redis can notify Pub/Sub clients about events happening in the key space. -# This feature is documented at http://redis.io/topics/notifications -# -# For instance if keyspace events notification is enabled, and a client -# performs a DEL operation on key "foo" stored in the Database 0, two -# messages will be published via Pub/Sub: -# -# PUBLISH __keyspace@0__:foo del -# PUBLISH __keyevent@0__:del foo -# -# It is possible to select the events that Redis will notify among a set -# of classes. Every class is identified by a single character: -# -# K Keyspace events, published with __keyspace@__ prefix. -# E Keyevent events, published with __keyevent@__ prefix. -# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... -# $ String commands -# l List commands -# s Set commands -# h Hash commands -# z Sorted set commands -# x Expired events (events generated every time a key expires) -# e Evicted events (events generated when a key is evicted for maxmemory) -# A Alias for g$lshzxe, so that the "AKE" string means all the events. -# -# The "notify-keyspace-events" takes as argument a string that is composed -# of zero or multiple characters. The empty string means that notifications -# are disabled. -# -# Example: to enable list and generic events, from the point of view of the -# event name, use: -# -# notify-keyspace-events Elg -# -# Example 2: to get the stream of the expired keys subscribing to channel -# name __keyevent@0__:expired use: -# -# notify-keyspace-events Ex -# -# By default all notifications are disabled because most users don't need -# this feature and the feature has some overhead. Note that if you don't -# specify at least one of K or E, no events will be delivered. -notify-keyspace-events "" - -############################### ADVANCED CONFIG ############################### - -# Hashes are encoded using a memory efficient data structure when they have a -# small number of entries, and the biggest entry does not exceed a given -# threshold. These thresholds can be configured using the following directives. -hash-max-ziplist-entries 512 -hash-max-ziplist-value 64 - -# Similarly to hashes, small lists are also encoded in a special way in order -# to save a lot of space. The special representation is only used when -# you are under the following limits: -list-max-ziplist-entries 512 -list-max-ziplist-value 64 - -# Sets have a special encoding in just one case: when a set is composed -# of just strings that happen to be integers in radix 10 in the range -# of 64 bit signed integers. -# The following configuration setting sets the limit in the size of the -# set in order to use this special memory saving encoding. -set-max-intset-entries 512 - -# Similarly to hashes and lists, sorted sets are also specially encoded in -# order to save a lot of space. This encoding is only used when the length and -# elements of a sorted set are below the following limits: -zset-max-ziplist-entries 128 -zset-max-ziplist-value 64 - -# HyperLogLog sparse representation bytes limit. The limit includes the -# 16 bytes header. When an HyperLogLog using the sparse representation crosses -# this limit, it is converted into the dense representation. -# -# A value greater than 16000 is totally useless, since at that point the -# dense representation is more memory efficient. -# -# The suggested value is ~ 3000 in order to have the benefits of -# the space efficient encoding without slowing down too much PFADD, -# which is O(N) with the sparse encoding. The value can be raised to -# ~ 10000 when CPU is not a concern, but space is, and the data set is -# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. -hll-sparse-max-bytes 3000 - -# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in -# order to help rehashing the main Redis hash table (the one mapping top-level -# keys to values). The hash table implementation Redis uses (see dict.c) -# performs a lazy rehashing: the more operation you run into a hash table -# that is rehashing, the more rehashing "steps" are performed, so if the -# server is idle the rehashing is never complete and some more memory is used -# by the hash table. -# -# The default is to use this millisecond 10 times every second in order to -# actively rehash the main dictionaries, freeing memory when possible. -# -# If unsure: -# use "activerehashing no" if you have hard latency requirements and it is -# not a good thing in your environment that Redis can reply from time to time -# to queries with 2 milliseconds delay. -# -# use "activerehashing yes" if you don't have such hard requirements but -# want to free memory asap when possible. -activerehashing yes - -# The client output buffer limits can be used to force disconnection of clients -# that are not reading data from the server fast enough for some reason (a -# common reason is that a Pub/Sub client can't consume messages as fast as the -# publisher can produce them). -# -# The limit can be set differently for the three different classes of clients: -# -# normal -> normal clients including MONITOR clients -# slave -> slave clients -# pubsub -> clients subscribed to at least one pubsub channel or pattern -# -# The syntax of every client-output-buffer-limit directive is the following: -# -# client-output-buffer-limit -# -# A client is immediately disconnected once the hard limit is reached, or if -# the soft limit is reached and remains reached for the specified number of -# seconds (continuously). -# So for instance if the hard limit is 32 megabytes and the soft limit is -# 16 megabytes / 10 seconds, the client will get disconnected immediately -# if the size of the output buffers reach 32 megabytes, but will also get -# disconnected if the client reaches 16 megabytes and continuously overcomes -# the limit for 10 seconds. -# -# By default normal clients are not limited because they don't receive data -# without asking (in a push way), but just after a request, so only -# asynchronous clients may create a scenario where data is requested faster -# than it can read. -# -# Instead there is a default limit for pubsub and slave clients, since -# subscribers and slaves receive data in a push fashion. -# -# Both the hard or the soft limit can be disabled by setting them to zero. -client-output-buffer-limit normal 0 0 0 -client-output-buffer-limit slave 256mb 64mb 60 -client-output-buffer-limit pubsub 32mb 8mb 60 - -# Redis calls an internal function to perform many background tasks, like -# closing connections of clients in timeout, purging expired keys that are -# never requested, and so forth. -# -# Not all tasks are performed with the same frequency, but Redis checks for -# tasks to perform according to the specified "hz" value. -# -# By default "hz" is set to 10. Raising the value will use more CPU when -# Redis is idle, but at the same time will make Redis more responsive when -# there are many keys expiring at the same time, and timeouts may be -# handled with more precision. -# -# The range is between 1 and 500, however a value over 100 is usually not -# a good idea. Most users should use the default of 10 and raise this up to -# 100 only in environments where very low latency is required. -hz 10 - -# When a child rewrites the AOF file, if the following option is enabled -# the file will be fsync-ed every 32 MB of data generated. This is useful -# in order to commit the file to the disk more incrementally and avoid -# big latency spikes. -aof-rewrite-incremental-fsync yes diff --git a/examples/storage/redis/image/redis-slave.conf b/examples/storage/redis/image/redis-slave.conf deleted file mode 100644 index afd0a45fd4..0000000000 --- a/examples/storage/redis/image/redis-slave.conf +++ /dev/null @@ -1,828 +0,0 @@ -# Redis configuration file example - -# Note on units: when memory size is needed, it is possible to specify -# it in the usual form of 1k 5GB 4M and so forth: -# -# 1k => 1000 bytes -# 1kb => 1024 bytes -# 1m => 1000000 bytes -# 1mb => 1024*1024 bytes -# 1g => 1000000000 bytes -# 1gb => 1024*1024*1024 bytes -# -# units are case insensitive so 1GB 1Gb 1gB are all the same. - -################################## INCLUDES ################################### - -# Include one or more other config files here. This is useful if you -# have a standard template that goes to all Redis servers but also need -# to customize a few per-server settings. Include files can include -# other files, so use this wisely. -# -# Notice option "include" won't be rewritten by command "CONFIG REWRITE" -# from admin or Redis Sentinel. Since Redis always uses the last processed -# line as value of a configuration directive, you'd better put includes -# at the beginning of this file to avoid overwriting config change at runtime. -# -# If instead you are interested in using includes to override configuration -# options, it is better to use include as the last line. -# -# include /path/to/local.conf -# include /path/to/other.conf - -################################ GENERAL ##################################### - -# By default Redis does not run as a daemon. Use 'yes' if you need it. -# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. -daemonize no - -# When running daemonized, Redis writes a pid file in /var/run/redis.pid by -# default. You can specify a custom pid file location here. -pidfile /var/run/redis.pid - -# Accept connections on the specified port, default is 6379. -# If port 0 is specified Redis will not listen on a TCP socket. -port 6379 - -# TCP listen() backlog. -# -# In high requests-per-second environments you need an high backlog in order -# to avoid slow clients connections issues. Note that the Linux kernel -# will silently truncate it to the value of /proc/sys/net/core/somaxconn so -# make sure to raise both the value of somaxconn and tcp_max_syn_backlog -# in order to get the desired effect. -tcp-backlog 511 - -# By default Redis listens for connections from all the network interfaces -# available on the server. It is possible to listen to just one or multiple -# interfaces using the "bind" configuration directive, followed by one or -# more IP addresses. -# -# Examples: -# -# bind 192.168.1.100 10.0.0.1 - -bind 0.0.0.0 - -# Specify the path for the Unix socket that will be used to listen for -# incoming connections. There is no default, so Redis will not listen -# on a unix socket when not specified. -# -# unixsocket /tmp/redis.sock -# unixsocketperm 700 - -# Close the connection after a client is idle for N seconds (0 to disable) -timeout 0 - -# TCP keepalive. -# -# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence -# of communication. This is useful for two reasons: -# -# 1) Detect dead peers. -# 2) Take the connection alive from the point of view of network -# equipment in the middle. -# -# On Linux, the specified value (in seconds) is the period used to send ACKs. -# Note that to close the connection the double of the time is needed. -# On other kernels the period depends on the kernel configuration. -# -# A reasonable value for this option is 60 seconds. -tcp-keepalive 60 - -# Specify the server verbosity level. -# This can be one of: -# debug (a lot of information, useful for development/testing) -# verbose (many rarely useful info, but not a mess like the debug level) -# notice (moderately verbose, what you want in production probably) -# warning (only very important / critical messages are logged) -loglevel notice - -# Specify the log file name. Also the empty string can be used to force -# Redis to log on the standard output. Note that if you use standard -# output for logging but daemonize, logs will be sent to /dev/null -logfile "" - -# To enable logging to the system logger, just set 'syslog-enabled' to yes, -# and optionally update the other syslog parameters to suit your needs. -# syslog-enabled no - -# Specify the syslog identity. -# syslog-ident redis - -# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. -# syslog-facility local0 - -# Set the number of databases. The default database is DB 0, you can select -# a different one on a per-connection basis using SELECT where -# dbid is a number between 0 and 'databases'-1 -databases 16 - -################################ SNAPSHOTTING ################################ -# -# Save the DB on disk: -# -# save -# -# Will save the DB if both the given number of seconds and the given -# number of write operations against the DB occurred. -# -# In the example below the behaviour will be to save: -# after 900 sec (15 min) if at least 1 key changed -# after 300 sec (5 min) if at least 10 keys changed -# after 60 sec if at least 10000 keys changed -# -# Note: you can disable saving completely by commenting out all "save" lines. -# -# It is also possible to remove all the previously configured save -# points by adding a save directive with a single empty string argument -# like in the following example: -# -# save "" - -save 900 1 -save 300 10 -save 60 10000 - -# By default Redis will stop accepting writes if RDB snapshots are enabled -# (at least one save point) and the latest background save failed. -# This will make the user aware (in a hard way) that data is not persisting -# on disk properly, otherwise chances are that no one will notice and some -# disaster will happen. -# -# If the background saving process will start working again Redis will -# automatically allow writes again. -# -# However if you have setup your proper monitoring of the Redis server -# and persistence, you may want to disable this feature so that Redis will -# continue to work as usual even if there are problems with disk, -# permissions, and so forth. -stop-writes-on-bgsave-error yes - -# Compress string objects using LZF when dump .rdb databases? -# For default that's set to 'yes' as it's almost always a win. -# If you want to save some CPU in the saving child set it to 'no' but -# the dataset will likely be bigger if you have compressible values or keys. -rdbcompression yes - -# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. -# This makes the format more resistant to corruption but there is a performance -# hit to pay (around 10%) when saving and loading RDB files, so you can disable it -# for maximum performances. -# -# RDB files created with checksum disabled have a checksum of zero that will -# tell the loading code to skip the check. -rdbchecksum yes - -# The filename where to dump the DB -dbfilename dump.rdb - -# The working directory. -# -# The DB will be written inside this directory, with the filename specified -# above using the 'dbfilename' configuration directive. -# -# The Append Only File will also be created inside this directory. -# -# Note that you must specify a directory here, not a file name. -dir "./" - -################################# REPLICATION ################################# - -# Master-Slave replication. Use slaveof to make a Redis instance a copy of -# another Redis server. A few things to understand ASAP about Redis replication. -# -# 1) Redis replication is asynchronous, but you can configure a master to -# stop accepting writes if it appears to be not connected with at least -# a given number of slaves. -# 2) Redis slaves are able to perform a partial resynchronization with the -# master if the replication link is lost for a relatively small amount of -# time. You may want to configure the replication backlog size (see the next -# sections of this file) with a sensible value depending on your needs. -# 3) Replication is automatic and does not need user intervention. After a -# network partition slaves automatically try to reconnect to masters -# and resynchronize with them. -# -slaveof %master-ip% %master-port% - -# If the master is password protected (using the "requirepass" configuration -# directive below) it is possible to tell the slave to authenticate before -# starting the replication synchronization process, otherwise the master will -# refuse the slave request. -# -# masterauth - -# When a slave loses its connection with the master, or when the replication -# is still in progress, the slave can act in two different ways: -# -# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will -# still reply to client requests, possibly with out of date data, or the -# data set may just be empty if this is the first synchronization. -# -# 2) if slave-serve-stale-data is set to 'no' the slave will reply with -# an error "SYNC with master in progress" to all the kind of commands -# but to INFO and SLAVEOF. -# -slave-serve-stale-data yes - -# You can configure a slave instance to accept writes or not. Writing against -# a slave instance may be useful to store some ephemeral data (because data -# written on a slave will be easily deleted after resync with the master) but -# may also cause problems if clients are writing to it because of a -# misconfiguration. -# -# Since Redis 2.6 by default slaves are read-only. -# -# Note: read only slaves are not designed to be exposed to untrusted clients -# on the internet. It's just a protection layer against misuse of the instance. -# Still a read only slave exports by default all the administrative commands -# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve -# security of read only slaves using 'rename-command' to shadow all the -# administrative / dangerous commands. -slave-read-only yes - -# Replication SYNC strategy: disk or socket. -# -# ------------------------------------------------------- -# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY -# ------------------------------------------------------- -# -# New slaves and reconnecting slaves that are not able to continue the replication -# process just receiving differences, need to do what is called a "full -# synchronization". An RDB file is transmitted from the master to the slaves. -# The transmission can happen in two different ways: -# -# 1) Disk-backed: The Redis master creates a new process that writes the RDB -# file on disk. Later the file is transferred by the parent -# process to the slaves incrementally. -# 2) Diskless: The Redis master creates a new process that directly writes the -# RDB file to slave sockets, without touching the disk at all. -# -# With disk-backed replication, while the RDB file is generated, more slaves -# can be queued and served with the RDB file as soon as the current child producing -# the RDB file finishes its work. With diskless replication instead once -# the transfer starts, new slaves arriving will be queued and a new transfer -# will start when the current one terminates. -# -# When diskless replication is used, the master waits a configurable amount of -# time (in seconds) before starting the transfer in the hope that multiple slaves -# will arrive and the transfer can be parallelized. -# -# With slow disks and fast (large bandwidth) networks, diskless replication -# works better. -repl-diskless-sync no - -# When diskless replication is enabled, it is possible to configure the delay -# the server waits in order to spawn the child that trnasfers the RDB via socket -# to the slaves. -# -# This is important since once the transfer starts, it is not possible to serve -# new slaves arriving, that will be queued for the next RDB transfer, so the server -# waits a delay in order to let more slaves arrive. -# -# The delay is specified in seconds, and by default is 5 seconds. To disable -# it entirely just set it to 0 seconds and the transfer will start ASAP. -repl-diskless-sync-delay 5 - -# Slaves send PINGs to server in a predefined interval. It's possible to change -# this interval with the repl_ping_slave_period option. The default value is 10 -# seconds. -# -# repl-ping-slave-period 10 - -# The following option sets the replication timeout for: -# -# 1) Bulk transfer I/O during SYNC, from the point of view of slave. -# 2) Master timeout from the point of view of slaves (data, pings). -# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings). -# -# It is important to make sure that this value is greater than the value -# specified for repl-ping-slave-period otherwise a timeout will be detected -# every time there is low traffic between the master and the slave. -# -# repl-timeout 60 - -# Disable TCP_NODELAY on the slave socket after SYNC? -# -# If you select "yes" Redis will use a smaller number of TCP packets and -# less bandwidth to send data to slaves. But this can add a delay for -# the data to appear on the slave side, up to 40 milliseconds with -# Linux kernels using a default configuration. -# -# If you select "no" the delay for data to appear on the slave side will -# be reduced but more bandwidth will be used for replication. -# -# By default we optimize for low latency, but in very high traffic conditions -# or when the master and slaves are many hops away, turning this to "yes" may -# be a good idea. -repl-disable-tcp-nodelay no - -# Set the replication backlog size. The backlog is a buffer that accumulates -# slave data when slaves are disconnected for some time, so that when a slave -# wants to reconnect again, often a full resync is not needed, but a partial -# resync is enough, just passing the portion of data the slave missed while -# disconnected. -# -# The bigger the replication backlog, the longer the time the slave can be -# disconnected and later be able to perform a partial resynchronization. -# -# The backlog is only allocated once there is at least a slave connected. -# -# repl-backlog-size 1mb - -# After a master has no longer connected slaves for some time, the backlog -# will be freed. The following option configures the amount of seconds that -# need to elapse, starting from the time the last slave disconnected, for -# the backlog buffer to be freed. -# -# A value of 0 means to never release the backlog. -# -# repl-backlog-ttl 3600 - -# The slave priority is an integer number published by Redis in the INFO output. -# It is used by Redis Sentinel in order to select a slave to promote into a -# master if the master is no longer working correctly. -# -# A slave with a low priority number is considered better for promotion, so -# for instance if there are three slaves with priority 10, 100, 25 Sentinel will -# pick the one with priority 10, that is the lowest. -# -# However a special priority of 0 marks the slave as not able to perform the -# role of master, so a slave with priority of 0 will never be selected by -# Redis Sentinel for promotion. -# -# By default the priority is 100. -slave-priority 100 - -# It is possible for a master to stop accepting writes if there are less than -# N slaves connected, having a lag less or equal than M seconds. -# -# The N slaves need to be in "online" state. -# -# The lag in seconds, that must be <= the specified value, is calculated from -# the last ping received from the slave, that is usually sent every second. -# -# This option does not GUARANTEE that N replicas will accept the write, but -# will limit the window of exposure for lost writes in case not enough slaves -# are available, to the specified number of seconds. -# -# For example to require at least 3 slaves with a lag <= 10 seconds use: -# -# min-slaves-to-write 3 -# min-slaves-max-lag 10 -# -# Setting one or the other to 0 disables the feature. -# -# By default min-slaves-to-write is set to 0 (feature disabled) and -# min-slaves-max-lag is set to 10. - -################################## SECURITY ################################### - -# Require clients to issue AUTH before processing any other -# commands. This might be useful in environments in which you do not trust -# others with access to the host running redis-server. -# -# This should stay commented out for backward compatibility and because most -# people do not need auth (e.g. they run their own servers). -# -# Warning: since Redis is pretty fast an outside user can try up to -# 150k passwords per second against a good box. This means that you should -# use a very strong password otherwise it will be very easy to break. -# -# requirepass foobared - -# Command renaming. -# -# It is possible to change the name of dangerous commands in a shared -# environment. For instance the CONFIG command may be renamed into something -# hard to guess so that it will still be available for internal-use tools -# but not available for general clients. -# -# Example: -# -# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 -# -# It is also possible to completely kill a command by renaming it into -# an empty string: -# -# rename-command CONFIG "" -# -# Please note that changing the name of commands that are logged into the -# AOF file or transmitted to slaves may cause problems. - -################################### LIMITS #################################### - -# Set the max number of connected clients at the same time. By default -# this limit is set to 10000 clients, however if the Redis server is not -# able to configure the process file limit to allow for the specified limit -# the max number of allowed clients is set to the current file limit -# minus 32 (as Redis reserves a few file descriptors for internal uses). -# -# Once the limit is reached Redis will close all the new connections sending -# an error 'max number of clients reached'. -# -# maxclients 10000 - -# Don't use more memory than the specified amount of bytes. -# When the memory limit is reached Redis will try to remove keys -# according to the eviction policy selected (see maxmemory-policy). -# -# If Redis can't remove keys according to the policy, or if the policy is -# set to 'noeviction', Redis will start to reply with errors to commands -# that would use more memory, like SET, LPUSH, and so on, and will continue -# to reply to read-only commands like GET. -# -# This option is usually useful when using Redis as an LRU cache, or to set -# a hard memory limit for an instance (using the 'noeviction' policy). -# -# WARNING: If you have slaves attached to an instance with maxmemory on, -# the size of the output buffers needed to feed the slaves are subtracted -# from the used memory count, so that network problems / resyncs will -# not trigger a loop where keys are evicted, and in turn the output -# buffer of slaves is full with DELs of keys evicted triggering the deletion -# of more keys, and so forth until the database is completely emptied. -# -# In short... if you have slaves attached it is suggested that you set a lower -# limit for maxmemory so that there is some free RAM on the system for slave -# output buffers (but this is not needed if the policy is 'noeviction'). -# -# maxmemory - -# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory -# is reached. You can select among five behaviors: -# -# volatile-lru -> remove the key with an expire set using an LRU algorithm -# allkeys-lru -> remove any key according to the LRU algorithm -# volatile-random -> remove a random key with an expire set -# allkeys-random -> remove a random key, any key -# volatile-ttl -> remove the key with the nearest expire time (minor TTL) -# noeviction -> don't expire at all, just return an error on write operations -# -# Note: with any of the above policies, Redis will return an error on write -# operations, when there are no suitable keys for eviction. -# -# At the date of writing these commands are: set setnx setex append -# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd -# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby -# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby -# getset mset msetnx exec sort -# -# The default is: -# -# maxmemory-policy volatile-lru - -# LRU and minimal TTL algorithms are not precise algorithms but approximated -# algorithms (in order to save memory), so you can select as well the sample -# size to check. For instance for default Redis will check three keys and -# pick the one that was used less recently, you can change the sample size -# using the following configuration directive. -# -# maxmemory-samples 3 - -############################## APPEND ONLY MODE ############################### - -# By default Redis asynchronously dumps the dataset on disk. This mode is -# good enough in many applications, but an issue with the Redis process or -# a power outage may result into a few minutes of writes lost (depending on -# the configured save points). -# -# The Append Only File is an alternative persistence mode that provides -# much better durability. For instance using the default data fsync policy -# (see later in the config file) Redis can lose just one second of writes in a -# dramatic event like a server power outage, or a single write if something -# wrong with the Redis process itself happens, but the operating system is -# still running correctly. -# -# AOF and RDB persistence can be enabled at the same time without problems. -# If the AOF is enabled on startup Redis will load the AOF, that is the file -# with the better durability guarantees. -# -# Please check http://redis.io/topics/persistence for more information. - -appendonly yes - -# The name of the append only file (default: "appendonly.aof") - -appendfilename "appendonly.aof" - -# The fsync() call tells the Operating System to actually write data on disk -# instead of waiting for more data in the output buffer. Some OS will really flush -# data on disk, some other OS will just try to do it ASAP. -# -# Redis supports three different modes: -# -# no: don't fsync, just let the OS flush the data when it wants. Faster. -# always: fsync after every write to the append only log. Slow, Safest. -# everysec: fsync only one time every second. Compromise. -# -# The default is "everysec", as that's usually the right compromise between -# speed and data safety. It's up to you to understand if you can relax this to -# "no" that will let the operating system flush the output buffer when -# it wants, for better performances (but if you can live with the idea of -# some data loss consider the default persistence mode that's snapshotting), -# or on the contrary, use "always" that's very slow but a bit safer than -# everysec. -# -# More details please check the following article: -# http://antirez.com/post/redis-persistence-demystified.html -# -# If unsure, use "everysec". - -# appendfsync always -appendfsync everysec -# appendfsync no - -# When the AOF fsync policy is set to always or everysec, and a background -# saving process (a background save or AOF log background rewriting) is -# performing a lot of I/O against the disk, in some Linux configurations -# Redis may block too long on the fsync() call. Note that there is no fix for -# this currently, as even performing fsync in a different thread will block -# our synchronous write(2) call. -# -# In order to mitigate this problem it's possible to use the following option -# that will prevent fsync() from being called in the main process while a -# BGSAVE or BGREWRITEAOF is in progress. -# -# This means that while another child is saving, the durability of Redis is -# the same as "appendfsync none". In practical terms, this means that it is -# possible to lose up to 30 seconds of log in the worst scenario (with the -# default Linux settings). -# -# If you have latency problems turn this to "yes". Otherwise leave it as -# "no" that is the safest pick from the point of view of durability. - -no-appendfsync-on-rewrite no - -# Automatic rewrite of the append only file. -# Redis is able to automatically rewrite the log file implicitly calling -# BGREWRITEAOF when the AOF log size grows by the specified percentage. -# -# This is how it works: Redis remembers the size of the AOF file after the -# latest rewrite (if no rewrite has happened since the restart, the size of -# the AOF at startup is used). -# -# This base size is compared to the current size. If the current size is -# bigger than the specified percentage, the rewrite is triggered. Also -# you need to specify a minimal size for the AOF file to be rewritten, this -# is useful to avoid rewriting the AOF file even if the percentage increase -# is reached but it is still pretty small. -# -# Specify a percentage of zero in order to disable the automatic AOF -# rewrite feature. - -auto-aof-rewrite-percentage 100 -auto-aof-rewrite-min-size 64mb - -# An AOF file may be found to be truncated at the end during the Redis -# startup process, when the AOF data gets loaded back into memory. -# This may happen when the system where Redis is running -# crashes, especially when an ext4 filesystem is mounted without the -# data=ordered option (however this can't happen when Redis itself -# crashes or aborts but the operating system still works correctly). -# -# Redis can either exit with an error when this happens, or load as much -# data as possible (the default now) and start if the AOF file is found -# to be truncated at the end. The following option controls this behavior. -# -# If aof-load-truncated is set to yes, a truncated AOF file is loaded and -# the Redis server starts emitting a log to inform the user of the event. -# Otherwise if the option is set to no, the server aborts with an error -# and refuses to start. When the option is set to no, the user requires -# to fix the AOF file using the "redis-check-aof" utility before to restart -# the server. -# -# Note that if the AOF file will be found to be corrupted in the middle -# the server will still exit with an error. This option only applies when -# Redis will try to read more data from the AOF file but not enough bytes -# will be found. -aof-load-truncated yes - -################################ LUA SCRIPTING ############################### - -# Max execution time of a Lua script in milliseconds. -# -# If the maximum execution time is reached Redis will log that a script is -# still in execution after the maximum allowed time and will start to -# reply to queries with an error. -# -# When a long running script exceeds the maximum execution time only the -# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be -# used to stop a script that did not yet called write commands. The second -# is the only way to shut down the server in the case a write command was -# already issued by the script but the user doesn't want to wait for the natural -# termination of the script. -# -# Set it to 0 or a negative value for unlimited execution without warnings. -lua-time-limit 5000 - -################################## SLOW LOG ################################### - -# The Redis Slow Log is a system to log queries that exceeded a specified -# execution time. The execution time does not include the I/O operations -# like talking with the client, sending the reply and so forth, -# but just the time needed to actually execute the command (this is the only -# stage of command execution where the thread is blocked and can not serve -# other requests in the meantime). -# -# You can configure the slow log with two parameters: one tells Redis -# what is the execution time, in microseconds, to exceed in order for the -# command to get logged, and the other parameter is the length of the -# slow log. When a new command is logged the oldest one is removed from the -# queue of logged commands. - -# The following time is expressed in microseconds, so 1000000 is equivalent -# to one second. Note that a negative number disables the slow log, while -# a value of zero forces the logging of every command. -slowlog-log-slower-than 10000 - -# There is no limit to this length. Just be aware that it will consume memory. -# You can reclaim memory used by the slow log with SLOWLOG RESET. -slowlog-max-len 128 - -################################ LATENCY MONITOR ############################## - -# The Redis latency monitoring subsystem samples different operations -# at runtime in order to collect data related to possible sources of -# latency of a Redis instance. -# -# Via the LATENCY command this information is available to the user that can -# print graphs and obtain reports. -# -# The system only logs operations that were performed in a time equal or -# greater than the amount of milliseconds specified via the -# latency-monitor-threshold configuration directive. When its value is set -# to zero, the latency monitor is turned off. -# -# By default latency monitoring is disabled since it is mostly not needed -# if you don't have latency issues, and collecting data has a performance -# impact, that while very small, can be measured under big load. Latency -# monitoring can easily be enabled at runtime using the command -# "CONFIG SET latency-monitor-threshold " if needed. -latency-monitor-threshold 0 - -############################# Event notification ############################## - -# Redis can notify Pub/Sub clients about events happening in the key space. -# This feature is documented at http://redis.io/topics/notifications -# -# For instance if keyspace events notification is enabled, and a client -# performs a DEL operation on key "foo" stored in the Database 0, two -# messages will be published via Pub/Sub: -# -# PUBLISH __keyspace@0__:foo del -# PUBLISH __keyevent@0__:del foo -# -# It is possible to select the events that Redis will notify among a set -# of classes. Every class is identified by a single character: -# -# K Keyspace events, published with __keyspace@__ prefix. -# E Keyevent events, published with __keyevent@__ prefix. -# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... -# $ String commands -# l List commands -# s Set commands -# h Hash commands -# z Sorted set commands -# x Expired events (events generated every time a key expires) -# e Evicted events (events generated when a key is evicted for maxmemory) -# A Alias for g$lshzxe, so that the "AKE" string means all the events. -# -# The "notify-keyspace-events" takes as argument a string that is composed -# of zero or multiple characters. The empty string means that notifications -# are disabled. -# -# Example: to enable list and generic events, from the point of view of the -# event name, use: -# -# notify-keyspace-events Elg -# -# Example 2: to get the stream of the expired keys subscribing to channel -# name __keyevent@0__:expired use: -# -# notify-keyspace-events Ex -# -# By default all notifications are disabled because most users don't need -# this feature and the feature has some overhead. Note that if you don't -# specify at least one of K or E, no events will be delivered. -notify-keyspace-events "" - -############################### ADVANCED CONFIG ############################### - -# Hashes are encoded using a memory efficient data structure when they have a -# small number of entries, and the biggest entry does not exceed a given -# threshold. These thresholds can be configured using the following directives. -hash-max-ziplist-entries 512 -hash-max-ziplist-value 64 - -# Similarly to hashes, small lists are also encoded in a special way in order -# to save a lot of space. The special representation is only used when -# you are under the following limits: -list-max-ziplist-entries 512 -list-max-ziplist-value 64 - -# Sets have a special encoding in just one case: when a set is composed -# of just strings that happen to be integers in radix 10 in the range -# of 64 bit signed integers. -# The following configuration setting sets the limit in the size of the -# set in order to use this special memory saving encoding. -set-max-intset-entries 512 - -# Similarly to hashes and lists, sorted sets are also specially encoded in -# order to save a lot of space. This encoding is only used when the length and -# elements of a sorted set are below the following limits: -zset-max-ziplist-entries 128 -zset-max-ziplist-value 64 - -# HyperLogLog sparse representation bytes limit. The limit includes the -# 16 bytes header. When an HyperLogLog using the sparse representation crosses -# this limit, it is converted into the dense representation. -# -# A value greater than 16000 is totally useless, since at that point the -# dense representation is more memory efficient. -# -# The suggested value is ~ 3000 in order to have the benefits of -# the space efficient encoding without slowing down too much PFADD, -# which is O(N) with the sparse encoding. The value can be raised to -# ~ 10000 when CPU is not a concern, but space is, and the data set is -# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. -hll-sparse-max-bytes 3000 - -# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in -# order to help rehashing the main Redis hash table (the one mapping top-level -# keys to values). The hash table implementation Redis uses (see dict.c) -# performs a lazy rehashing: the more operation you run into a hash table -# that is rehashing, the more rehashing "steps" are performed, so if the -# server is idle the rehashing is never complete and some more memory is used -# by the hash table. -# -# The default is to use this millisecond 10 times every second in order to -# actively rehash the main dictionaries, freeing memory when possible. -# -# If unsure: -# use "activerehashing no" if you have hard latency requirements and it is -# not a good thing in your environment that Redis can reply from time to time -# to queries with 2 milliseconds delay. -# -# use "activerehashing yes" if you don't have such hard requirements but -# want to free memory asap when possible. -activerehashing yes - -# The client output buffer limits can be used to force disconnection of clients -# that are not reading data from the server fast enough for some reason (a -# common reason is that a Pub/Sub client can't consume messages as fast as the -# publisher can produce them). -# -# The limit can be set differently for the three different classes of clients: -# -# normal -> normal clients including MONITOR clients -# slave -> slave clients -# pubsub -> clients subscribed to at least one pubsub channel or pattern -# -# The syntax of every client-output-buffer-limit directive is the following: -# -# client-output-buffer-limit -# -# A client is immediately disconnected once the hard limit is reached, or if -# the soft limit is reached and remains reached for the specified number of -# seconds (continuously). -# So for instance if the hard limit is 32 megabytes and the soft limit is -# 16 megabytes / 10 seconds, the client will get disconnected immediately -# if the size of the output buffers reach 32 megabytes, but will also get -# disconnected if the client reaches 16 megabytes and continuously overcomes -# the limit for 10 seconds. -# -# By default normal clients are not limited because they don't receive data -# without asking (in a push way), but just after a request, so only -# asynchronous clients may create a scenario where data is requested faster -# than it can read. -# -# Instead there is a default limit for pubsub and slave clients, since -# subscribers and slaves receive data in a push fashion. -# -# Both the hard or the soft limit can be disabled by setting them to zero. -client-output-buffer-limit normal 0 0 0 -client-output-buffer-limit slave 256mb 64mb 60 -client-output-buffer-limit pubsub 32mb 8mb 60 - -# Redis calls an internal function to perform many background tasks, like -# closing connections of clients in timeout, purging expired keys that are -# never requested, and so forth. -# -# Not all tasks are performed with the same frequency, but Redis checks for -# tasks to perform according to the specified "hz" value. -# -# By default "hz" is set to 10. Raising the value will use more CPU when -# Redis is idle, but at the same time will make Redis more responsive when -# there are many keys expiring at the same time, and timeouts may be -# handled with more precision. -# -# The range is between 1 and 500, however a value over 100 is usually not -# a good idea. Most users should use the default of 10 and raise this up to -# 100 only in environments where very low latency is required. -hz 10 - -# When a child rewrites the AOF file, if the following option is enabled -# the file will be fsync-ed every 32 MB of data generated. This is useful -# in order to commit the file to the disk more incrementally and avoid -# big latency spikes. -aof-rewrite-incremental-fsync yes diff --git a/examples/storage/redis/image/run.sh b/examples/storage/redis/image/run.sh deleted file mode 100755 index 6fed5af4a8..0000000000 --- a/examples/storage/redis/image/run.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -# Copyright 2014 The Kubernetes Authors. -# -# 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. - -function launchmaster() { - if [[ ! -e /redis-master-data ]]; then - echo "Redis master data doesn't exist, data won't be persistent!" - mkdir /redis-master-data - fi - redis-server /redis-master/redis.conf --protected-mode no -} - -function launchsentinel() { - while true; do - master=$(redis-cli -h ${REDIS_SENTINEL_SERVICE_HOST} -p ${REDIS_SENTINEL_SERVICE_PORT} --csv SENTINEL get-master-addr-by-name mymaster | tr ',' ' ' | cut -d' ' -f1) - if [[ -n ${master} ]]; then - master="${master//\"}" - else - master=$(hostname -i) - fi - - redis-cli -h ${master} INFO - if [[ "$?" == "0" ]]; then - break - fi - echo "Connecting to master failed. Waiting..." - sleep 10 - done - - sentinel_conf=sentinel.conf - - echo "sentinel monitor mymaster ${master} 6379 2" > ${sentinel_conf} - echo "sentinel down-after-milliseconds mymaster 60000" >> ${sentinel_conf} - echo "sentinel failover-timeout mymaster 180000" >> ${sentinel_conf} - echo "sentinel parallel-syncs mymaster 1" >> ${sentinel_conf} - echo "bind 0.0.0.0" >> ${sentinel_conf} - - redis-sentinel ${sentinel_conf} --protected-mode no -} - -function launchslave() { - while true; do - master=$(redis-cli -h ${REDIS_SENTINEL_SERVICE_HOST} -p ${REDIS_SENTINEL_SERVICE_PORT} --csv SENTINEL get-master-addr-by-name mymaster | tr ',' ' ' | cut -d' ' -f1) - if [[ -n ${master} ]]; then - master="${master//\"}" - else - echo "Failed to find master." - sleep 60 - exit 1 - fi - redis-cli -h ${master} INFO - if [[ "$?" == "0" ]]; then - break - fi - echo "Connecting to master failed. Waiting..." - sleep 10 - done - sed -i "s/%master-ip%/${master}/" /redis-slave/redis.conf - sed -i "s/%master-port%/6379/" /redis-slave/redis.conf - redis-server /redis-slave/redis.conf --protected-mode no -} - -if [[ "${MASTER}" == "true" ]]; then - launchmaster - exit 0 -fi - -if [[ "${SENTINEL}" == "true" ]]; then - launchsentinel - exit 0 -fi - -launchslave diff --git a/examples/storage/redis/redis-controller.yaml b/examples/storage/redis/redis-controller.yaml deleted file mode 100644 index dab2f7f1ab..0000000000 --- a/examples/storage/redis/redis-controller.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: redis -spec: - replicas: 1 - selector: - name: redis - template: - metadata: - labels: - name: redis - spec: - containers: - - name: redis - image: k8s.gcr.io/redis:v1 - ports: - - containerPort: 6379 - resources: - limits: - cpu: "0.1" - volumeMounts: - - mountPath: /redis-master-data - name: data - volumes: - - name: data - emptyDir: {} - diff --git a/examples/storage/redis/redis-sentinel-controller.yaml b/examples/storage/redis/redis-sentinel-controller.yaml deleted file mode 100644 index 6c4b14347a..0000000000 --- a/examples/storage/redis/redis-sentinel-controller.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: redis-sentinel -spec: - replicas: 1 - selector: - redis-sentinel: "true" - template: - metadata: - labels: - name: redis-sentinel - redis-sentinel: "true" - role: sentinel - spec: - containers: - - name: sentinel - image: k8s.gcr.io/redis:v1 - env: - - name: SENTINEL - value: "true" - ports: - - containerPort: 26379 diff --git a/examples/storage/redis/redis-sentinel-service.yaml b/examples/storage/redis/redis-sentinel-service.yaml deleted file mode 100644 index c670a82415..0000000000 --- a/examples/storage/redis/redis-sentinel-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - name: sentinel - role: service - name: redis-sentinel -spec: - ports: - - port: 26379 - targetPort: 26379 - selector: - redis-sentinel: "true" diff --git a/examples/storage/rethinkdb/README.md b/examples/storage/rethinkdb/README.md deleted file mode 100644 index f15a56838d..0000000000 --- a/examples/storage/rethinkdb/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storage/rethinkdb/README.md](https://github.com/kubernetes/examples/blob/master/staging/storage/rethinkdb/README.md) diff --git a/examples/storage/rethinkdb/admin-pod.yaml b/examples/storage/rethinkdb/admin-pod.yaml deleted file mode 100644 index 12163909d6..0000000000 --- a/examples/storage/rethinkdb/admin-pod.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - db: rethinkdb - role: admin - name: rethinkdb-admin -spec: - containers: - - image: k8s.gcr.io/rethinkdb:1.16.0_1 - name: rethinkdb - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - ports: - - containerPort: 8080 - name: admin-port - - containerPort: 28015 - name: driver-port - - containerPort: 29015 - name: cluster-port - volumeMounts: - - mountPath: /data/rethinkdb_data - name: rethinkdb-storage - volumes: - - name: rethinkdb-storage - emptyDir: {} diff --git a/examples/storage/rethinkdb/admin-service.yaml b/examples/storage/rethinkdb/admin-service.yaml deleted file mode 100644 index 0ae37c0261..0000000000 --- a/examples/storage/rethinkdb/admin-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - db: rethinkdb - name: rethinkdb-admin -spec: - ports: - - port: 8080 - targetPort: 8080 - type: LoadBalancer - selector: - db: rethinkdb - role: admin diff --git a/examples/storage/rethinkdb/driver-service.yaml b/examples/storage/rethinkdb/driver-service.yaml deleted file mode 100644 index c2c559adfb..0000000000 --- a/examples/storage/rethinkdb/driver-service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - db: rethinkdb - name: rethinkdb-driver -spec: - ports: - - port: 28015 - targetPort: 28015 - selector: - db: rethinkdb diff --git a/examples/storage/rethinkdb/gen-pod.sh b/examples/storage/rethinkdb/gen-pod.sh deleted file mode 100755 index 90a44f2300..0000000000 --- a/examples/storage/rethinkdb/gen-pod.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -set -o errexit -set -o nounset -set -o pipefail - -: ${VERSION:=1.16.0} - -readonly NAME=${1-} -if [[ -z "${NAME}" ]]; then - echo -e "\033[1;31mName must be specified\033[0m" - exit 1 -fi - -ADMIN="" -if [[ ${NAME} == "admin" ]]; then - ADMIN="role: admin" -fi - -NODE="" -# One needs to label a node with the same key/value pair, -# i.e., 'kubectl label nodes name=${2}' -if [[ ! -z "${2-}" ]]; then - NODE="nodeSelector: { name: ${2} }" -fi - -cat << EOF -apiVersion: v1 -kind: Pod -metadata: - labels: - ${ADMIN} - db: rethinkdb - name: rethinkdb-${NAME}-${VERSION} - namespace: rethinkdb -spec: - containers: - - image: antmanler/rethinkdb:${VERSION} - name: rethinkdb - ports: - - containerPort: 8080 - name: admin-port - protocol: TCP - - containerPort: 28015 - name: driver-port - protocol: TCP - - containerPort: 29015 - name: cluster-port - protocol: TCP - volumeMounts: - - mountPath: /data/rethinkdb_data - name: rethinkdb-storage - ${NODE} - restartPolicy: Always - volumes: - - hostPath: - path: /data/db/rethinkdb - name: rethinkdb-storage -EOF diff --git a/examples/storage/rethinkdb/image/Dockerfile b/examples/storage/rethinkdb/image/Dockerfile deleted file mode 100644 index ff650cd249..0000000000 --- a/examples/storage/rethinkdb/image/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM rethinkdb:1.16.0 - - -RUN apt-get update && \ - apt-get install -yq curl && \ - rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/* && \ - curl -L http://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && \ - chmod u+x /usr/bin/jq - -COPY ./run.sh /usr/bin/run.sh -RUN chmod u+x /usr/bin/run.sh - -CMD "/usr/bin/run.sh" diff --git a/examples/storage/rethinkdb/image/run.sh b/examples/storage/rethinkdb/image/run.sh deleted file mode 100644 index 607eb59edc..0000000000 --- a/examples/storage/rethinkdb/image/run.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -set -o pipefail - -echo Checking for other nodes -IP="" -if [[ -n "${KUBERNETES_SERVICE_HOST}" ]]; then - - POD_NAMESPACE=${POD_NAMESPACE:-default} - MYHOST=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') - echo My host: ${MYHOST} - - URL="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1/namespaces/${POD_NAMESPACE}/endpoints/rethinkdb-driver" - echo "Endpont url: ${URL}" - echo "Looking for IPs..." - token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) - # try to pick up first different ip from endpoints - IP=$(curl -s ${URL} --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --header "Authorization: Bearer ${token}" \ - | jq -s -r --arg h "${MYHOST}" '.[0].subsets | .[].addresses | [ .[].ip ] | map(select(. != $h)) | .[0]') || exit 1 - [[ "${IP}" == null ]] && IP="" -fi - -if [[ -n "${IP}" ]]; then - ENDPOINT="${IP}:29015" - echo "Join to ${ENDPOINT}" - exec rethinkdb --bind all --join ${ENDPOINT} -else - echo "Start single instance" - exec rethinkdb --bind all -fi diff --git a/examples/storage/rethinkdb/rc.yaml b/examples/storage/rethinkdb/rc.yaml deleted file mode 100644 index 23becb6e88..0000000000 --- a/examples/storage/rethinkdb/rc.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - labels: - db: rethinkdb - name: rethinkdb-rc -spec: - replicas: 1 - selector: - db: rethinkdb - role: replicas - template: - metadata: - labels: - db: rethinkdb - role: replicas - spec: - containers: - - image: k8s.gcr.io/rethinkdb:1.16.0_1 - name: rethinkdb - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - ports: - - containerPort: 8080 - name: admin-port - - containerPort: 28015 - name: driver-port - - containerPort: 29015 - name: cluster-port - volumeMounts: - - mountPath: /data/rethinkdb_data - name: rethinkdb-storage - volumes: - - name: rethinkdb-storage - emptyDir: {} diff --git a/examples/storage/vitess/README.md b/examples/storage/vitess/README.md deleted file mode 100644 index 6b350d8e51..0000000000 --- a/examples/storage/vitess/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storage/vitess/README.md](https://github.com/kubernetes/examples/blob/master/staging/storage/vitess/README.md) diff --git a/examples/storage/vitess/configure.sh b/examples/storage/vitess/configure.sh deleted file mode 100755 index 7166c7fbb9..0000000000 --- a/examples/storage/vitess/configure.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This script generates config.sh, which is a site-local config file that is not -# checked into source control. - -# Select and configure Backup Storage Implementation. -storage=gcs -read -p "Backup Storage (file, gcs) [gcs]: " -if [ -n "$REPLY" ]; then storage="$REPLY"; fi - -case "$storage" in -gcs) - # Google Cloud Storage - project=$(gcloud config list project | grep 'project\s*=' | sed -r 's/^.*=\s*(.*)$/\1/') - read -p "Google Developers Console Project [$project]: " - if [ -n "$REPLY" ]; then project="$REPLY"; fi - if [ -z "$project" ]; then - echo "ERROR: Project name must not be empty." - exit 1 - fi - - read -p "Google Cloud Storage bucket for Vitess backups: " bucket - if [ -z "$bucket" ]; then - echo "ERROR: Bucket name must not be empty." - exit 1 - fi - echo - echo "NOTE: If you haven't already created this bucket, you can do so by running:" - echo " gsutil mb gs://$bucket" - echo - - backup_flags=$(echo -backup_storage_implementation gcs \ - -gcs_backup_storage_project "'$project'" \ - -gcs_backup_storage_bucket "'$bucket'") - ;; -file) - # Mounted volume (e.g. NFS) - read -p "Root directory for backups (usually an NFS mount): " file_root - if [ -z "$file_root" ]; then - echo "ERROR: Root directory must not be empty." - exit 1 - fi - echo - echo "NOTE: You must add your NFS mount to the vtctld-controller-template" - echo " and vttablet-pod-template as described in the Kubernetes docs:" - echo " http://kubernetes.io/v1.0/docs/user-guide/volumes.html#nfs" - echo - - backup_flags=$(echo -backup_storage_implementation file \ - -file_backup_storage_root "'$file_root'") - ;; -*) - echo "ERROR: Unsupported backup storage implementation: $storage" - exit 1 -esac - -echo "Saving config.sh..." -echo "backup_flags=\"$backup_flags\"" > config.sh - diff --git a/examples/storage/vitess/create_test_table.sql b/examples/storage/vitess/create_test_table.sql deleted file mode 100644 index 0a6ef36090..0000000000 --- a/examples/storage/vitess/create_test_table.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE messages ( - page BIGINT(20) UNSIGNED, - time_created_ns BIGINT(20) UNSIGNED, - keyspace_id BIGINT(20) UNSIGNED, - message VARCHAR(10000), - PRIMARY KEY (page, time_created_ns) -) ENGINE=InnoDB - diff --git a/examples/storage/vitess/env.sh b/examples/storage/vitess/env.sh deleted file mode 100644 index 49b06c8007..0000000000 --- a/examples/storage/vitess/env.sh +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an include file used by the other scripts in this directory. - -# Most clusters will just be accessed with 'kubectl' on $PATH. -# However, some might require a different command. For example, GKE required -# KUBECTL='gcloud beta container kubectl' for a while. Now that most of our -# use cases just need KUBECTL=kubectl, we'll make that the default. -KUBECTL=${KUBECTL:-kubectl} - -# This should match the nodePort in vtctld-service.yaml -VTCTLD_PORT=${VTCTLD_PORT:-30001} - -# Customizable parameters -SHARDS=${SHARDS:-'-80,80-'} -TABLETS_PER_SHARD=${TABLETS_PER_SHARD:-2} -RDONLY_COUNT=${RDONLY_COUNT:-0} -MAX_TASK_WAIT_RETRIES=${MAX_TASK_WAIT_RETRIES:-300} -MAX_VTTABLET_TOPO_WAIT_RETRIES=${MAX_VTTABLET_TOPO_WAIT_RETRIES:-180} -VTTABLET_TEMPLATE=${VTTABLET_TEMPLATE:-'vttablet-pod-template.yaml'} -VTGATE_TEMPLATE=${VTGATE_TEMPLATE:-'vtgate-controller-template.yaml'} -VTGATE_COUNT=${VTGATE_COUNT:-1} -CELLS=${CELLS:-'test'} -ETCD_REPLICAS=3 - -VTGATE_REPLICAS=$VTGATE_COUNT - -# Get the ExternalIP of any node. -get_node_ip() { - $KUBECTL get -o template -t '{{range (index .items 0).status.addresses}}{{if eq .type "ExternalIP"}}{{.address}}{{end}}{{end}}' nodes -} - -# Try to find vtctld address if not provided. -get_vtctld_addr() { - if [ -z "$VTCTLD_ADDR" ]; then - node_ip=$(get_node_ip) - if [ -n "$node_ip" ]; then - VTCTLD_ADDR="$node_ip:$VTCTLD_PORT" - fi - fi - echo "$VTCTLD_ADDR" -} - -config_file=`dirname "${BASH_SOURCE}"`/config.sh -if [ ! -f $config_file ]; then - echo "Please run ./configure.sh first to generate config.sh file." - exit 1 -fi - -source $config_file - diff --git a/examples/storage/vitess/etcd-controller-template.yaml b/examples/storage/vitess/etcd-controller-template.yaml deleted file mode 100644 index dcd7980bd9..0000000000 --- a/examples/storage/vitess/etcd-controller-template.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: etcd-{{cell}} -spec: - replicas: {{replicas}} - template: - metadata: - labels: - component: etcd - cell: {{cell}} - app: vitess - spec: - volumes: - - name: certs - hostPath: {path: /etc/ssl/certs} - containers: - - name: etcd - image: vitess/etcd:v2.0.13-lite - volumeMounts: - - name: certs - readOnly: true - mountPath: /etc/ssl/certs - resources: - limits: - memory: "128Mi" - cpu: "100m" - command: - - bash - - "-c" - - >- - ipaddr=$(hostname -i) - - global_etcd=$ETCD_GLOBAL_SERVICE_HOST:$ETCD_GLOBAL_SERVICE_PORT - - cell="{{cell}}" && - local_etcd_host_var="ETCD_${cell^^}_SERVICE_HOST" && - local_etcd_port_var="ETCD_${cell^^}_SERVICE_PORT" && - local_etcd=${!local_etcd_host_var}:${!local_etcd_port_var} - - if [ "{{cell}}" != "global" ]; then - until etcdctl -C "http://$global_etcd" - set "/vt/cells/{{cell}}" "http://$local_etcd"; do - echo "[$(date)] waiting for global etcd to register cell '{{cell}}'"; - sleep 1; - done; - fi - - etcd -name $HOSTNAME -discovery {{discovery}} - -advertise-client-urls http://$ipaddr:4001 - -initial-advertise-peer-urls http://$ipaddr:7001 - -listen-client-urls http://$ipaddr:4001 - -listen-peer-urls http://$ipaddr:7001 - diff --git a/examples/storage/vitess/etcd-down.sh b/examples/storage/vitess/etcd-down.sh deleted file mode 100755 index 1f3ca258cb..0000000000 --- a/examples/storage/vitess/etcd-down.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that tears down the etcd servers started by -# etcd-up.sh. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -CELLS=${CELLS:-'test'} -cells=`echo $CELLS | tr ',' ' '` - -# Delete replication controllers -for cell in 'global' $cells; do - echo "Deleting etcd replicationcontroller for $cell cell..." - $KUBECTL delete replicationcontroller etcd-$cell - - echo "Deleting etcd service for $cell cell..." - $KUBECTL delete service etcd-$cell -done - diff --git a/examples/storage/vitess/etcd-service-template.yaml b/examples/storage/vitess/etcd-service-template.yaml deleted file mode 100644 index 817c3e1323..0000000000 --- a/examples/storage/vitess/etcd-service-template.yaml +++ /dev/null @@ -1,16 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: etcd-{{cell}} - labels: - component: etcd - cell: {{cell}} - app: vitess -spec: - ports: - - port: 4001 - selector: - component: etcd - cell: {{cell}} - app: vitess - diff --git a/examples/storage/vitess/etcd-up.sh b/examples/storage/vitess/etcd-up.sh deleted file mode 100755 index b97e369007..0000000000 --- a/examples/storage/vitess/etcd-up.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that creates etcd clusters. -# Vitess requires a global cluster, as well as one for each cell. -# -# For automatic discovery, an etcd cluster can be bootstrapped from an -# existing cluster. In this example, we use an externally-run discovery -# service, but you can use your own. See the etcd docs for more: -# https://github.com/coreos/etcd/blob/v2.0.13/Documentation/clustering.md - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -replicas=${ETCD_REPLICAS:-3} - -CELLS=${CELLS:-'test'} -cells=`echo $CELLS | tr ',' ' '` - -for cell in 'global' $cells; do - # Generate a discovery token. - echo "Generating discovery token for $cell cell..." - discovery=$(curl -sL https://discovery.etcd.io/new?size=$replicas) - if [ -z "$discovery" ]; then - echo "Failed to get etcd discovery token for cell '$cell'." - exit 1 - fi - - # Create the client service, which will load-balance across all replicas. - echo "Creating etcd service for $cell cell..." - cat etcd-service-template.yaml | \ - sed -e "s/{{cell}}/$cell/g" | \ - $KUBECTL create -f - - - # Expand template variables - sed_script="" - for var in cell discovery replicas; do - sed_script+="s,{{$var}},${!var},g;" - done - - # Create the replication controller. - echo "Creating etcd replicationcontroller for $cell cell..." - cat etcd-controller-template.yaml | sed -e "$sed_script" | $KUBECTL create -f - -done - diff --git a/examples/storage/vitess/guestbook-controller.yaml b/examples/storage/vitess/guestbook-controller.yaml deleted file mode 100644 index 1c5ca5a18b..0000000000 --- a/examples/storage/vitess/guestbook-controller.yaml +++ /dev/null @@ -1,23 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: guestbook -spec: - replicas: 3 - template: - metadata: - labels: - component: guestbook - app: vitess - spec: - containers: - - name: guestbook - image: vitess/guestbook:v2.0.0-alpha5 - ports: - - name: http-server - containerPort: 8080 - resources: - limits: - memory: "128Mi" - cpu: "100m" - diff --git a/examples/storage/vitess/guestbook-down.sh b/examples/storage/vitess/guestbook-down.sh deleted file mode 100755 index bac48ed321..0000000000 --- a/examples/storage/vitess/guestbook-down.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that stops guestbook. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -echo "Deleting guestbook replicationcontroller..." -$KUBECTL delete replicationcontroller guestbook - -echo "Deleting guestbook service..." -$KUBECTL delete service guestbook diff --git a/examples/storage/vitess/guestbook-service.yaml b/examples/storage/vitess/guestbook-service.yaml deleted file mode 100644 index 5435f7fa80..0000000000 --- a/examples/storage/vitess/guestbook-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: guestbook - labels: - component: guestbook - app: vitess -spec: - ports: - - port: 80 - targetPort: http-server - selector: - component: guestbook - app: vitess - type: LoadBalancer - diff --git a/examples/storage/vitess/guestbook-up.sh b/examples/storage/vitess/guestbook-up.sh deleted file mode 100755 index b3afe9f059..0000000000 --- a/examples/storage/vitess/guestbook-up.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that starts a guestbook replicationcontroller. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -echo "Creating guestbook service..." -$KUBECTL create -f guestbook-service.yaml - -echo "Creating guestbook replicationcontroller..." -$KUBECTL create -f guestbook-controller.yaml diff --git a/examples/storage/vitess/vitess-down.sh b/examples/storage/vitess/vitess-down.sh deleted file mode 100755 index dc3884a35d..0000000000 --- a/examples/storage/vitess/vitess-down.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -./vtgate-down.sh -SHARDS=$SHARDS CELLS=$CELLS TABLETS_PER_SHARD=$TABLETS_PER_SHARD ./vttablet-down.sh -./vtctld-down.sh -./etcd-down.sh diff --git a/examples/storage/vitess/vitess-up.sh b/examples/storage/vitess/vitess-up.sh deleted file mode 100755 index 4add4ee7e1..0000000000 --- a/examples/storage/vitess/vitess-up.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that creates a fully functional vitess cluster. -# It performs the following steps: -# - Create etcd clusters -# - Create vtctld pod -# - Create vttablet pods -# - Perform vtctl initialization: -# SetKeyspaceShardingInfo, Rebuild Keyspace, Reparent Shard, Apply Schema -# - Create vtgate pods - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -cells=`echo $CELLS | tr ',' ' '` -num_cells=`echo $cells | wc -w` - -function update_spinner_value () { - spinner='-\|/' - cur_spinner=${spinner:$(($1%${#spinner})):1} -} - -function wait_for_running_tasks () { - # This function waits for pods to be in the "Running" state - # 1. task_name: Name that the desired task begins with - # 2. num_tasks: Number of tasks to wait for - # Returns: - # 0 if successful, -1 if timed out - task_name=$1 - num_tasks=$2 - counter=0 - - echo "Waiting for ${num_tasks}x $task_name to enter state Running" - - while [ $counter -lt $MAX_TASK_WAIT_RETRIES ]; do - # Get status column of pods with name starting with $task_name, - # count how many are in state Running - num_running=`$KUBECTL get pods | grep ^$task_name | grep Running | wc -l` - - echo -en "\r$task_name: $num_running out of $num_tasks in state Running..." - if [ $num_running -eq $num_tasks ] - then - echo Complete - return 0 - fi - update_spinner_value $counter - echo -n $cur_spinner - let counter=counter+1 - sleep 1 - done - echo Timed out - return -1 -} - -if [ -z "$GOPATH" ]; then - echo "ERROR: GOPATH undefined, can't obtain vtctlclient" - exit -1 -fi - -export KUBECTL='kubectl' - -echo "Downloading and installing vtctlclient..." -go get -u github.com/youtube/vitess/go/cmd/vtctlclient -num_shards=`echo $SHARDS | tr "," " " | wc -w` -total_tablet_count=$(($num_shards*$TABLETS_PER_SHARD*$num_cells)) -vtgate_count=$VTGATE_COUNT -if [ $vtgate_count -eq 0 ]; then - vtgate_count=$(($total_tablet_count/4>3?$total_tablet_count/4:3)) -fi - -echo "****************************" -echo "*Creating vitess cluster:" -echo "* Shards: $SHARDS" -echo "* Tablets per shard: $TABLETS_PER_SHARD" -echo "* Rdonly per shard: $RDONLY_COUNT" -echo "* VTGate count: $vtgate_count" -echo "* Cells: $cells" -echo "****************************" - -echo 'Running etcd-up.sh' && CELLS=$CELLS ./etcd-up.sh -wait_for_running_tasks etcd-global 3 -for cell in $cells; do - wait_for_running_tasks etcd-$cell 3 -done - -echo 'Running vtctld-up.sh' && ./vtctld-up.sh -echo 'Running vttablet-up.sh' && CELLS=$CELLS ./vttablet-up.sh -echo 'Running vtgate-up.sh' && ./vtgate-up.sh - -wait_for_running_tasks vtctld 1 -wait_for_running_tasks vttablet $total_tablet_count -wait_for_running_tasks vtgate $vtgate_count - -vtctld_port=30001 -vtctld_ip=`kubectl get -o yaml nodes | grep 'type: ExternalIP' -B 1 | head -1 | awk '{print $NF}'` -vtctl_server="$vtctld_ip:$vtctld_port" -kvtctl="$GOPATH/bin/vtctlclient -server $vtctl_server" - -echo Waiting for tablets to be visible in the topology -counter=0 -while [ $counter -lt $MAX_VTTABLET_TOPO_WAIT_RETRIES ]; do - num_tablets=0 - for cell in $cells; do - num_tablets=$(($num_tablets+`$kvtctl ListAllTablets $cell | wc -l`)) - done - echo -en "\r$num_tablets out of $total_tablet_count in topology..." - if [ $num_tablets -eq $total_tablet_count ] - then - echo Complete - break - fi - update_spinner_value $counter - echo -n $cur_spinner - let counter=counter+1 - sleep 1 - if [ $counter -eq $MAX_VTTABLET_TOPO_WAIT_RETRIES ] - then - echo Timed out - fi -done - -# split_shard_count = num_shards for sharded keyspace, 0 for unsharded -split_shard_count=$num_shards -if [ $split_shard_count -eq 1 ]; then - split_shard_count=0 -fi - -echo -n Setting Keyspace Sharding Info... -$kvtctl SetKeyspaceShardingInfo -force -split_shard_count $split_shard_count test_keyspace keyspace_id uint64 -echo Done -echo -n Rebuilding Keyspace Graph... -$kvtctl RebuildKeyspaceGraph test_keyspace -echo Done -echo -n Reparenting... -shard_num=1 -for shard in $(echo $SHARDS | tr "," " "); do - $kvtctl InitShardMaster -force test_keyspace/$shard `echo $cells | awk '{print $1}'`-0000000${shard_num}00 - let shard_num=shard_num+1 -done -echo Done -echo -n Applying Schema... -$kvtctl ApplySchema -sql "$(cat create_test_table.sql)" test_keyspace -echo Done - -echo "****************************" -echo "* Complete!" -echo "* Use the following line to make an alias to kvtctl:" -echo "* alias kvtctl='\$GOPATH/bin/vtctlclient -server $vtctl_server'" -echo "* See the vtctld UI at: http://${vtctld_ip}:30000" -echo "****************************" - diff --git a/examples/storage/vitess/vtctld-controller-template.yaml b/examples/storage/vitess/vtctld-controller-template.yaml deleted file mode 100644 index 72fe245a21..0000000000 --- a/examples/storage/vitess/vtctld-controller-template.yaml +++ /dev/null @@ -1,55 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: vtctld -spec: - replicas: 1 - template: - metadata: - labels: - component: vtctld - app: vitess - spec: - containers: - - name: vtctld - image: vitess/lite:v2.0.0-alpha5 - volumeMounts: - - name: syslog - mountPath: /dev/log - - name: vtdataroot - mountPath: /vt/vtdataroot - - name: certs - readOnly: true - mountPath: /etc/ssl/certs - resources: - limits: - memory: "128Mi" - cpu: "100m" - command: - - sh - - "-c" - - >- - mkdir -p $VTDATAROOT/tmp && - chown -R vitess /vt && - su -p -c "/vt/bin/vtctld - -debug - -templates $VTTOP/go/cmd/vtctld/templates - -web_dir $VTTOP/web/vtctld - -log_dir $VTDATAROOT/tmp - -alsologtostderr - -port 15000 - -grpc_port 15001 - -service_map 'grpc-vtctl' - -topo_implementation etcd - -tablet_protocol grpc - -tablet_manager_protocol grpc - -etcd_global_addrs http://$ETCD_GLOBAL_SERVICE_HOST:$ETCD_GLOBAL_SERVICE_PORT - {{backup_flags}}" vitess - volumes: - - name: syslog - hostPath: {path: /dev/log} - - name: vtdataroot - emptyDir: {} - - name: certs - hostPath: {path: /etc/ssl/certs} - diff --git a/examples/storage/vitess/vtctld-down.sh b/examples/storage/vitess/vtctld-down.sh deleted file mode 100755 index d5a0dfb186..0000000000 --- a/examples/storage/vitess/vtctld-down.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that stops vtctld. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -echo "Deleting vtctld replicationcontroller..." -$KUBECTL delete replicationcontroller vtctld - -echo "Deleting vtctld service..." -$KUBECTL delete service vtctld diff --git a/examples/storage/vitess/vtctld-service.yaml b/examples/storage/vitess/vtctld-service.yaml deleted file mode 100644 index 70d619a873..0000000000 --- a/examples/storage/vitess/vtctld-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: vtctld - labels: - component: vtctld - app: vitess -spec: - ports: - - port: 15000 - name: web - targetPort: 15000 - nodePort: 30000 - - port: 15001 - name: grpc - targetPort: 15001 - nodePort: 30001 - selector: - component: vtctld - app: vitess - type: NodePort - diff --git a/examples/storage/vitess/vtctld-up.sh b/examples/storage/vitess/vtctld-up.sh deleted file mode 100755 index 257b2d7730..0000000000 --- a/examples/storage/vitess/vtctld-up.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that starts vtctld. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -echo "Creating vtctld service..." -$KUBECTL create -f vtctld-service.yaml - -echo "Creating vtctld replicationcontroller..." -# Expand template variables -sed_script="" -for var in backup_flags; do - sed_script+="s,{{$var}},${!var},g;" -done - -# Instantiate template and send to kubectl. -cat vtctld-controller-template.yaml | sed -e "$sed_script" | $KUBECTL create -f - - -server=$(get_vtctld_addr) -echo -echo "vtctld address: http://$server" - diff --git a/examples/storage/vitess/vtgate-controller-template.yaml b/examples/storage/vitess/vtgate-controller-template.yaml deleted file mode 100644 index 03c9665b2d..0000000000 --- a/examples/storage/vitess/vtgate-controller-template.yaml +++ /dev/null @@ -1,45 +0,0 @@ -kind: ReplicationController -apiVersion: v1 -metadata: - name: vtgate -spec: - replicas: {{replicas}} - template: - metadata: - labels: - component: vtgate - app: vitess - spec: - containers: - - name: vtgate - image: vitess/lite:v2.0.0-alpha5 - volumeMounts: - - name: syslog - mountPath: /dev/log - - name: vtdataroot - mountPath: /vt/vtdataroot - resources: - limits: - memory: "512Mi" - cpu: "500m" - command: - - sh - - "-c" - - >- - mkdir -p $VTDATAROOT/tmp && - chown -R vitess /vt && - su -p -c "/vt/bin/vtgate - -topo_implementation etcd - -etcd_global_addrs http://$ETCD_GLOBAL_SERVICE_HOST:$ETCD_GLOBAL_SERVICE_PORT - -log_dir $VTDATAROOT/tmp - -alsologtostderr - -port 15001 - -tablet_protocol grpc - -service_map 'bsonrpc-vt-vtgateservice' - -cell test" vitess - volumes: - - name: syslog - hostPath: {path: /dev/log} - - name: vtdataroot - emptyDir: {} - diff --git a/examples/storage/vitess/vtgate-down.sh b/examples/storage/vitess/vtgate-down.sh deleted file mode 100755 index cf72e840b4..0000000000 --- a/examples/storage/vitess/vtgate-down.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that stops vtgate. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -echo "Deleting vtgate replicationcontroller..." -$KUBECTL delete replicationcontroller vtgate - -echo "Deleting vtgate service..." -$KUBECTL delete service vtgate diff --git a/examples/storage/vitess/vtgate-service.yaml b/examples/storage/vitess/vtgate-service.yaml deleted file mode 100644 index 192968aa2d..0000000000 --- a/examples/storage/vitess/vtgate-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: vtgate - labels: - component: vtgate - app: vitess -spec: - ports: - - port: 15001 - selector: - component: vtgate - app: vitess - type: LoadBalancer - diff --git a/examples/storage/vitess/vtgate-up.sh b/examples/storage/vitess/vtgate-up.sh deleted file mode 100755 index b7e327cc60..0000000000 --- a/examples/storage/vitess/vtgate-up.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that starts a vtgate replicationcontroller. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -VTGATE_REPLICAS=${VTGATE_REPLICAS:-3} -VTGATE_TEMPLATE=${VTGATE_TEMPLATE:-'vtgate-controller-template.yaml'} - -replicas=$VTGATE_REPLICAS - -echo "Creating vtgate service..." -$KUBECTL create -f vtgate-service.yaml - -sed_script="" -for var in replicas; do - sed_script+="s,{{$var}},${!var},g;" -done - -echo "Creating vtgate replicationcontroller..." -cat $VTGATE_TEMPLATE | sed -e "$sed_script" | $KUBECTL create -f - diff --git a/examples/storage/vitess/vttablet-down.sh b/examples/storage/vitess/vttablet-down.sh deleted file mode 100755 index 0683f1f7de..0000000000 --- a/examples/storage/vitess/vttablet-down.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that tears down the vttablet pods started by -# vttablet-up.sh. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -server=$(get_vtctld_addr) - -# Delete the pods for all shards -CELLS=${CELLS:-'test'} -keyspace='test_keyspace' -SHARDS=${SHARDS:-'0'} -TABLETS_PER_SHARD=${TABLETS_PER_SHARD:-5} -UID_BASE=${UID_BASE:-100} - -num_shards=`echo $SHARDS | tr "," " " | wc -w` -uid_base=$UID_BASE - -for shard in `seq 1 $num_shards`; do - cell_index=0 - for cell in `echo $CELLS | tr "," " "`; do - for uid_index in `seq 0 $(($TABLETS_PER_SHARD-1))`; do - uid=$[$uid_base + $uid_index + $cell_index] - printf -v alias '%s-%010d' $cell $uid - - echo "Deleting pod for tablet $alias..." - $KUBECTL delete pod vttablet-$uid - done - let cell_index=cell_index+100000000 - done - let uid_base=uid_base+100 -done - diff --git a/examples/storage/vitess/vttablet-pod-template.yaml b/examples/storage/vitess/vttablet-pod-template.yaml deleted file mode 100644 index d3d097e8fc..0000000000 --- a/examples/storage/vitess/vttablet-pod-template.yaml +++ /dev/null @@ -1,128 +0,0 @@ -kind: Pod -apiVersion: v1 -metadata: - name: vttablet-{{uid}} - labels: - component: vttablet - keyspace: "{{keyspace}}" - shard: "{{shard_label}}" - tablet: "{{alias}}" - app: vitess -spec: - containers: - - name: vttablet - image: vitess/lite:v2.0.0-alpha5 - volumeMounts: - - name: syslog - mountPath: /dev/log - - name: vtdataroot - mountPath: /vt/vtdataroot - - name: certs - readOnly: true - mountPath: /etc/ssl/certs - resources: - limits: - memory: "1Gi" - cpu: "500m" - command: - - bash - - "-c" - - >- - set -e - - mysql_socket="$VTDATAROOT/{{tablet_subdir}}/mysql.sock" - - mkdir -p $VTDATAROOT/tmp - - chown -R vitess /vt - - while [ ! -e $mysql_socket ]; do - echo "[$(date)] waiting for $mysql_socket" ; - sleep 1 ; - done - - su -p -s /bin/bash -c "mysql -u vt_dba -S $mysql_socket - -e 'CREATE DATABASE IF NOT EXISTS vt_{{keyspace}}'" vitess - - su -p -s /bin/bash -c "/vt/bin/vttablet - -topo_implementation etcd - -etcd_global_addrs http://$ETCD_GLOBAL_SERVICE_HOST:$ETCD_GLOBAL_SERVICE_PORT - -log_dir $VTDATAROOT/tmp - -alsologtostderr - -port {{port}} - -grpc_port {{grpc_port}} - -service_map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' - -binlog_player_protocol grpc - -tablet-path {{alias}} - -tablet_hostname $(hostname -i) - -init_keyspace {{keyspace}} - -init_shard {{shard}} - -target_tablet_type {{tablet_type}} - -mysqlctl_socket $VTDATAROOT/mysqlctl.sock - -db-config-app-uname vt_app - -db-config-app-dbname vt_{{keyspace}} - -db-config-app-charset utf8 - -db-config-dba-uname vt_dba - -db-config-dba-dbname vt_{{keyspace}} - -db-config-dba-charset utf8 - -db-config-repl-uname vt_repl - -db-config-repl-dbname vt_{{keyspace}} - -db-config-repl-charset utf8 - -db-config-filtered-uname vt_filtered - -db-config-filtered-dbname vt_{{keyspace}} - -db-config-filtered-charset utf8 - -enable-rowcache - -rowcache-bin /usr/bin/memcached - -rowcache-socket $VTDATAROOT/{{tablet_subdir}}/memcache.sock - -health_check_interval 5s - -restore_from_backup {{backup_flags}}" vitess - - name: mysql - image: vitess/lite:v2.0.0-alpha5 - volumeMounts: - - name: syslog - mountPath: /dev/log - - name: vtdataroot - mountPath: /vt/vtdataroot - resources: - limits: - memory: "1Gi" - cpu: "500m" - command: - - sh - - "-c" - - >- - mkdir -p $VTDATAROOT/tmp && - chown -R vitess /vt - - su -p -c "/vt/bin/mysqlctld - -log_dir $VTDATAROOT/tmp - -alsologtostderr - -tablet_uid {{uid}} - -socket_file $VTDATAROOT/mysqlctl.sock - -db-config-app-uname vt_app - -db-config-app-dbname vt_{{keyspace}} - -db-config-app-charset utf8 - -db-config-dba-uname vt_dba - -db-config-dba-dbname vt_{{keyspace}} - -db-config-dba-charset utf8 - -db-config-repl-uname vt_repl - -db-config-repl-dbname vt_{{keyspace}} - -db-config-repl-charset utf8 - -db-config-filtered-uname vt_filtered - -db-config-filtered-dbname vt_{{keyspace}} - -db-config-filtered-charset utf8 - -bootstrap_archive mysql-db-dir_10.0.13-MariaDB.tbz" vitess - # The bootstrap archive above contains an empty mysql data dir - # with user permissions set up as required by Vitess. The archive is - # included in the Docker image. - env: - - name: EXTRA_MY_CNF - value: /vt/config/mycnf/master_mariadb.cnf - volumes: - - name: syslog - hostPath: {path: /dev/log} - - name: vtdataroot - emptyDir: {} - - name: certs - hostPath: {path: /etc/ssl/certs} - diff --git a/examples/storage/vitess/vttablet-up.sh b/examples/storage/vitess/vttablet-up.sh deleted file mode 100755 index 231b7589bc..0000000000 --- a/examples/storage/vitess/vttablet-up.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# This is an example script that creates a vttablet deployment. - -set -e - -script_root=`dirname "${BASH_SOURCE}"` -source $script_root/env.sh - -# Create the pods for shard-0 -CELLS=${CELLS:-'test'} -keyspace='test_keyspace' -SHARDS=${SHARDS:-'0'} -TABLETS_PER_SHARD=${TABLETS_PER_SHARD:-5} -port=15002 -grpc_port=16002 -UID_BASE=${UID_BASE:-100} -VTTABLET_TEMPLATE=${VTTABLET_TEMPLATE:-'vttablet-pod-template.yaml'} -RDONLY_COUNT=${RDONLY_COUNT:-2} - -uid_base=$UID_BASE -for shard in $(echo $SHARDS | tr "," " "); do - cell_index=0 - for cell in `echo $CELLS | tr ',' ' '`; do - echo "Creating $keyspace.shard-$shard pods in cell $CELL..." - for uid_index in `seq 0 $(($TABLETS_PER_SHARD-1))`; do - uid=$[$uid_base + $uid_index + $cell_index] - printf -v alias '%s-%010d' $cell $uid - printf -v tablet_subdir 'vt_%010d' $uid - - echo "Creating pod for tablet $alias..." - - # Add xx to beginning or end if there is a dash. K8s does not allow for - # leading or trailing dashes for labels - shard_label=`echo $shard | sed s'/[-]$/-xx/' | sed s'/^-/xx-/'` - - tablet_type=replica - if [ $uid_index -gt $(($TABLETS_PER_SHARD-$RDONLY_COUNT-1)) ]; then - tablet_type=rdonly - fi - - # Expand template variables - sed_script="" - for var in alias cell uid keyspace shard shard_label port grpc_port tablet_subdir tablet_type backup_flags; do - sed_script+="s,{{$var}},${!var},g;" - done - - # Instantiate template and send to kubectl. - cat $VTTABLET_TEMPLATE | sed -e "$sed_script" | $KUBECTL create -f - - done - let cell_index=cell_index+100000000 - done - let uid_base=uid_base+100 -done diff --git a/examples/storm/README.md b/examples/storm/README.md deleted file mode 100644 index 0867b35f18..0000000000 --- a/examples/storm/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/storm/README.md](https://github.com/kubernetes/examples/blob/master/staging/storm/README.md) diff --git a/examples/storm/storm-nimbus-service.json b/examples/storm/storm-nimbus-service.json deleted file mode 100644 index 2a8f71349f..0000000000 --- a/examples/storm/storm-nimbus-service.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "nimbus", - "labels": { - "name": "nimbus" - } - }, - "spec": { - "ports": [ - { - "port": 6627 - } - ], - "selector": { - "name": "nimbus" - } - } -} diff --git a/examples/storm/storm-nimbus.json b/examples/storm/storm-nimbus.json deleted file mode 100644 index e9a2f927a8..0000000000 --- a/examples/storm/storm-nimbus.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "nimbus", - "labels": { - "name": "nimbus" - } - }, - "spec": { - "containers": [ - { - "name": "nimbus", - "image": "mattf/storm-nimbus", - "ports": [ - { - "containerPort": 6627 - } - ], - "resources": { - "limits": { - "cpu": "100m" - } - } - } - ] - } -} diff --git a/examples/storm/storm-worker-controller.json b/examples/storm/storm-worker-controller.json deleted file mode 100644 index 0806b27454..0000000000 --- a/examples/storm/storm-worker-controller.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "kind": "ReplicationController", - "apiVersion": "v1", - "metadata": { - "name": "storm-worker-controller", - "labels": { - "name": "storm-worker" - } - }, - "spec": { - "replicas": 2, - "selector": { - "name": "storm-worker" - }, - "template": { - "metadata": { - "labels": { - "name": "storm-worker", - "uses": "nimbus" - } - }, - "spec": { - "containers": [ - { - "name": "storm-worker", - "image": "mattf/storm-worker", - "ports": [ - { - "hostPort": 6700, - "containerPort": 6700 - }, - { - "hostPort": 6701, - "containerPort": 6701 - }, - { - "hostPort": 6702, - "containerPort": 6702 - }, - { - "hostPort": 6703, - "containerPort": 6703 - } - ], - "resources": { - "limits": { - "cpu": "200m" - } - } - } - ] - } - } - } -} diff --git a/examples/storm/zookeeper-service.json b/examples/storm/zookeeper-service.json deleted file mode 100644 index bbfc515bd7..0000000000 --- a/examples/storm/zookeeper-service.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "zookeeper", - "labels": { - "name": "zookeeper" - } - }, - "spec": { - "ports": [ - { - "port": 2181 - } - ], - "selector": { - "name": "zookeeper" - } - } -} diff --git a/examples/storm/zookeeper.json b/examples/storm/zookeeper.json deleted file mode 100644 index 89b82b7bca..0000000000 --- a/examples/storm/zookeeper.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "kind": "Pod", - "apiVersion": "v1", - "metadata": { - "name": "zookeeper", - "labels": { - "name": "zookeeper" - } - }, - "spec": { - "containers": [ - { - "name": "zookeeper", - "image": "mattf/zookeeper", - "ports": [ - { - "containerPort": 2181 - } - ], - "resources": { - "limits": { - "cpu": "100m" - } - } - } - ] - } -} diff --git a/examples/sysdig-cloud/README.md b/examples/sysdig-cloud/README.md deleted file mode 100644 index 23678fe16a..0000000000 --- a/examples/sysdig-cloud/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/sysdig-cloud/README.md](https://github.com/kubernetes/examples/blob/master/staging/sysdig-cloud/README.md) diff --git a/examples/sysdig-cloud/sysdig-daemonset.yaml b/examples/sysdig-cloud/sysdig-daemonset.yaml deleted file mode 100644 index 3cfd4a54f8..0000000000 --- a/examples/sysdig-cloud/sysdig-daemonset.yaml +++ /dev/null @@ -1,73 +0,0 @@ -#Use this sysdig.yaml when Daemon Sets are enabled on Kubernetes (minimum version 1.1.1). Otherwise use the RC method. - -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: sysdig-agent - labels: - app: sysdig-agent -spec: - template: - metadata: - labels: - name: sysdig-agent - spec: - volumes: - - name: docker-sock - hostPath: - path: /var/run/docker.sock - type: Socket - - name: dev-vol - hostPath: - path: /dev - - name: proc-vol - hostPath: - path: /proc - - name: boot-vol - hostPath: - path: /boot - - name: modules-vol - hostPath: - path: /lib/modules - - name: usr-vol - hostPath: - path: /usr - hostNetwork: true - hostPID: true - containers: - - name: sysdig-agent - image: sysdig/agent - securityContext: - privileged: true - env: - - name: ACCESS_KEY #REQUIRED - replace with your Sysdig Cloud access key - value: 8312341g-5678-abcd-4a2b2c-33bcsd655 -# - name: TAGS #OPTIONAL -# value: linux:ubuntu,dept:dev,local:nyc -# - name: COLLECTOR #OPTIONAL - on-prem install only -# value: 192.168.183.200 -# - name: SECURE #OPTIONAL - on-prem install only -# value: false -# - name: CHECK_CERTIFICATE #OPTIONAL - on-prem install only -# value: false -# - name: ADDITIONAL_CONF #OPTIONAL pass additional parameters to the agent such as authentication example provided here -# value: "k8s_uri: https://myacct:mypass@localhost:4430\nk8s_ca_certificate: k8s-ca.crt\nk8s_ssl_verify_certificate: true" - volumeMounts: - - mountPath: /host/var/run/docker.sock - name: docker-sock - readOnly: false - - mountPath: /host/dev - name: dev-vol - readOnly: false - - mountPath: /host/proc - name: proc-vol - readOnly: true - - mountPath: /host/boot - name: boot-vol - readOnly: true - - mountPath: /host/lib/modules - name: modules-vol - readOnly: true - - mountPath: /host/usr - name: usr-vol - readOnly: true diff --git a/examples/sysdig-cloud/sysdig-rc.yaml b/examples/sysdig-cloud/sysdig-rc.yaml deleted file mode 100644 index dfef08de1a..0000000000 --- a/examples/sysdig-cloud/sysdig-rc.yaml +++ /dev/null @@ -1,78 +0,0 @@ -#Use this sysdig.yaml when Daemon Sets are NOT enabled on Kubernetes (minimum version 1.1.1). If Daemon Sets are available, use the other example sysdig.yaml - that is the recommended method. - -apiVersion: v1 -kind: ReplicationController -metadata: - name: sysdig-agent - labels: - app: sysdig-agent -spec: - replicas: 100 #REQUIRED - replace with the maximum number of slave nodes in the cluster - template: - spec: - volumes: - - name: docker-sock - hostPath: - path: /var/run/docker.sock - type: Socket - - name: dev-vol - hostPath: - path: /dev - - name: proc-vol - hostPath: - path: /proc - - name: boot-vol - hostPath: - path: /boot - - name: modules-vol - hostPath: - path: /lib/modules - - name: usr-vol - hostPath: - path: /usr - hostNetwork: true - hostPID: true - containers: - - name: sysdig-agent - image: sysdig/agent - ports: - - containerPort: 6666 - hostPort: 6666 - securityContext: - privileged: true - env: - - name: ACCESS_KEY #REQUIRED - replace with your Sysdig Cloud access key - value: 8312341g-5678-abcd-4a2b2c-33bcsd655 -# - name: K8S_DELEGATED_NODE #OPTIONAL - only necessary when connecting remotely to API server -# value: -# - name: K8S_API_URI #OPTIONAL - only necessary when connecting remotely to API server -# value: "http[s]://[username:passwd@]host[:port]" -# - name: TAGS #OPTIONAL -# value: linux:ubuntu,dept:dev,local:nyc -# - name: COLLECTOR #OPTIONAL -# value: 192.168.183.200 -# - name: SECURE #OPTIONAL -# value: false -# - name: CHECK_CERTIFICATE #OPTIONAL -# value: false -# - name: ADDITIONAL_CONF #OPTIONAL -# value: "app_checks:\n - name: nginx\n check_module: nginx\n pattern:\n comm: nginx\n conf:\n nginx_status_url: "http://localhost:{port}/nginx_status\"" - volumeMounts: - - mountPath: /host/var/run/docker.sock - name: docker-sock - readOnly: false - - mountPath: /host/dev - name: dev-vol - readOnly: false - - mountPath: /host/proc - name: proc-vol - readOnly: true - - mountPath: /host/boot - name: boot-vol - readOnly: true - - mountPath: /host/lib/modules - name: modules-vol - readOnly: true - - mountPath: /host/usr - name: usr-vol - readOnly: true diff --git a/examples/volumes/aws_ebs/README.md b/examples/volumes/aws_ebs/README.md deleted file mode 100644 index 3edf78fef4..0000000000 --- a/examples/volumes/aws_ebs/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/aws_ebs/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/aws_ebs/README.md) diff --git a/examples/volumes/aws_ebs/aws-ebs-web.yaml b/examples/volumes/aws_ebs/aws-ebs-web.yaml deleted file mode 100644 index 56667f5383..0000000000 --- a/examples/volumes/aws_ebs/aws-ebs-web.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: aws-web -spec: - containers: - - name: web - image: nginx - ports: - - name: web - containerPort: 80 - protocol: tcp - volumeMounts: - - name: html-volume - mountPath: "/usr/share/nginx/html" - volumes: - - name: html-volume - awsElasticBlockStore: - # Enter the volume ID below - volumeID: volume_ID - fsType: ext4 diff --git a/examples/volumes/azure_disk/README.md b/examples/volumes/azure_disk/README.md deleted file mode 100644 index f495261e3d..0000000000 --- a/examples/volumes/azure_disk/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_disk/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_disk/README.md) diff --git a/examples/volumes/azure_disk/azure.yaml b/examples/volumes/azure_disk/azure.yaml deleted file mode 100644 index 04df7fb9b4..0000000000 --- a/examples/volumes/azure_disk/azure.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: azure -spec: - containers: - - image: kubernetes/pause - name: azure - volumeMounts: - - name: azure - mountPath: /mnt/azure - volumes: - - name: azure - azureDisk: - diskName: test.vhd - diskURI: https://someaccount.blob.microsoft.net/vhds/test.vhd diff --git a/examples/volumes/azure_file/README.md b/examples/volumes/azure_file/README.md deleted file mode 100644 index 007a6841bd..0000000000 --- a/examples/volumes/azure_file/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_file/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_file/README.md) diff --git a/examples/volumes/azure_file/azure.yaml b/examples/volumes/azure_file/azure.yaml deleted file mode 100644 index 6567f30799..0000000000 --- a/examples/volumes/azure_file/azure.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: azure -spec: - containers: - - image: kubernetes/pause - name: azure - volumeMounts: - - name: azure - mountPath: /mnt/azure - volumes: - - name: azure - azureFile: - secretName: azure-secret - shareName: k8stest - readOnly: false diff --git a/examples/volumes/azure_file/secret/azure-secret.yaml b/examples/volumes/azure_file/secret/azure-secret.yaml deleted file mode 100644 index bf448bd9ce..0000000000 --- a/examples/volumes/azure_file/secret/azure-secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: azure-secret -type: Opaque -data: - azurestorageaccountname: azhzdGVzdA== - azurestorageaccountkey: eElGMXpKYm5ub2pGTE1Ta0JwNTBteDAyckhzTUsyc2pVN21GdDRMMTNob0I3ZHJBYUo4akQ2K0E0NDNqSm9nVjd5MkZVT2hRQ1dQbU02WWFOSHk3cWc9PQ== diff --git a/examples/volumes/cephfs/README.md b/examples/volumes/cephfs/README.md deleted file mode 100644 index 851e01c571..0000000000 --- a/examples/volumes/cephfs/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/cephfs/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/cephfs/README.md) diff --git a/examples/volumes/cephfs/cephfs-with-secret.yaml b/examples/volumes/cephfs/cephfs-with-secret.yaml deleted file mode 100644 index c3d7a02cb0..0000000000 --- a/examples/volumes/cephfs/cephfs-with-secret.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: cephfs2 -spec: - containers: - - name: cephfs-rw - image: kubernetes/pause - volumeMounts: - - mountPath: "/mnt/cephfs" - name: cephfs - volumes: - - name: cephfs - cephfs: - monitors: - - 10.16.154.78:6789 - - 10.16.154.82:6789 - - 10.16.154.83:6789 - user: admin - secretRef: - name: ceph-secret - readOnly: true diff --git a/examples/volumes/cephfs/cephfs.yaml b/examples/volumes/cephfs/cephfs.yaml deleted file mode 100644 index e4eb395b62..0000000000 --- a/examples/volumes/cephfs/cephfs.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: cephfs -spec: - containers: - - name: cephfs-rw - image: kubernetes/pause - volumeMounts: - - mountPath: "/mnt/cephfs" - name: cephfs - volumes: - - name: cephfs - cephfs: - monitors: - - 10.16.154.78:6789 - - 10.16.154.82:6789 - - 10.16.154.83:6789 - # by default the path is /, but you can override and mount a specific path of the filesystem by using the path attribute - # path: /some/path/in/side/cephfs - user: admin - secretFile: "/etc/ceph/admin.secret" - readOnly: true diff --git a/examples/volumes/cephfs/secret/ceph-secret.yaml b/examples/volumes/cephfs/secret/ceph-secret.yaml deleted file mode 100644 index e29a5535ab..0000000000 --- a/examples/volumes/cephfs/secret/ceph-secret.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: ceph-secret -data: - key: QVFCMTZWMVZvRjVtRXhBQTVrQ1FzN2JCajhWVUxSdzI2Qzg0SEE9PQ== diff --git a/examples/volumes/cinder/README.md b/examples/volumes/cinder/README.md deleted file mode 100644 index 4d008c58e1..0000000000 --- a/examples/volumes/cinder/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/cinder/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/cinder/README.md) diff --git a/examples/volumes/cinder/cinder-web.yaml b/examples/volumes/cinder/cinder-web.yaml deleted file mode 100644 index 4692ac868a..0000000000 --- a/examples/volumes/cinder/cinder-web.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: cinder-web -spec: - containers: - - name: web - image: nginx - ports: - - name: web - containerPort: 80 - protocol: tcp - volumeMounts: - - name: html-volume - mountPath: "/usr/share/nginx/html" - volumes: - - name: html-volume - cinder: - # Enter the volume ID below - volumeID: volume_ID - fsType: ext4 diff --git a/examples/volumes/fibre_channel/README.md b/examples/volumes/fibre_channel/README.md deleted file mode 100644 index 308bae6026..0000000000 --- a/examples/volumes/fibre_channel/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/fibre_channel/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/fibre_channel/README.md) diff --git a/examples/volumes/fibre_channel/fc.yaml b/examples/volumes/fibre_channel/fc.yaml deleted file mode 100644 index ac28bee4a3..0000000000 --- a/examples/volumes/fibre_channel/fc.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: fc -spec: - containers: - - image: kubernetes/pause - name: fc - volumeMounts: - - name: fc-vol - mountPath: /mnt/fc - volumes: - - name: fc-vol - fc: - targetWWNs: ['500a0982991b8dc5', '500a0982891b8dc5'] - lun: 2 - fsType: ext4 - readOnly: true diff --git a/examples/volumes/flexvolume/README.md b/examples/volumes/flexvolume/README.md deleted file mode 100644 index a872b65248..0000000000 --- a/examples/volumes/flexvolume/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md) diff --git a/examples/volumes/flexvolume/deploy/Dockerfile b/examples/volumes/flexvolume/deploy/Dockerfile deleted file mode 100644 index 55ef6011a4..0000000000 --- a/examples/volumes/flexvolume/deploy/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 The Kubernetes Authors. -# -# 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. - -FROM busybox -WORKDIR . - -# TODO Change to your desired driver. -COPY ./drivers/dummy /dummy - -COPY deploy.sh /deploy.sh -CMD /bin/sh /deploy.sh diff --git a/examples/volumes/flexvolume/deploy/README.md b/examples/volumes/flexvolume/deploy/README.md deleted file mode 100644 index f9b0480a37..0000000000 --- a/examples/volumes/flexvolume/deploy/README.md +++ /dev/null @@ -1,7 +0,0 @@ -This directory contains an example of the DaemonSet Flexvolume driver deployment method. See documentation [here](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/flexvolume-deployment.md#recommended-driver-deployment-method). - -Steps to use the DaemonSet deployment method: -1. Copy the Flexvolume driver to `drivers` directory. To get a basic example running, copy the `dummy` driver from the parent directory. -1. If you'd like to just get a basic example running, you could skip this step. Otherwise, change the places marked with `TODO` in all files. -1. Build the deployment Docker image and upload to your container registry. -1. Create the DaemonSet. diff --git a/examples/volumes/flexvolume/deploy/deploy.sh b/examples/volumes/flexvolume/deploy/deploy.sh deleted file mode 100755 index ee8ae0ee2a..0000000000 --- a/examples/volumes/flexvolume/deploy/deploy.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# Copyright 2018 The Kubernetes Authors. -# -# 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. - -set -o errexit -set -o pipefail - -# TODO change to your desired driver. -VENDOR=${VENDOR:-k8s} -DRIVER=${DRIVER:-dummy} - -# Assuming the single driver file is located at /$DRIVER inside the DaemonSet image. - -driver_dir=$VENDOR${VENDOR:+"~"}${DRIVER} -if [ ! -d "/flexmnt/$driver_dir" ]; then - mkdir "/flexmnt/$driver_dir" -fi - -tmp_driver=.tmp_$DRIVER -cp "/$DRIVER" "/flexmnt/$driver_dir/$tmp_driver" -mv -f "/flexmnt/$driver_dir/$tmp_driver" "/flexmnt/$driver_dir/$DRIVER" - -while : ; do - sleep 3600 -done diff --git a/examples/volumes/flexvolume/deploy/ds.yaml b/examples/volumes/flexvolume/deploy/ds.yaml deleted file mode 100644 index 9089bd19fc..0000000000 --- a/examples/volumes/flexvolume/deploy/ds.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: flex-ds -spec: - template: - metadata: - name: flex-deploy - labels: - app: flex-deploy - spec: - containers: - # TODO Change to your container registry. - - image: "" - name: flex-deploy - securityContext: - privileged: true - volumeMounts: - - mountPath: /flexmnt - name: flexvolume-mount - volumes: - - name: flexvolume-mount - hostPath: - # TODO Change to the Flexvolume plugin directory of your cluster. - path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/ diff --git a/examples/volumes/flexvolume/dummy b/examples/volumes/flexvolume/dummy deleted file mode 100755 index 4b4012ceda..0000000000 --- a/examples/volumes/flexvolume/dummy +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -# This driver implements a tmpfs with a pre-populated file index.html. - -FLEX_DUMMY_LOG=${FLEX_DUMMY_LOG:-"/tmp/flex-dummy.log"} - -log() { - printf "$*" >&1 -} - -debug() { - echo "$(date) $*" >> "${FLEX_DUMMY_LOG}" -} - -domount() { - debug "domount $@" - MNTPATH=$1 - mkdir -p ${MNTPATH} >/dev/null 2>&1 - mount -t tmpfs none ${MNTPATH} >/dev/null 2>&1 - echo "Hello from flexvolume!" >> "${MNTPATH}/index.html" - log "{\"status\":\"Success\"}" - exit 0 -} - -unmount() { - debug "unmount $@" - MNTPATH=$1 - rm ${MNTPATH}/index.html >/dev/null 2>&1 - umount ${MNTPATH} >/dev/null 2>&1 - log "{\"status\":\"Success\"}" - exit 0 -} - -op=$1 - -if [ "$op" = "init" ]; then - debug "init $@" - log "{\"status\":\"Success\",\"capabilities\":{\"attach\":false}}" - exit 0 -fi - -shift - -case "$op" in - mount) - domount $* - ;; - unmount) - unmount $* - ;; - *) - log "{\"status\":\"Not supported\"}" - exit 0 -esac - -exit 1 diff --git a/examples/volumes/flexvolume/dummy-attachable b/examples/volumes/flexvolume/dummy-attachable deleted file mode 100755 index 8afd6b4bfa..0000000000 --- a/examples/volumes/flexvolume/dummy-attachable +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh - -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -# This driver implements a tmpfs with a pre-populated file index.html. -# Attach is required, but it is a no-op that always returns success. - -FLEX_DUMMY_LOG=${FLEX_DUMMY_LOG:-"/tmp/flex-dummy.log"} - -VALID_MNTDEVICE=foo - -# attach always returns one valid mount device so a different device -# showing up in a subsequent driver call implies a bug -validateMountDeviceOrDie() { - MNTDEVICE=$1 - CALL=$2 - if [ "$MNTDEVICE" != "$VALID_MNTDEVICE" ]; then - log "{\"status\":\"Failure\",\"message\":\"call "${CALL}" expected device "${VALID_MNTDEVICE}", got device "${MNTDEVICE}"\"}" - exit 0 - fi -} - -log() { - printf "$*" >&1 -} - -debug() { - echo "$(date) $*" >> "${FLEX_DUMMY_LOG}" -} - -attach() { - debug "attach $@" - log "{\"status\":\"Success\",\"device\":\""${VALID_MNTDEVICE}"\"}" - exit 0 -} - -detach() { - debug "detach $@" - log "{\"status\":\"Success\"}" - exit 0 -} - -waitforattach() { - debug "waitforattach $@" - MNTDEVICE=$1 - validateMountDeviceOrDie "$MNTDEVICE" "waitforattach" - log "{\"status\":\"Success\",\"device\":\""${MNTDEVICE}"\"}" - exit 0 -} - -isattached() { - debug "isattached $@" - log "{\"status\":\"Success\",\"attached\":true}" - exit 0 -} - -domountdevice() { - debug "domountdevice $@" - MNTDEVICE=$2 - validateMountDeviceOrDie "$MNTDEVICE" "domountdevice" - MNTPATH=$1 - mkdir -p ${MNTPATH} >/dev/null 2>&1 - mount -t tmpfs none ${MNTPATH} >/dev/null 2>&1 - echo "Hello from flexvolume!" >> "${MNTPATH}/index.html" - log "{\"status\":\"Success\"}" - exit 0 -} - -unmountdevice() { - debug "unmountdevice $@" - MNTDEVICE=$2 - validateMountDeviceOrDie "$MNTDEVICE" "unmountdevice" - MNTPATH=$1 - rm "${MNTPATH}/index.html" >/dev/null 2>&1 - umount ${MNTPATH} >/dev/null 2>&1 - log "{\"status\":\"Success\"}" - exit 0 -} - -op=$1 - -if [ "$op" = "init" ]; then - debug "init $@" - log "{\"status\":\"Success\",\"capabilities\":{\"attach\":true}}" - exit 0 -fi - -shift - -case "$op" in - attach) - attach $* - ;; - detach) - detach $* - ;; - waitforattach) - waitforattach $* - ;; - isattached) - isattached $* - ;; - mountdevice) - domountdevice $* - ;; - unmountdevice) - unmountdevice $* - ;; - *) - log "{\"status\":\"Not supported\"}" - exit 0 -esac - -exit 1 diff --git a/examples/volumes/flexvolume/lvm b/examples/volumes/flexvolume/lvm deleted file mode 100755 index f60af48404..0000000000 --- a/examples/volumes/flexvolume/lvm +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# Notes: -# - Please install "jq" package before using this driver. -usage() { - err "Invalid usage. Usage: " - err "\t$0 init" - err "\t$0 attach " - err "\t$0 detach " - err "\t$0 waitforattach " - err "\t$0 mountdevice " - err "\t$0 unmountdevice " - err "\t$0 isattached " - exit 1 -} - -err() { - echo -ne $* 1>&2 -} - -log() { - echo -ne $* >&1 -} - -ismounted() { - MOUNT=`findmnt -n ${MNTPATH} 2>/dev/null | cut -d' ' -f1` - if [ "${MOUNT}" == "${MNTPATH}" ]; then - echo "1" - else - echo "0" - fi -} - -getdevice() { - VOLUMEID=$(echo ${JSON_PARAMS} | jq -r '.volumeID') - VG=$(echo ${JSON_PARAMS}|jq -r '.volumegroup') - - # LVM substitutes - with -- - VOLUMEID=`echo $VOLUMEID|sed s/-/--/g` - VG=`echo $VG|sed s/-/--/g` - - DMDEV="/dev/mapper/${VG}-${VOLUMEID}" - echo ${DMDEV} -} - -attach() { - JSON_PARAMS=$1 - SIZE=$(echo $1 | jq -r '.size') - - DMDEV=$(getdevice) - if [ ! -b "${DMDEV}" ]; then - err "{\"status\": \"Failure\", \"message\": \"Volume ${VOLUMEID} does not exist\"}" - exit 1 - fi - log "{\"status\": \"Success\", \"device\":\"${DMDEV}\"}" - exit 0 -} - -detach() { - log "{\"status\": \"Success\"}" - exit 0 -} - -waitforattach() { - shift - attach $* -} - -domountdevice() { - MNTPATH=$1 - DMDEV=$2 - FSTYPE=$(echo $3|jq -r '.["kubernetes.io/fsType"]') - - if [ ! -b "${DMDEV}" ]; then - err "{\"status\": \"Failure\", \"message\": \"${DMDEV} does not exist\"}" - exit 1 - fi - - if [ $(ismounted) -eq 1 ] ; then - log "{\"status\": \"Success\"}" - exit 0 - fi - - VOLFSTYPE=`blkid -o udev ${DMDEV} 2>/dev/null|grep "ID_FS_TYPE"|cut -d"=" -f2` - if [ "${VOLFSTYPE}" == "" ]; then - mkfs -t ${FSTYPE} ${DMDEV} >/dev/null 2>&1 - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failure\", \"message\": \"Failed to create fs ${FSTYPE} on device ${DMDEV}\"}" - exit 1 - fi - fi - - mkdir -p ${MNTPATH} &> /dev/null - - mount ${DMDEV} ${MNTPATH} &> /dev/null - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failure\", \"message\": \"Failed to mount device ${DMDEV} at ${MNTPATH}\"}" - exit 1 - fi - log "{\"status\": \"Success\"}" - exit 0 -} - -unmountdevice() { - MNTPATH=$1 - if [ ! -d ${MNTPATH} ]; then - log "{\"status\": \"Success\"}" - exit 0 - fi - - if [ $(ismounted) -eq 0 ] ; then - log "{\"status\": \"Success\"}" - exit 0 - fi - - umount ${MNTPATH} &> /dev/null - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failed\", \"message\": \"Failed to unmount volume at ${MNTPATH}\"}" - exit 1 - fi - - log "{\"status\": \"Success\"}" - exit 0 -} - -isattached() { - log "{\"status\": \"Success\", \"attached\":true}" - exit 0 -} - -op=$1 - -if [ "$op" = "init" ]; then - log "{\"status\": \"Success\"}" - exit 0 -fi - -if [ $# -lt 2 ]; then - usage -fi - -shift - -case "$op" in - attach) - attach $* - ;; - detach) - detach $* - ;; - waitforattach) - waitforattach $* - ;; - mountdevice) - domountdevice $* - ;; - unmountdevice) - unmountdevice $* - ;; - isattached) - isattached $* - ;; - *) - log "{ \"status\": \"Not supported\" }" - exit 0 -esac - -exit 1 diff --git a/examples/volumes/flexvolume/nfs b/examples/volumes/flexvolume/nfs deleted file mode 100755 index 4d0977cec8..0000000000 --- a/examples/volumes/flexvolume/nfs +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -# Notes: -# - Please install "jq" package before using this driver. -usage() { - err "Invalid usage. Usage: " - err "\t$0 init" - err "\t$0 mount " - err "\t$0 unmount " - exit 1 -} - -err() { - echo -ne $* 1>&2 -} - -log() { - echo -ne $* >&1 -} - -ismounted() { - MOUNT=`findmnt -n ${MNTPATH} 2>/dev/null | cut -d' ' -f1` - if [ "${MOUNT}" == "${MNTPATH}" ]; then - echo "1" - else - echo "0" - fi -} - -domount() { - MNTPATH=$1 - - NFS_SERVER=$(echo $2 | jq -r '.server') - SHARE=$(echo $2 | jq -r '.share') - - if [ $(ismounted) -eq 1 ] ; then - log '{"status": "Success"}' - exit 0 - fi - - mkdir -p ${MNTPATH} &> /dev/null - - mount -t nfs ${NFS_SERVER}:/${SHARE} ${MNTPATH} &> /dev/null - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failure\", \"message\": \"Failed to mount ${NFS_SERVER}:${SHARE} at ${MNTPATH}\"}" - exit 1 - fi - log '{"status": "Success"}' - exit 0 -} - -unmount() { - MNTPATH=$1 - if [ $(ismounted) -eq 0 ] ; then - log '{"status": "Success"}' - exit 0 - fi - - umount ${MNTPATH} &> /dev/null - if [ $? -ne 0 ]; then - err "{ \"status\": \"Failed\", \"message\": \"Failed to unmount volume at ${MNTPATH}\"}" - exit 1 - fi - - log '{"status": "Success"}' - exit 0 -} - -op=$1 - -if ! command -v jq >/dev/null 2>&1; then - err "{ \"status\": \"Failure\", \"message\": \"'jq' binary not found. Please install jq package before using this driver\"}" - exit 1 -fi - -if [ "$op" = "init" ]; then - log '{"status": "Success", "capabilities": {"attach": false}}' - exit 0 -fi - -if [ $# -lt 2 ]; then - usage -fi - -shift - -case "$op" in - mount) - domount $* - ;; - unmount) - unmount $* - ;; - *) - log '{"status": "Not supported"}' - exit 0 -esac - -exit 1 diff --git a/examples/volumes/flexvolume/nginx-dummy-attachable.yaml b/examples/volumes/flexvolume/nginx-dummy-attachable.yaml deleted file mode 100644 index 80b322c986..0000000000 --- a/examples/volumes/flexvolume/nginx-dummy-attachable.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: nginx-dummy-attachable - namespace: default -spec: - containers: - - name: nginx-dummy-attachable - image: nginx - volumeMounts: - - name: dummy-attachable - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: dummy-attachable - flexVolume: - driver: "k8s/dummy-attachable" diff --git a/examples/volumes/flexvolume/nginx-dummy.yaml b/examples/volumes/flexvolume/nginx-dummy.yaml deleted file mode 100644 index 33ee34251a..0000000000 --- a/examples/volumes/flexvolume/nginx-dummy.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: nginx-dummy - namespace: default -spec: - containers: - - name: nginx-dummy - image: nginx - volumeMounts: - - name: dummy - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: dummy - flexVolume: - driver: "k8s/dummy" diff --git a/examples/volumes/flexvolume/nginx-lvm.yaml b/examples/volumes/flexvolume/nginx-lvm.yaml deleted file mode 100644 index c7d7859cc5..0000000000 --- a/examples/volumes/flexvolume/nginx-lvm.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: nginx - namespace: default -spec: - containers: - - name: nginx - image: nginx - volumeMounts: - - name: test - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: test - flexVolume: - driver: "kubernetes.io/lvm" - fsType: "ext4" - options: - volumeID: "vol1" - size: "1000m" - volumegroup: "kube_vg" diff --git a/examples/volumes/flexvolume/nginx-nfs.yaml b/examples/volumes/flexvolume/nginx-nfs.yaml deleted file mode 100644 index 177c1e8f41..0000000000 --- a/examples/volumes/flexvolume/nginx-nfs.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: nginx-nfs - namespace: default -spec: - containers: - - name: nginx-nfs - image: nginx - volumeMounts: - - name: test - mountPath: /data - ports: - - containerPort: 80 - volumes: - - name: test - flexVolume: - driver: "k8s/nfs" - fsType: "nfs" - options: - server: "172.16.0.25" - share: "dws_nas_scratch" diff --git a/examples/volumes/flocker/README.md b/examples/volumes/flocker/README.md deleted file mode 100644 index 906446f4cc..0000000000 --- a/examples/volumes/flocker/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/flocker/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/flocker/README.md) diff --git a/examples/volumes/flocker/flocker-pod-with-rc.yml b/examples/volumes/flocker/flocker-pod-with-rc.yml deleted file mode 100644 index 01a40f8811..0000000000 --- a/examples/volumes/flocker/flocker-pod-with-rc.yml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: flocker-ghost - labels: - app: flocker-ghost -spec: - ports: - # the port that this service should serve on - - port: 80 - targetPort: 80 - selector: - app: flocker-ghost ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: flocker-ghost - # these labels can be applied automatically - # from the labels in the pod template if not set - labels: - purpose: demo -spec: - replicas: 1 - template: - metadata: - labels: - app: flocker-ghost - spec: - containers: - - name: flocker-ghost - image: ghost:0.7.1 - env: - - name: GET_HOSTS_FROM - value: dns - ports: - - containerPort: 2368 - hostPort: 80 - protocol: TCP - volumeMounts: - # name must match the volume name below - - name: ghost-data - mountPath: "/var/lib/ghost" - volumes: - - name: ghost-data - flocker: - datasetName: my-flocker-vol diff --git a/examples/volumes/flocker/flocker-pod.yml b/examples/volumes/flocker/flocker-pod.yml deleted file mode 100644 index fb923cd49f..0000000000 --- a/examples/volumes/flocker/flocker-pod.yml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: flocker-web -spec: - containers: - - name: web - image: nginx - ports: - - name: web - containerPort: 80 - volumeMounts: - # name must match the volume name below - - name: www-root - mountPath: "/usr/share/nginx/html" - volumes: - - name: www-root - flocker: - datasetName: my-flocker-vol diff --git a/examples/volumes/glusterfs/README.md b/examples/volumes/glusterfs/README.md deleted file mode 100644 index ae7d23c5f1..0000000000 --- a/examples/volumes/glusterfs/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/glusterfs/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/glusterfs/README.md) diff --git a/examples/volumes/glusterfs/glusterfs-endpoints.json b/examples/volumes/glusterfs/glusterfs-endpoints.json deleted file mode 100644 index 740ce42586..0000000000 --- a/examples/volumes/glusterfs/glusterfs-endpoints.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "kind": "Endpoints", - "apiVersion": "v1", - "metadata": { - "name": "glusterfs-cluster" - }, - "subsets": [ - { - "addresses": [ - { - "ip": "10.240.106.152" - } - ], - "ports": [ - { - "port": 1 - } - ] - }, - { - "addresses": [ - { - "ip": "10.240.79.157" - } - ], - "ports": [ - { - "port": 1 - } - ] - } - ] -} diff --git a/examples/volumes/glusterfs/glusterfs-pod.json b/examples/volumes/glusterfs/glusterfs-pod.json deleted file mode 100644 index 63c075be66..0000000000 --- a/examples/volumes/glusterfs/glusterfs-pod.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "name": "glusterfs" - }, - "spec": { - "containers": [ - { - "name": "glusterfs", - "image": "nginx", - "volumeMounts": [ - { - "mountPath": "/mnt/glusterfs", - "name": "glusterfsvol" - } - ] - } - ], - "volumes": [ - { - "name": "glusterfsvol", - "glusterfs": { - "endpoints": "glusterfs-cluster", - "path": "kube_vol", - "readOnly": true - } - } - ] - } -} diff --git a/examples/volumes/glusterfs/glusterfs-service.json b/examples/volumes/glusterfs/glusterfs-service.json deleted file mode 100644 index 79139febd8..0000000000 --- a/examples/volumes/glusterfs/glusterfs-service.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "glusterfs-cluster" - }, - "spec": { - "ports": [ - {"port": 1} - ] - } -} diff --git a/examples/volumes/iscsi/README.md b/examples/volumes/iscsi/README.md deleted file mode 100644 index 6b8ca9a854..0000000000 --- a/examples/volumes/iscsi/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/iscsi/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/iscsi/README.md) diff --git a/examples/volumes/iscsi/chap-secret.yaml b/examples/volumes/iscsi/chap-secret.yaml deleted file mode 100644 index 5bc9cc8747..0000000000 --- a/examples/volumes/iscsi/chap-secret.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - name: chap-secret -type: "kubernetes.io/iscsi-chap" -data: - discovery.sendtargets.auth.username: dXNlcg== - discovery.sendtargets.auth.password: ZGVtbw== - discovery.sendtargets.auth.username_in: bXVzZXI= - discovery.sendtargets.auth.password_in: bXBhc3M= - node.session.auth.username: dXNlcm5hbWU= - node.session.auth.password: cGFzc3dvcmQ= - node.session.auth.username_in: bXVzZXIy - node.session.auth.password_in: bXBhc3My diff --git a/examples/volumes/iscsi/iscsi-chap.yaml b/examples/volumes/iscsi/iscsi-chap.yaml deleted file mode 100644 index 1ddc2f02ca..0000000000 --- a/examples/volumes/iscsi/iscsi-chap.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: iscsipd -spec: - containers: - - name: iscsipd-ro - image: kubernetes/pause - volumeMounts: - - mountPath: "/mnt/iscsipd" - name: iscsivol - volumes: - - name: iscsivol - iscsi: - targetPortal: 127.0.0.1 - iqn: iqn.2015-02.example.com:test - lun: 0 - fsType: ext4 - readOnly: true - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: chap-secret diff --git a/examples/volumes/iscsi/iscsi.yaml b/examples/volumes/iscsi/iscsi.yaml deleted file mode 100644 index 46736eda8f..0000000000 --- a/examples/volumes/iscsi/iscsi.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: v1 -kind: Pod -metadata: - name: iscsipd -spec: - containers: - - name: iscsipd-rw - image: kubernetes/pause - volumeMounts: - - mountPath: "/mnt/iscsipd" - name: iscsipd-rw - volumes: - - name: iscsipd-rw - iscsi: - targetPortal: 10.0.2.15:3260 - portals: ['10.0.2.16:3260', '10.0.2.17:3260'] - iqn: iqn.2001-04.com.example:storage.kube.sys1.xyz - lun: 0 - fsType: ext4 - readOnly: true diff --git a/examples/volumes/nfs/README.md b/examples/volumes/nfs/README.md deleted file mode 100644 index acd56f937d..0000000000 --- a/examples/volumes/nfs/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md) diff --git a/examples/volumes/nfs/nfs-busybox-rc.yaml b/examples/volumes/nfs/nfs-busybox-rc.yaml deleted file mode 100644 index 617d027558..0000000000 --- a/examples/volumes/nfs/nfs-busybox-rc.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# This mounts the nfs volume claim into /mnt and continuously -# overwrites /mnt/index.html with the time and hostname of the pod. - -apiVersion: v1 -kind: ReplicationController -metadata: - name: nfs-busybox -spec: - replicas: 2 - selector: - name: nfs-busybox - template: - metadata: - labels: - name: nfs-busybox - spec: - containers: - - image: busybox - command: - - sh - - -c - - 'while true; do date > /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); done' - imagePullPolicy: IfNotPresent - name: busybox - volumeMounts: - # name must match the volume name below - - name: nfs - mountPath: "/mnt" - volumes: - - name: nfs - persistentVolumeClaim: - claimName: nfs diff --git a/examples/volumes/nfs/nfs-data/Dockerfile b/examples/volumes/nfs/nfs-data/Dockerfile deleted file mode 100644 index 96986bd801..0000000000 --- a/examples/volumes/nfs/nfs-data/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# 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. - -FROM centos -RUN yum -y install /usr/bin/ps nfs-utils && yum clean all -RUN mkdir -p /exports -ADD run_nfs.sh /usr/local/bin/ -ADD index.html /tmp/index.html -RUN chmod 644 /tmp/index.html - -# expose mountd 20048/tcp and nfsd 2049/tcp and rpcbind 111/tcp -EXPOSE 2049/tcp 20048/tcp 111/tcp 111/udp - -ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"] diff --git a/examples/volumes/nfs/nfs-data/README.md b/examples/volumes/nfs/nfs-data/README.md deleted file mode 100644 index 0b3a8b3198..0000000000 --- a/examples/volumes/nfs/nfs-data/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-data/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-data/README.md) diff --git a/examples/volumes/nfs/nfs-data/index.html b/examples/volumes/nfs/nfs-data/index.html deleted file mode 100644 index cd0875583a..0000000000 --- a/examples/volumes/nfs/nfs-data/index.html +++ /dev/null @@ -1 +0,0 @@ -Hello world! diff --git a/examples/volumes/nfs/nfs-data/run_nfs.sh b/examples/volumes/nfs/nfs-data/run_nfs.sh deleted file mode 100755 index fa7b165c01..0000000000 --- a/examples/volumes/nfs/nfs-data/run_nfs.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Kubernetes Authors. -# -# 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. - -function start() -{ - - # prepare /etc/exports - for i in "$@"; do - # fsid=0: needed for NFSv4 - echo "$i *(rw,fsid=0,insecure,no_root_squash)" >> /etc/exports - # move index.html to here - /bin/cp /tmp/index.html $i/ - chmod 644 $i/index.html - echo "Serving $i" - done - - # start rpcbind if it is not started yet - /usr/sbin/rpcinfo 127.0.0.1 > /dev/null; s=$? - if [ $s -ne 0 ]; then - echo "Starting rpcbind" - /usr/sbin/rpcbind -w - fi - - mount -t nfsd nfds /proc/fs/nfsd - - # -N 4.x: disable NFSv4 - # -V 3: enable NFSv3 - /usr/sbin/rpc.mountd -N 2 -V 3 -N 4 -N 4.1 - - /usr/sbin/exportfs -r - # -G 10 to reduce grace time to 10 seconds (the lowest allowed) - /usr/sbin/rpc.nfsd -G 10 -N 2 -V 3 -N 4 -N 4.1 2 - /usr/sbin/rpc.statd --no-notify - echo "NFS started" -} - -function stop() -{ - echo "Stopping NFS" - - /usr/sbin/rpc.nfsd 0 - /usr/sbin/exportfs -au - /usr/sbin/exportfs -f - - kill $( pidof rpc.mountd ) - umount /proc/fs/nfsd - echo > /etc/exports - exit 0 -} - - -trap stop TERM - -start "$@" - -# Ugly hack to do nothing and wait for SIGTERM -while true; do - sleep 5 -done diff --git a/examples/volumes/nfs/nfs-pv.png b/examples/volumes/nfs/nfs-pv.png deleted file mode 100644 index 1ac5fc0d1a..0000000000 Binary files a/examples/volumes/nfs/nfs-pv.png and /dev/null differ diff --git a/examples/volumes/nfs/nfs-pv.yaml b/examples/volumes/nfs/nfs-pv.yaml deleted file mode 100644 index 258f4d4c9d..0000000000 --- a/examples/volumes/nfs/nfs-pv.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: nfs -spec: - capacity: - storage: 1Mi - accessModes: - - ReadWriteMany - nfs: - # FIXME: use the right IP - server: 10.244.1.4 - path: "/exports" diff --git a/examples/volumes/nfs/nfs-pvc.yaml b/examples/volumes/nfs/nfs-pvc.yaml deleted file mode 100644 index 9c1821f7c4..0000000000 --- a/examples/volumes/nfs/nfs-pvc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: nfs -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 1Mi diff --git a/examples/volumes/nfs/nfs-server-rc.yaml b/examples/volumes/nfs/nfs-server-rc.yaml deleted file mode 100644 index c83ed1db87..0000000000 --- a/examples/volumes/nfs/nfs-server-rc.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -kind: ReplicationController -metadata: - name: nfs-server -spec: - replicas: 1 - selector: - role: nfs-server - template: - metadata: - labels: - role: nfs-server - spec: - containers: - - name: nfs-server - image: gcr.io/google-samples/nfs-server:1.1 - ports: - - name: nfs - containerPort: 2049 - - name: mountd - containerPort: 20048 - - name: rpcbind - containerPort: 111 - securityContext: - privileged: true - volumeMounts: - - mountPath: /exports - name: mypvc - volumes: - - name: mypvc - persistentVolumeClaim: - claimName: nfs-pv-provisioning-demo diff --git a/examples/volumes/nfs/nfs-server-service.yaml b/examples/volumes/nfs/nfs-server-service.yaml deleted file mode 100644 index 9654d15838..0000000000 --- a/examples/volumes/nfs/nfs-server-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: nfs-server -spec: - ports: - - name: nfs - port: 2049 - - name: mountd - port: 20048 - - name: rpcbind - port: 111 - selector: - role: nfs-server diff --git a/examples/volumes/nfs/nfs-web-rc.yaml b/examples/volumes/nfs/nfs-web-rc.yaml deleted file mode 100644 index 6c96682cb1..0000000000 --- a/examples/volumes/nfs/nfs-web-rc.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# This pod mounts the nfs volume claim into /usr/share/nginx/html and -# serves a simple web page. - -apiVersion: v1 -kind: ReplicationController -metadata: - name: nfs-web -spec: - replicas: 2 - selector: - role: web-frontend - template: - metadata: - labels: - role: web-frontend - spec: - containers: - - name: web - image: nginx - ports: - - name: web - containerPort: 80 - volumeMounts: - # name must match the volume name below - - name: nfs - mountPath: "/usr/share/nginx/html" - volumes: - - name: nfs - persistentVolumeClaim: - claimName: nfs diff --git a/examples/volumes/nfs/nfs-web-service.yaml b/examples/volumes/nfs/nfs-web-service.yaml deleted file mode 100644 index b73cac2bc9..0000000000 --- a/examples/volumes/nfs/nfs-web-service.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: nfs-web -spec: - ports: - - port: 80 - selector: - role: web-frontend diff --git a/examples/volumes/nfs/provisioner/nfs-server-gce-pv.yaml b/examples/volumes/nfs/provisioner/nfs-server-gce-pv.yaml deleted file mode 100644 index cccb9a42a4..0000000000 --- a/examples/volumes/nfs/provisioner/nfs-server-gce-pv.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: nfs-pv-provisioning-demo - labels: - demo: nfs-pv-provisioning -spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 200Gi diff --git a/examples/volumes/portworx/README.md b/examples/volumes/portworx/README.md deleted file mode 100644 index d1ab62468e..0000000000 --- a/examples/volumes/portworx/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/portworx/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/portworx/README.md) diff --git a/examples/volumes/portworx/portworx-volume-pod.yaml b/examples/volumes/portworx/portworx-volume-pod.yaml deleted file mode 100644 index f44302f59e..0000000000 --- a/examples/volumes/portworx/portworx-volume-pod.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: test-portworx-volume-pod -spec: - containers: - - image: k8s.gcr.io/test-webserver - name: test-container - volumeMounts: - - mountPath: /test-portworx-volume - name: test-volume - volumes: - - name: test-volume - # This Portworx volume must already exist. - portworxVolume: - volumeID: "vol1" diff --git a/examples/volumes/portworx/portworx-volume-pv.yaml b/examples/volumes/portworx/portworx-volume-pv.yaml deleted file mode 100644 index af4e0114fa..0000000000 --- a/examples/volumes/portworx/portworx-volume-pv.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: pv0001 -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - portworxVolume: - volumeID: "pv0001" diff --git a/examples/volumes/portworx/portworx-volume-pvc.yaml b/examples/volumes/portworx/portworx-volume-pvc.yaml deleted file mode 100644 index 181a3848d8..0000000000 --- a/examples/volumes/portworx/portworx-volume-pvc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvc0001 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi \ No newline at end of file diff --git a/examples/volumes/portworx/portworx-volume-pvcpod.yaml b/examples/volumes/portworx/portworx-volume-pvcpod.yaml deleted file mode 100644 index bef2d49656..0000000000 --- a/examples/volumes/portworx/portworx-volume-pvcpod.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: pvpod -spec: - containers: - - name: test-container - image: k8s.gcr.io/test-webserver - volumeMounts: - - name: test-volume - mountPath: /test-portworx-volume - volumes: - - name: test-volume - persistentVolumeClaim: - claimName: pvc0001 diff --git a/examples/volumes/portworx/portworx-volume-pvcsc.yaml b/examples/volumes/portworx/portworx-volume-pvcsc.yaml deleted file mode 100644 index 736e67feea..0000000000 --- a/examples/volumes/portworx/portworx-volume-pvcsc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvcsc001 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - storageClassName: portworx-io-priority-high diff --git a/examples/volumes/portworx/portworx-volume-pvcscpod.yaml b/examples/volumes/portworx/portworx-volume-pvcscpod.yaml deleted file mode 100644 index 8bdd513192..0000000000 --- a/examples/volumes/portworx/portworx-volume-pvcscpod.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: pvpod -spec: - containers: - - name: test-container - image: k8s.gcr.io/test-webserver - volumeMounts: - - name: test-volume - mountPath: /test-portworx-volume - volumes: - - name: test-volume - persistentVolumeClaim: - claimName: pvcsc001 diff --git a/examples/volumes/portworx/portworx-volume-sc-high.yaml b/examples/volumes/portworx/portworx-volume-sc-high.yaml deleted file mode 100644 index 8fc7323778..0000000000 --- a/examples/volumes/portworx/portworx-volume-sc-high.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: portworx-io-priority-high -provisioner: kubernetes.io/portworx-volume -parameters: - repl: "1" - snap_interval: "70" - io_priority: "high" diff --git a/examples/volumes/quobyte/Readme.md b/examples/volumes/quobyte/Readme.md deleted file mode 100644 index fe41c8e595..0000000000 --- a/examples/volumes/quobyte/Readme.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/quobyte/Readme.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/quobyte/Readme.md) diff --git a/examples/volumes/quobyte/quobyte-pod.yaml b/examples/volumes/quobyte/quobyte-pod.yaml deleted file mode 100644 index f731a53ea5..0000000000 --- a/examples/volumes/quobyte/quobyte-pod.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: quobyte -spec: - containers: - - name: quobyte - image: kubernetes/pause - volumeMounts: - - mountPath: /mnt - name: quobytevolume - volumes: - - name: quobytevolume - quobyte: - registry: registry:7861 - volume: testVolume - readOnly: false - user: root - group: root diff --git a/examples/volumes/rbd/README.md b/examples/volumes/rbd/README.md deleted file mode 100644 index 46b19d8d36..0000000000 --- a/examples/volumes/rbd/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/rbd/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/rbd/README.md) diff --git a/examples/volumes/rbd/rbd-with-secret.json b/examples/volumes/rbd/rbd-with-secret.json deleted file mode 100644 index 30375583d0..0000000000 --- a/examples/volumes/rbd/rbd-with-secret.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "name": "rbd2" - }, - "spec": { - "containers": [ - { - "name": "rbd-rw", - "image": "kubernetes/pause", - "volumeMounts": [ - { - "mountPath": "/mnt/rbd", - "name": "rbdpd" - } - ] - } - ], - "volumes": [ - { - "name": "rbdpd", - "rbd": { - "monitors": [ - "10.16.154.78:6789", - "10.16.154.82:6789", - "10.16.154.83:6789" - ], - "pool": "kube", - "image": "foo", - "user": "admin", - "secretRef": { - "name": "ceph-secret" - }, - "fsType": "ext4", - "readOnly": true - } - } - ] - } -} diff --git a/examples/volumes/rbd/rbd.json b/examples/volumes/rbd/rbd.json deleted file mode 100644 index 68033bffd8..0000000000 --- a/examples/volumes/rbd/rbd.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "apiVersion": "v1", - "kind": "Pod", - "metadata": { - "name": "rbd" - }, - "spec": { - "containers": [ - { - "name": "rbd-rw", - "image": "kubernetes/pause", - "volumeMounts": [ - { - "mountPath": "/mnt/rbd", - "name": "rbdpd" - } - ] - } - ], - "volumes": [ - { - "name": "rbdpd", - "rbd": { - "monitors": [ - "10.16.154.78:6789", - "10.16.154.82:6789", - "10.16.154.83:6789" - ], - "pool": "kube", - "image": "foo", - "user": "admin", - "keyring": "/etc/ceph/keyring", - "fsType": "ext4", - "readOnly": true - } - } - ] - } -} diff --git a/examples/volumes/rbd/secret/ceph-secret.yaml b/examples/volumes/rbd/secret/ceph-secret.yaml deleted file mode 100644 index f717f9005e..0000000000 --- a/examples/volumes/rbd/secret/ceph-secret.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: ceph-secret -type: "kubernetes.io/rbd" -data: - key: QVFCMTZWMVZvRjVtRXhBQTVrQ1FzN2JCajhWVUxSdzI2Qzg0SEE9PQ== diff --git a/examples/volumes/scaleio/README.md b/examples/volumes/scaleio/README.md deleted file mode 100644 index fb7f9a6fac..0000000000 --- a/examples/volumes/scaleio/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/scaleio/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/scaleio/README.md) diff --git a/examples/volumes/scaleio/pod-sc-pvc.yaml b/examples/volumes/scaleio/pod-sc-pvc.yaml deleted file mode 100644 index c94e7bc393..0000000000 --- a/examples/volumes/scaleio/pod-sc-pvc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -kind: Pod -apiVersion: v1 -metadata: - name: pod-sio-small -spec: - containers: - - name: pod-sio-small-container - image: k8s.gcr.io/test-webserver - volumeMounts: - - mountPath: /test - name: test-data - volumes: - - name: test-data - persistentVolumeClaim: - claimName: pvc-sio-small diff --git a/examples/volumes/scaleio/pod.yaml b/examples/volumes/scaleio/pod.yaml deleted file mode 100644 index b13ec668c7..0000000000 --- a/examples/volumes/scaleio/pod.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: pod-0 -spec: - containers: - - image: k8s.gcr.io/test-webserver - name: pod-0 - volumeMounts: - - mountPath: /test-pd - name: vol-0 - volumes: - - name: vol-0 - scaleIO: - gateway: https://localhost:443/api - system: scaleio - volumeName: vol-0 - secretRef: - name: sio-secret - fsType: xfs diff --git a/examples/volumes/scaleio/sc-pvc.yaml b/examples/volumes/scaleio/sc-pvc.yaml deleted file mode 100644 index 078fb63548..0000000000 --- a/examples/volumes/scaleio/sc-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvc-sio-small -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi - storageClassName: sio-small diff --git a/examples/volumes/scaleio/sc.yaml b/examples/volumes/scaleio/sc.yaml deleted file mode 100644 index 2ff4c028f5..0000000000 --- a/examples/volumes/scaleio/sc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: sio-small -provisioner: kubernetes.io/scaleio -parameters: - gateway: https://localhost:443/api - system: scaleio - protectionDomain: default - secretRef: sio-secret - fsType: xfs diff --git a/examples/volumes/scaleio/secret.yaml b/examples/volumes/scaleio/secret.yaml deleted file mode 100644 index b2fad68afa..0000000000 --- a/examples/volumes/scaleio/secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: sio-secret -type: kubernetes.io/scaleio -data: - username: YWRtaW4= - password: c0NhbGVpbzEyMw== diff --git a/examples/volumes/storageos/README.md b/examples/volumes/storageos/README.md deleted file mode 100644 index c2d6f74dbb..0000000000 --- a/examples/volumes/storageos/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/storageos/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/storageos/README.md) diff --git a/examples/volumes/storageos/storageos-pod.yaml b/examples/volumes/storageos/storageos-pod.yaml deleted file mode 100644 index 8225c5481b..0000000000 --- a/examples/volumes/storageos/storageos-pod.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - name: redis - role: master - name: test-storageos-redis -spec: - containers: - - name: master - image: kubernetes/redis:v1 - env: - - name: MASTER - value: "true" - ports: - - containerPort: 6379 - resources: - limits: - cpu: "0.1" - volumeMounts: - - mountPath: /redis-master-data - name: redis-data - volumes: - - name: redis-data - storageos: - # This volume must already exist within StorageOS - volumeName: redis-vol01 - # Namespace is optional, and specifies the volume scope within - # StorageOS. If no namespace is provided, it will use the namespace - # of the pod. Set to `default` or leave blank if you are not using - # namespaces. - #namespace: test-storageos - # The name of the storageos pool to use. Will use `default` if not - # specified, which should be available on most StorageOS clusters. - pool: default - # The filesystem type to create on the volume, if required. - fsType: ext4 diff --git a/examples/volumes/storageos/storageos-pv.yaml b/examples/volumes/storageos/storageos-pv.yaml deleted file mode 100644 index 3afe090947..0000000000 --- a/examples/volumes/storageos/storageos-pv.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: pv0001 -spec: - capacity: - storage: 5Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Delete - storageClassName: fast - storageos: - # This volume must already exist within StorageOS - volumeName: pv0001 - # volumeNamespace is optional, and specifies the volume scope within - # StorageOS. Set to `default` or leave blank if you are not using - # namespaces. - #volumeNamespace: default - # The filesystem type to create on the volume, if required. - fsType: ext4 - # The secret name for API credentials - secretName: storageos-secret diff --git a/examples/volumes/storageos/storageos-pvc.yaml b/examples/volumes/storageos/storageos-pvc.yaml deleted file mode 100644 index 4eecf36442..0000000000 --- a/examples/volumes/storageos/storageos-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: pvc0001 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi - storageClassName: fast diff --git a/examples/volumes/storageos/storageos-pvcpod.yaml b/examples/volumes/storageos/storageos-pvcpod.yaml deleted file mode 100644 index dbea02c2c6..0000000000 --- a/examples/volumes/storageos/storageos-pvcpod.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - name: redis - role: master - name: test-storageos-redis-pvc -spec: - containers: - - name: master - image: kubernetes/redis:v1 - env: - - name: MASTER - value: "true" - ports: - - containerPort: 6379 - resources: - limits: - cpu: "0.1" - volumeMounts: - - mountPath: /redis-master-data - name: redis-data - volumes: - - name: redis-data - persistentVolumeClaim: - claimName: pvc0001 diff --git a/examples/volumes/storageos/storageos-sc-pvc.yaml b/examples/volumes/storageos/storageos-sc-pvc.yaml deleted file mode 100644 index 96d7b13412..0000000000 --- a/examples/volumes/storageos/storageos-sc-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: fast0001 -spec: - accessModes: - - ReadWriteOnce - storageClassName: fast - resources: - requests: - storage: 5Gi diff --git a/examples/volumes/storageos/storageos-sc-pvcpod.yaml b/examples/volumes/storageos/storageos-sc-pvcpod.yaml deleted file mode 100644 index a75a6c51a0..0000000000 --- a/examples/volumes/storageos/storageos-sc-pvcpod.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - name: redis - role: master - name: test-storageos-redis-sc-pvc -spec: - containers: - - name: master - image: kubernetes/redis:v1 - env: - - name: MASTER - value: "true" - ports: - - containerPort: 6379 - resources: - limits: - cpu: "0.1" - volumeMounts: - - mountPath: /redis-master-data - name: redis-data - volumes: - - name: redis-data - persistentVolumeClaim: - claimName: fast0001 diff --git a/examples/volumes/storageos/storageos-sc.yaml b/examples/volumes/storageos/storageos-sc.yaml deleted file mode 100644 index 4f7bd60387..0000000000 --- a/examples/volumes/storageos/storageos-sc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: sc-fast -provisioner: kubernetes.io/storageos -parameters: - pool: default - description: Kubernetes volume - fsType: ext4 - adminSecretNamespace: default - adminSecretName: storageos-secret \ No newline at end of file diff --git a/examples/volumes/storageos/storageos-secret.yaml b/examples/volumes/storageos/storageos-secret.yaml deleted file mode 100644 index f837eb1380..0000000000 --- a/examples/volumes/storageos/storageos-secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: storageos-secret -type: "kubernetes.io/storageos" -data: - apiAddress: dGNwOi8vMTI3LjAuMC4xOjU3MDU= - apiUsername: c3RvcmFnZW9z - apiPassword: c3RvcmFnZW9z diff --git a/examples/volumes/vsphere/README.md b/examples/volumes/vsphere/README.md deleted file mode 100644 index 11c6e1abea..0000000000 --- a/examples/volumes/vsphere/README.md +++ /dev/null @@ -1 +0,0 @@ -This file has moved to [https://github.com/kubernetes/examples/blob/master/staging/volumes/vsphere/README.md](https://github.com/kubernetes/examples/blob/master/staging/volumes/vsphere/README.md) diff --git a/examples/volumes/vsphere/deployment.yaml b/examples/volumes/vsphere/deployment.yaml deleted file mode 100644 index 1ea779b8aa..0000000000 --- a/examples/volumes/vsphere/deployment.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: deployment -spec: - replicas: 1 - template: - metadata: - labels: - app: redis - spec: - containers: - - name: redis - image: redis - volumeMounts: - - name: vmfs-vmdk-storage - mountPath: /data/ - volumes: - - name: vmfs-vmdk-storage - vsphereVolume: - volumePath: "[Datastore] volumes/testdir" - fsType: ext4 \ No newline at end of file diff --git a/examples/volumes/vsphere/simple-statefulset.yaml b/examples/volumes/vsphere/simple-statefulset.yaml deleted file mode 100644 index d9de93c257..0000000000 --- a/examples/volumes/vsphere/simple-statefulset.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: nginx - labels: - app: nginx -spec: - ports: - - port: 80 - name: web - clusterIP: None - selector: - app: nginx ---- -apiVersion: apps/v1beta1 -kind: StatefulSet -metadata: - name: web -spec: - serviceName: "nginx" - replicas: 14 - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: k8s.gcr.io/nginx-slim:0.8 - ports: - - containerPort: 80 - name: web - volumeMounts: - - name: www - mountPath: /usr/share/nginx/html - volumeClaimTemplates: - - metadata: - name: www - spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: 1Gi - storageClassName: thin-disk diff --git a/examples/volumes/vsphere/simple-storageclass.yaml b/examples/volumes/vsphere/simple-storageclass.yaml deleted file mode 100644 index 87327836f0..0000000000 --- a/examples/volumes/vsphere/simple-storageclass.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: thin-disk -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: thin diff --git a/examples/volumes/vsphere/vsphere-volume-pod.yaml b/examples/volumes/vsphere/vsphere-volume-pod.yaml deleted file mode 100644 index 0204ad3a59..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-pod.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: test-vmdk -spec: - containers: - - image: k8s.gcr.io/test-webserver - name: test-container - volumeMounts: - - mountPath: /test-vmdk - name: test-volume - volumes: - - name: test-volume - # This VMDK volume must already exist. - vsphereVolume: - volumePath: "[DatastoreName] volumes/myDisk" - fsType: ext4 \ No newline at end of file diff --git a/examples/volumes/vsphere/vsphere-volume-pv.yaml b/examples/volumes/vsphere/vsphere-volume-pv.yaml deleted file mode 100644 index 5bc2782881..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-pv.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: pv0001 -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - vsphereVolume: - volumePath: "[DatastoreName] volumes/myDisk" - fsType: ext4 \ No newline at end of file diff --git a/examples/volumes/vsphere/vsphere-volume-pvc.yaml b/examples/volumes/vsphere/vsphere-volume-pvc.yaml deleted file mode 100644 index 181a3848d8..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-pvc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvc0001 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi \ No newline at end of file diff --git a/examples/volumes/vsphere/vsphere-volume-pvcpod.yaml b/examples/volumes/vsphere/vsphere-volume-pvcpod.yaml deleted file mode 100644 index 326c0031f3..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-pvcpod.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: pvpod -spec: - containers: - - name: test-container - image: k8s.gcr.io/test-webserver - volumeMounts: - - name: test-volume - mountPath: /test-vmdk - volumes: - - name: test-volume - persistentVolumeClaim: - claimName: pvc0001 diff --git a/examples/volumes/vsphere/vsphere-volume-pvcsc.yaml b/examples/volumes/vsphere/vsphere-volume-pvcsc.yaml deleted file mode 100644 index 03f3f8f8fe..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-pvcsc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvcsc001 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - storageClassName: fast diff --git a/examples/volumes/vsphere/vsphere-volume-pvcscpod.yaml b/examples/volumes/vsphere/vsphere-volume-pvcscpod.yaml deleted file mode 100644 index c569a0b36d..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-pvcscpod.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: pvpod -spec: - containers: - - name: test-container - image: k8s.gcr.io/test-webserver - volumeMounts: - - name: test-volume - mountPath: /test-vmdk - volumes: - - name: test-volume - persistentVolumeClaim: - claimName: pvcsc001 diff --git a/examples/volumes/vsphere/vsphere-volume-sc-fast.yaml b/examples/volumes/vsphere/vsphere-volume-sc-fast.yaml deleted file mode 100644 index 959e28e883..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-sc-fast.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fast -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: zeroedthick - fstype: ext3 \ No newline at end of file diff --git a/examples/volumes/vsphere/vsphere-volume-sc-vsancapabilities-with-datastore.yaml b/examples/volumes/vsphere/vsphere-volume-sc-vsancapabilities-with-datastore.yaml deleted file mode 100644 index 5c4a9a6652..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-sc-vsancapabilities-with-datastore.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fast -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: zeroedthick - datastore: vsanDatastore - hostFailuresToTolerate: "2" - cachereservation: "20" diff --git a/examples/volumes/vsphere/vsphere-volume-sc-vsancapabilities.yaml b/examples/volumes/vsphere/vsphere-volume-sc-vsancapabilities.yaml deleted file mode 100644 index 5f8f9f2fc1..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-sc-vsancapabilities.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fast -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: zeroedthick - hostFailuresToTolerate: "2" - cachereservation: "20" diff --git a/examples/volumes/vsphere/vsphere-volume-sc-with-datastore.yaml b/examples/volumes/vsphere/vsphere-volume-sc-with-datastore.yaml deleted file mode 100644 index 3fb56bf1ab..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-sc-with-datastore.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fast -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: zeroedthick - datastore: vsanDatastore diff --git a/examples/volumes/vsphere/vsphere-volume-spbm-policy-with-datastore.yaml b/examples/volumes/vsphere/vsphere-volume-spbm-policy-with-datastore.yaml deleted file mode 100644 index 43e22c506f..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-spbm-policy-with-datastore.yaml +++ /dev/null @@ -1,9 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fast -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: zeroedthick - storagePolicyName: gold - datastore: VSANDatastore diff --git a/examples/volumes/vsphere/vsphere-volume-spbm-policy.yaml b/examples/volumes/vsphere/vsphere-volume-spbm-policy.yaml deleted file mode 100644 index 0d68f680c2..0000000000 --- a/examples/volumes/vsphere/vsphere-volume-spbm-policy.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fast -provisioner: kubernetes.io/vsphere-volume -parameters: - diskformat: zeroedthick - storagePolicyName: gold diff --git a/hack/.golint_failures b/hack/.golint_failures index e6c0102f40..9b5904c4b0 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -9,7 +9,6 @@ cmd/kubeadm/app/apis/kubeadm/v1alpha1 cmd/kubelet/app cmd/kubelet/app/options cmd/kubemark -examples/guestbook-go pkg/api/endpoints pkg/api/ref pkg/api/testapi diff --git a/hack/generate-bindata.sh b/hack/generate-bindata.sh index a0545d11cf..1f54570dcb 100755 --- a/hack/generate-bindata.sh +++ b/hack/generate-bindata.sh @@ -22,8 +22,8 @@ export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" source "${KUBE_ROOT}/hack/lib/logging.sh" -if [[ ! -d "${KUBE_ROOT}/examples" ]]; then - echo "${KUBE_ROOT}/examples not detected. This script should be run from a location where the source dirs are available." +if [[ ! -d "${KUBE_ROOT}/pkg" ]]; then + echo "${KUBE_ROOT}/pkg not detected. This script should be run from a location where the source dirs are available." exit 1 fi @@ -43,7 +43,6 @@ pushd "${KUBE_ROOT}" >/dev/null BINDATA_OUTPUT="test/e2e/generated/bindata.go" go-bindata -nometadata -o "${BINDATA_OUTPUT}.tmp" -pkg generated \ -ignore .jpg -ignore .png -ignore .md \ - "examples/..." \ "test/e2e/testing-manifests/..." \ "test/images/..." \ "test/fixtures/..." diff --git a/hack/make-rules/helpers/cache_go_dirs.sh b/hack/make-rules/helpers/cache_go_dirs.sh index 82402c6676..6de1e5b25c 100755 --- a/hack/make-rules/helpers/cache_go_dirs.sh +++ b/hack/make-rules/helpers/cache_go_dirs.sh @@ -47,8 +47,7 @@ function kfind() { -path ./staging -o \ -path ./_\* -o \ -path ./.\* -o \ - -path ./docs -o \ - -path ./examples \ + -path ./docs \ \) -prune \ \) \ \) \ diff --git a/hack/make-rules/test-cmd-util.sh b/hack/make-rules/test-cmd-util.sh index efce34f330..e88f1ea912 100755 --- a/hack/make-rules/test-cmd-util.sh +++ b/hack/make-rules/test-cmd-util.sh @@ -533,7 +533,7 @@ run_pod_tests() { kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' # Command kubectl create -f test/fixtures/doc-yaml/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - kubectl create -f examples/storage/redis/redis-master.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/kubectl/redis-master-pod.yaml "${kube_flags[@]}" # Post-condition: valid-pod and redis-master PODs are created kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-master:valid-pod:' @@ -2534,7 +2534,7 @@ run_service_tests() { # Pre-condition: Only the default kubernetes services exist kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' # Command - kubectl create -f examples/guestbook/redis-master-service.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/guestbook/redis-master-service.yaml "${kube_flags[@]}" # Post-condition: redis-master service exists kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' # Describe command should print detailed information @@ -2559,14 +2559,14 @@ run_service_tests() { kube::test::get_object_assert 'services redis-master' "{{range$service_selector_field}}{{.}}:{{end}}" "redis:master:backend:" # Set selector of a local file without talking to the server - kubectl set selector -f examples/guestbook/redis-master-service.yaml role=padawan --local -o yaml "${kube_flags[@]}" - ! kubectl set selector -f examples/guestbook/redis-master-service.yaml role=padawan --dry-run -o yaml "${kube_flags[@]}" + kubectl set selector -f test/e2e/testing-manifests/guestbook/redis-master-service.yaml role=padawan --local -o yaml "${kube_flags[@]}" + ! kubectl set selector -f test/e2e/testing-manifests/guestbook/redis-master-service.yaml role=padawan --dry-run -o yaml "${kube_flags[@]}" # Set command to change the selector. - kubectl set selector -f examples/guestbook/redis-master-service.yaml role=padawan + kubectl set selector -f test/e2e/testing-manifests/guestbook/redis-master-service.yaml role=padawan # prove role=padawan kube::test::get_object_assert 'services redis-master' "{{range$service_selector_field}}{{.}}:{{end}}" "padawan:" # Set command to reset the selector back to the original one. - kubectl set selector -f examples/guestbook/redis-master-service.yaml app=redis,role=master,tier=backend + kubectl set selector -f test/e2e/testing-manifests/guestbook/redis-master-service.yaml app=redis,role=master,tier=backend # prove role=master kube::test::get_object_assert 'services redis-master' "{{range$service_selector_field}}{{.}}:{{end}}" "redis:master:backend:" # Show dry-run works on running selector @@ -2640,8 +2640,8 @@ __EOF__ # Pre-condition: Only the default kubernetes services exist kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' # Command - kubectl create -f examples/guestbook/redis-master-service.yaml "${kube_flags[@]}" - kubectl create -f examples/guestbook/redis-slave-service.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/guestbook/redis-master-service.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/guestbook/redis-slave-service.yaml "${kube_flags[@]}" # Post-condition: redis-master and redis-slave services are created kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:redis-slave:' @@ -2760,8 +2760,8 @@ run_rc_tests() { kubectl delete rc frontend "${kube_flags[@]}" ### Scale multiple replication controllers - kubectl create -f examples/guestbook/legacy/redis-master-controller.yaml "${kube_flags[@]}" - kubectl create -f examples/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" # Command kubectl scale rc/redis-master rc/redis-slave --replicas=4 "${kube_flags[@]}" # Post-condition: 4 replicas each @@ -2871,7 +2871,7 @@ run_rc_tests() { kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' # Command kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - kubectl create -f examples/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" + kubectl create -f test/e2e/testing-manifests/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" # Post-condition: frontend and redis-slave kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' diff --git a/hack/test-update-storage-objects.sh b/hack/test-update-storage-objects.sh index 4c5cc2d745..aca9c48e2a 100755 --- a/hack/test-update-storage-objects.sh +++ b/hack/test-update-storage-objects.sh @@ -105,7 +105,7 @@ echo "${ETCD_VERSION}" > "${ETCD_DIR}/version.txt" # source_file,resource,namespace,name,old_version,new_version tests=( -examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml,storageclasses,,slow,v1beta1,v1 +test/e2e/testing-manifests/rbd-storage-class.yaml,storageclasses,,slow,v1beta1,v1 ) KUBE_OLD_API_VERSION="networking.k8s.io/v1,storage.k8s.io/v1beta1,extensions/v1beta1" diff --git a/pkg/kubectl/cmd/BUILD b/pkg/kubectl/cmd/BUILD index 3ddfebab56..594808e1b8 100644 --- a/pkg/kubectl/cmd/BUILD +++ b/pkg/kubectl/cmd/BUILD @@ -178,7 +178,6 @@ go_test( data = [ "testdata", "//api/openapi-spec:swagger-spec", - "//examples:config", "//test/e2e/testing-manifests:all-srcs", "//test/fixtures", ], diff --git a/pkg/kubectl/cmd/create/BUILD b/pkg/kubectl/cmd/create/BUILD index 27a4928ab7..6a6445ce08 100644 --- a/pkg/kubectl/cmd/create/BUILD +++ b/pkg/kubectl/cmd/create/BUILD @@ -67,7 +67,7 @@ go_test( "create_test.go", ], data = [ - "//examples:config", + "//test/e2e/testing-manifests:all-srcs", ], embed = [":go_default_library"], deps = [ diff --git a/pkg/kubectl/cmd/create/create_test.go b/pkg/kubectl/cmd/create/create_test.go index 91ff4f840b..f83a51c6e5 100644 --- a/pkg/kubectl/cmd/create/create_test.go +++ b/pkg/kubectl/cmd/create/create_test.go @@ -73,7 +73,7 @@ func TestCreateObject(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdCreate(tf, ioStreams) - cmd.Flags().Set("filename", "../../../../examples/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -111,8 +111,8 @@ func TestCreateMultipleObject(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdCreate(tf, ioStreams) - cmd.Flags().Set("filename", "../../../../examples/guestbook/legacy/redis-master-controller.yaml") - cmd.Flags().Set("filename", "../../../../examples/guestbook/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/guestbook/frontend-service.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -149,7 +149,7 @@ func TestCreateDirectory(t *testing.T) { ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams() cmd := NewCmdCreate(tf, ioStreams) - cmd.Flags().Set("filename", "../../../../examples/guestbook/legacy") + cmd.Flags().Set("filename", "../../../../test/e2e/testing-manifests/guestbook/legacy") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) diff --git a/pkg/kubectl/cmd/delete_test.go b/pkg/kubectl/cmd/delete_test.go index a7a1f60788..9e7da6b21a 100644 --- a/pkg/kubectl/cmd/delete_test.go +++ b/pkg/kubectl/cmd/delete_test.go @@ -253,7 +253,7 @@ func TestDeleteObject(t *testing.T) { buf, errBuf := bytes.NewBuffer([]byte{}), bytes.NewBuffer([]byte{}) cmd := NewCmdDelete(tf, buf, errBuf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -365,7 +365,7 @@ func TestDeleteObjectNotFound(t *testing.T) { options := &DeleteOptions{ FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../examples/guestbook/legacy/redis-master-controller.yaml"}, + Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml"}, }, GracePeriod: -1, Cascade: false, @@ -402,7 +402,7 @@ func TestDeleteObjectIgnoreNotFound(t *testing.T) { buf, errBuf := bytes.NewBuffer([]byte{}), bytes.NewBuffer([]byte{}) cmd := NewCmdDelete(tf, buf, errBuf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("ignore-not-found", "true") cmd.Flags().Set("output", "name") @@ -533,8 +533,8 @@ func TestDeleteMultipleObject(t *testing.T) { buf, errBuf := bytes.NewBuffer([]byte{}), bytes.NewBuffer([]byte{}) cmd := NewCmdDelete(tf, buf, errBuf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") - cmd.Flags().Set("filename", "../../../examples/guestbook/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/frontend-service.yaml") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -572,7 +572,7 @@ func TestDeleteMultipleObjectContinueOnMissing(t *testing.T) { options := &DeleteOptions{ FilenameOptions: resource.FilenameOptions{ - Filenames: []string{"../../../examples/guestbook/legacy/redis-master-controller.yaml", "../../../examples/guestbook/frontend-service.yaml"}, + Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml", "../../../test/e2e/testing-manifests/guestbook/frontend-service.yaml"}, }, GracePeriod: -1, Cascade: false, @@ -657,7 +657,7 @@ func TestDeleteDirectory(t *testing.T) { buf, errBuf := bytes.NewBuffer([]byte{}), bytes.NewBuffer([]byte{}) cmd := NewCmdDelete(tf, buf, errBuf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) diff --git a/pkg/kubectl/cmd/describe_test.go b/pkg/kubectl/cmd/describe_test.go index 6e029f3d68..85424e97ec 100644 --- a/pkg/kubectl/cmd/describe_test.go +++ b/pkg/kubectl/cmd/describe_test.go @@ -106,7 +106,7 @@ func TestDescribeObject(t *testing.T) { buf := bytes.NewBuffer([]byte{}) buferr := bytes.NewBuffer([]byte{}) cmd := NewCmdDescribe(tf, buf, buferr) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") cmd.Run(cmd, []string{}) if d.Name != "redis-master" || d.Namespace != "test" { diff --git a/pkg/kubectl/cmd/expose_test.go b/pkg/kubectl/cmd/expose_test.go index 7097d67940..6cfe5f6085 100644 --- a/pkg/kubectl/cmd/expose_test.go +++ b/pkg/kubectl/cmd/expose_test.go @@ -312,7 +312,7 @@ func TestRunExposeService(t *testing.T) { Selector: map[string]string{"app": "go"}, }, }, - flags: map[string]string{"filename": "../../../examples/guestbook/redis-master-service.yaml", "selector": "func=stream", "protocol": "UDP", "port": "14", "name": "foo", "labels": "svc=test", "dry-run": "true"}, + flags: map[string]string{"filename": "../../../test/e2e/testing-manifests/guestbook/redis-master-service.yaml", "selector": "func=stream", "protocol": "UDP", "port": "14", "name": "foo", "labels": "svc=test", "dry-run": "true"}, output: &api.Service{ ObjectMeta: metav1.ObjectMeta{Name: "foo", Labels: map[string]string{"svc": "test"}}, Spec: api.ServiceSpec{ diff --git a/pkg/kubectl/cmd/patch_test.go b/pkg/kubectl/cmd/patch_test.go index 6d9757eb5c..e4737f6353 100644 --- a/pkg/kubectl/cmd/patch_test.go +++ b/pkg/kubectl/cmd/patch_test.go @@ -97,7 +97,7 @@ func TestPatchObjectFromFile(t *testing.T) { cmd.Flags().Set("namespace", "test") cmd.Flags().Set("patch", `{"spec":{"type":"NodePort"}}`) cmd.Flags().Set("output", "name") - cmd.Flags().Set("filename", "../../../examples/guestbook/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/frontend-service.yaml") cmd.Run(cmd, []string{}) // uses the name from the response @@ -185,7 +185,7 @@ func TestPatchObjectFromFileOutput(t *testing.T) { cmd.Flags().Set("namespace", "test") cmd.Flags().Set("patch", `{"spec":{"type":"NodePort"}}`) cmd.Flags().Set("output", "yaml") - cmd.Flags().Set("filename", "../../../examples/guestbook/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/frontend-service.yaml") cmd.Run(cmd, []string{}) t.Log(buf.String()) diff --git a/pkg/kubectl/cmd/replace_test.go b/pkg/kubectl/cmd/replace_test.go index 300696e59d..2789967784 100644 --- a/pkg/kubectl/cmd/replace_test.go +++ b/pkg/kubectl/cmd/replace_test.go @@ -66,7 +66,7 @@ func TestReplaceObject(t *testing.T) { buf := bytes.NewBuffer([]byte{}) cmd := NewCmdReplace(tf, buf, buf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -137,8 +137,8 @@ func TestReplaceMultipleObject(t *testing.T) { buf := bytes.NewBuffer([]byte{}) cmd := NewCmdReplace(tf, buf, buf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") - cmd.Flags().Set("filename", "../../../examples/guestbook/frontend-service.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/frontend-service.yaml") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -195,7 +195,7 @@ func TestReplaceDirectory(t *testing.T) { buf := bytes.NewBuffer([]byte{}) cmd := NewCmdReplace(tf, buf, buf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy") cmd.Flags().Set("namespace", "test") cmd.Flags().Set("output", "name") cmd.Run(cmd, []string{}) @@ -242,7 +242,7 @@ func TestForceReplaceObjectNotFound(t *testing.T) { buf := bytes.NewBuffer([]byte{}) cmd := NewCmdReplace(tf, buf, buf) - cmd.Flags().Set("filename", "../../../examples/guestbook/legacy/redis-master-controller.yaml") + cmd.Flags().Set("filename", "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml") cmd.Flags().Set("force", "true") cmd.Flags().Set("cascade", "false") cmd.Flags().Set("output", "name") diff --git a/pkg/kubectl/cmd/resource/BUILD b/pkg/kubectl/cmd/resource/BUILD index 0f65660c25..78ac12bae5 100644 --- a/pkg/kubectl/cmd/resource/BUILD +++ b/pkg/kubectl/cmd/resource/BUILD @@ -36,7 +36,6 @@ go_test( srcs = ["get_test.go"], data = [ "//api/openapi-spec:swagger-spec", - "//examples:config", "//test/e2e/testing-manifests:all-srcs", "//test/fixtures", ], diff --git a/pkg/kubectl/cmd/set/BUILD b/pkg/kubectl/cmd/set/BUILD index 60d517199c..0181e2d0f5 100644 --- a/pkg/kubectl/cmd/set/BUILD +++ b/pkg/kubectl/cmd/set/BUILD @@ -56,7 +56,6 @@ go_test( "set_test.go", ], data = [ - "//examples:config", "//test/e2e/testing-manifests:all-srcs", "//test/fixtures", ], diff --git a/pkg/kubectl/resource/BUILD b/pkg/kubectl/resource/BUILD index fc5d020538..142fc8ce1e 100644 --- a/pkg/kubectl/resource/BUILD +++ b/pkg/kubectl/resource/BUILD @@ -51,7 +51,7 @@ go_test( "visitor_test.go", ], data = [ - "//examples:config", + "//test/e2e/testing-manifests:all-srcs", "//test/fixtures", ], embed = [":go_default_library"], diff --git a/pkg/kubectl/resource/builder_test.go b/pkg/kubectl/resource/builder_test.go index c728a359f3..a70a384680 100644 --- a/pkg/kubectl/resource/builder_test.go +++ b/pkg/kubectl/resource/builder_test.go @@ -375,9 +375,9 @@ func TestPathBuilderWithMultiple(t *testing.T) { directory string expectedNames []string }{ - {"pod", &v1.Pod{}, false, "../../../examples/pod", []string{"nginx"}}, + {"pod", &v1.Pod{}, false, "../../../test/e2e/testing-manifests/pod", []string{"nginx"}}, {"recursive-pod", &v1.Pod{}, true, fmt.Sprintf("%s/recursive/pod", tmpDir), []string{"busybox0", "busybox1"}}, - {"rc", &v1.ReplicationController{}, false, "../../../examples/guestbook/legacy/redis-master-controller.yaml", []string{"redis-master"}}, + {"rc", &v1.ReplicationController{}, false, "../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml", []string{"redis-master"}}, {"recursive-rc", &v1.ReplicationController{}, true, fmt.Sprintf("%s/recursive/rc", tmpDir), []string{"busybox0", "busybox1"}}, {"hardlink", &v1.Pod{}, false, fmt.Sprintf("%s/inode/hardlink/busybox-link.json", tmpDir), []string{"busybox0"}}, {"hardlink", &v1.Pod{}, true, fmt.Sprintf("%s/inode/hardlink/busybox-link.json", tmpDir), []string{"busybox0"}}, @@ -459,7 +459,7 @@ func TestPathBuilderWithMultipleInvalid(t *testing.T) { func TestDirectoryBuilder(t *testing.T) { b := newDefaultBuilder(). - FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../examples/guestbook/legacy"}}). + FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/legacy"}}). NamespaceParam("test").DefaultNamespace() test := &testVisitor{} @@ -1029,7 +1029,7 @@ func TestContinueOnErrorVisitor(t *testing.T) { func TestSingleItemImpliedObject(t *testing.T) { obj, err := newDefaultBuilder(). NamespaceParam("test").DefaultNamespace(). - FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../examples/guestbook/legacy/redis-master-controller.yaml"}}). + FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml"}}). Flatten(). Do().Object() @@ -1049,7 +1049,7 @@ func TestSingleItemImpliedObject(t *testing.T) { func TestSingleItemImpliedObjectNoExtension(t *testing.T) { obj, err := newDefaultBuilder(). NamespaceParam("test").DefaultNamespace(). - FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../examples/pod"}}). + FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../test/e2e/testing-manifests/pod"}}). Flatten(). Do().Object() @@ -1160,7 +1160,7 @@ func TestWatch(t *testing.T) { }), })). NamespaceParam("test").DefaultNamespace(). - FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../examples/guestbook/redis-master-service.yaml"}}).Flatten(). + FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/redis-master-service.yaml"}}).Flatten(). Do().Watch("12") if err != nil { @@ -1187,8 +1187,8 @@ func TestWatch(t *testing.T) { func TestWatchMultipleError(t *testing.T) { _, err := newDefaultBuilder(). NamespaceParam("test").DefaultNamespace(). - FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../examples/guestbook/legacy/redis-master-controller.yaml"}}).Flatten(). - FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../examples/guestbook/legacy/redis-master-controller.yaml"}}).Flatten(). + FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml"}}).Flatten(). + FilenameParam(false, &FilenameOptions{Recursive: false, Filenames: []string{"../../../test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml"}}).Flatten(). Do().Watch("") if err == nil { diff --git a/test/e2e/generated/BUILD b/test/e2e/generated/BUILD index 5ad22c808b..1b92341380 100644 --- a/test/e2e/generated/BUILD +++ b/test/e2e/generated/BUILD @@ -21,7 +21,6 @@ go_library( genrule( name = "bindata", srcs = [ - "//examples:all-srcs", "//test/images:all-srcs", "//test/fixtures:all-srcs", "//test/e2e/testing-manifests:all-srcs", diff --git a/examples/guestbook/legacy/frontend-controller.yaml b/test/e2e/testing-manifests/guestbook/legacy/frontend-controller.yaml similarity index 100% rename from examples/guestbook/legacy/frontend-controller.yaml rename to test/e2e/testing-manifests/guestbook/legacy/frontend-controller.yaml diff --git a/examples/guestbook/legacy/redis-master-controller.yaml b/test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml similarity index 100% rename from examples/guestbook/legacy/redis-master-controller.yaml rename to test/e2e/testing-manifests/guestbook/legacy/redis-master-controller.yaml diff --git a/examples/guestbook/legacy/redis-slave-controller.yaml b/test/e2e/testing-manifests/guestbook/legacy/redis-slave-controller.yaml similarity index 100% rename from examples/guestbook/legacy/redis-slave-controller.yaml rename to test/e2e/testing-manifests/guestbook/legacy/redis-slave-controller.yaml diff --git a/examples/storage/redis/redis-master.yaml b/test/e2e/testing-manifests/kubectl/redis-master-pod.yaml similarity index 100% rename from examples/storage/redis/redis-master.yaml rename to test/e2e/testing-manifests/kubectl/redis-master-pod.yaml diff --git a/examples/pod b/test/e2e/testing-manifests/pod similarity index 100% rename from examples/pod rename to test/e2e/testing-manifests/pod diff --git a/examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml b/test/e2e/testing-manifests/rbd-storage-class.yaml similarity index 100% rename from examples/persistent-volume-provisioning/rbd/rbd-storage-class.yaml rename to test/e2e/testing-manifests/rbd-storage-class.yaml