# Copyright 2019 The KubeOne Authors.
#
# 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.

apiVersion: kubeone.io/v1alpha1
kind: KubeOneCluster
name: {{kubeone_name}}
versions:
  kubernetes: {{kubeone_versions_kubernetes}}
clusterNetwork:
  podSubnet: {{kubeone_clusterNetwork_podSubnet}}
  serviceSubnet: {{ kubeone_clusterNetwork_serviceSubnet }}
  serviceDomainName: {{ kubeone_clusterNetwork_serviceDomainName }}
  nodePortRange: {{ kubeone_clusterNetwork_nodePortRange }}
  cni:
    provider: {{ kubeone_clusterNetwork_cni_provider }}
    encrypted: {{ kubeone_clusterNetwork_cni_encrypted }}
cloudProvider:
  name: {{ kubeone_cloudProvider_name }}
  external: {{ kubeone_cloudProvider_external }}
  cloudConfig: {{ kubeone_cloudProvider_cloudconfig }}
{% if kubeone_hosts %}
hosts:
{{ kubeone_hosts|to_yaml }}
{% endif %}
{% if kubeone_workers %}
workers:
{{ kubeone_workers|to_yaml }}
{% endif %}
apiEndpoint:
  host: {{ kubeone_apiEndpoint_host }}
  port: {{ kubeone_apiEndpoint_port }}
features:
  podSecurityPolicy:
    enable: {{ kubeone_features_podSecurityPolicy_enable }}
  dynamicAuditLog:
    enable: {{ kubeone_features_dynamicAuditLog_enable }}
  metricsServer:
    enable: {{ kubeone_features_metricsServer_enable }}
  openidConnect:
      enable: {{ kubeone_openidConnect_enable }}
      config:
        issuerUrl: {{ kubeone_openidConnect_config_issuerUrl }}
        clientId: {{ kubeone_openidConnect_config_clientId }}
        usernameClaim: {{ kubeone_openidConnect_config_usernameClaim }}
        usernamePrefix: "{{ kubeone_openidConnect_config_usernamePrefix }}"
        groupsClaim: {{ kubeone_openidConnect_config_groupsClaim }}
        groupsPrefix: "{{ kubeone_openidConnect_config_config_groupsPrefix }}"
        signingAlgs: {{ kubeone_openidConnect_config_signingAlgs }}
        requiredClaim: {{ kubeone_openidConnect_config_requiredClaim }}
        caFile: {{ kubeone_openidConnect_config_caFile }}
proxy:
  http: {{ kubeone_proxy_http }}
  https: {{ kubeone_proxy_https }}
  noProxy: {{ kubeone_proxy_noProxy }}
machineController:
  deploy: {{ kubeone_machineController_deploy }}
  provider: {{ kubeone_machineController_provider }}
