mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
vendor files
This commit is contained in:
33
vendor/k8s.io/kubernetes/examples/explorer/BUILD
generated
vendored
Normal file
33
vendor/k8s.io/kubernetes/examples/explorer/BUILD
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "explorer",
|
||||
importpath = "k8s.io/kubernetes/examples/explorer",
|
||||
library = ":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"],
|
||||
)
|
19
vendor/k8s.io/kubernetes/examples/explorer/Dockerfile
generated
vendored
Normal file
19
vendor/k8s.io/kubernetes/examples/explorer/Dockerfile
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# 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"]
|
30
vendor/k8s.io/kubernetes/examples/explorer/Makefile
generated
vendored
Normal file
30
vendor/k8s.io/kubernetes/examples/explorer/Makefile
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
# 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 gcr.io/google_containers/explorer:$(TAG) .
|
||||
|
||||
push: container
|
||||
gcloud docker -- push gcr.io/google_containers/explorer:$(TAG)
|
||||
|
||||
clean:
|
||||
rm -f explorer
|
1
vendor/k8s.io/kubernetes/examples/explorer/README.md
generated
vendored
Normal file
1
vendor/k8s.io/kubernetes/examples/explorer/README.md
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
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)
|
122
vendor/k8s.io/kubernetes/examples/explorer/explorer.go
generated
vendored
Normal file
122
vendor/k8s.io/kubernetes/examples/explorer/explorer.go
generated
vendored
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
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, "<b> Kubernetes environment explorer </b><br/><br/>")
|
||||
for _, v := range links {
|
||||
fmt.Fprintf(w, `<a href="%v">%v: %v</a><br/>`, 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, `<html><body>
|
||||
<form action="/dns">
|
||||
<input name="q" type="text" value="%v"></input>
|
||||
<button type="submit">Lookup</button>
|
||||
</form>
|
||||
<br/><br/><pre>`, 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, `</pre>
|
||||
</body>
|
||||
</html>`)
|
||||
}
|
18
vendor/k8s.io/kubernetes/examples/explorer/pod.yaml
generated
vendored
Normal file
18
vendor/k8s.io/kubernetes/examples/explorer/pod.yaml
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: explorer
|
||||
spec:
|
||||
containers:
|
||||
- name: explorer
|
||||
image: gcr.io/google_containers/explorer:1.0
|
||||
args: ["-port=8080"]
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: "/mount/test-volume"
|
||||
name: test-volume
|
||||
volumes:
|
||||
- name: test-volume
|
||||
emptyDir: {}
|
Reference in New Issue
Block a user