version: 1
kind: component
meta:
  name: gke
  brief: Google Kubernetes Engine

requires:
  - gcp

parameters:
- name: projectId
  env: PROJECT
- name: hubStackName
- name: hub.deployedBy
  value: superhub
  brief: Placeholder parameter for proper tagging of cloud resources

- name: component.gke
  parameters:
  - name: name
    value: superhub
    env: NAME
  - name: version
    value: 1.22.8-gke.202
  - name: releaseChannel
    value: regular
  - name: zone
    empty: allow
    env: ZONE
  - name: region
    empty: allow
    env: REGION
  - name: machineType
    value: e2-standard-4
  - name: nodeCount
    value: 1
  - name: addons
    env: CLUSTER_ADDONS
    value: |
      NetworkPolicy
      NodeLocalDNS
  - name: imageType
    value: ubuntu_containerd
  - name: network
    value: default
  - name: subnet
    empty: allow
    brief: Optional subnet name
    env: SUBNET

outputs:
- name: component.gke.url
  value: https://console.cloud.google.com/kubernetes/clusters/details/${component.gke.zone}/${component.gke.name}/details?project=${projectId}"

templates:
  files:
    - "*.template"
