mirror of https://github.com/k3s-io/k3s
Cleanup netexec image and usage.
parent
9d270ad5ed
commit
1d7cdffebc
|
@ -25,7 +25,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
kubeletEtcHostsImageName = "gcr.io/google_containers/netexec:1.4"
|
||||
kubeletEtcHostsImageName = "gcr.io/google_containers/netexec:1.7"
|
||||
kubeletEtcHostsPodName = "test-pod"
|
||||
kubeletEtcHostsHostNetworkPodName = "test-host-network-pod"
|
||||
etcHostsPartialContent = "# Kubernetes-managed hosts file."
|
||||
|
|
|
@ -35,7 +35,7 @@ const (
|
|||
notPrivilegedHttpPort = 9090
|
||||
notPrivilegedUdpPort = 9091
|
||||
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"
|
||||
)
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ const (
|
|||
testContainerHttpPort = 8080
|
||||
clusterHttpPort = 80
|
||||
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"
|
||||
testPodName = "test-container-pod"
|
||||
hostTestPodName = "host-test-container-pod"
|
||||
|
|
|
@ -2073,7 +2073,7 @@ func (j *ServiceTestJig) newRCTemplate(namespace string) *api.ReplicationControl
|
|||
Containers: []api.Container{
|
||||
{
|
||||
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"},
|
||||
ReadinessProbe: &api.Probe{
|
||||
PeriodSeconds: 3,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
.PHONY: all netexec image push clean
|
||||
|
||||
TAG = 1.6
|
||||
TAG = 1.7
|
||||
PREFIX = gcr.io/google_containers
|
||||
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ func startHTTPServer(httpPort int) {
|
|||
http.HandleFunc("/shell", shellHandler)
|
||||
http.HandleFunc("/upload", uploadHandler)
|
||||
http.HandleFunc("/dial", dialHandler)
|
||||
http.HandleFunc("/healthz", healthzHandler)
|
||||
// older handlers
|
||||
http.HandleFunc("/hostName", hostNameHandler)
|
||||
http.HandleFunc("/shutdown", shutdownHandler)
|
||||
|
@ -120,13 +121,12 @@ func exitHandler(w http.ResponseWriter, r *http.Request) {
|
|||
func hostnameHandler(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("GET /hostname")
|
||||
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
|
||||
// as a health check of the HTTP server by virtue of being a HTTP handler.
|
||||
func healthzHandler(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("GET /healthz")
|
||||
if serverReady.get() {
|
||||
w.WriteHeader(200)
|
||||
return
|
||||
|
@ -348,6 +348,7 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func hostNameHandler(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("GET /hostName")
|
||||
fmt.Fprintf(w, getHostName())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue