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

fix(metrics-server): add double dashes to extra arguments #3109

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

kasia-kujawa
Copy link
Contributor

@kasia-kujawa kasia-kujawa commented Jun 29, 2023

extraArgs for metric-server needs to be added with double dashes, see: https://github.com/kubernetes-sigs/metrics-server/blob/master/docs/command-line-flags.txt

and in metric-server helm chart extraArgs are described in following way:

## extraArgs:
##   - --kubelet-insecure-tls=true
##   - --kubelet-preferred-address-types=InternalIP
##
extraArgs: []

sumologic colllection adds know two extraArgs without dashes

    - kubelet-insecure-tls=true
    - kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname

which causes that extraArgs are not taken into account

current form of Pod spec:

$ kubectl get pod -n sumologic collection-metrics-server-57ff4db75-79fj7 -o yaml
apiVersion: v1
kind: Pod
metadata:
  annotations:
    cni.projectcalico.org/podIP: 10.1.126.187/32
    cni.projectcalico.org/podIPs: 10.1.126.187/32
  creationTimestamp: "2023-06-29T07:30:46Z"
  generateName: collection-metrics-server-57ff4db75-
  labels:
    app.kubernetes.io/instance: collection
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: metrics-server
    helm.sh/chart: metrics-server-6.2.4
    pod-template-hash: 57ff4db75
  name: collection-metrics-server-57ff4db75-79fj7
  namespace: sumologic
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: collection-metrics-server-57ff4db75
    uid: 9cc6f5f4-1fd6-4294-8bab-a24e893bbf85
  resourceVersion: "37005"
  selfLink: /api/v1/namespaces/sumologic/pods/collection-metrics-server-57ff4db75-79fj7
  uid: b08f558e-8d7d-447d-a6c7-d8228d6695c7
spec:
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - podAffinityTerm:
          labelSelector:
            matchLabels:
              app.kubernetes.io/instance: collection
              app.kubernetes.io/name: metrics-server
          topologyKey: kubernetes.io/hostname
        weight: 1
  containers:
  - args:
    - --secure-port=8443
    - kubelet-insecure-tls=true
    - kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
    command:
    - metrics-server
    image: docker.io/bitnami/metrics-server:0.6.3-debian-11-r32
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /livez
        port: https
        scheme: HTTPS
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1
    name: metrics-server
    ports:
    - containerPort: 8443
      name: https
      protocol: TCP
    readinessProbe:
      failureThreshold: 3
      httpGet:
        path: /readyz
        port: https
        scheme: HTTPS
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1
    resources: {}
    securityContext:
      readOnlyRootFilesystem: false
      runAsNonRoot: true
      runAsUser: 1001
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: kube-api-access-9fl2v
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  nodeName: sumologic-kubernetes-collection
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: collection-metrics-server
  serviceAccountName: collection-metrics-server
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300
  volumes:
  - name: kube-api-access-9fl2v
    projected:
      defaultMode: 420
      sources:
      - serviceAccountToken:
          expirationSeconds: 3607
          path: token
      - configMap:
          items:
          - key: ca.crt
            path: ca.crt
          name: kube-root-ca.crt
      - downwardAPI:
          items:
          - fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
            path: namespace
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2023-06-29T07:30:47Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2023-06-29T07:30:47Z"
    message: 'containers with unready status: [metrics-server]'
    reason: ContainersNotReady
    status: "False"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2023-06-29T07:30:47Z"
    message: 'containers with unready status: [metrics-server]'
    reason: ContainersNotReady
    status: "False"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2023-06-29T07:30:47Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: containerd://c91d933598065151cd0b642d79babeb8ae906832a7b0c095d00d82c358993382
    image: docker.io/bitnami/metrics-server:0.6.3-debian-11-r32
    imageID: docker.io/bitnami/metrics-server@sha256:73256913f56528f8beb7804150104d9f722e121af11bdd76b745386d37684f11
    lastState: {}
    name: metrics-server
    ready: false
    restartCount: 0
    started: true
    state:
      running:
        startedAt: "2023-06-29T07:31:01Z"
  hostIP: 10.0.2.15
  phase: Running
  podIP: 10.1.126.187
  podIPs:
  - ip: 10.1.126.187
  qosClass: BestEffort
  startTime: "2023-06-29T07:30:47Z"

Checklist

  • Changelog updated or skip changelog label added
  • Documentation updated
  • Template tests added

@kasia-kujawa kasia-kujawa force-pushed the kk-fix-metrics-server branch 4 times, most recently from cbe45eb to def1c8f Compare June 29, 2023 09:19
@github-actions github-actions bot added the documentation documentation label Jun 29, 2023
@kasia-kujawa kasia-kujawa force-pushed the kk-fix-metrics-server branch from b44c9fd to 7f6f8c1 Compare June 29, 2023 09:36
@kasia-kujawa kasia-kujawa force-pushed the kk-fix-metrics-server branch from 7f6f8c1 to 53e656c Compare June 29, 2023 09:41
@kasia-kujawa kasia-kujawa marked this pull request as ready for review June 29, 2023 09:47
@kasia-kujawa kasia-kujawa requested a review from a team as a code owner June 29, 2023 09:47
@kasia-kujawa kasia-kujawa merged commit 6941379 into main Jun 29, 2023
@kasia-kujawa kasia-kujawa deleted the kk-fix-metrics-server branch June 29, 2023 10:22
@kasia-kujawa kasia-kujawa restored the kk-fix-metrics-server branch June 11, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants