text.txt 762 Bytes
Newer Older
bryanl's avatar
bryanl committed
1 2
local env = std.extVar("__ksonnet/environments");
local params = std.extVar("__ksonnet/params").components.myDeployment;
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
{
   "apiVersion": "apps/v1beta1",
   "kind": "Deployment",
   "metadata": {
      "name": params.name
   },
   "spec": {
      "replicas": params.replicas,
      "template": {
         "metadata": {
            "labels": {
               "app": params.name
            }
         },
         "spec": {
            "containers": [
               {
                  "image": params.image,
                  "name": params.name,
                  "ports": [
                     {
                        "containerPort": params.containerPort
                     }
                  ]
               }
            ]
         }
      }
   }
}