Address comments

This commit is contained in:
Manuel de Brito Fontes 2017-02-07 13:32:25 -03:00
parent da2630638b
commit 6715bd53db
3 changed files with 9 additions and 28 deletions

View File

@ -19,13 +19,14 @@ package main // import "k8s.io/kops/cmd/nodeup"
import (
"flag"
"fmt"
"os"
"time"
"github.com/golang/glog"
"k8s.io/kops"
"k8s.io/kops/nodeup/pkg/bootstrap"
"k8s.io/kops/upup/models"
"k8s.io/kops/upup/pkg/fi/nodeup"
"os"
"time"
)
const retryInterval = 30 * time.Second
@ -70,6 +71,8 @@ func main() {
for {
var err error
if install {
// create a systemd unit to bootstrap kops
// using the same args as we were called with
var command []string
for i := 0; i < len(os.Args); i++ {
s := os.Args[i]

View File

@ -18,6 +18,8 @@ package model
import (
"fmt"
"strings"
"k8s.io/kops/pkg/flagbuilder"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/nodeup/nodetasks"
@ -25,7 +27,6 @@ import (
"k8s.io/kubernetes/pkg/api/v1"
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/util/intstr"
"strings"
)
// KubeAPIServerBuilder install kube-apiserver (just the manifest at the moment)
@ -43,12 +44,12 @@ func (b *KubeAPIServerBuilder) Build(c *fi.ModelBuilderContext) error {
{
pod, err := b.buildPod()
if err != nil {
return fmt.Errorf("error building kube-apiserver pod: %v", err)
return fmt.Errorf("error building kube-apiserver manifest: %v", err)
}
manifest, err := ToVersionedYaml(pod)
if err != nil {
return fmt.Errorf("error marshalling pod to yaml: %v", err)
return fmt.Errorf("error marshalling manifest to yaml: %v", err)
}
t := &nodetasks.File{
@ -145,21 +146,6 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) {
return pod, nil
}
//// hasHostPath is used to check if the directory exists. We use it because usually we don't want to set up a host-path
//// mapping if the host path doesn't exist, in case the volume is mounted read-only: docker will try to create the host-path
//// it will fail if the volume is read only, and that will prevent the container from starting.
//func hasHostPath(path string) bool {
// _, err := os.Stat(path)
// if err != nil {
// if os.IsNotExist(err) {
// return false
// } else {
// glog.Warningf("error checking if host path %q exists: %v", path, err)
// }
// }
// return true
//}
func addHostPathMapping(pod *v1.Pod, container *v1.Container, name string, path string, readOnly bool) {
pod.Spec.Volumes = append(pod.Spec.Volumes, v1.Volume{
Name: name,

View File

@ -272,14 +272,6 @@ type KubeDNSConfig struct {
ServerIP string `json:"serverIP,omitempty"`
}
//type MasterConfig struct {
// Name string `json:",omitempty"`
//
// Image string `json:",omitempty"`
// Zone string `json:",omitempty"`
// MachineType string `json:",omitempty"`
//}
type EtcdClusterSpec struct {
// Name is the name of the etcd cluster (main, events etc)
Name string `json:"name,omitempty"`