cni:
  kube_proxy: |
    {{ .kubernetes.kube_proxy.enabled | default true }}
  # apiVersion for policy may be changed for difference kubernetes version. https://kube-api.ninja
  api_version_policy: |
    {{- if .kube_version | semverCompare "<v1.21" }}
    policy/v1beta1
    {{- else }}
    policy/v1
    {{- end }}
  kube_network_plugin: |
    {{ .kubernetes.kube_network_plugin | default "calico" }}
  # ip cidr config.
  # dual stack. support ipv4/ipv6
  ipv6_support: |
    {{- if gt ( .kubernetes.networking.pod_cidr | default "10.233.64.0/18" | splitList "," | len) 1 }}
    true
    {{- else }}
    false
    {{- end }}
  kube_pods_v4_cidr: |
    {{ .kubernetes.networking.pod_cidr | default "10.233.64.0/18" | splitList "," | first }}
  kube_pods_v6_cidr: |
    {{- if .cni.ipv6_support }}
    {{ .kubernetes.networking.pod_cidr | splitList "," | last }}
    {{- end }}
  node_cidr_mask_size: |
    {{ .kubernetes.controller_manager.kube_network_node_prefix | default 24 }}
  kube_svc_cidr: |
    {{ .kubernetes.networking.service_cidr | default "10.233.0.0/18" }}
  multus:
    enabled: false
    image: |
      {{ .dockerio_registry }}/kubesphere/multus-cni:v3.8
  calico:
    # when cluster node > 50. it default true.
    typha: |
      {{- if gt (.groups.k8s_cluster | default list | len) 50 }}
      true
      {{- else }}
      false
      {{- end }}
    veth_mtu: 0
    ipip_mode: Always
    vxlan_mode: Never
    # true is enabled
    ipv4pool_nat_outgoing: true
    # true is enabled
    default_ip_pool: true
    # image
    cni_image: |
      {{ .dockerio_registry }}/calico/cni:{{ .calico_version }}
    node_image: |
      {{ .dockerio_registry }}/calico/node:{{ .calico_version }}
    kube_controller_image: |
      {{ .dockerio_registry }}/calico/kube-controllers:{{ .calico_version }}
    typha_image: |
      {{ .dockerio_registry }}/calico/typha:{{ .calico_version }}
    replicas: 1
    node_selector: {}
  flannel:
    # https://github.com/flannel-io/flannel/blob/master/Documentation/backends.md
    backend: vxlan
    cni_plugin_image: |
      {{ .dockerio_registry }}/flannel/flannel-cni-plugin:v1.4.0-flannel1
    flannel_image: |
      {{ .dockerio_registry }}/flannel/flannel:{{ .flannel_version }}
  cilium:
    # image repo
    cilium_repository: |
      {{ .quayio_registry }}/cilium/cilium
    certgen_repository: |
      {{ .quayio_registry }}/cilium/certgen
    hubble_relay_repository: |
      {{ .quayio_registry }}/cilium/hubble-relay
    hubble_ui_backend_repository: |
      {{ .quayio_registry }}/cilium/hubble-ui-backend
    hubble_ui_repository: |
      {{ .quayio_registry }}/cilium/hubble-ui
    cilium_envoy_repository: |
      {{ .quayio_registry }}/cilium/cilium-envoy
    cilium_etcd_operator_repository: |
      {{ .quayio_registry }}/cilium/cilium-etcd-operator
    operator_repository: |
      {{ .quayio_registry }}/cilium/operator
    startup_script_repository: |
      {{ .quayio_registry }}/cilium/startup-script
    clustermesh_apiserver_repository: |
      {{ .quayio_registry }}/cilium/clustermesh-apiserver
    busybox_repository: |
      {{ .dockerio_registry }}/library/busybox
    spire_agent_repository: |
      {{ .ghcrio_registry }}/spiffe/spire-agent
    spire_server_repository: |
      {{ .ghcrio_registry }}/spiffe/spire-server
    k8s_endpoint: |
      {{- if and .kubernetes.control_plane_endpoint (ne .kubernetes.control_plane_endpoint "") }}
      {{ .kubernetes.control_plane_endpoint }}
      {{- else }}
      {{ .groups.kube_control_plane | default list | first }}
      {{- end }}
    operator_replicas: |
      1
    k8s_port: |
      {{ .kubernetes.apiserver.port | default 6443 }}
  kubeovn:
    replica: 1
    registry: |
      {{ .dockerio_registry }}/kubeovn
  hybridnet:
    registry: |
      {{ .dockerio_registry }}
#    hybridnet_image: hybridnetdev/hybridnet
#    hybridnet_tag: v0.8.8
