#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################
# NodeGroup resource
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: ${NODEGROUP_KUSTOMIZATION_NAME}
  namespace: managed-resources
  labels:
    node: ${NODEGROUP_KUSTOMIZATION_NAME}
spec:
  commonMetadata:
    labels:
      node: ${NODEGROUP_KUSTOMIZATION_NAME}
  interval: 1h
  retryInterval: 1m
  timeout: 5m
  sourceRef:
    kind: GitRepository
    name: sw-catalogs
    namespace: flux-system
  path: ./cloud-resources/eks-nodegroup/manifests/base
  prune: true
  # force: true
  wait: true
  # Input parameters
  postBuild:
    substitute:
      providerconfig_name: default
      nodegroup_name: node1
      cluster_name: ekscluster01
      node_count: "1"
      vm_size: t3.medium
      cluster_location: ap-south-1
      role: arn:aws:iam::123456789012:role/role
    substituteFrom:
      - kind: ConfigMap
        name: node1-parameters

