-
Notifications
You must be signed in to change notification settings - Fork 8
/
constants.go
109 lines (100 loc) · 4.46 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
Copyright 2019 The cctl authors.
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.
*/
package common
import "time"
const (
DefaultAPIServerPort = 6443
DrainTimeout = 5 * time.Minute
DrainGracePeriodSeconds = -1
DrainDeleteLocalData = false
DrainForce = false
MasterRole = "master"
NodeRole = "node"
DefaultSSHPort = 22
DefaultNamespace = "default"
DefaultClusterName = "cctl-cluster"
DefaultSSHCredentialSecretName = "ssh-credential"
DefaultCommonCASecretName = "common-ca"
DefaultEtcdCASecretName = "etcd-ca"
DefaultAPIServerCASecretName = "apiserver-ca"
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"
DefaultNodeadmVersion = "v0.3.0"
DefaultEtcdadmVersion = "v0.1.1"
DefaultKubernetesVersion = "1.12.8"
DefaultCNIVersion = "v0.6.0"
DefaultFlannelVersion = "v0.10.0"
DefaultKeepalivedVersion = "v2.0.4"
DefaultEtcdVersion = "v3.3.8"
DockerKubeAPIServerNameFilter = "name=k8s_kube-apiserver.*kube-system.*"
DockerRunningStatusFilter = "status=running"
InstanceStatusAnnotationKey = "instance-status"
KubeAPIServer = "kube-apiserver"
KubeControllerManager = "kube-controller-manager"
KubeScheduler = "kube-scheduler"
KubeSystemNamespace = "kube-system"
MinimumControlPlaneVersion = "v1.11.0"
TmpKubeConfigNamePrefix = "kubeconfig"
DefaultAdminConfigSecretName = "admin-kubeconfig"
DefaultAdminConfigSecretKey = "data"
KubeAPIServerServiceNodePortRange = "80-32767"
KubeControllerMgrPodEvictionTimeout = "20s"
DashcamBundleBaseDir = "/var/tmp"
DashcamCommandPath = "/opt/bin/dashcam"
SupportBundleFileNamePrefix = "cctl-bundle"
ClusterV1PrintTemplate = `Cluster Information
------- ------------
Cluster Name : {{ .Cluster.ObjectMeta.Name}}
Creation Timestamp : {{ .Cluster.ObjectMeta.CreationTimestamp }}
Networking
Pod CIDR : {{ .Cluster.Spec.ClusterNetwork.Pods.CIDRBlocks }}
Service CIDR : {{ .Cluster.Spec.ClusterNetwork.Services.CIDRBlocks }}
{{ if .ClusterProviderSpec.VIPConfiguration }}
VIP : {{ .ClusterProviderSpec.VIPConfiguration.IP }}
RouterID : {{ .ClusterProviderSpec.VIPConfiguration.RouterID }}
{{- else }}
VIP : None configured.
{{ end }}
`
MachineV1PrintTemplate = `Machine Information
------- -----------
Machine IP Creation Timestamp Role
{{ range $machine := .}}{{ $machine.ObjectMeta.Name }} {{ $machine.ObjectMeta.CreationTimestamp }} {{ $machine.Spec.Roles }}
{{ end }}
`
// LabelNodeRoleMaster specifies that a node is a master
LabelNodeRoleMaster = "node-role.kubernetes.io/master"
)
var (
// TODO(dlipovetsky) Move fields to configuration
KubeletFailSwapOn = false
KubeletMaxPods = int32(500)
KubeletKubeAPIQPS = int32(20)
KubeletKubeAPIBurst = int32(40)
KubeletEvictionHard = map[string]string{
"memory.available": "600Mi",
"nodefs.available": "10%",
}
KubeletFeatureGates = map[string]bool{
"PodPriority": true,
}
DefaultKubeAPIServerExtraArgs = map[string]string{}
DefaultKubeControllerManagerExtraArgs = map[string]string{}
DefaultKubeSchedulerExtraArgs = map[string]string{}
)
var MasterComponents = []string{KubeAPIServer, KubeControllerManager, KubeScheduler}