laetho/metagraf

Make it possible to generate manifests without an k8s connection for --dryrun --output scenarios.

Closed this issue · 3 comments

Investigate the possibility of generating kubernetes manifests without a connection to a kubernetes cluster when --dryrun --output arguments are passed to mg create 's.

Also investigate inspecting docker images without a docker daemon or openshift imagestream present.

We can easily make a conditional around the client part in the generators based on cmdline flags. The big problem is inspecting images without a docker daemon or openshift imagestream.

By default skopeo does not report back the ExposedPort information. Skopeo seems to use https://github.com/containers/image which might be a better integration target as a native part of the mg utility.

note to self

It appears skopeo actually provides that information through skopeo inspect --config. Thank you @mtrmac for providing that nugget of information.

skopeo inspect --config docker://docker.io/mysql | jq .config
{
  "ExposedPorts": {
    "3306/tcp": {},
    "33060/tcp": {}
  },
  "Env": [
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "GOSU_VERSION=1.7",
    "MYSQL_MAJOR=8.0",
    "MYSQL_VERSION=8.0.19-1debian9"
  ],
  "Entrypoint": [
    "docker-entrypoint.sh"
  ],
  "Cmd": [
    "mysqld"
  ],
  "Volumes": {
    "/var/lib/mysql": {}
  }
}

Partly solved. It needs to be integrated into the generate subcomands.