anthos-service-mesh-packages icon indicating copy to clipboard operation
anthos-service-mesh-packages copied to clipboard

Add a setter for machine type

Open janetkuo opened this issue 4 years ago • 3 comments

janetkuo avatar May 08 '20 19:05 janetkuo

Also my default pool consistently comes up as n1-standard-1, no matter what it's set to. It seems to be ignoring max nodes and the machine sizing request.

tibers avatar Jul 09 '20 21:07 tibers

Hi, I'm trying to create a new setter for machineType by

kpt cfg create-setter asm nodeConfig.machineType e2-standard-4

Why I get {"$kpt-set":"nodeConfig.machineType"} rather than {"$ref":"#/definitions/..."}? Am i miss something? or where can I find the reference of "$ref":"#/definitions?

## Kptfile
    io.k8s.cli.setters.gcloud.container.nodepool.max-nodes:
      x-k8s-cli:
        setter:
          name: gcloud.container.nodepool.max-nodes
          value: "4"
    io.k8s.cli.setters.nodeConfig.machineType:
      x-k8s-cli:
        setter:
          name: nodeConfig.machineType
          value: e2-standard-4
## nodepool.yaml
  autoscaling:
    minNodeCount: 2
    maxNodeCount: 5 # {"$ref":"#/definitions/io.k8s.cli.setters.gcloud.container.nodepool.max-nodes"}
  nodeConfig:
    machineType: e2-standard-4 # {"$kpt-set":"nodeConfig.machineType"}

RammusXu avatar Sep 14 '20 07:09 RammusXu

@RammusXu The newer versions of kpt uses a shorter reference to a setter in the manifests than it used to in the past. So the # {"$kpt-set":"nodeConfig.machineType"} still references a setter/substitution named nodeConfig.machineType, it just doesn't include the #/definitions/.. prefix. Both should work, so if you are running into any problem with this, just let us know.

mortent avatar Sep 16 '20 16:09 mortent