Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Container fails to create in Kubernetes #6943

Closed justinhauer closed 4 years ago

justinhauer commented 6 years ago

Description

azuresdk/azure-powershell-core:latest container image fails to create in kubernetes. Image works fine when running docker locally but when scheduling in kubernetes, image fails to build:

tagging-1534357500-sdj4f   0/1       ContainerCreating   0          3s
kubectl logs tagging-1534357500-d8s4z
Failed to initialize CoreCLR, HRESULT: 0x80004005

Script/Steps for Reproduction

kind: CronJob
apiVersion: batch/v1beta1
metadata:
  name: tagging
  namespace: default
spec:
  schedule: '*/1 * * * *'
  startingDeadlineSeconds: 30
  concurrencyPolicy: Forbid
  suspend: false
  jobTemplate:
    metadata:
      creationTimestamp: null
    spec:
      template:
        metadata:
          creationTimestamp: null
          labels:
            parent: tagging
        spec:
          containers:
          - name: tagging2
            image: azuresdk/azure-powershell-core:latest
            command:
              - pwsh
              - -File
              - /tmp/myscript.ps1
            resources: {}
            terminationMessagePath: /dev/termination-log
            terminationMessagePolicy: File
            imagePullPolicy: IfNotPresent
            volumeMounts:
              - name: azuretags
                mountPath: /tmp/
          volumes:
            - name: azuretags
              configMap:
                 name: azuretags
          restartPolicy: Never
          terminationGracePeriodSeconds: 30
          schedulerName: default-scheduler
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1

Module Version

not applicable `

Environment Data

not applicable

Debug Output

justinhauer commented 6 years ago

Can anyone comment on this?

justinhauer commented 6 years ago

@markcowl to update on this, the docker image will run if it's compiled with the powershell script. The update appears to be trying to run the powershell script when its mounted from a configmap.

dingmeng-xue commented 4 years ago

@justinhauer , we are revisiting this issue. Could you try new version of Azure PowerShell docker images? https://hub.docker.com/_/microsoft-azure-powershell

dingmeng-xue commented 4 years ago

@justinhauer , thanks for your reporting. We hope the new version of docker can resolve your problem. I'm closing this issue now. If you have any new problem, please create new issue. Thanks very much.