1

I'm moving an Apache Mesos application, where my configurations are based in JSON, to Kubernetes, where my configurations are based in YAML. Would the JSON configuration files work as a YAML file since YAML is a superset of JSON, or would I need to write a new YAML file?

emp440
  • 11
  • 3

1 Answers1

1

Yes, JSON works as well, it's just more pain than YAML to write it, manually. Also, you may be able to use micahhausler/container-transform to convert your Marathon specs to Kubernetes specs.

Michael Hausenblas
  • 13,162
  • 4
  • 52
  • 66
  • Would JSON work natively or would I have to use the typical yaml style? Also, I've got multiple JSON files but, for my deployment, I need to have only one yaml file. Is it possible to combine the JSON files into one yaml file? – emp440 Jul 18 '18 at 15:31
  • It works natively but unlike in YAML you can't combine multiple JSON files, no. – Michael Hausenblas Jul 18 '18 at 15:32
  • What do you mean by "unlike in YAML". So I can combine YAML files but not JSON files. So I can't move the JSON files to YAML and then combine them? – emp440 Jul 18 '18 at 16:31
  • Sorry, I should have been more clear: you can't combine multiple JSONs using `---` but you'd need to use a list resource as shown in https://github.com/kubernetes/kubernetes/blob/master/hack/testdata/multi-resource-list.json … hope that makes sense? – Michael Hausenblas Jul 18 '18 at 16:48
  • If I transform them into yaml files using the container-transform, could I then combine multiple yaml files into one? – emp440 Jul 18 '18 at 18:03
  • Yes, just separate them with `---` – Michael Hausenblas Jul 18 '18 at 18:07
  • So for container-transform, would the proper command be `container-transform -i marathon -o kubernetes _____` where ______ represents the file name? – emp440 Jul 20 '18 at 18:25