Create main file for storage provisioner
parent
bb9b7b1385
commit
a8fedc86e1
10
Makefile
10
Makefile
|
@ -300,6 +300,16 @@ $(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile
|
|||
@echo ""
|
||||
@echo "$(@) successfully built"
|
||||
|
||||
out/storage-provisioner-main: cmd/storage-provisioner/main.go
|
||||
go build cmd/storage-provisioner/main.go
|
||||
|
||||
.PHONY: storage-provisioner-image
|
||||
storage-provisioner-image: out/storage-provisioner-main
|
||||
docker build -t $(REGISTRY)/storage-provisioner:$(TAG) -f deploy/storage-provisioner/Dockerfile .
|
||||
gcloud docker -- push $(REGISTRY)/storage-provisioner:$(TAG)
|
||||
# docker build -t gcr.io/priya-wadhwa/storage-provisioner:$(TAG) -f deploy/storage-provisioner/Dockerfile .
|
||||
# gcloud docker -- push gcr.io/priya-wadhwa/storage-provisioner:$(TAG)
|
||||
|
||||
.PHONY: release-iso
|
||||
release-iso: minikube_iso checksum
|
||||
gsutil cp out/minikube.iso gs://$(ISO_BUCKET)/minikube-$(ISO_VERSION).iso
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"k8s.io/minikube/cmd/localkube/cmd"
|
||||
"sync"
|
||||
)
|
||||
|
||||
func main() {
|
||||
localkubeServer := cmd.NewLocalkubeServer()
|
||||
storageProvisionerServer := localkubeServer.NewStorageProvisionerServer()
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(2)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
storageProvisionerServer.Start()
|
||||
}()
|
||||
wg.Wait()
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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 ubuntu:16.04
|
||||
|
||||
COPY main main
|
||||
|
||||
CMD ["/main"]
|
||||
|
|
@ -30,8 +30,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"k8s.io/minikube/pkg/util"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
const provisionerName = "k8s.io/minikube-hostpath"
|
||||
|
@ -115,9 +114,8 @@ func (lk LocalkubeServer) NewStorageProvisionerServer() Server {
|
|||
}
|
||||
|
||||
func StartStorageProvisioner(lk LocalkubeServer) func() error {
|
||||
|
||||
return func() error {
|
||||
config, err := clientcmd.BuildConfigFromFlags("", util.DefaultKubeConfigPath)
|
||||
config, err := restclient.InClusterConfig()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -141,6 +139,7 @@ func StartStorageProvisioner(lk LocalkubeServer) func() error {
|
|||
// PVs
|
||||
pc := controller.NewProvisionController(clientset, provisionerName, hostPathProvisioner, serverVersion.GitVersion)
|
||||
|
||||
fmt.Println("wait never stop")
|
||||
pc.Run(wait.NeverStop)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue