mirror of https://github.com/k3s-io/k3s
Cleanup netexec image and usage.
parent
9d270ad5ed
commit
1d7cdffebc
|
@ -25,7 +25,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
kubeletEtcHostsImageName = "gcr.io/google_containers/netexec:1.4"
|
kubeletEtcHostsImageName = "gcr.io/google_containers/netexec:1.7"
|
||||||
kubeletEtcHostsPodName = "test-pod"
|
kubeletEtcHostsPodName = "test-pod"
|
||||||
kubeletEtcHostsHostNetworkPodName = "test-host-network-pod"
|
kubeletEtcHostsHostNetworkPodName = "test-host-network-pod"
|
||||||
etcHostsPartialContent = "# Kubernetes-managed hosts file."
|
etcHostsPartialContent = "# Kubernetes-managed hosts file."
|
||||||
|
|
|
@ -35,7 +35,7 @@ const (
|
||||||
notPrivilegedHttpPort = 9090
|
notPrivilegedHttpPort = 9090
|
||||||
notPrivilegedUdpPort = 9091
|
notPrivilegedUdpPort = 9091
|
||||||
notPrivilegedContainerName = "not-privileged-container"
|
notPrivilegedContainerName = "not-privileged-container"
|
||||||
privilegedContainerImage = "gcr.io/google_containers/netexec:1.4"
|
privilegedContainerImage = "gcr.io/google_containers/netexec:1.7"
|
||||||
privilegedCommand = "ip link add dummy1 type dummy"
|
privilegedCommand = "ip link add dummy1 type dummy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ const (
|
||||||
testContainerHttpPort = 8080
|
testContainerHttpPort = 8080
|
||||||
clusterHttpPort = 80
|
clusterHttpPort = 80
|
||||||
clusterUdpPort = 90
|
clusterUdpPort = 90
|
||||||
netexecImageName = "gcr.io/google_containers/netexec:1.5"
|
netexecImageName = "gcr.io/google_containers/netexec:1.7"
|
||||||
hostexecImageName = "gcr.io/google_containers/hostexec:1.2"
|
hostexecImageName = "gcr.io/google_containers/hostexec:1.2"
|
||||||
testPodName = "test-container-pod"
|
testPodName = "test-container-pod"
|
||||||
hostTestPodName = "host-test-container-pod"
|
hostTestPodName = "host-test-container-pod"
|
||||||
|
|
|
@ -2073,7 +2073,7 @@ func (j *ServiceTestJig) newRCTemplate(namespace string) *api.ReplicationControl
|
||||||
Containers: []api.Container{
|
Containers: []api.Container{
|
||||||
{
|
{
|
||||||
Name: "netexec",
|
Name: "netexec",
|
||||||
Image: "gcr.io/google_containers/netexec:1.6",
|
Image: "gcr.io/google_containers/netexec:1.7",
|
||||||
Args: []string{"--http-port=80", "--udp-port=80"},
|
Args: []string{"--http-port=80", "--udp-port=80"},
|
||||||
ReadinessProbe: &api.Probe{
|
ReadinessProbe: &api.Probe{
|
||||||
PeriodSeconds: 3,
|
PeriodSeconds: 3,
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
.PHONY: all netexec image push clean
|
.PHONY: all netexec image push clean
|
||||||
|
|
||||||
TAG = 1.6
|
TAG = 1.7
|
||||||
PREFIX = gcr.io/google_containers
|
PREFIX = gcr.io/google_containers
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ func startHTTPServer(httpPort int) {
|
||||||
http.HandleFunc("/shell", shellHandler)
|
http.HandleFunc("/shell", shellHandler)
|
||||||
http.HandleFunc("/upload", uploadHandler)
|
http.HandleFunc("/upload", uploadHandler)
|
||||||
http.HandleFunc("/dial", dialHandler)
|
http.HandleFunc("/dial", dialHandler)
|
||||||
|
http.HandleFunc("/healthz", healthzHandler)
|
||||||
// older handlers
|
// older handlers
|
||||||
http.HandleFunc("/hostName", hostNameHandler)
|
http.HandleFunc("/hostName", hostNameHandler)
|
||||||
http.HandleFunc("/shutdown", shutdownHandler)
|
http.HandleFunc("/shutdown", shutdownHandler)
|
||||||
|
@ -120,13 +121,12 @@ func exitHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
func hostnameHandler(w http.ResponseWriter, r *http.Request) {
|
func hostnameHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Printf("GET /hostname")
|
log.Printf("GET /hostname")
|
||||||
fmt.Fprintf(w, getHostName())
|
fmt.Fprintf(w, getHostName())
|
||||||
http.HandleFunc("/healthz", healthzHandler)
|
|
||||||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", httpPort), nil))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// healthHandler response with a 200 if the UDP server is ready. It also serves
|
// healthHandler response with a 200 if the UDP server is ready. It also serves
|
||||||
// as a health check of the HTTP server by virtue of being a HTTP handler.
|
// as a health check of the HTTP server by virtue of being a HTTP handler.
|
||||||
func healthzHandler(w http.ResponseWriter, r *http.Request) {
|
func healthzHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
log.Printf("GET /healthz")
|
||||||
if serverReady.get() {
|
if serverReady.get() {
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
return
|
return
|
||||||
|
@ -348,6 +348,7 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func hostNameHandler(w http.ResponseWriter, r *http.Request) {
|
func hostNameHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
log.Printf("GET /hostName")
|
||||||
fmt.Fprintf(w, getHostName())
|
fmt.Fprintf(w, getHostName())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue