Merge pull request #21434 from erictune/job-ga
Auto commit by PR queue bot
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/api/install"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/batch/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/componentconfig/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/metrics/install"
|
||||
|
@@ -29,6 +29,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/api/install"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/batch/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/componentconfig/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/metrics/install"
|
||||
|
@@ -38,6 +38,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
"k8s.io/kubernetes/pkg/apis/batch"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/apiserver"
|
||||
"k8s.io/kubernetes/pkg/apiserver/authenticator"
|
||||
@@ -305,6 +306,11 @@ func Run(s *options.APIServer) error {
|
||||
// sure autoscaling has a storage destination. If the autoscaling group
|
||||
// itself is on, it will overwrite this decision below.
|
||||
storageDestinations.AddAPIGroup(autoscaling.GroupName, expEtcdStorage)
|
||||
|
||||
// Since Job has been moved to the batch group, we need to make
|
||||
// sure batch has a storage destination. If the batch group
|
||||
// itself is on, it will overwrite this decision below.
|
||||
storageDestinations.AddAPIGroup(batch.GroupName, expEtcdStorage)
|
||||
}
|
||||
|
||||
// autoscaling/v1/horizontalpodautoscalers is a move from extensions/v1beta1/horizontalpodautoscalers.
|
||||
@@ -333,6 +339,33 @@ func Run(s *options.APIServer) error {
|
||||
storageDestinations.AddAPIGroup(autoscaling.GroupName, autoscalingEtcdStorage)
|
||||
}
|
||||
|
||||
// batch/v1/job is a move from extensions/v1beta1/job. The storage
|
||||
// version needs to be either extensions/v1beta1 or batch/v1. Users
|
||||
// must roll forward while using 1.2, because we will require the
|
||||
// latter for 1.3.
|
||||
if !apiGroupVersionOverrides["batch/v1"].Disable {
|
||||
glog.Infof("Configuring batch/v1 storage destination")
|
||||
batchGroup, err := registered.Group(batch.GroupName)
|
||||
if err != nil {
|
||||
glog.Fatalf("Batch API is enabled in runtime config, but not enabled in the environment variable KUBE_API_VERSIONS. Error: %v", err)
|
||||
}
|
||||
// Figure out what storage group/version we should use.
|
||||
storageGroupVersion, found := storageVersions[batchGroup.GroupVersion.Group]
|
||||
if !found {
|
||||
glog.Fatalf("Couldn't find the storage version for group: %q in storageVersions: %v", batchGroup.GroupVersion.Group, storageVersions)
|
||||
}
|
||||
|
||||
if storageGroupVersion != "batch/v1" && storageGroupVersion != "extensions/v1beta1" {
|
||||
glog.Fatalf("The storage version for batch must be either 'batch/v1' or 'extensions/v1beta1'")
|
||||
}
|
||||
glog.Infof("Using %v for batch group storage version", storageGroupVersion)
|
||||
batchEtcdStorage, err := newEtcd(s.EtcdServerList, api.Codecs, storageGroupVersion, "extensions/__internal", s.EtcdPathPrefix, s.EtcdQuorumRead)
|
||||
if err != nil {
|
||||
glog.Fatalf("Invalid extensions storage version or misconfigured etcd: %v", err)
|
||||
}
|
||||
storageDestinations.AddAPIGroup(batch.GroupName, batchEtcdStorage)
|
||||
}
|
||||
|
||||
updateEtcdOverrides(s.EtcdServersOverrides, storageVersions, s.EtcdPathPrefix, s.EtcdQuorumRead, &storageDestinations, newEtcd)
|
||||
|
||||
n := s.ServiceClusterIPRange
|
||||
@@ -520,6 +553,14 @@ func parseRuntimeConfig(s *options.APIServer) (map[string]genericapiserver.APIGr
|
||||
Disable: true,
|
||||
}
|
||||
}
|
||||
disableBatch := disableAllAPIs
|
||||
batchGroupVersion := "batch/v1"
|
||||
disableBatch = !getRuntimeConfigValue(s, batchGroupVersion, !disableBatch)
|
||||
if disableBatch {
|
||||
apiGroupVersionOverrides[batchGroupVersion] = genericapiserver.APIGroupVersionOverride{
|
||||
Disable: true,
|
||||
}
|
||||
}
|
||||
|
||||
for key := range s.RuntimeConfig {
|
||||
if strings.HasPrefix(key, v1GroupVersion+"/") {
|
||||
|
Reference in New Issue
Block a user