提交 3b46c27b 编写于 作者: M Matt Rickard

Minikube changes for v1.6.0-alpha.1

上级 cd9820bb
......@@ -23,9 +23,9 @@ import (
"github.com/coreos/pkg/capnslog"
"github.com/golang/glog"
"k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/capabilities"
"k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/util/config"
"k8s.io/minikube/pkg/localkube"
"k8s.io/minikube/pkg/version"
)
......@@ -76,7 +76,7 @@ func SetupServer(s *localkube.LocalkubeServer) {
//Set feature gates
if s.FeatureGates != "" {
glog.Infof("Setting Feature Gates: %s", s.FeatureGates)
err := config.DefaultFeatureGate.Set(s.FeatureGates)
err := feature.DefaultFeatureGate.Set(s.FeatureGates)
if err != nil {
fmt.Printf("Error setting feature gates: %s", err)
}
......
......@@ -19,13 +19,13 @@ metadata:
namespace: kube-system
labels:
component: kube-addon-manager
version: v6.1
version: v6.4-alpha.1
kubernetes.io/minikube-addons: addon-manager
spec:
hostNetwork: true
containers:
- name: kube-addon-manager
image: gcr.io/google-containers/kube-addon-manager:v6.3
image: gcr.io/google-containers/kube-addon-manager:v6.4-alpha.1
imagePullPolicy: IfNotPresent
resources:
requests:
......
......@@ -31,7 +31,7 @@ minikube start
--iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/iso/minikube-v1.0.7.iso")
--keep-context This will keep the existing kubectl context and will create a minikube context.
--kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3)
OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64) (default "v1.5.3")
OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64) (default "v1.6.0-alpha.1")
--kvm-network string The KVM network name. (only supported with KVM driver) (default "default")
--memory int Amount of RAM allocated to the minikube VM (default 2048)
--network-plugin string The name of the network plugin
......
......@@ -20,7 +20,7 @@ import (
apiserver "k8s.io/kubernetes/cmd/kube-apiserver/app"
"k8s.io/kubernetes/cmd/kube-apiserver/app/options"
"k8s.io/kubernetes/pkg/storage/storagebackend"
"k8s.io/apiserver/pkg/storage/storagebackend"
)
func (lk LocalkubeServer) NewAPIServer() Server {
......@@ -30,21 +30,26 @@ func (lk LocalkubeServer) NewAPIServer() Server {
func StartAPIServer(lk LocalkubeServer) func() error {
config := options.NewServerRunOptions()
config.GenericServerRunOptions.BindAddress = lk.APIServerAddress
config.GenericServerRunOptions.SecurePort = lk.APIServerPort
config.GenericServerRunOptions.InsecureBindAddress = lk.APIServerInsecureAddress
config.GenericServerRunOptions.InsecurePort = lk.APIServerInsecurePort
config.SecureServing.ServingOptions.BindAddress = lk.APIServerAddress
config.SecureServing.ServingOptions.BindPort = lk.APIServerPort
config.GenericServerRunOptions.ClientCAFile = lk.GetCAPublicKeyCertPath()
config.GenericServerRunOptions.TLSCertFile = lk.GetPublicKeyCertPath()
config.GenericServerRunOptions.TLSPrivateKeyFile = lk.GetPrivateKeyCertPath()
config.InsecureServing.BindAddress = lk.APIServerInsecureAddress
config.InsecureServing.BindPort = lk.APIServerInsecurePort
config.Authentication.ClientCert.ClientCA = lk.GetCAPublicKeyCertPath()
config.SecureServing.ServerCert.CertKey.CertFile = lk.GetPublicKeyCertPath()
config.SecureServing.ServerCert.CertKey.KeyFile = lk.GetPrivateKeyCertPath()
config.GenericServerRunOptions.AdmissionControl = "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota"
// use localkube etcd
config.GenericServerRunOptions.StorageConfig = storagebackend.Config{ServerList: KubeEtcdClientURLs}
config.Etcd.StorageConfig = storagebackend.Config{
ServerList: KubeEtcdClientURLs,
Type: storagebackend.StorageTypeETCD2,
}
// set Service IP range
config.GenericServerRunOptions.ServiceClusterIPRange = lk.ServiceClusterIPRange
config.ServiceClusterIPRange = lk.ServiceClusterIPRange
// defaults from apiserver command
config.GenericServerRunOptions.EnableProfiling = true
......
......@@ -26,8 +26,8 @@ import (
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/util/config"
utilnet "k8s.io/kubernetes/pkg/util/net"
utilnet "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/minikube/pkg/util"
)
......@@ -54,7 +54,7 @@ type LocalkubeServer struct {
ShouldGenerateCerts bool
ShowVersion bool
ShowHostIP bool
RuntimeConfig config.ConfigurationMap
RuntimeConfig flag.ConfigurationMap
NodeIP net.IP
ContainerRuntime string
NetworkPlugin string
......
......@@ -24,13 +24,14 @@ import (
"time"
"github.com/golang/glog"
"github.com/kubernetes-incubator/external-storage/lib/controller"
"github.com/kubernetes-incubator/external-storage/lib/leaderelection"
"github.com/r2d4/external-storage/lib/controller"
"github.com/r2d4/external-storage/lib/leaderelection"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/types"
"k8s.io/client-go/pkg/util/uuid"
"k8s.io/client-go/pkg/util/wait"
"k8s.io/client-go/rest"
)
......@@ -72,7 +73,7 @@ func (p *hostPathProvisioner) Provision(options controller.VolumeOptions) (*v1.P
}
pv := &v1.PersistentVolume{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: meta_v1.ObjectMeta{
Name: options.PVName,
Annotations: map[string]string{
"hostPathProvisionerIdentity": string(p.identity),
......
......@@ -21,8 +21,8 @@ import (
"os"
"path/filepath"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
"k8s.io/kubernetes/pkg/util/homedir"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"k8s.io/kubernetes/pkg/version"
minikubeVersion "k8s.io/minikube/pkg/version"
)
......
......@@ -24,9 +24,9 @@ import (
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api/latest"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/clientcmd/api"
"k8s.io/client-go/tools/clientcmd/api/latest"
)
type KubeConfigSetup struct {
......
......@@ -23,7 +23,7 @@ import (
"strconv"
"testing"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api"
"k8s.io/client-go/tools/clientcmd/api"
"k8s.io/minikube/pkg/minikube/constants"
)
......
......@@ -27,6 +27,7 @@ import (
"github.com/docker/machine/libmachine"
"github.com/pkg/browser"
"github.com/pkg/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/pkg/api/v1"
......@@ -34,7 +35,7 @@ import (
"text/template"
"k8s.io/client-go/pkg/labels"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/util"
)
......@@ -94,7 +95,7 @@ func GetServiceURLs(api libmachine.API, namespace string, t *template.Template)
serviceInterface := client.Services(namespace)
svcs, err := serviceInterface.List(v1.ListOptions{})
svcs, err := serviceInterface.List(meta_v1.ListOptions{})
if err != nil {
return nil, err
}
......@@ -138,7 +139,7 @@ func printURLsForService(c corev1.CoreV1Interface, ip, service, namespace string
}
s := c.Services(namespace)
svc, err := s.Get(service)
svc, err := s.Get(service, meta_v1.GetOptions{})
if err != nil {
return nil, errors.Wrapf(err, "service '%s' could not be found running", service)
}
......@@ -191,14 +192,14 @@ func CheckService(namespace string, service string) error {
}
func validateService(s corev1.ServiceInterface, service string) error {
if _, err := s.Get(service); err != nil {
if _, err := s.Get(service, meta_v1.GetOptions{}); err != nil {
return errors.Wrapf(err, "Error getting service %s", service)
}
return nil
}
func checkEndpointReady(endpoints corev1.EndpointsInterface, service string) error {
endpoint, err := endpoints.Get(service)
endpoint, err := endpoints.Get(service, meta_v1.GetOptions{})
if err != nil {
return errors.Wrapf(err, "Error getting endpoints for service %s", service)
}
......@@ -253,7 +254,7 @@ func GetServiceListByLabel(namespace string, key string, value string) (*v1.Serv
func getServiceListFromServicesByLabel(services corev1.ServiceInterface, key string, value string) (*v1.ServiceList, error) {
selector := labels.SelectorFromSet(labels.Set(map[string]string{key: value}))
serviceList, err := services.List(v1.ListOptions{LabelSelector: selector.String()})
serviceList, err := services.List(meta_v1.ListOptions{LabelSelector: selector.String()})
if err != nil {
return &v1.ServiceList{}, &util.RetriableError{Err: err}
}
......@@ -272,7 +273,7 @@ func CreateSecret(namespace, name string, dataValues map[string]string, labels m
return &util.RetriableError{Err: err}
}
secret, _ := secrets.Get(name)
secret, _ := secrets.Get(name, meta_v1.GetOptions{})
// Delete existing secret
if len(secret.Name) > 0 {
......@@ -290,7 +291,7 @@ func CreateSecret(namespace, name string, dataValues map[string]string, labels m
// Create Secret
secretObj := &v1.Secret{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: meta_v1.ObjectMeta{
Name: name,
Labels: labels,
},
......@@ -319,7 +320,7 @@ func DeleteSecret(namespace, name string) error {
return &util.RetriableError{Err: err}
}
err = secrets.Delete(name, &v1.DeleteOptions{})
err = secrets.Delete(name, &meta_v1.DeleteOptions{})
if err != nil {
return &util.RetriableError{Err: err}
}
......
......@@ -25,6 +25,7 @@ import (
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/host"
"github.com/pkg/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/kubernetes/typed/core/v1/fake"
"k8s.io/client-go/pkg/api/v1"
......@@ -55,7 +56,7 @@ var defaultNamespaceServiceInterface = &MockServiceInterface{
ServiceList: &v1.ServiceList{
Items: []v1.Service{
{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: meta_v1.ObjectMeta{
Name: "mock-dashboard",
Namespace: "default",
},
......@@ -67,7 +68,7 @@ var defaultNamespaceServiceInterface = &MockServiceInterface{
},
},
{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: meta_v1.ObjectMeta{
Name: "mock-dashboard-no-ports",
Namespace: "default",
},
......@@ -119,7 +120,7 @@ var endpointMap = map[string]*v1.Endpoints{
},
}
func (e MockEndpointsInterface) Get(name string) (*v1.Endpoints, error) {
func (e MockEndpointsInterface) Get(name string, _ meta_v1.GetOptions) (*v1.Endpoints, error) {
endpoint, ok := endpointMap[name]
if !ok {
return nil, errors.New("Endpoint not found")
......@@ -170,7 +171,7 @@ type MockServiceInterface struct {
ServiceList *v1.ServiceList
}
func (s MockServiceInterface) List(opts v1.ListOptions) (*v1.ServiceList, error) {
func (s MockServiceInterface) List(opts meta_v1.ListOptions) (*v1.ServiceList, error) {
serviceList := &v1.ServiceList{
Items: []v1.Service{},
}
......@@ -189,7 +190,7 @@ func (s MockServiceInterface) List(opts v1.ListOptions) (*v1.ServiceList, error)
return s.ServiceList, nil
}
func (s MockServiceInterface) Get(name string) (*v1.Service, error) {
func (s MockServiceInterface) Get(name string, _ meta_v1.GetOptions) (*v1.Service, error) {
for _, svc := range s.ServiceList.Items {
if svc.ObjectMeta.Name == name {
return &svc, nil
......
......@@ -23,7 +23,7 @@ import (
"strconv"
"strings"
utilnet "k8s.io/kubernetes/pkg/util/net"
utilnet "k8s.io/apimachinery/pkg/util/net"
)
// findNestedElement uses reflection to find the element corresponding to the dot-separated string parameter.
......
......@@ -22,7 +22,7 @@ import (
"reflect"
"testing"
utilnet "k8s.io/kubernetes/pkg/util/net"
utilnet "k8s.io/apimachinery/pkg/util/net"
)
type aliasedString string
......
......@@ -28,7 +28,8 @@ import (
"github.com/pkg/errors"
"k8s.io/kubernetes/pkg/api"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1"
commonutil "k8s.io/minikube/pkg/util"
"k8s.io/minikube/test/integration/util"
......@@ -45,7 +46,7 @@ func testAddons(t *testing.T) {
kubectlRunner := util.NewKubectlRunner(t)
checkAddon := func() error {
pods := api.PodList{}
pods := v1.PodList{}
if err := kubectlRunner.RunCommandParseOutput(addonManagerCmd, &pods); err != nil {
return &commonutil.RetriableError{Err: errors.Wrap(err, "Error parsing kubectl output")}
}
......
......@@ -33,6 +33,8 @@ import (
commonutil "k8s.io/minikube/pkg/util"
)
const kubectlBinary = "kubectl-v1.6.0-alpha.1"
type MinikubeRunner struct {
T *testing.T
BinaryPath string
......@@ -130,7 +132,7 @@ type KubectlRunner struct {
}
func NewKubectlRunner(t *testing.T) *KubectlRunner {
p, err := exec.LookPath("kubectl")
p, err := exec.LookPath(kubectlBinary)
if err != nil {
t.Fatalf("Couldn't find kubectl on path.")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册