cloudfoundry / cf-for-k8s

The open source deployment manifest for Cloud Foundry on Kubernetes
Apache License 2.0
300 stars 115 forks source link

Kubernetes >= 1.16.x #22

Closed jseely closed 4 years ago

jseely commented 4 years ago

Error Message:

kapp: Error: Expected to find kind 'extensions/v1beta1/DaemonSet', but did not 

Related to deprecation of extensions/v1beta1/DaemonSet: https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/

cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/171223940

The labels on this github issue will be updated when the story is started.

kramerul commented 4 years ago

We have the same problem. The title should be "kubernetes >= 1.16.x". After changing config/_ytt_lib/github.com/cloudfoundry/cf-k8s-logging/config/manifests/500-fluentd-daemonset.yaml accordingly we ran into #23

julian-hj commented 4 years ago

FWIW, this markup for the fluentd DaemonSet appears to work on newer k8s versions...it just needs a selector added in addition to changing the apiVersion

---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: cf-system
  labels:
    app: fluentd
    version: v1
  annotations:
    kapp.k14s.io/change-rule.istio-sidecar-injector: upsert after upserting cf-for-k8s.cloudfoundry.org/istio-sidecar-injector
spec:
  selector:
    matchLabels:
      app: fluentd
      version: v1
  template:
    metadata:
      labels:
        app: fluentd
        version: v1
    spec:
      serviceAccountName: fluentd-service-account
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      imagePullSecrets:
      - name: image-registry-credentials
      containers:
      - name: fluentd
        image: logcache/cf-k8s-logging
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - name: fluentd-config
          mountPath: /fluentd/etc
        - name: varlog
          mountPath: /var/log
        - name: varvcapstore
          mountPath: /var/vcap/store
        - name: dockercontainers
          mountPath: /var/lib/docker/containers
        - mountPath: /ca
          name: ca
          readOnly: true
      terminationGracePeriodSeconds: 30
      volumes:
      - name: fluentd-config
        configMap:
          name: fluentd-config
      - name: varlog
        hostPath:
          path: /var/log
      - name: varvcapstore
        hostPath:
          path: /var/vcap/store
      - name: dockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: ca
        secret:
          secretName: log-cache-ca
nthomson-pivotal commented 4 years ago

I've used this ytt config file to apply the changes outlined in the above comment, resulted in a working install on 1.17:

#@ load("@ytt:overlay", "overlay")

#! remove resource requirements to allow installation on smaller environments
#@ for/end kind in ["DaemonSet"]:
#@overlay/match by=overlay.subset({"metadata":{"name":"fluentd"}}),expects="1+"
---
#@overlay/match missing_ok=True
apiVersion: apps/v1
spec:
  #@overlay/match missing_ok=True
  selector:
    matchLabels:
      app: fluentd
      version: v1
julian-hj commented 4 years ago

Just in case you missed it, Google is planning to start updating GKE clusters to 1.16 in the next few weeks, so this issue might start to manifest in CI for any team that didn't create their cluster on the stable channel

GKE will gradually upgrade clusters to Kubernetes v1.16:

  • clusters subscribed to the regular release channel will begin upgrades on or after April 9, 2020
  • clusters subscribed to the stable release channel and non-release-channel clusters will be upgraded later this year; a reminder will be sent before these clusters are upgraded to v1.16
Syerram commented 4 years ago

cf-for-k8s is now compatible with K8s version 1.16.X