Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version information for all the components in machine spec #81

Merged
merged 3 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func createCluster(clusterName, podsCIDR, servicesCIDR, vip string, routerID int
APIEndpoints: []clusterv1.APIEndpoint{
clusterv1.APIEndpoint{
Host: vip,
Port: common.DEFAULT_APISERVER_PORT,
Port: common.DefaultApiserverPort,
},
},
},
Expand Down
13 changes: 11 additions & 2 deletions cmd/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ func newProvisionedMachineAndMachine(name string, role clustercommon.MachineRole
Roles: []spv1.MachineRole{
spv1.MachineRole(role),
},
ComponentVersions: &spv1.MachineComponentVersions{
NodeadmVersion: common.DefaultNodeadmVersion,
EtcdadmVersion: common.DefaultEtcdadmVersion,
KubernetesVersion: common.DefaultKubernetesVersion,
CNIVersion: common.DefaultCNIVersion,
KeepalivedVersion: common.DefaultKeepalivedVersion,
FlannelVersion: common.DefaultFlannelVersion,
EtcdVersion: common.DefaultEtcdVersion,
},
}
if err := sputil.PutMachineSpec(machineProviderSpec, &newMachine); err != nil {
return nil, nil, fmt.Errorf("unable to encode machine provider spec: %v", err)
Expand Down Expand Up @@ -612,8 +621,8 @@ func init() {
deleteCmd.AddCommand(machineCmdDelete)
machineCmdDelete.Flags().String("ip", "", "IP of the machine")
machineCmdDelete.Flags().String("force", "", "Force delete the machine")
machineCmdDelete.Flags().DurationVar(&drainTimeout, "drain-timeout", common.DRAIN_TIMEOUT, "The length of time to wait before giving up, zero means infinite")
machineCmdDelete.Flags().IntVar(&drainGracePeriodSeconds, "drain-graceperiod", common.DRAIN_GRACE_PERIOD_SECONDS, "Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.")
machineCmdDelete.Flags().DurationVar(&drainTimeout, "drain-timeout", common.DrainTimeout, "The length of time to wait before giving up, zero means infinite")
machineCmdDelete.Flags().IntVar(&drainGracePeriodSeconds, "drain-graceperiod", common.DrainGracePeriodSeconds, "Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.")

machineCmdGet.Flags().String("ip", "", "IP of the machine")
getCmd.AddCommand(machineCmdGet)
Expand Down
32 changes: 17 additions & 15 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package common
import "time"

const (
K8S_VERSION = "1.10.4"
DEFAULT_APISERVER_PORT = 6443
DRAIN_TIMEOUT = 5 * time.Minute
DRAIN_GRACE_PERIOD_SECONDS = -1

MasterRole = "master"
NodeRole = "node"

DefaultApiserverPort = 6443
DrainTimeout = 5 * time.Minute
DrainGracePeriodSeconds = -1
MasterRole = "master"
NodeRole = "node"
DefaultSSHPort = 22
DefaultNamespace = "default"
DefaultClusterName = "cctl-cluster"
Expand All @@ -21,13 +18,18 @@ const (
DefaultFrontProxyCASecretName = "front-proxy-ca"
DefaultServiceAccountKeySecretName = "serviceaccount-key"
DefaultBootstrapTokenSecretName = "bootstrap-token"

SystemUUIDFile = "/sys/class/dmi/id/product_uuid"
KubectlFile = "/opt/bin/kubectl"
AdminKubeconfig = "/etc/kubernetes/admin.conf"
KubeletKubeconfig = "/etc/kubernetes/kubelet.conf"

ClusterV1PrintTemplate = `Cluster Information
SystemUUIDFile = "/sys/class/dmi/id/product_uuid"
KubectlFile = "/opt/bin/kubectl"
AdminKubeconfig = "/etc/kubernetes/admin.conf"
KubeletKubeconfig = "/etc/kubernetes/kubelet.conf"
DefaultNodeadmVersion = "v0.0.1-alpha"
DefaultEtcdadmVersion = "v0.0.1-alpha"
DefaultKubernetesVersion = "1.10.4"
DefaultCNIVersion = "v0.6.0"
DefaultFlannelVersion = "v0.10.0"
DefaultKeepalivedVersion = "v2.0.4"
DefaultEtcdVersion = "v3.3.8"
ClusterV1PrintTemplate = `Cluster Information
------- ------------
Cluster Name : {{ .Cluster.ObjectMeta.Name}}
Creation Timestamp : {{ .Cluster.ObjectMeta.CreationTimestamp }}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.