Azure / iot-edge-virtual-kubelet-provider

Kubernetes virtual kubelet provider for managing Azure IoT Edge deployments
MIT License
94 stars 25 forks source link

Fixing issues for the configMap configuration #25

Closed neumanndaniel closed 5 years ago

neumanndaniel commented 5 years ago

This PR fixes a couple of issues resulting in a Provider failed state of the customer container module, when the following scenarios are met for the configMap configuration.

Scenario Current IoT Edge VK provider version New IoT Edge VK provider version
Missing configMap Pod running Pod running
Missing data part in configMap Provider failed Pod running
Empty data part in configMap Provider failed Pod running
Missing restartPolicy part in configMap Provider failed Pod running
Empty restartPolicy part in configMap Provider failed Pod running
Missing createOptions part in configMap Provider failed Pod running

Example configMaps for each scenario except the first one

Missing data part in configMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: go-webapp-arm

Empty data part in configMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: go-webapp-arm
data:

Missing restartPolicy part in configMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: go-webapp-arm
data:
  status: running
  version: "1.0"
  createOptions: |
    {
      "HostConfig": {
        "PortBindings": {
          "8080/tcp": [
            {
              "HostPort": "80"
            }
          ]
        }
      }
    }

Empty restartPolicy part in configMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: go-webapp-arm
data:
  status: running
  restartPolicy:

With an empty restaryPolicy part you need to run kubectl apply -f deployment.yaml --validate=false to execute the deployment process.

Missing createOptions part in configMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: go-webapp-arm
data:
  status: running
  restartPolicy: always
  version: "1.0"
neumanndaniel commented 5 years ago

Ping @veyalla @avranju

neumanndaniel commented 5 years ago

@avranju Side note @veyalla needs to build a new container image and push it to https://hub.docker.com/r/microsoft/iot-edge-vk-provider/tags/