AKS icon indicating copy to clipboard operation
AKS copied to clipboard

[BUG] aks-node-ca-watcher cannot run

Open pawellrus opened this issue 2 years ago • 29 comments

Describe the bug After k8s cluster reconfiguration one of nodes cannot run pod daemonset custom-ca-trust. Pod throws an error "Container image "mcr.microsoft.com/aks/aks-node-ca-watcher:static" is not present with pull policy of Never"

To Reproduce Steps to reproduce the behavior:

  1. Custom Ca certificates should be enabled. And that is all that I can say. Seems that issue is not easy reproduceable.

Environment (please complete the following information):

  • AKS 1.27.7

pawellrus avatar Jul 03 '24 11:07 pawellrus

@pawellrus - is this happening on a node that was created a while ago, but didn't have the feature enabled initially after creation? If yes, can you attempt to perform a node image upgrade on that node and see if this helps with the issue?

UtheMan avatar Jul 03 '24 17:07 UtheMan

@pawellrus - is this happening on a node that was created a while ago, but didn't have the feature enabled initially after creation? If yes, can you attempt to perform a node image upgrade on that node and see if this helps with the issue?

thank you for advice. I will try to perform node image upgrade in maintenance window.

pawellrus avatar Jul 04 '24 09:07 pawellrus

Node image upgrade helped. Thank you @UtheMan

pawellrus avatar Jul 08 '24 08:07 pawellrus

We are seeing the same issue after an automatic node image upgrade on 2 of our clusters. One since around 8 hours ago, the other since 3d12h.

One cluster is on k8s version 1.30.4, the other is on k8s version 1.29.9. Both using AzureLinux (AKSAzureLinux-V2gen2-202409.23.0) as the node image on all node pools. The issue is on all nodes in all node pools in both clusters. Both have had CustomCATrustPreview enabled on all nodes since they were created.

It looks to me like this container image needs to be preloaded on the node, which it was before but since the restart it's not (please correct me if I'm wrong).

Perhaps this information helps to pinpoint the issue. If I can do anything to help testing that's fine, I can do some non-destructive work on one of our clusters.

fester-io avatar Oct 08 '24 07:10 fester-io

I encountered the same issue as fester-io. Need this fixed ASAP.

ghost avatar Oct 08 '24 19:10 ghost

I am encountering the this as well and thus I am unable to spin up new nodes. Is there an ETA on fixing this?

DarthVader-JF avatar Oct 08 '24 19:10 DarthVader-JF

We're looking into this issue, will post updates here asap.

UtheMan avatar Oct 08 '24 20:10 UtheMan

I identified the issue and submitted a fix. As a short term mitigation, you can re-tag the image on your nodes like so:

ctr --namespace k8s.io image tag mcr.microsoft.com/aks/aks-node-ca-watcher:master.240820.1 mcr.microsoft.com/aks/aks-node-ca-watcher:static 

This would have to be ran on every affected node, so ideally it would be triggered using a daemonset.

UtheMan avatar Oct 08 '24 23:10 UtheMan

Thanks for the recommendation that fixed our issue. Here is the daemonset that I deployed to update the each of the host:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: host-command-ctr
  labels:
    k8s-app: host-command-ctr
  annotations:
    command: &cmd apt-get update -qy && apt-get install -qy open-iscsi xfsprogs && ctr --namespace k8s.io image tag mcr.microsoft.com/aks/aks-node-ca-watcher:master.240820.1 mcr.microsoft.com/aks/aks-node-ca-watcher:static --force
spec:
  selector:
    matchLabels:
      k8s-app: host-command-ctr
  template:
    metadata:
      labels:
        k8s-app: host-command-ctr
    spec:
      hostNetwork: true
      hostPID: true
      initContainers:
        - name: init-node
          command:
            - nsenter
            - --mount=/proc/1/ns/mnt
            - --
            - sh
            - -c
            - *cmd
          image: alpine:3
          securityContext:
            privileged: true
      containers:
        - name: wait
          image: k8s.gcr.io/pause:3.1
      tolerations:
        - key: CriticalAddonsOnly
          operator: Exists
        - effect: NoExecute
          operator: Exists
        - effect: NoSchedule
          operator: Exists
  updateStrategy:
    type: RollingUpdate

DarthVader-JF avatar Oct 09 '24 04:10 DarthVader-JF

Thanks this fixed it for us.

klbrg avatar Oct 10 '24 11:10 klbrg

The issue seems to be coming back for us. Is anyone else facing the same problem?

klbrg avatar Oct 21 '24 07:10 klbrg

@rickardk-se could you share which node image version you are using on the nodes that started seeing the issue again? Were they perhaps updated to 2024.09.30 image version? Please see here for some more details: https://github.com/Azure/AKS/issues/4586

UtheMan avatar Oct 21 '24 19:10 UtheMan

@UtheMan yes it was updated to 2024.09.30. Thanks.

klbrg avatar Oct 22 '24 06:10 klbrg

Action required from @aritraghosh, @julia-yin, @AllenWen-at-Azure

Issue needing attention of @Azure/aks-leads

Issue needing attention of @Azure/aks-leads

Issue needing attention of @Azure/aks-leads

Issue needing attention of @Azure/aks-leads

Issue needing attention of @Azure/aks-leads

Issue needing attention of @Azure/aks-leads