kubernetes daemonset fails to pull docker image from the cluster



  • I am having issues with my Kubernetes cluster daemonSet. I have deployed this yaml file on my cluster. It looks like the daemonSet is failing to pull the docker image from the registry.

    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: oci-la-fluentd-daemonset
      namespace: kube-system
      labels:
        app: oci-la-fluentd-logs
        version: v1
    spec:
      selector:
        matchLabels:
          app: oci-la-fluentd-logs
          version: v1
      template:
        metadata:
          labels:
            app: oci-la-fluentd-logs
            version: v1
        spec:
          serviceAccountName: oci-la-fluentd-serviceaccount
          tolerations:
            - key: node-role.kubernetes.io/master
              effect: NoSchedule
          # Uncomment the following section if a secret is associated to pull the image
          imagePullSecrets:
          - name: regcred
          containers:
            - name: oci-la-fluentd-logs
              # Replace this value with actual docker image url
              image: iad.ocir.io/kobie/oke_logging/fluentd_oci_la
              # Replace this value with desired value for image pull policy
              imagePullPolicy: Always
              env:
                - name: awx_lower
                  valueFrom:
                    fieldRef:
                      fieldPath: spec.nodeName
    

    As you could see I have attached the secrets on my yaml files to pull the image.

    This is the error message. This is what I get on the cluster when I look at the pods.

    Failed to pull image iad.ocir.io/kobie/oke_logging/fluentd_oci_la:latest rpc error: code = Unknown desc denied: Anonymous users are only allowed read access on public repos
    


  • One way to fix this if that's allowed is by setting insecure-registries on the host's docker config:

    sudo cat /etc/docker/daemon.json
    

    {
    "insecure-registries" : [ "10.10.10.10:5000" ]
    }

    restart docker daemon after this




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2