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

feat(platform): update k8s 1.19.7 support #1070

Merged
merged 5 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
feat(platform): update support k8s to 1.19.7
  • Loading branch information
leonarliu committed Jan 21, 2021
commit a8c1ac48fb022befef30a249d5b08249d2ba5e22
2 changes: 1 addition & 1 deletion build/docker/tools/provider-res/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations under the License.

IMAGE = provider-res
VERSION = v1.18.3-3
VERSION = v1.19.7-1
REGISTRY_PREFIX ?= tkestack

COMMON_SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
Expand Down
2 changes: 1 addition & 1 deletion build/docker/tools/tke-installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -o pipefail
REGISTRY_PREFIX=${REGISTRY_PREFIX:-tkestack}
BUILDER=${BUILDER:-default}
VERSION=${VERSION:-$(git describe --dirty --always --tags | sed 's/-/./g')}
PROVIDER_RES_VERSION=v1.18.3-3
PROVIDER_RES_VERSION=v1.19.7-1
K8S_VERSION=${PROVIDER_RES_VERSION%-*}
DOCKER_VERSION=19.03.14
OSS=(linux)
Expand Down
2 changes: 1 addition & 1 deletion cmd/setup-env/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func main() {
env := os.Environ()
env = append(env, fmt.Sprintf("ARCHS=%s", strings.Join(spec.Archs, " ")))
env = append(env, fmt.Sprintf("OSS=%s", strings.Join(spec.OSs, " ")))
env = append(env, fmt.Sprintf("K8S_VERSIONS=%s", strings.Join(spec.K8sValidVersionsWithV, " ")))
env = append(env, fmt.Sprintf("K8S_VERSIONS=%s", strings.Join(spec.K8sVersionsWithV, " ")))
env = append(env, fmt.Sprintf("DOCKER_VERSIONS=%s", strings.Join(spec.DockerVersions, " ")))
env = append(env, fmt.Sprintf("CNI_PLUGINS_VERSIONS=%s", strings.Join(spec.CNIPluginsVersions, " ")))
env = append(env, fmt.Sprintf("NVIDIA_DRIVER_VERSIONS=%s", strings.Join(spec.NvidiaDriverVersions, " ")))
Expand Down
2 changes: 1 addition & 1 deletion cmd/tke-installer/app/installer/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var components = Components{
Busybox: containerregistry.Image{Name: "busybox", Tag: "1.31.1"},
InfluxDB: containerregistry.Image{Name: "influxdb", Tag: "1.7.9"},

ProviderRes: containerregistry.Image{Name: "provider-res", Tag: "v1.18.3-3"},
ProviderRes: containerregistry.Image{Name: "provider-res", Tag: "v1.19.7-1"},

TKEAuthAPI: containerregistry.Image{Name: "tke-auth-api", Tag: Version},
TKEAuthController: containerregistry.Image{Name: "tke-auth-controller", Tag: Version},
Expand Down
2 changes: 1 addition & 1 deletion cmd/tke-installer/app/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@ func (t *TKE) patchPlatformVersion(ctx context.Context) error {
return nil
}

versionsByte, err := json.Marshal(spec.K8sValidVersions)
versionsByte, err := json.Marshal(spec.K8sVersions)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tke-installer/app/installer/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (t *TKE) getLatestProviderResTag(ctx context.Context) (tag string, err erro
if err != nil {
return "", err
}
if len(k8sValidVersions) > len(spec.K8sValidVersions) {
if len(k8sValidVersions) > len(spec.K8sVersions) {
return k8sValidVersions[len(k8sValidVersions)-1], nil
}
return images.Get().ProviderRes.Tag, nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/tke-installer/app/installer/upgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (t *TKE) updateTKEPlatformController(ctx context.Context) error {
case result < 0:
return errors.Errorf("can't upgrade, platform's version %s is higher than installer's version %s", tkeVersion, spec.TKEVersion)
case result == 0:
if len(k8sValidVersions) == len(spec.K8sValidVersions) {
if len(k8sValidVersions) == len(spec.K8sVersions) {
return errors.Errorf("can't upgrade, platform's version %s is equal to installer's version %s, please prepare your custom upgrade images before upgrade", tkeVersion, spec.TKEVersion)
}
depl.Spec.Template.Spec.InitContainers[0].Image = containerregistry.GetImagePrefix(images.Get().ProviderRes.Name + ":" + k8sValidVersions[len(k8sValidVersions)-1])
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/provider/baremetal/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var kubecomponetNames = []string{"kube-apiserver", "kube-controller-manager", "k
var components = Components{
ETCD: containerregistry.Image{Name: "etcd", Tag: "v3.4.7"},
CoreDNS: containerregistry.Image{Name: "coredns", Tag: "1.6.7"},
Pause: containerregistry.Image{Name: "pause", Tag: "3.1"},
Pause: containerregistry.Image{Name: "pause", Tag: "3.2"},
NvidiaDevicePlugin: containerregistry.Image{Name: "nvidia-device-plugin", Tag: "1.0.0-beta4"},
Keepalived: containerregistry.Image{Name: "keepalived", Tag: "2.0.16-r0"},

Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/provider/baremetal/res/res.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (
}
KubernetesNode = Package{
Name: "kubernetes-node",
Versions: spec.K8sValidVersionsWithV,
Versions: spec.K8sVersionsWithV,
}
NvidiaDriver = Package{
Name: "NVIDIA",
Expand Down
7 changes: 1 addition & 6 deletions pkg/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ var (
OSs = []string{"linux"}

K8sVersionConstraint = ">= 1.10"
K8sVersions = []string{"1.18.3", "1.17.13", "1.16.9"}
K8sVersions = []string{"1.19.7", "1.18.3", "1.17.13"}
K8sVersionsWithV = funk.Map(K8sVersions, func(s string) string {
return "v" + s
}).([]string)
// K8sValidVersions for backward compatibility.
K8sValidVersions = append(K8sVersions, []string{"1.16.6", "1.14.10"}...)
K8sValidVersionsWithV = funk.Map(K8sValidVersions, func(s string) string {
return "v" + s
}).([]string)

DockerVersions = []string{"19.03.14"}
CNIPluginsVersions = []string{"v0.8.6"}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/apiclient/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestPullImageWithPod(t *testing.T) {
Containers: []corev1.Container{
{
Name: "test",
Image: "tkestack/pause:3.1",
Image: "tkestack/pause:3.2",
},
},
},
Expand Down