1. 23 Feb, 2018 14 commits
    • Kubernetes Submit Queue's avatar
      Merge pull request #59898 from Random-Liu/add-log-rotation · b38f1b90
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue (batch tested with PRs 60214, 58762, 59898, 59897, 60204). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      Add CRI container log rotation support
      
      Fixes https://github.com/kubernetes/kubernetes/issues/58823.
      
      This PR:
      1) Added `pkg/kubelet/logs/container_log_manager.go` which manages and rotates container logs.
      2) Added a feature gate `CRIContainerLogRotation` to enable the alpha feature. And 2 kubelet flags `--container-log-max-size` and `--container-log-max-files` to configure the rotation behavior.
      3) Added unit test and node e2e test for container log rotation.
      
      Note that:
      1) Container log manager only starts when the container runtime is `remote` (not docker), because we can't implement `ReopenContainerLog` for docker.
      2) Rotated logs are compressed with `gzip`.
      2) The latest rotated log is not compressed. Because fluentd may still be reading the file right after rotation.
      3) `kubectl logs` still doesn't support log rotation. This is not a regression anyway, it doesn't support log rotation for docker log today. We'll probably fix this in the future. (Issue: https://github.com/kubernetes/kubernetes/issues/59902)
      
      An example of container log directory with `--container-log-max-files=3`:
      ```console
      $ ls -al /var/log/pods/57146449-11ec-11e8-90e1-42010af00002
      total 592
      drwxr-xr-x 2 root root   4096 Feb 15 01:07 .
      drwxr-xr-x 3 root root  12288 Feb 15 01:06 ..
      -rw-r----- 1 root root 176870 Feb 15 01:07 log-container_0.log
      -rw-r--r-- 1 root root  40239 Feb 15 01:07 log-container_0.log.20180215-010737.gz
      -rw-r----- 1 root root 365996 Feb 15 01:07 log-container_0.log.20180215-010747
      ```
      
      /assign @mtaufen for the config change.
      /assign @dashpole @crassirostris for the log change.
      /assign @feiskyer for CRI related change.
      /cc @yujuhong @feiskyer @abhi @mikebrow @mrunalp @runcom 
      /cc @kubernetes/sig-node-pr-reviews @kubernetes/sig-instrumentation-pr-reviews 
      
      **Release note**:
      
      ```release-note
      [Alpha] Kubelet now supports container log rotation for container runtime which implements CRI(container runtime interface).
      The feature can be enabled with feature gate `CRIContainerLogRotation`.
      The flags `--container-log-max-size` and `--container-log-max-files` can be used to configure the rotation behavior.
      ```
      b38f1b90
    • Kubernetes Submit Queue's avatar
      Merge pull request #58762 from musse/make-volume-attr-first-class · a9dc6231
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue (batch tested with PRs 60214, 58762, 59898, 59897, 60204). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      Make CSI volume attributes first class
      
      **What this PR does / why we need it**:
      Move CSI volume attributes from PV annotation to CSI volume source first class field
      
      **Release note**:
      ```release-note
      NONE
      ```
      a9dc6231
    • Kubernetes Submit Queue's avatar
      Merge pull request #60214 from sttts/sttts-mac-nsenter · fa5c815c
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      Fix compilation of nsenter code on Mac
      fa5c815c
    • Kubernetes Submit Queue's avatar
      Merge pull request #59793 from nikhita/staging-repos-boilerplate · 1a1643bb
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      staging: add boilerplate header
      
      Follow up of https://github.com/kubernetes/kubernetes/pull/57656.
      
      Adds boilerplate in the relevant staging repos so that they don't need to depend on code-generator's boilerplate.
      
      **Release note**:
      
      ```release-note
      NONE
      ```
      
      /cc sttts fisherxu
      1a1643bb
    • Kubernetes Submit Queue's avatar
      Merge pull request #57962 from xiangpengzhao/proxy-feature-gates · da564ef4
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
       Migrate FeatureGates type of kube-proxy from string to map[string]bool
      
      **What this PR does / why we need it**:
      Migration of FeatureGates type. This is a follow-up of #53025.
      
      **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
      ref: #53025
      https://github.com/kubernetes/kubernetes/pull/57754#discussion_r160023416
      
      **Special notes for your reviewer**:
      /cc @luxas @mtaufen @ncdc 
      
      **Release note**:
      
      ```release-note
      action required: kube-proxy: feature gates are now specified as a map when provided via a JSON or YAML KubeProxyConfiguration, rather than as a string of key-value pairs.
      ```
      da564ef4
    • Kubernetes Submit Queue's avatar
      Merge pull request #56164 from danwinship/proxier-chain-split · f0ca9962
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      Split KUBE-SERVICES chain to re-shrink the INPUT chain
      
      **What this PR does / why we need it**:
      #43972 added an iptables rule "`-A INPUT -j KUBE-SERVICES`" to make NodePort ICMP rejection work. (Previously the KUBE-SERVICES chain was only run from OUTPUT, not INPUT.) #44547 extended that patch for ExternalIP rejection as well.
      
      However, the KUBE-SERVICES chain may potentially have a very large number of ICMP reject rules for plain ClusterIP services (the ones that get run from OUTPUT), and it seems that for some reason the kernel is much more sensitive to the length of the INPUT chain than it is to the length of the OUTPUT chain. So a node that worked fine with kube 1.6 (when KUBE-SERVICES was only run from OUTPUT) might fall over with kube 1.7 (with KUBE-SERVICES being run from both INPUT and OUTPUT).
      
      (Specifically, a node with about 5000 ClusterIP reject rules that ran fine with OpenShift 3.6 [kube 1.6] slowed almost to a complete halt with OpenShift 3.7 [kube 1.7].)
      
      This PR fixes things by splitting out the "new" part of KUBE-SERVICES (NodePort and ExternalIP reject rules) into a separate KUBE-EXTERNAL-SERVICES chain run from INPUT, and moves KUBE-SERVICES back to being only run from OUTPUT. (So, yes, this assumes that you don't have 5000 NodePort/ExternalIP services, but, if you do, there's not much we can do, since those rules *have* to be run on the INPUT side.)
      
      Oh, and I left in the code to clean up the "`-A INPUT -j KUBE-SERVICES`" rule even though we don't generate it any more, so it gets fixed on upgrade.
      
      **Release note**:
      ```release-note
      Reorganized iptables rules to fix a performance regression on clusters with thousands of services.
      ```
      
      @kubernetes/sig-network-bugs @kubernetes/rh-networking
      f0ca9962
    • Kubernetes Submit Queue's avatar
      Merge pull request #58816 from croomes/storageos_containerized_kubelet · 9a75b4d7
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      StorageOS configurable device directory and mount options
      
      **What this PR does / why we need it**:
      This allows StorageOS volumes to be mounted when the kubelet is running in a container and we are unable to use the default device location (/var/lib/storageos/volumes).  With this PR, the node's device location is requested via the StorageOS api, falling back to the current behaviour if not configured.  The node's device location can be supplied as an environment variable (DEVICE_DIR) to the StorageOS container.  This is backwards-compatible and no changes are needed to existing deployments.
      
      The PR also allows Mount options to be set for StorageOS volumes in the same way they're enabled for other volume plugins.
      
      The StorageOS API dependency was updated to the latest version, but no functionality changes besides adding the DeviceDir property to the Controller object.
      
      There is also a small refactor of the loopback device handling code in storageos_utils.go to capture stderr output.
      
      **Release note**:
      ```release-note
      StorageOS volume plugin updated to support mount options and environments where the kubelet runs in a container and the device location should be specified.
      ```
      
      Not sure why godep changed the comments of unrelated packages in Godeps.json...
      
      /sig storage
      9a75b4d7
    • Lantao Liu's avatar
      Add node e2e test for log rotation. · faa581c5
      Lantao Liu authored
      faa581c5
    • Lantao Liu's avatar
      Generated code · 313e8717
      Lantao Liu authored
      313e8717
    • Lantao Liu's avatar
      Use container log manager in kubelet · d7b21a33
      Lantao Liu authored
      d7b21a33
    • Lantao Liu's avatar
      Add kubelet container log manager · ebb48654
      Lantao Liu authored
      ebb48654
    • Kubernetes Submit Queue's avatar
      Merge pull request #60149 from aveshagarwal/master-kubectl-priority-issue · 948f28a7
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      Fix kubectl describe output for priority class objects.
      
      **What this PR does / why we need it**:
      
      Fixes `kubectl describe priorityclass`  (try https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#example-priorityclass)  
      
      ```
      Name:           high-priority
      Value:          %!s(int32=1000000)
      GlobalDefault:  %!s(bool=false)
      Description:    This priority class should be used for XYZ service pods only.
      Annotations:    <none>
      Events:         <none>
      
      ```
      
      **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
      Fixes #
      
      **Special notes for your reviewer**:
      
      **Release note**:
      
      ```release-note
      None
      ```
      
      @bsalamat @kubernetes/sig-scheduling-bugs  @kubernetes/sig-cli-bugs 
      /king bug
      /sig scheduling
      /sig cli
      948f28a7
    • Kubernetes Submit Queue's avatar
      Merge pull request #60226 from php-coder/psp_examples_owners · 4ebaddb6
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      examples/podsecuritypolicy: add owners
      
      When we modify something PSP-related, we need to update examples as well but unfortunately they wasn't belong to us.
      4ebaddb6
    • Kubernetes Submit Queue's avatar
      Merge pull request #59973 from kawych/e2e · 6c533678
      Kubernetes Submit Queue authored
      Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
      
      Introduce e2e test for Stackdriver Metadata Agent
      
      **What this PR does / why we need it**:
      Introduce e2e test for Stackdriver Metadata Agent
      
      **Release note**:
      ```release-note
      None
      ```
      6c533678
  2. 22 Feb, 2018 26 commits