mirror of https://github.com/kubernetes/kops.git
Use legacy image registry gcr.io/google_containers for <= 1.9
The k8s.gcr.io prefix is an alias, but for CI builds we run from a docker load, and we only double-tag from 1.10 onwards. For versions prior to 1.10, remap k8s.gcr.io to the old name. This also means that we won't start using the aliased names on existing clusters, which could otherwise be surprising to users.
This commit is contained in:
parent
468946b1a6
commit
e4fafa6065
|
@ -81,6 +81,7 @@ k8s.io/kops/pkg/formatter
|
|||
k8s.io/kops/pkg/instancegroups
|
||||
k8s.io/kops/pkg/jsonutils
|
||||
k8s.io/kops/pkg/k8scodecs
|
||||
k8s.io/kops/pkg/k8sversion
|
||||
k8s.io/kops/pkg/kopscodecs
|
||||
k8s.io/kops/pkg/kubeconfig
|
||||
k8s.io/kops/pkg/kubemanifest
|
||||
|
|
|
@ -7,11 +7,13 @@ go_library(
|
|||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/apis/kops:go_default_library",
|
||||
"//pkg/apis/kops/util:go_default_library",
|
||||
"//pkg/featureflag:go_default_library",
|
||||
"//pkg/kubemanifest:go_default_library",
|
||||
"//pkg/values:go_default_library",
|
||||
"//util/pkg/hashing:go_default_library",
|
||||
"//util/pkg/vfs:go_default_library",
|
||||
"//vendor/github.com/blang/semver:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -24,9 +24,11 @@ import (
|
|||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/blang/semver"
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/kops/pkg/apis/kops"
|
||||
"k8s.io/kops/pkg/apis/kops/util"
|
||||
"k8s.io/kops/pkg/featureflag"
|
||||
"k8s.io/kops/pkg/kubemanifest"
|
||||
"k8s.io/kops/pkg/values"
|
||||
|
@ -45,6 +47,9 @@ type AssetBuilder struct {
|
|||
AssetsLocation *kops.Assets
|
||||
// TODO we'd like to use cloudup.Phase here, but that introduces a go cyclic dependency
|
||||
Phase string
|
||||
|
||||
// KubernetesVersion is the version of kubernetes we are installing
|
||||
KubernetesVersion semver.Version
|
||||
}
|
||||
|
||||
// ContainerAsset models a container's location.
|
||||
|
@ -67,11 +72,20 @@ type FileAsset struct {
|
|||
}
|
||||
|
||||
// NewAssetBuilder creates a new AssetBuilder.
|
||||
func NewAssetBuilder(assets *kops.Assets, phase string) *AssetBuilder {
|
||||
return &AssetBuilder{
|
||||
AssetsLocation: assets,
|
||||
func NewAssetBuilder(cluster *kops.Cluster, phase string) *AssetBuilder {
|
||||
a := &AssetBuilder{
|
||||
AssetsLocation: cluster.Spec.Assets,
|
||||
Phase: phase,
|
||||
}
|
||||
|
||||
version, err := util.ParseKubernetesVersion(cluster.Spec.KubernetesVersion)
|
||||
if err != nil {
|
||||
// This should have already been validated
|
||||
glog.Fatalf("unexpected error from ParseKubernetesVersion %s: %v", cluster.Spec.KubernetesVersion, err)
|
||||
}
|
||||
a.KubernetesVersion = *version
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// RemapManifest transforms a kubernetes manifest.
|
||||
|
@ -112,6 +126,15 @@ func (a *AssetBuilder) RemapImage(image string) (string, error) {
|
|||
|
||||
asset.DockerImage = image
|
||||
|
||||
// The k8s.gcr.io prefix is an alias, but for CI builds we run from a docker load,
|
||||
// and we only double-tag from 1.10 onwards.
|
||||
// For versions prior to 1.10, remap k8s.gcr.io to the old name.
|
||||
// This also means that we won't start using the aliased names on existing clusters,
|
||||
// which could otherwise be surprising to users.
|
||||
if !util.IsKubernetesGTE("1.10", a.KubernetesVersion) && strings.HasPrefix(image, "k8s.gcr.io/") {
|
||||
image = "gcr.io/google_containers/" + strings.TrimPrefix(image, "k8s.gcr.io/")
|
||||
}
|
||||
|
||||
if strings.HasPrefix(image, "kope/dns-controller:") {
|
||||
// To use user-defined DNS Controller:
|
||||
// 1. DOCKER_REGISTRY=[your docker hub repo] make dns-controller-push
|
||||
|
|
|
@ -159,10 +159,10 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
encryptionConfig: null
|
||||
etcdClusters:
|
||||
events:
|
||||
image: k8s.gcr.io/etcd:2.2.1
|
||||
image: gcr.io/google_containers/etcd:2.2.1
|
||||
version: 2.2.1
|
||||
main:
|
||||
image: k8s.gcr.io/etcd:2.2.1
|
||||
image: gcr.io/google_containers/etcd:2.2.1
|
||||
version: 2.2.1
|
||||
kubeAPIServer:
|
||||
address: 127.0.0.1
|
||||
|
@ -181,7 +181,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
- http://127.0.0.1:4001
|
||||
etcdServersOverrides:
|
||||
- /events#http://127.0.0.1:4002
|
||||
image: k8s.gcr.io/kube-apiserver:v1.4.12
|
||||
image: gcr.io/google_containers/kube-apiserver:v1.4.12
|
||||
insecurePort: 8080
|
||||
logLevel: 2
|
||||
securePort: 443
|
||||
|
@ -194,7 +194,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
clusterCIDR: 100.96.0.0/11
|
||||
clusterName: additionaluserdata.example.com
|
||||
configureCloudRoutes: true
|
||||
image: k8s.gcr.io/kube-controller-manager:v1.4.12
|
||||
image: gcr.io/google_containers/kube-controller-manager:v1.4.12
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
logLevel: 2
|
||||
|
@ -204,10 +204,10 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
cpuRequest: 100m
|
||||
featureGates: null
|
||||
hostnameOverride: '@aws'
|
||||
image: k8s.gcr.io/kube-proxy:v1.4.12
|
||||
image: gcr.io/google_containers/kube-proxy:v1.4.12
|
||||
logLevel: 2
|
||||
kubeScheduler:
|
||||
image: k8s.gcr.io/kube-scheduler:v1.4.12
|
||||
image: gcr.io/google_containers/kube-scheduler:v1.4.12
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
logLevel: 2
|
||||
|
@ -227,7 +227,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
networkPluginMTU: 9001
|
||||
networkPluginName: kubenet
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
podInfraContainerImage: k8s.gcr.io/pause-amd64:3.0
|
||||
podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
|
||||
podManifestPath: /etc/kubernetes/manifests
|
||||
reconcileCIDR: true
|
||||
masterKubelet:
|
||||
|
@ -246,7 +246,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda
|
|||
networkPluginName: kubenet
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
podCIDR: 10.123.45.0/28
|
||||
podInfraContainerImage: k8s.gcr.io/pause-amd64:3.0
|
||||
podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
|
||||
podManifestPath: /etc/kubernetes/manifests
|
||||
reconcileCIDR: true
|
||||
registerSchedulable: false
|
||||
|
@ -459,7 +459,7 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionaluserdataexamplecom.Pro
|
|||
cpuRequest: 100m
|
||||
featureGates: null
|
||||
hostnameOverride: '@aws'
|
||||
image: k8s.gcr.io/kube-proxy:v1.4.12
|
||||
image: gcr.io/google_containers/kube-proxy:v1.4.12
|
||||
logLevel: 2
|
||||
kubelet:
|
||||
allowPrivileged: true
|
||||
|
@ -476,7 +476,7 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionaluserdataexamplecom.Pro
|
|||
networkPluginMTU: 9001
|
||||
networkPluginName: kubenet
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
podInfraContainerImage: k8s.gcr.io/pause-amd64:3.0
|
||||
podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
|
||||
podManifestPath: /etc/kubernetes/manifests
|
||||
reconcileCIDR: true
|
||||
|
||||
|
|
|
@ -150,10 +150,10 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
encryptionConfig: null
|
||||
etcdClusters:
|
||||
events:
|
||||
image: k8s.gcr.io/etcd:2.2.1
|
||||
image: gcr.io/google_containers/etcd:2.2.1
|
||||
version: 2.2.1
|
||||
main:
|
||||
image: k8s.gcr.io/etcd:2.2.1
|
||||
image: gcr.io/google_containers/etcd:2.2.1
|
||||
version: 2.2.1
|
||||
kubeAPIServer:
|
||||
address: 127.0.0.1
|
||||
|
@ -172,7 +172,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
- http://127.0.0.1:4001
|
||||
etcdServersOverrides:
|
||||
- /events#http://127.0.0.1:4002
|
||||
image: k8s.gcr.io/kube-apiserver:v1.4.12
|
||||
image: gcr.io/google_containers/kube-apiserver:v1.4.12
|
||||
insecurePort: 8080
|
||||
logLevel: 2
|
||||
securePort: 443
|
||||
|
@ -185,7 +185,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
clusterCIDR: 100.96.0.0/11
|
||||
clusterName: minimal.example.com
|
||||
configureCloudRoutes: true
|
||||
image: k8s.gcr.io/kube-controller-manager:v1.4.12
|
||||
image: gcr.io/google_containers/kube-controller-manager:v1.4.12
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
logLevel: 2
|
||||
|
@ -195,10 +195,10 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
cpuRequest: 100m
|
||||
featureGates: null
|
||||
hostnameOverride: '@aws'
|
||||
image: k8s.gcr.io/kube-proxy:v1.4.12
|
||||
image: gcr.io/google_containers/kube-proxy:v1.4.12
|
||||
logLevel: 2
|
||||
kubeScheduler:
|
||||
image: k8s.gcr.io/kube-scheduler:v1.4.12
|
||||
image: gcr.io/google_containers/kube-scheduler:v1.4.12
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
logLevel: 2
|
||||
|
@ -218,7 +218,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
networkPluginMTU: 9001
|
||||
networkPluginName: kubenet
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
podInfraContainerImage: k8s.gcr.io/pause-amd64:3.0
|
||||
podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
|
||||
podManifestPath: /etc/kubernetes/manifests
|
||||
reconcileCIDR: true
|
||||
masterKubelet:
|
||||
|
@ -237,7 +237,7 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco
|
|||
networkPluginName: kubenet
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
podCIDR: 10.123.45.0/28
|
||||
podInfraContainerImage: k8s.gcr.io/pause-amd64:3.0
|
||||
podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
|
||||
podManifestPath: /etc/kubernetes/manifests
|
||||
reconcileCIDR: true
|
||||
registerSchedulable: false
|
||||
|
@ -429,7 +429,7 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use
|
|||
cpuRequest: 100m
|
||||
featureGates: null
|
||||
hostnameOverride: '@aws'
|
||||
image: k8s.gcr.io/kube-proxy:v1.4.12
|
||||
image: gcr.io/google_containers/kube-proxy:v1.4.12
|
||||
logLevel: 2
|
||||
kubelet:
|
||||
allowPrivileged: true
|
||||
|
@ -446,7 +446,7 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use
|
|||
networkPluginMTU: 9001
|
||||
networkPluginName: kubenet
|
||||
nonMasqueradeCIDR: 100.64.0.0/10
|
||||
podInfraContainerImage: k8s.gcr.io/pause-amd64:3.0
|
||||
podInfraContainerImage: gcr.io/google_containers/pause-amd64:3.0
|
||||
podManifestPath: /etc/kubernetes/manifests
|
||||
reconcileCIDR: true
|
||||
|
||||
|
|
Loading…
Reference in New Issue