Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
(6.2) Kubernetes 1.16.0. (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0mant committed Sep 24, 2019
1 parent e6cdde3 commit 59f5595
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -19,7 +19,7 @@ ASSETSDIR=$(TOP)/assets
BINDIR ?= /usr/bin

# Current Kubernetes version
K8S_VER := 1.15.4
K8S_VER := 1.16.0
# Kubernetes version suffix for the planet package, constructed by concatenating
# major + minor padded to 2 chars with 0 + patch also padded to 2 chars, e.g.
# 1.13.5 -> 11305, 1.13.12 -> 11312, 2.0.0 -> 20000 and so on
Expand All @@ -42,7 +42,7 @@ RELEASE_OUT ?=
TELEPORT_TAG = 3.2.7
# TELEPORT_REPOTAG adapts TELEPORT_TAG to the teleport tagging scheme
TELEPORT_REPOTAG := v$(TELEPORT_TAG)
PLANET_TAG := 6.1.5-$(K8S_VER_SUFFIX)
PLANET_TAG := 6.2.0-$(K8S_VER_SUFFIX)
PLANET_BRANCH := $(PLANET_TAG)
K8S_APP_TAG := $(GRAVITY_TAG)
TELEKUBE_APP_TAG := $(GRAVITY_TAG)
Expand Down
4 changes: 2 additions & 2 deletions assets/dns-app/resources/dns.yaml
Expand Up @@ -75,7 +75,7 @@ subjects:
name: coredns
namespace: kube-system
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: coredns
Expand Down Expand Up @@ -158,7 +158,7 @@ spec:
- key: Corefile
path: Corefile
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: coredns-worker
Expand Down
4 changes: 2 additions & 2 deletions assets/rbac-app/resources/resources.yaml
Expand Up @@ -104,7 +104,7 @@ subjects:
- kind: Group
name: restricted-psp-users
---
apiVersion: extensions/v1beta1
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: restricted
Expand All @@ -131,7 +131,7 @@ spec:
volumes:
- '*'
---
apiVersion: extensions/v1beta1
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: privileged
Expand Down
2 changes: 1 addition & 1 deletion assets/site-app/resources/site.yaml
Expand Up @@ -89,7 +89,7 @@ subjects:
name: gravity-site
namespace: kube-system
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
Expand Down
7 changes: 5 additions & 2 deletions assets/tiller-app/resources/resources.yaml
Expand Up @@ -17,7 +17,7 @@ subjects:
name: tiller
namespace: kube-system
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: tiller-deploy
Expand All @@ -27,6 +27,10 @@ metadata:
name: tiller
spec:
replicas: 1
selector:
matchLabels:
app: helm
name: tiller
template:
metadata:
labels:
Expand Down Expand Up @@ -75,4 +79,3 @@ spec:
port: 44135
initialDelaySeconds: 1
timeoutSeconds: 1

3 changes: 2 additions & 1 deletion build.assets/robotest_run_nightly.sh
Expand Up @@ -7,7 +7,8 @@ DOCKER_STORAGE_DRIVERS="overlay2"

declare -A UPGRADE_MAP
# gravity version -> list of OS releases to test upgrades on
UPGRADE_MAP[5.5.0]="centos:7 ubuntu:16"
UPGRADE_MAP[6.0.9]="centos:7 ubuntu:16"
UPGRADE_MAP[6.1.5]="centos:7 ubuntu:16"

readonly GET_GRAVITATIONAL_IO_APIKEY=${GET_GRAVITATIONAL_IO_APIKEY:?API key for distribution Ops Center required}
readonly GRAVITY_BUILDDIR=${GRAVITY_BUILDDIR:?Set GRAVITY_BUILDDIR to the build directory}
Expand Down
3 changes: 2 additions & 1 deletion build.assets/robotest_run_suite.sh
Expand Up @@ -5,7 +5,8 @@ readonly UPGRADE_FROM_DIR=${1:-$(pwd)/../upgrade_from}

declare -A UPGRADE_MAP
# gravity version -> list of OS releases to exercise on
UPGRADE_MAP[5.5.0]="ubuntu:16"
UPGRADE_MAP[6.0.9]="ubuntu:16"
UPGRADE_MAP[6.1.5]="ubuntu:16"

readonly GET_GRAVITATIONAL_IO_APIKEY=${GET_GRAVITATIONAL_IO_APIKEY:?API key for distribution Ops Center required}
readonly GRAVITY_BUILDDIR=${GRAVITY_BUILDDIR:?Set GRAVITY_BUILDDIR to the build directory}
Expand Down
1 change: 1 addition & 0 deletions lib/app/resources/resourcefiles.go
Expand Up @@ -422,6 +422,7 @@ func isKnownNonPodObject(object runtime.Object) bool {
*corev1.PersistentVolume,
*corev1.PersistentVolumeClaim,
*policyv1beta1.PodDisruptionBudget,
*policyv1beta1.PodSecurityPolicy,
*settingsv1alpha1.PodPreset,
*extensions.PodSecurityPolicy,
*corev1.ResourceQuota,
Expand Down
4 changes: 3 additions & 1 deletion lib/app/resources/utils.go
Expand Up @@ -16,7 +16,7 @@ import (
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv2alpha1 "k8s.io/api/batch/v2alpha1"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
)

Expand Down Expand Up @@ -117,6 +117,8 @@ func renderResourceTemplate(path string, serviceUser systeminfo.User) error {
spec = &resource.Spec.Template.Spec
case *appsv1beta2.Deployment:
spec = &resource.Spec.Template.Spec
case *appsv1.Deployment:
spec = &resource.Spec.Template.Spec
case *extensions.DaemonSet:
spec = &resource.Spec.Template.Spec
case *appsv1.DaemonSet:
Expand Down
8 changes: 4 additions & 4 deletions lib/fsm/kubernetes.go
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/gravitational/rigging"
"github.com/gravitational/trace"
log "github.com/sirupsen/logrus"
"k8s.io/api/extensions/v1beta1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -90,16 +90,16 @@ func GetUpsertBootstrapResourceFunc(client *kubernetes.Clientset) resources.Reso
return trace.Wrap(rigging.ConvertError(err))
}
log.Debugf("Updated RoleBinding %q.", resource.Name)
case *v1beta1.PodSecurityPolicy:
_, err = client.Extensions().PodSecurityPolicies().Create(resource)
case *policyv1beta1.PodSecurityPolicy:
_, err = client.Policy().PodSecurityPolicies().Create(resource)
if err == nil {
log.Debugf("Created PodSecurityPolicy %q.", resource.Name)
return nil
}
if !trace.IsAlreadyExists(rigging.ConvertError(err)) {
return trace.Wrap(rigging.ConvertError(err))
}
_, err = client.Extensions().PodSecurityPolicies().Update(resource)
_, err = client.Policy().PodSecurityPolicies().Update(resource)
if err != nil {
return trace.Wrap(rigging.ConvertError(err))
}
Expand Down

0 comments on commit 59f5595

Please sign in to comment.