This product is not supported for your selected Datadog site. ().

Metadata

Id: 1c621b8e-2c6a-44f5-bd6a-fb0fb7ba33e2

Cloud Provider: k8s

Framework: Kubernetes

Severity: Medium

Category: Secret Management

Learn More

Description

The RotateKubeletServerCertificate argument should be set to true.

Compliant Code Examples

apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
address: "192.168.0.8"
port: 20250
serializeImagePulls: false
evictionHard:
    memory.available:  "200Mi"
featureGates:
    RotateKubeletServerCertificate: true
{
    "kind": "KubeletConfiguration",
    "address": "192.168.0.8",
    "apiVersion": "kubelet.config.k8s.io/v1beta1",
    "evictionHard": {
        "memory.available": "200Mi"
    },
    "port": 20250,
    "serializeImagePulls": false
}
{
    "kind": "KubeletConfiguration",
    "address": "192.168.0.8",
    "apiVersion": "kubelet.config.k8s.io/v1beta1",
    "evictionHard": {
        "memory.available": "200Mi"
    },
    "featureGates": {
        "RotateKubeletServerCertificate": true
    },
    "port": 20250,
    "serializeImagePulls": false
}

Non-Compliant Code Examples

apiVersion: v1
kind: Pod
metadata:
  name: command-demo
  labels:
    purpose: demonstrate-command
spec:
  containers:
    - name: command-demo-container
      image: foo/bar
      command: ["kubelet"]
      args: ["--feature-gates=RotateKubeletServerCertificate=false"]
  restartPolicy: OnFailure
{
    "kind": "KubeletConfiguration",
    "address": "192.168.0.8",
    "apiVersion": "kubelet.config.k8s.io/v1beta1",
    "evictionHard": {
        "memory.available": "200Mi"
    },
    "featureGates": {
        "RotateKubeletServerCertificate": false
    },
    "port": 20250,
    "serializeImagePulls": false
}
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
  labels:
    purpose: demonstrate-command
spec:
  containers:
    - name: command-demo-container7
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-controller-manager"]
      args: ["--feature-gates=RotateKubeletServerCertificate=false"]
  restartPolicy: OnFailure