kops: Nodeup broken due to lack of crictl

/kind bug

1. What kops version are you running? The command kops version, will display this information. v1.29.0-beta.1

2. What Kubernetes version are you running? kubectl version will print the version if a cluster is running or provide the Kubernetes version specified as a kops flag. v1.26.11

3. What cloud provider are you using? AWS

4. What commands did you run? What is the simplest way to reproduce this issue?

  • Upgrade kOps from v1.28.1 to v1.29.0-beta.1 in a Kubernetes cluster running version v1.26.11
  • Run kops rolling-update cluster at the Master Instance Group

5. What happened after the commands executed?

  • New Master node doesn’t join at the cluster with the following logs (journalctl):
Mar 21 17:59:40 ip-10-33-87-46 nodeup[1592]: W0321 17:59:40.248893    1592 main.go:133] got error running nodeup (will retry in 30s): error building loader: building *model.CrictlBuilder: unable to locate asset "crictl": found multiple matching assets for key: "crictl"
$ whereis crictl
crictl:

6. What did you expect to happen?

  • Master node joining the cluster successfully

7. Please provide your cluster manifest. Execute kops get --name my.example.com -o yaml to display your cluster manifest. You may want to remove your cluster name and other sensitive information.

apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
metadata:
  labels:
    kops.k8s.io/cluster: my-cluster.internal
  name: my-cluster.internal
spec:
  api:
    loadBalancer:
      crossZoneLoadBalancing: true
      type: Internal
  channel: stable
  cloudConfig:
    awsEBSCSIDriver:
      enabled: true
    disableSecurityGroupIngress: true
    elbSecurityGroup: <redacted>
  cloudProvider: aws
  configBase: s3://my-cluster.internal
  containerRuntime: containerd
  containerd:
    packages:
      hashAmd64: <redacted>
      hashArm64: <redacted>
      urlAmd64: https://github.com/containerd/containerd/releases/download/v1.7.6/cri-containerd-cni-1.7.6-linux-amd64.tar.gz
      urlArm64: https://github.com/containerd/containerd/releases/download/v1.7.6/cri-containerd-cni-1.7.6-linux-arm64.tar.gz
    registryMirrors:
      docker.io:
      - https://my-registry-mirror.internal
  dnsZone: <redacted>
  etcdClusters:
  - cpuRequest: 200m
    etcdMembers:
    - instanceGroup: master-zone-1a
      name: zone-1a
      volumeIops: 3000
      volumeSize: 40
      volumeThroughput: 125
      volumeType: gp3
    - instanceGroup: master-zone-1b
      name: zone-1b
      volumeIops: 3000
      volumeSize: 40
      volumeThroughput: 125
      volumeType: gp3
    - instanceGroup: master-zone-1c
      name: zone-1c
      volumeIops: 3000
      volumeSize: 40
      volumeThroughput: 125
      volumeType: gp3
    manager:
      env:
      - name: ETCD_LISTEN_METRICS_URLS
        value: http://0.0.0.0:8881
      - name: ETCD_METRICS
        value: extensive
      - name: ETCD_MANAGER_HOURLY_BACKUPS_RETENTION
        value: 7d
      - name: ETCD_MANAGER_DAILY_BACKUPS_RETENTION
        value: 45d
    memoryRequest: 100Mi
    name: main
    provider: Manager
    version: 3.5.9
  - cpuRequest: 100m
    etcdMembers:
    - instanceGroup: master-zone-1a
      name: zone-1a
      volumeIops: 3000
      volumeSize: 40
      volumeThroughput: 125
      volumeType: gp3
    - instanceGroup: master-zone-1b
      name: zone-1b
      volumeIops: 3000
      volumeSize: 40
      volumeThroughput: 125
      volumeType: gp3
    - instanceGroup: master-zone-1c
      name: zone-1c
      volumeIops: 3000
      volumeSize: 40
      volumeThroughput: 125
      volumeType: gp3
    manager:
      env:
      - name: ETCD_LISTEN_METRICS_URLS
        value: http://0.0.0.0:8882
      - name: ETCD_METRICS
        value: extensive
      - name: ETCD_MANAGER_HOURLY_BACKUPS_RETENTION
        value: 7d
      - name: ETCD_MANAGER_DAILY_BACKUPS_RETENTION
        value: 45d
    memoryRequest: 100Mi
    name: events
    provider: Manager
    version: 3.5.9
  externalPolicies:
    master:
    - <redacted>
  fileAssets:
  - content: |
      ---
      <redacted>
    name: kubernetes-audit-policy-file
    path: /srv/kubernetes/kube-apiserver/audit-policy-config.yaml
    roles:
    - ControlPlane
  iam:
    allowContainerRegistry: true
    legacy: false
  kubeAPIServer:
    auditLogMaxAge: 10
    auditLogMaxBackups: 1
    auditLogMaxSize: 100
    auditLogPath: /var/log/kube-apiserver-audit.log
    auditPolicyFile: /srv/kubernetes/kube-apiserver/audit-policy-config.yaml
    disableBasicAuth: true
    eventTTL: 3h0m0s
    featureGates:
      EphemeralContainers: "true"
    maxMutatingRequestsInflight: 450
    maxRequestsInflight: 1000
    oidcClientID: <redacted>
    oidcGroupsClaim: <redacted>
    oidcGroupsPrefix: <redacted>
    oidcIssuerURL: <redacted>
    oidcUsernameClaim: <redacted>
    oidcUsernamePrefix: <redacted>
  kubeDNS:
    affinity:
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
          - matchExpressions:
            - key: my-node-role
              operator: In
              values:
              - "true"
      podAntiAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
        - podAffinityTerm:
            labelSelector:
              matchExpressions:
              - key: k8s-app
                operator: In
                values:
                - kube-dns
            topologyKey: kubernetes.io/hostname
          weight: 100
    nodeLocalDNS:
      enabled: true
    provider: CoreDNS
    tolerations:
    - key: CriticalAddonsOnly
      operator: Exists
    - effect: NoSchedule
      key: instancegroup
      value: my-ig
  kubeProxy:
    metricsBindAddress: 0.0.0.0
  kubelet:
    anonymousAuth: false
    authenticationTokenWebhook: true
    authorizationMode: Webhook
    cpuCFSQuota: false
    cpuManagerPolicy: none
    featureGates:
      EphemeralContainers: "true"
    imageGCHighThresholdPercent: 65
    imageGCLowThresholdPercent: 60
    kubeReserved:
      cpu: 200m
      ephemeral-storage: 1Gi
      memory: 300Mi
    kubeReservedCgroup: /kube-reserved
    maxPods: 50
    systemReserved:
      cpu: 200m
      ephemeral-storage: 1Gi
      memory: 300Mi
    systemReservedCgroup: /system-reserved
  kubernetesApiAccess:
  - <redacted>
  kubernetesVersion: 1.26.11
  masterPublicName: api.my-cluster.internal
  metricsServer:
    enabled: true
    insecure: true
  networkCIDR: <redacted>
  networkID: <redacted>
  networking:
    calico:
      crossSubnet: true
      mtu: 8912
      prometheusGoMetricsEnabled: true
      prometheusMetricsEnabled: true
      prometheusProcessMetricsEnabled: true
      typhaPrometheusMetricsEnabled: true
      typhaReplicas: 3
  nodeProblemDetector:
    enabled: false
  nodeTerminationHandler:
    enabled: false
  nonMasqueradeCIDR: <redacted>
  serviceAccountIssuerDiscovery:
    discoveryStore: s3://my-cluster.internal
    enableAWSOIDCProvider: true
  subnets:
  - cidr: <redacted>
    id: <redacted>
    name: zone-1a
    type: Private
    zone: us-east-1a
  - cidr: <redacted>
    id: <redacted>
    name: zone-1b
    type: Private
    zone: us-east-1b
  - cidr: <redacted>
    id: <redacted>
    name: zone-1c
    type: Private
    zone: us-east-1c
... instanceGroups definitions redacted

8. Please run the commands with most verbose logging by adding the -v 10 flag. Paste the logs into this report, or in a gist and provide the gist link here.

9. Anything else do we need to know? We need to upgrade kOps because of these two features: https://github.com/kubernetes/kops/pull/16067

  • We’re having serious port conflict problems between containerd and various components like Calico, Datadog, Node-Exporter, etc. https://github.com/kubernetes/kops/pull/16192
  • Some clusters are experiencing a shortage of IPAM blocks because Calico is unable to release blocks from nodes that have already been removed (more details here).

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 18 (15 by maintainers)

Most upvoted comments

I don’t know why they provide two style packages for each version. But, should we use cri-containerd-cni-$version-linux-amd64.tar.gz to install crictl?

I remembered why I moved away from cri-containerd-* some time ago. I think all cri-* packages are deprecated and will be removed in 2.x releases: https://github.com/containerd/containerd/blob/c17839bdc7bf8699badf796078afc91fd54de6ac/releases/cri-containerd.DEPRECATED.txt

Probably, our default containerd download package does not contain crictl. https://github.com/kubernetes/kops/blob/02c1cc75b23c2c13fe973dd645c338f207526424/pkg/nodemodel/wellknownassets/containerd.go#L34-L35

  • containerd-$version-linux-amd64.tar.gz: does not contain crictl, it contains ctr.
  • cri-containerd-cni-$version-linux-amd64.tar.gz: contains crictl.

I don’t know why they provide two style packages for each version. But, should we use cri-containerd-cni-$version-linux-amd64.tar.gz to install crictl?

We removed the following hardcoded version of containerd from our cluster.yaml and all works fine.

  containerd:
    packages:
      hashAmd64: <redacted>
      hashArm64: <redacted>
      urlAmd64: https://github.com/containerd/containerd/releases/download/v1.7.6/cri-containerd-cni-1.7.6-linux-amd64.tar.gz
      urlArm64: https://github.com/containerd/containerd/releases/download/v1.7.6/cri-containerd-cni-1.7.6-linux-arm64.tar.gz

Thanks guys.

@cmotta2016 nodeup finds it, just finds 2 of them and cannot decide which one to pick, check the error again:

... found multiple matching assets for key: "crictl"

Thanks @cmotta2016. The problem is that we have multiple binaries with the same name, crictl:

% tar tfv cri-containerd-cni-1.7.6-linux-amd64.tar.gz | grep crictl
-rw-r--r--  0 root   root       57 Sep 12  2023 etc/crictl.yaml
-rwxr-xr-x  0 root   root 54137463 Sep 12  2023 usr/local/bin/crictl