0

I am trying to setup a zookeeper container in Azure. I want it to use three different Azure File Shares. One is for the zookeeper configuration, one is for data, and one is for logs. Because of the multiple mounts, I have to use an ARM template for deployment.

Also, I am not sure exactly how I would make the container use the -v switch, or if I need to so that it looks at my config share as the file it needs. You can see my attempt in the command override.

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"resources": [
    {
        "location": "centralus",
        "name": "redacted",
        "type": "Microsoft.ContainerInstance/containerGroups",
        "apiVersion": "2018-10-01",
        "properties": {
            "containers": [
                {
                    "name": "redacted",
                    "properties": {
                        "image": "zookeeper:latest",
                        "resources": {
                            "requests": {
                                "cpu": "1",
                                "memoryInGB": "1.5"
                            }
                        },
                        "ports": [
                            {
                                "port": "2181",
                                "protocol": "TCP"
                            }
                        ],
                        "command": [
                            "-v/azshare/config/zk/cfg:/conf/zoo.cfg zookeeper"
                        ],
                        "volumeMounts": [
                            {
                                "name": "config",
                                "mountPath": "azshare/config"
                            },
                            {
                                "name": "data",
                                "mountPath": "azshare/data"
                            },
                            {
                                "name": "logs",
                                "mountPath": "azshare/logs"
                            }
                        ]
                    }
                }
            ],
            "restartPolicy": "Always",
            "osType": "Linux",
            "ipAddress": {
                "type": "Public",
                "ports": [
                    {
                        "port": "2181",
                        "protocol": "TCP"
                    }
                ],
                "dnsNameLabel": "redacted"
            },
            "volumes": [
                {
                    "name": "config",
                    "azureFile": {
                        "shareName": "config",
                        "storageAccountName": "redacted",
                        "storageAccountKey": "redacted"
                    }
                },
                {
                    "name": "data",
                    "azureFile": {
                        "shareName": "data",
                        "storageAccountName": "redacted",
                        "storageAccountKey": "redacted"
                    }
                },
                {
                    "name": "logs",
                    "azureFile": {
                        "shareName": "logs",
                        "storageAccountName": "redacted",
                        "storageAccountKey": "redacted"
                    }
                }
            ]
        },
        "tags": {}
    }
]
}
fizch
  • 101

1 Answers1

0

So it turns out that my mount path needs to start with a leading slash. The path should be /azshare/config and etc.

As far as passing commands go, it looks like the command is just replacing the docker entry point. If you are using the template format, your commands are space delimited, so every space is a new string.

fizch
  • 101