Skip to content

Commit 1c06d18

Browse files
authored
Merge pull request #1693 from r2d4/k8s-1.7-rebase
Upgrade to k8s-v1.7
2 parents ba0411b + 1aaeb67 commit 1c06d18

File tree

4,068 files changed

+537347
-167967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,068 files changed

+537347
-167967
lines changed

Godeps/Godeps.json

+2,194-1,596
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BUILDROOT_BRANCH ?= 2017.02
2323
REGISTRY?=gcr.io/k8s-minikube
2424

2525
MINIKUBE_BUILD_IMAGE ?= karalabe/xgo-1.8.3
26-
LOCALKUBE_BUILD_IMAGE ?= gcr.io/google_containers/kube-cross:v1.7.1-0
26+
LOCALKUBE_BUILD_IMAGE ?= gcr.io/google_containers/kube-cross:v1.8.3-1
2727
ISO_BUILD_IMAGE ?= $(REGISTRY)/buildroot-image
2828

2929
ISO_VERSION ?= v0.22.0

cmd/localkube/cmd/options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func AddFlags(s *localkube.LocalkubeServer) {
6363
flag.StringVar(&s.APIServerName, "apiserver-name", s.APIServerName, "The apiserver name which is used in the generated certificate for localkube/kubernetes. This can be used if you want to make the API server available from outside the machine")
6464

6565
flag.BoolVar(&s.ShouldGenerateCerts, "generate-certs", s.ShouldGenerateCerts, "If localkube should generate it's own certificates")
66-
flag.BoolVar(&s.ShowVersion, "version", s.ShowVersion, "If localkube should just print the version and exit.")
66+
flag.BoolVar(&s.ShowVersion, "show-version", s.ShowVersion, "If localkube should just print the version and exit.")
6767
flag.BoolVar(&s.ShowHostIP, "host-ip", s.ShowHostIP, "If localkube should just print the host IP and exit.")
6868
flag.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
6969
flag.IPVar(&s.NodeIP, "node-ip", s.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node.")

cmd/localkube/cmd/start.go

-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"os"
2222
"os/signal"
2323

24-
"github.com/coreos/pkg/capnslog"
2524
"github.com/golang/glog"
2625
"k8s.io/apiserver/pkg/util/feature"
2726

@@ -47,11 +46,6 @@ func StartLocalkube() {
4746
os.Exit(0)
4847
}
4948

50-
// Get the etcd logger for the api repo
51-
apiRepoLogger := capnslog.MustRepoLogger("github.com/coreos/etcd/etcdserver/api")
52-
// Set the logging level to NOTICE as there is an INFO lvl log statement that runs every few seconds -> log spam
53-
apiRepoLogger.SetRepoLogLevel(capnslog.NOTICE)
54-
5549
// TODO: Require root
5650

5751
SetupServer(Server)

deploy/addons/addon-manager.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
hostNetwork: true
2626
containers:
2727
- name: kube-addon-manager
28-
image: gcr.io/google-containers/kube-addon-manager:v6.4-beta.1
28+
image: gcr.io/google-containers/kube-addon-manager:v6.4-beta.2
2929
imagePullPolicy: IfNotPresent
3030
resources:
3131
requests:

deploy/addons/kube-dns/kube-dns-controller.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
optional: true
4545
containers:
4646
- name: kubedns
47-
image: gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.2
47+
image: gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.4
4848
resources:
4949
# TODO: Set memory limits when we've profiled the container for large
5050
# clusters, then set request = limit to keep this container in
@@ -95,7 +95,7 @@ spec:
9595
- name: kube-dns-config
9696
mountPath: /kube-dns-config
9797
- name: dnsmasq
98-
image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.2
98+
image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.4
9999
livenessProbe:
100100
httpGet:
101101
path: /healthcheck/dnsmasq
@@ -133,7 +133,7 @@ spec:
133133
- name: kube-dns-config
134134
mountPath: /etc/k8s/dns/dnsmasq-nanny
135135
- name: sidecar
136-
image: gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.2
136+
image: gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.4
137137
livenessProbe:
138138
httpGet:
139139
path: /metrics

hack/get_k8s_version.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from datetime import datetime
2323

2424
K8S_PACKAGE = 'k8s.io/kubernetes/'
25-
X_ARG_BASE = '-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.'
25+
X_ARGS = ['-X k8s.io/minikube/vendor/k8s.io/kubernetes/pkg/version.', '-X k8s.io/minikube/vendor/k8s.io/client-go/pkg/version.']
2626

2727
def get_rev():
2828
return 'gitCommit=%s' % get_from_godep('Rev')
@@ -52,7 +52,11 @@ def main():
5252
if len(sys.argv) > 1 and sys.argv[1] == "--k8s-version-only":
5353
return get_from_godep('Comment')
5454
args = [get_rev(), get_version(), get_tree_state(), get_build_date()]
55-
return ' '.join([X_ARG_BASE + arg for arg in args])
55+
ret = ''
56+
for xarg in X_ARGS:
57+
for arg in args:
58+
ret += xarg + arg + " "
59+
return ret
5660

5761
if __name__ == '__main__':
5862
sys.exit(main())

hack/godeps/godep-restore.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,8 @@ if [ ! -d "${KUBE_ROOT}" ]; then
3232
popd >/dev/null
3333
fi
3434

35-
pushd ${KUBE_ROOT} >/dev/null
36-
git checkout ${KUBE_VERSION}
37-
./hack/godep-restore.sh
38-
popd >/dev/null
35+
godep::restore_kubernetes
3936

40-
godep::sync_staging
4137
pushd ${MINIKUBE_ROOT} >/dev/null
4238
godep restore ./...
4339
popd >/dev/null

hack/godeps/godep-save.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ godep::sync_staging
2828

2929
rm -rf ${MINIKUBE_ROOT}/vendor ${MINIKUBE_ROOT}/Godeps
3030
godep save ./...
31+
cp ${KUBE_ROOT}/pkg/generated/openapi/zz_generated.openapi.go ${MINIKUBE_ROOT}/vendor/k8s.io/kubernetes/pkg/generated/openapi
3132

3233
godep::remove_staging_from_json
3334
git checkout -- ${MINIKUBE_ROOT}/vendor/golang.org/x/sys/windows
3435

35-
git apply ${MINIKUBE_ROOT}/hack/tpr-patch.diff
36+
pushd ${MINIKUBE_ROOT} >/dev/null
37+
git apply ${MINIKUBE_ROOT}/hack/tpr-patch.diff
38+
git apply ${MINIKUBE_ROOT}/hack/kube-proxy-patch.diff
39+
popd >/dev/null
40+

hack/godeps/godep-update-k8s.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Copyright 2016 The Kubernetes Authors All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
K8S_ORG_ROOT=${GOPATH}/src/k8s.io
18+
MINIKUBE_ROOT=${K8S_ORG_ROOT}/minikube
19+
KUBE_ROOT=${K8S_ORG_ROOT}/kubernetes
20+
KUBE_VERSION=${KUBE_VERSION:=$(python ${MINIKUBE_ROOT}/hack/get_k8s_version.py --k8s-version-only 2>&1)}
21+
22+
source ${MINIKUBE_ROOT}/hack/godeps/utils.sh
23+
24+
godep::restore_kubernetes
25+
${MINIKUBE_ROOT}/hack/godeps/godep-save.sh

hack/godeps/godeps-json-updater.go

+14-13
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,20 @@ package main
1818

1919
import (
2020
"encoding/json"
21+
"io/ioutil"
2122
"log"
2223
"os"
24+
"path"
2325
"strings"
2426

2527
flag "github.com/spf13/pflag"
2628
)
2729

2830
var (
29-
godepsFile = flag.String("godeps-file", "", "absolute path to Godeps.json")
31+
godepsFile = flag.String("godeps-file", "", "absolute path to Godeps.json")
32+
kubernetesPath = flag.String("kubernetes-dir", "", "absolute path to the kubernetes folder")
3033
)
3134

32-
var ignoredPrefixes = []string{
33-
"k8s.io/client-go",
34-
"k8s.io/apimachinery",
35-
"k8s.io/apiserver",
36-
"k8s.io/kube-aggregator",
37-
"k8s.io/kube-apiextensions-server",
38-
"k8s.io/metrics",
39-
}
40-
4135
type Dependency struct {
4236
ImportPath string
4337
Comment string `json:",omitempty"`
@@ -55,7 +49,7 @@ type Godeps struct {
5549
func main() {
5650
flag.Parse()
5751
var g Godeps
58-
if len(*godepsFile) == 0 {
52+
if godepsFile == nil || kubernetesPath == nil {
5953
log.Fatalf("absolute path to Godeps.json is required")
6054
}
6155
f, err := os.OpenFile(*godepsFile, os.O_RDWR, 0666)
@@ -68,11 +62,18 @@ func main() {
6862
log.Fatalf("Unable to parse %q: %v", *godepsFile, err)
6963
}
7064

65+
k8sStagingDir := path.Join(*kubernetesPath, "staging", "src", "k8s.io")
66+
stagedRepos, err := ioutil.ReadDir(k8sStagingDir)
67+
if err != nil {
68+
log.Fatalf("Couldn't read kubernetes staging repo: %v", err)
69+
}
70+
7171
i := 0
7272
for _, dep := range g.Deps {
7373
ignored := false
74-
for _, ignoredPrefix := range ignoredPrefixes {
75-
if strings.HasPrefix(dep.ImportPath, ignoredPrefix) {
74+
for _, stagedRepo := range stagedRepos {
75+
importPrefix := path.Join("k8s.io", stagedRepo.Name())
76+
if strings.HasPrefix(dep.ImportPath, importPrefix) {
7677
ignored = true
7778
}
7879
}

hack/godeps/utils.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ for repo in $(ls ${KUBE_ROOT}/staging/src/k8s.io); do
5252
done
5353
}
5454

55+
godep::restore_kubernetes() {
56+
pushd ${KUBE_ROOT} >/dev/null
57+
git checkout ${KUBE_VERSION}
58+
./hack/godep-restore.sh
59+
bazel build //pkg/generated/openapi:zz_generated.openapi
60+
popd >/dev/null
61+
godep::sync_staging
62+
}
63+
5564
godep::remove_staging_from_json() {
56-
go run ${MINIKUBE_ROOT}/hack/godeps/godeps-json-updater.go --godeps-file ${MINIKUBE_ROOT}/Godeps/Godeps.json
65+
go run ${MINIKUBE_ROOT}/hack/godeps/godeps-json-updater.go --godeps-file ${MINIKUBE_ROOT}/Godeps/Godeps.json --kubernetes-dir ${KUBE_ROOT}
5766
}

hack/kube-proxy-patch.diff

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go b/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go
2+
index 8d1ae7774..8745a176f 100644
3+
--- a/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go
4+
+++ b/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go
5+
@@ -422,7 +422,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
6+
if c, err := configz.New("componentconfig"); err == nil {
7+
c.Set(config)
8+
} else {
9+
- return nil, fmt.Errorf("unable to register configz: %s", err)
10+
+ glog.Errorf("unable to register configz: %s", err)
11+
}
12+
13+
protocol := utiliptables.ProtocolIpv4

pkg/localkube/apiserver.go

+11-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func (lk LocalkubeServer) NewAPIServer() Server {
3636
func StartAPIServer(lk LocalkubeServer) func() error {
3737
config := options.NewServerRunOptions()
3838

39-
config.SecureServing.ServingOptions.BindAddress = lk.APIServerAddress
40-
config.SecureServing.ServingOptions.BindPort = lk.APIServerPort
39+
config.SecureServing.BindAddress = lk.APIServerAddress
40+
config.SecureServing.BindPort = lk.APIServerPort
4141

4242
config.InsecureServing.BindAddress = lk.APIServerInsecureAddress
4343
config.InsecureServing.BindPort = lk.APIServerInsecurePort
@@ -46,8 +46,13 @@ func StartAPIServer(lk LocalkubeServer) func() error {
4646

4747
config.SecureServing.ServerCert.CertKey.CertFile = lk.GetPublicKeyCertPath()
4848
config.SecureServing.ServerCert.CertKey.KeyFile = lk.GetPrivateKeyCertPath()
49-
config.GenericServerRunOptions.AdmissionControl = "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota"
50-
49+
config.Admission.PluginNames = []string{
50+
"NamespaceLifecycle",
51+
"LimitRanger",
52+
"ServiceAccount",
53+
"DefaultStorageClass",
54+
"ResourceQuota",
55+
}
5156
// use localkube etcd
5257

5358
config.Etcd.StorageConfig.ServerList = KubeEtcdClientURLs
@@ -73,7 +78,8 @@ func StartAPIServer(lk LocalkubeServer) func() error {
7378
lk.SetExtraConfigForComponent("apiserver", &config)
7479

7580
return func() error {
76-
return apiserver.Run(config)
81+
stop := make(chan struct{})
82+
return apiserver.Run(config, stop)
7783
}
7884
}
7985

pkg/localkube/proxy.go

+13-12
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package localkube
1919
import (
2020
kubeproxy "k8s.io/kubernetes/cmd/kube-proxy/app"
2121

22-
"k8s.io/kubernetes/cmd/kube-proxy/app/options"
22+
"k8s.io/apimachinery/pkg/runtime"
2323
"k8s.io/kubernetes/pkg/apis/componentconfig"
2424
"k8s.io/kubernetes/pkg/kubelet/qos"
2525
)
@@ -34,22 +34,23 @@ func (lk LocalkubeServer) NewProxyServer() Server {
3434
}
3535

3636
func StartProxyServer(lk LocalkubeServer) func() error {
37-
config := options.NewProxyConfig()
38-
39-
// master details
40-
config.Master = lk.GetAPIServerInsecureURL()
41-
42-
config.Mode = componentconfig.ProxyModeIPTables
43-
44-
// defaults
45-
config.OOMScoreAdj = &OOMScoreAdj
46-
config.IPTablesMasqueradeBit = &MasqueradeBit
37+
config := &componentconfig.KubeProxyConfiguration{
38+
OOMScoreAdj: &OOMScoreAdj,
39+
IPTables: componentconfig.KubeProxyIPTablesConfiguration{
40+
MasqueradeBit: &MasqueradeBit,
41+
},
42+
BindAddress: lk.APIServerInsecureAddress.String(),
43+
Mode: componentconfig.ProxyModeIPTables,
44+
FeatureGates: lk.FeatureGates,
45+
// Disable the healthz check
46+
HealthzBindAddress: "0",
47+
}
4748

4849
lk.SetExtraConfigForComponent("proxy", &config)
4950

5051
return func() error {
5152
// Creating this config requires the API Server to be up, so do it in the start function itself.
52-
server, err := kubeproxy.NewProxyServerDefault(config)
53+
server, err := kubeproxy.NewProxyServer(config, false, runtime.NewScheme(), lk.GetAPIServerInsecureURL())
5354
if err != nil {
5455
panic(err)
5556
}

pkg/minikube/service/service_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func TestGetServiceListFromServicesByLabel(t *testing.T) {
225225
}
226226

227227
func TestPrintURLsForService(t *testing.T) {
228-
defaultTemplate := template.Must(template.New("svc-template").Parse("{{.IP}}:{{.Port}}"))
228+
defaultTemplate := template.Must(template.New("svc-template").Parse("http://{{.IP}}:{{.Port}}"))
229229
client := &MockCoreClient{
230230
servicesMap: serviceNamespaces,
231231
}
@@ -260,15 +260,15 @@ func TestPrintURLsForService(t *testing.T) {
260260
test := test
261261
t.Run(test.description, func(t *testing.T) {
262262
t.Parallel()
263-
urls, err := printURLsForService(client, "http://127.0.0.1", test.serviceName, test.namespace, test.tmpl)
263+
urls, err := printURLsForService(client, "127.0.0.1", test.serviceName, test.namespace, test.tmpl)
264264
if err != nil && !test.err {
265265
t.Errorf("Error: %s", err)
266266
}
267267
if err == nil && test.err {
268268
t.Errorf("Expected error but got none")
269269
}
270270
if !reflect.DeepEqual(urls, test.expectedOutput) {
271-
t.Errorf("\nExpected %v \nActual: %v \n\n", urls, test.expectedOutput)
271+
t.Errorf("\nExpected %v \nActual: %v \n\n", test.expectedOutput, urls)
272272
}
273273
})
274274
}
@@ -350,7 +350,7 @@ func TestGetServiceURLsForService(t *testing.T) {
350350
},
351351
},
352352
}
353-
defaultTemplate := template.Must(template.New("svc-template").Parse("{{.IP}}:{{.Port}}"))
353+
defaultTemplate := template.Must(template.New("svc-template").Parse("http://{{.IP}}:{{.Port}}"))
354354

355355
var tests = []struct {
356356
description string

pkg/util/kubeconfig/config_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ func configEquals(a, b *api.Config) bool {
445445

446446
if aCluster.LocationOfOrigin != bCluster.LocationOfOrigin ||
447447
aCluster.Server != bCluster.Server ||
448-
aCluster.APIVersion != bCluster.APIVersion ||
449448
aCluster.InsecureSkipTLSVerify != bCluster.InsecureSkipTLSVerify ||
450449
aCluster.CertificateAuthority != bCluster.CertificateAuthority ||
451450
len(aCluster.CertificateAuthorityData) != len(bCluster.CertificateAuthorityData) ||

vendor/github.com/Microsoft/go-winio/.gitignore

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/README.md

+11-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)