github.com/verrazzano/verrazzano@v1.7.0/cluster-operator/controllers/quickcreate/oke/template/nodes/nodes.goyaml (about)

     1  # Copyright (c) 2023, Oracle and/or its affiliates.
     2  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  {{ $virtualNodes := .OKE.VirtualNodePools }}
     5  {{ $nodePools := .OKE.NodePools }}
     6  {{ $availabilityDomains := .AvailabilityDomains }}
     7  
     8  {{- range $node := $virtualNodes }}
     9  apiVersion: cluster.x-k8s.io/v1beta1
    10  kind: MachinePool
    11  metadata:
    12      name: {{$node.Name}}-virtual
    13      namespace: {{$.Namespace}}
    14      annotations:
    15          "cluster.x-k8s.io/replicas-managed-by": ""
    16  spec:
    17      clusterName: {{$.Name}}
    18      replicas: {{$node.Replicas}}
    19      template:
    20          spec:
    21              clusterName: {{$.Name}}
    22              bootstrap:
    23                  dataSecretName: ""
    24              infrastructureRef:
    25                  apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    26                  kind: OCIVirtualMachinePool
    27                  name: {{$node.Name}}
    28              version: {{$.Kubernetes.Version}}
    29  ---
    30  apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    31  kind: OCIVirtualMachinePool
    32  metadata:
    33      name: {{$node.Name}}
    34      namespace: {{$.Namespace}}
    35  ---
    36  {{- end }}
    37  {{- range $node := $nodePools }}
    38  ---
    39  apiVersion: cluster.x-k8s.io/v1beta1
    40  kind: MachinePool
    41  metadata:
    42      name: {{$node.Name}}
    43      namespace: {{$.Namespace}}
    44      annotations:
    45          "cluster.x-k8s.io/replicas-managed-by": ""
    46  spec:
    47      clusterName: {{$.Name}}
    48      replicas: {{$node.Replicas}}
    49      template:
    50          spec:
    51              clusterName: {{$.Name}}
    52              bootstrap:
    53                  dataSecretName: ""
    54              infrastructureRef:
    55                  apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    56                  kind: OCIManagedMachinePool
    57                  name: {{$node.Name}}
    58              version: {{$.Kubernetes.Version}}
    59  ---
    60  apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    61  kind: OCIManagedMachinePool
    62  metadata:
    63      name: {{$node.Name}}
    64      namespace: {{$.Namespace}}
    65  spec:
    66      version: {{$.Kubernetes.Version}}
    67      initialNodeLabels:
    68          - key: name
    69            value: {{$node.Name}}
    70      nodePoolCyclingDetails:
    71          isNodeCyclingEnabled: true
    72      nodeEvictionNodePoolSettings:
    73          evictionGraceDuration: PT1H
    74          isForceDeleteAfterGraceDuration: false
    75      {{- if eq $.OKE.Network.CNIType "FLANNEL_OVERLAY" }}
    76      nodePoolNodeConfig:
    77          nodePoolPodNetworkOptionDetails:
    78              cniType: {{$.OKE.Network.CNIType}}
    79      {{- end }}
    80      nodeShape: {{$node.Shape}}
    81      # Add shape config if using flex shapes
    82      {{- if and (or $node.OCPUs $node.MemoryGbs) (contains $node.Shape "Flex") }}
    83      nodeShapeConfig:
    84          {{- if $node.OCPUs }}
    85          ocpus: "{{$node.OCPUs}}"
    86          {{- end }}
    87          {{- if $node.MemoryGbs }}
    88          memoryInGBs: "{{$node.MemoryGbs}}"
    89          {{- end }}
    90      {{- end }}
    91      # Add SSH Public Key if present
    92      {{- if $.OKE.SSHPublicKey }}
    93      sshPublicKey: {{$.OKE.SSHPublicKey}}
    94      {{- end }}
    95      nodeSourceViaImage:
    96          imageId: {{$.OKE.ImageID}}
    97          bootVolumeSizeInGBs: {{$node.BootVolumeGbs}}
    98  ---
    99  {{- end }}