mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 11:12:03 +00:00
Removed non-md files from docs. Moved doc yamls to test/fixtures.
Most of the contents of docs/ has moved to kubernetes.github.io. Development of the docs and accompanying files has continued there, making the copies in this repo stale. I've removed everything but the .md files which remain to redirect old links. The .yaml config files in the docs were used by some tests, these have been moved to test/fixtures/doc-yaml, and can remain there to be used by tests or other purposes.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: backend-rc
|
||||
labels:
|
||||
type: backend-type
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
type: backend-type
|
||||
spec:
|
||||
containers:
|
||||
- name: backend-container
|
||||
image: gcr.io/google-samples/env-backend:1.1
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
@@ -1,13 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: backend-srv
|
||||
labels:
|
||||
type: backend-type
|
||||
spec:
|
||||
ports:
|
||||
- port: 5000
|
||||
protocol: TCP
|
||||
selector:
|
||||
type: backend-type
|
@@ -1,16 +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 golang:onbuild
|
||||
EXPOSE 8080
|
@@ -1,37 +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.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func printInfo(resp http.ResponseWriter, req *http.Request) {
|
||||
name := os.Getenv("POD_NAME")
|
||||
namespace := os.Getenv("POD_NAMESPACE")
|
||||
fmt.Fprintf(resp, "Backend Container\n")
|
||||
fmt.Fprintf(resp, "Backend Pod Name: %v\n", name)
|
||||
fmt.Fprintf(resp, "Backend Namespace: %v\n", namespace)
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", printInfo)
|
||||
log.Fatal(http.ListenAndServe(":5000", nil))
|
||||
}
|
@@ -1,16 +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 golang:onbuild
|
||||
EXPOSE 8080
|
@@ -1,95 +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.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func getKubeEnv() (map[string]string, error) {
|
||||
environS := os.Environ()
|
||||
environ := make(map[string]string)
|
||||
for _, val := range environS {
|
||||
split := strings.Split(val, "=")
|
||||
if len(split) != 2 {
|
||||
return environ, fmt.Errorf("Some weird env vars")
|
||||
}
|
||||
environ[split[0]] = split[1]
|
||||
}
|
||||
for key := range environ {
|
||||
if !(strings.HasSuffix(key, "_SERVICE_HOST") ||
|
||||
strings.HasSuffix(key, "_SERVICE_PORT")) {
|
||||
delete(environ, key)
|
||||
}
|
||||
}
|
||||
return environ, nil
|
||||
}
|
||||
|
||||
func printInfo(resp http.ResponseWriter, req *http.Request) {
|
||||
kubeVars, err := getKubeEnv()
|
||||
if err != nil {
|
||||
http.Error(resp, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
backendHost := os.Getenv("BACKEND_SRV_SERVICE_HOST")
|
||||
backendPort := os.Getenv("BACKEND_SRV_SERVICE_PORT")
|
||||
backendRsp, backendErr := http.Get(fmt.Sprintf(
|
||||
"http://%v:%v/",
|
||||
backendHost,
|
||||
backendPort))
|
||||
if backendErr == nil {
|
||||
defer backendRsp.Body.Close()
|
||||
}
|
||||
|
||||
name := os.Getenv("POD_NAME")
|
||||
namespace := os.Getenv("POD_NAMESPACE")
|
||||
fmt.Fprintf(resp, "Pod Name: %v \n", name)
|
||||
fmt.Fprintf(resp, "Pod Namespace: %v \n", namespace)
|
||||
|
||||
envvar := os.Getenv("USER_VAR")
|
||||
fmt.Fprintf(resp, "USER_VAR: %v \n", envvar)
|
||||
|
||||
fmt.Fprintf(resp, "\nKubernetes environment variables\n")
|
||||
var keys []string
|
||||
for key := range kubeVars {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, key := range keys {
|
||||
fmt.Fprintf(resp, "%v = %v \n", key, kubeVars[key])
|
||||
}
|
||||
|
||||
fmt.Fprintf(resp, "\nFound backend ip: %v port: %v\n", backendHost, backendPort)
|
||||
if backendErr == nil {
|
||||
fmt.Fprintf(resp, "Response from backend\n")
|
||||
io.Copy(resp, backendRsp.Body)
|
||||
} else {
|
||||
fmt.Fprintf(resp, "Error from backend: %v", backendErr.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", printInfo)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
@@ -1,32 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ReplicationController
|
||||
metadata:
|
||||
name: show-rc
|
||||
labels:
|
||||
type: show-type
|
||||
spec:
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
type: show-type
|
||||
spec:
|
||||
containers:
|
||||
- name: show-container
|
||||
image: gcr.io/google-samples/env-show:1.1
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: USER_VAR
|
||||
value: important information
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
@@ -1,15 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: show-srv
|
||||
labels:
|
||||
type: show-type
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
selector:
|
||||
type: show-type
|
Reference in New Issue
Block a user