acs-engine icon indicating copy to clipboard operation
acs-engine copied to clipboard

Kubernetes ACI connector InvalidImageName

Open forrestcoward opened this issue 8 years ago • 2 comments

Hey everyone,

I'm trying to use ACS-Engine to deploy a Kubernetes cluster with the ACI connector enabled. I'm following the instruction here: https://github.com/Azure/acs-engine/tree/master/examples/addons/aci-connector

I've added the following to my linux template where the values get filled out before submission to the resource manager:

      "kubernetesConfig": {
        "addons": [
          {
            "name": "aci-connector",
            "enabled" : true,
            "config": {
                "clientId": "[ClusterSPClientID]",
                "clientKey": "[ClusterSPClientSecret]",
                "tenantId": "[tenantID]",
                "resourceGroup": "[resourceGroupName]",
            },
            "containers": [
              {
                "name": "aci-connector",
                "cpuRequests": "50m",
                "memoryRequests": "150Mi",
                "cpuLimits": "50m",
                "memoryLimits": "150Mi"
              }
            ]
          }
        ]
      }

My cluster starts and is running correctly except for the aci-connector pod is broken:

PS E:\repos\K8sCluster\ACSEngine> kubectl get pods -n kube-system
NAME                                            READY     STATUS             RESTARTS   AGE
aci-connector-6f8974f7bc-6rsbn                  0/1       InvalidImageName   0          13m
heapster-75f8df9884-qkg4p                       2/2       Running            0          13m
kube-addon-manager-k8s-master-29352689-0        1/1       Running            0          13m
kube-apiserver-k8s-master-29352689-0            1/1       Running            0          12m
kube-controller-manager-k8s-master-29352689-0   1/1       Running            0          12m
kube-dns-v20-5d9fdc7448-d2g2d                   3/3       Running            0          13m
kube-dns-v20-5d9fdc7448-qrchc                   3/3       Running            0          13m
kube-proxy-56zkp                                1/1       Running            0          13m
kube-proxy-5t5r6                                1/1       Running            0          13m
kube-proxy-g5rsn                                1/1       Running            0          13m
kube-proxy-qtn6q                                1/1       Running            0          13m
kube-scheduler-k8s-master-29352689-0            1/1       Running            0          12m
kubernetes-dashboard-8555bd85db-25xbz           1/1       Running            0          13m
tiller-deploy-86d6cf59b-fw7wq                   1/1       Running            0          13m

PS E:\repos\K8sCluster\ACSEngine> kubectl -n kube-system describe pod aci-connector-6f8974f7bc-6rsbn
Name:           aci-connector-6f8974f7bc-6rsbn
Namespace:      kube-system
Node:           k8s-agentpool1-29352689-2/10.240.0.4
Start Time:     Thu, 22 Mar 2018 14:51:13 -0700
Labels:         app=aci-connector
                pod-template-hash=2945309367
Annotations:    kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"kube-system","name":"aci-connector-6f8974f7bc","uid":"240e879c-2e1b-11e8-8a08-000...
Status:         Pending
IP:             10.240.0.17
Controlled By:  ReplicaSet/aci-connector-6f8974f7bc
Containers:
  aci-connector:
    Container ID:
    Image:         microsoft/
    Image ID:
    Port:          <none>
    Command:
      virtual-kubelet
    Args:
      --provider
      azure
      --nodename
      aci-connector
      --os
      Linux
      --taint
      azure.com/aci
    State:          Waiting
      Reason:       InvalidImageName
    Ready:          False
    Restart Count:  0
    Limits:
      cpu:     50m
      memory:  150Mi
    Requests:
      cpu:     50m
      memory:  150Mi
    Environment:
      AZURE_AUTH_LOCATION:  /etc/virtual-kubelet/credentials.json
      ACI_RESOURCE_GROUP:   forrest-dev-cluster-westus2-linux
      ACI_REGION:           westus
    Mounts:
      /etc/virtual-kubelet from credentials (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from aci-connector-token-hfzx2 (ro)
Conditions:
  Type           Status
  Initialized    True
  Ready          False
  PodScheduled   True
Volumes:
  credentials:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  aci-connector-secret
    Optional:    false
  aci-connector-token-hfzx2:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  aci-connector-token-hfzx2
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  <none>
Tolerations:     <none>
Events:
  Type     Reason                 Age                 From                                Message
  ----     ------                 ----                ----                                -------
  Normal   Scheduled              13m                 default-scheduler                   Successfully assigned aci-connector-6f8974f7bc-6rsbn to k8s-agentpool1-29352689-2
  Normal   SuccessfulMountVolume  13m                 kubelet, k8s-agentpool1-29352689-2  MountVolume.SetUp succeeded for volume "credentials"
  Normal   SuccessfulMountVolume  13m                 kubelet, k8s-agentpool1-29352689-2  MountVolume.SetUp succeeded for volume "aci-connector-token-hfzx2"
  Normal   SandboxChanged         13m (x3 over 13m)   kubelet, k8s-agentpool1-29352689-2  Pod sandbox changed, it will be killed and re-created.
  Warning  InspectFailed          12m (x10 over 13m)  kubelet, k8s-agentpool1-29352689-2  Failed to apply default image tag "microsoft/": couldn't parse image reference "microsoft/": invalid reference format
  Warning  FailedSync             3m (x50 over 13m)   kubelet, k8s-agentpool1-29352689-2  Error syncing pod

The image seems incorrect:

Image:         microsoft/

Any idea what is happening?

Thanks, Forrest

forrestcoward avatar Mar 22 '18 22:03 forrestcoward

Seems like your containers configuration is missing the image parameter.

"containers": [ { "name": "aci-connector", "image": "microsoft/aci-connector-k8s:latest", "cpuRequests": "50m", "memoryRequests": "150Mi", "cpuLimits": "50m", "memoryLimits": "150Mi" }

Please look at the https://github.com/Azure/acs-engine/blob/master/examples/addons/aci-connector/kubernetes-aci-connector.json for complete json

vpatelsj avatar Mar 24 '18 06:03 vpatelsj

According to the readme, image is not a required parameter. It looks like the defaults for image are not being set correctly at: https://github.com/Azure/acs-engine/blob/81a2d990ac8cadc4d408074837f55f49cc7e1457/pkg/acsengine/k8s_versions.go#L195-L229

amit-kumar-4 avatar Apr 12 '18 10:04 amit-kumar-4