mirror of https://github.com/kubernetes/kops.git
Add Initializers admission controller
Also sync up Admission controllers with current default sets for 1.7 & 1.8
This commit is contained in:
parent
1e5cf2db52
commit
4d52a7c9e6
|
|
@ -79,6 +79,10 @@ func IsKubernetesGTE(version string, k8sVersion semver.Version) bool {
|
||||||
return k8sVersion.Major > 1 || (k8sVersion.Major == 1 && k8sVersion.Minor >= 6)
|
return k8sVersion.Major > 1 || (k8sVersion.Major == 1 && k8sVersion.Minor >= 6)
|
||||||
case "1.7":
|
case "1.7":
|
||||||
return k8sVersion.Major > 1 || (k8sVersion.Major == 1 && k8sVersion.Minor >= 7)
|
return k8sVersion.Major > 1 || (k8sVersion.Major == 1 && k8sVersion.Minor >= 7)
|
||||||
|
case "1.8":
|
||||||
|
return k8sVersion.Major > 1 || (k8sVersion.Major == 1 && k8sVersion.Minor >= 8)
|
||||||
|
case "1.9":
|
||||||
|
return k8sVersion.Major > 1 || (k8sVersion.Major == 1 && k8sVersion.Minor >= 9)
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("IsKubernetesGTE not supported with version %q", version))
|
panic(fmt.Sprintf("IsKubernetesGTE not supported with version %q", version))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
|
||||||
c.EtcdServers = []string{"http://127.0.0.1:4001"}
|
c.EtcdServers = []string{"http://127.0.0.1:4001"}
|
||||||
c.EtcdServersOverrides = []string{"/events#http://127.0.0.1:4002"}
|
c.EtcdServersOverrides = []string{"/events#http://127.0.0.1:4002"}
|
||||||
|
|
||||||
|
// TODO: We can probably rewrite these more clearly in descending order
|
||||||
if b.IsKubernetesGTE("1.3") && b.IsKubernetesLT("1.4") {
|
if b.IsKubernetesGTE("1.3") && b.IsKubernetesLT("1.4") {
|
||||||
c.AdmissionControl = []string{
|
c.AdmissionControl = []string{
|
||||||
"NamespaceLifecycle",
|
"NamespaceLifecycle",
|
||||||
|
|
@ -149,9 +150,8 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
|
||||||
"DefaultStorageClass",
|
"DefaultStorageClass",
|
||||||
"ResourceQuota",
|
"ResourceQuota",
|
||||||
}
|
}
|
||||||
c.AnonymousAuth = fi.Bool(false)
|
|
||||||
}
|
}
|
||||||
if b.IsKubernetesGTE("1.6") {
|
if b.IsKubernetesGTE("1.6") && b.IsKubernetesLT("1.7") {
|
||||||
c.AdmissionControl = []string{
|
c.AdmissionControl = []string{
|
||||||
"NamespaceLifecycle",
|
"NamespaceLifecycle",
|
||||||
"LimitRanger",
|
"LimitRanger",
|
||||||
|
|
@ -161,6 +161,37 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
|
||||||
"DefaultTolerationSeconds",
|
"DefaultTolerationSeconds",
|
||||||
"ResourceQuota",
|
"ResourceQuota",
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if b.IsKubernetesGTE("1.7") && b.IsKubernetesLT("1.8") {
|
||||||
|
c.AdmissionControl = []string{
|
||||||
|
"Initializers",
|
||||||
|
"NamespaceLifecycle",
|
||||||
|
"LimitRanger",
|
||||||
|
"ServiceAccount",
|
||||||
|
"PersistentVolumeLabel",
|
||||||
|
"DefaultStorageClass",
|
||||||
|
"DefaultTolerationSeconds",
|
||||||
|
"NodeRestriction",
|
||||||
|
"ResourceQuota",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if b.IsKubernetesGTE("1.8") {
|
||||||
|
c.AdmissionControl = []string{
|
||||||
|
"Initializers",
|
||||||
|
"NamespaceLifecycle",
|
||||||
|
"LimitRanger",
|
||||||
|
"ServiceAccount",
|
||||||
|
"PersistentVolumeLabel",
|
||||||
|
"DefaultStorageClass",
|
||||||
|
"DefaultTolerationSeconds",
|
||||||
|
"NodeRestriction",
|
||||||
|
"Priority",
|
||||||
|
"ResourceQuota",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We make sure to disable AnonymousAuth from when it was introduced
|
||||||
|
if b.IsKubernetesGTE("1.5") {
|
||||||
c.AnonymousAuth = fi.Bool(false)
|
c.AnonymousAuth = fi.Bool(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue