|
| 1 | +apiVersion: kubeadm.k8s.io/v1beta3 |
| 2 | +bootstrapTokens: |
| 3 | +- groups: |
| 4 | + - system:bootstrappers:kubeadm:default-node-token |
| 5 | + token: <%= @token %> |
| 6 | + ttl: <%= @ttl_duration %> |
| 7 | + usages: |
| 8 | + - signing |
| 9 | + - authentication |
| 10 | +kind: InitConfiguration |
| 11 | +localAPIEndpoint: |
| 12 | + advertiseAddress: <%= @kube_api_advertise_address %> |
| 13 | + bindPort: <%= @kube_api_bind_port %> |
| 14 | +nodeRegistration: |
| 15 | + name: <%= @node_name %> |
| 16 | + <%- if @container_runtime == "cri_containerd" -%> |
| 17 | + criSocket: unix:///run/containerd/containerd.sock |
| 18 | + <%- end -%> |
| 19 | + taints: |
| 20 | + - effect: NoSchedule |
| 21 | + key: node-role.kubernetes.io/master |
| 22 | + kubeletExtraArgs: |
| 23 | + cgroup-driver: <%= @cgroup_driver %> |
| 24 | + <%- if @cloud_provider -%> |
| 25 | + cloud-provider: <%= @cloud_provider %> |
| 26 | + <%- end -%> |
| 27 | + <%- if @cloud_config -%> |
| 28 | + cloud-config: <%= @cloud_config %> |
| 29 | + <%- end -%> |
| 30 | + <%- @kubelet_extra_arguments.each do |arg| -%> |
| 31 | + <%= arg %> |
| 32 | + <%- end -%> |
| 33 | +<% if @skip_phases -%> |
| 34 | +skipPhases: |
| 35 | +<% @skip_phases.split(',').each do |skip_phase| -%> |
| 36 | +- <%= skip_phase %> |
| 37 | +<% end -%> |
| 38 | +<% end -%> |
| 39 | +--- |
| 40 | +apiServer: |
| 41 | + timeoutForControlPlane: 4m0s |
| 42 | +<%- if @apiserver_cert_extra_sans -%> |
| 43 | + certSANs: |
| 44 | + <%- @apiserver_cert_extra_sans.each do |san| -%> |
| 45 | + - <%= san %> |
| 46 | + <%- end -%> |
| 47 | +<%- end -%> |
| 48 | +<%- if @apiserver_merged_extra_arguments -%> |
| 49 | + extraArgs: |
| 50 | + <%- @apiserver_merged_extra_arguments.each do |arg| -%> |
| 51 | + <%= arg %> |
| 52 | + <%- end -%> |
| 53 | +<%- end -%> |
| 54 | +<%- if @apiserver_merged_extra_volumes -%> |
| 55 | + extraVolumes: |
| 56 | + <%- @apiserver_merged_extra_volumes.each do |name, config| -%> |
| 57 | + - name: <%= name %> |
| 58 | + hostPath: <%= config['hostPath'] %> |
| 59 | + mountPath: <%= config['mountPath'] %> |
| 60 | + readOnly: <%= config['readOnly'] %> |
| 61 | + pathType: <%= config['pathType'] %> |
| 62 | + <%- end -%> |
| 63 | +<%- end -%> |
| 64 | +apiVersion: kubeadm.k8s.io/v1beta3 |
| 65 | +certificatesDir: /etc/kubernetes/pki |
| 66 | +<%- if @kubernetes_cluster_name != "kubernetes" -%> |
| 67 | +clusterName: <%= @kubernetes_cluster_name %> |
| 68 | +<%- end -%> |
| 69 | +controlPlaneEndpoint: "<%= @controller_address %>" |
| 70 | +controllerManager: |
| 71 | +<%- if @controllermanager_merged_extra_arguments -%> |
| 72 | + extraArgs: |
| 73 | + <%- @controllermanager_merged_extra_arguments.each do |arg| -%> |
| 74 | + <%= arg %> |
| 75 | + <%- end -%> |
| 76 | +<%- end -%> |
| 77 | +<%- if @controllermanager_merged_extra_volumes -%> |
| 78 | + extraVolumes: |
| 79 | + <%- @controllermanager_merged_extra_volumes.each do |name, config| -%> |
| 80 | + - name: <%= name %> |
| 81 | + hostPath: <%= config['hostPath'] %> |
| 82 | + mountPath: <%= config['mountPath'] %> |
| 83 | + readOnly: <%= config['readOnly'] %> |
| 84 | + pathType: <%= config['pathType'] %> |
| 85 | + <%- end -%> |
| 86 | +<%- end -%> |
| 87 | +scheduler: |
| 88 | +<%- if @scheduler_merged_extra_arguments -%> |
| 89 | + extraArgs: |
| 90 | + <%- @scheduler_merged_extra_arguments.each do |arg| -%> |
| 91 | + <%= arg %> |
| 92 | + <%- end -%> |
| 93 | +<%- end -%> |
| 94 | +etcd: |
| 95 | + external: |
| 96 | + caFile: /etc/kubernetes/pki/etcd/ca.crt |
| 97 | + certFile: /etc/kubernetes/pki/etcd/client.crt |
| 98 | + endpoints: |
| 99 | +<% @etcd_peers.each do |peer| -%> |
| 100 | + - https://<%= peer %>:2379 |
| 101 | +<% end -%> |
| 102 | + keyFile: /etc/kubernetes/pki/etcd/client.key |
| 103 | +imageRepository: <%= @image_repository %> |
| 104 | +<% unless @feature_gates.empty? -%> |
| 105 | +featureGates: |
| 106 | +<% @feature_gates.each_pair do |key,value| -%> |
| 107 | + <%= key %>: <%= value %> |
| 108 | +<% end -%> |
| 109 | +<% end -%> |
| 110 | +kind: ClusterConfiguration |
| 111 | +kubernetesVersion: v<%= @kubernetes_version %> |
| 112 | +networking: |
| 113 | + dnsDomain: <%= @dns_domain %> |
| 114 | + podSubnet: <%= @cni_pod_cidr %> |
| 115 | + serviceSubnet: <%= @service_cidr %> |
| 116 | +<%- if @kubeadm_extra_config -%> |
| 117 | +<%= @kubeadm_extra_config_yaml %> |
| 118 | +<%- end -%> |
| 119 | +--- |
| 120 | +apiVersion: kubeproxy.config.k8s.io/v1alpha1 |
| 121 | +bindAddress: 0.0.0.0 |
| 122 | +clientConnection: |
| 123 | + acceptContentTypes: "" |
| 124 | + burst: 10 |
| 125 | + contentType: application/vnd.kubernetes.protobuf |
| 126 | + kubeconfig: /var/lib/kube-proxy/kubeconfig.conf |
| 127 | + qps: 5 |
| 128 | +clusterCIDR: <%= @cni_pod_cidr %> |
| 129 | +configSyncPeriod: 15m0s |
| 130 | +conntrack: |
| 131 | + maxPerCore: <%= @conntrack_max_per_core %> |
| 132 | + min: <%= @conntrack_min %> |
| 133 | + tcpCloseWaitTimeout: <%= @conntrack_tcp_wait_timeout %> |
| 134 | + tcpEstablishedTimeout: <%= @conntrack_tcp_stablished_timeout %> |
| 135 | +enableProfiling: false |
| 136 | +healthzBindAddress: 0.0.0.0:10256 |
| 137 | +hostnameOverride: "" |
| 138 | +iptables: |
| 139 | + masqueradeAll: false |
| 140 | + masqueradeBit: 14 |
| 141 | + minSyncPeriod: 0s |
| 142 | + syncPeriod: 30s |
| 143 | +ipvs: |
| 144 | + excludeCIDRs: null |
| 145 | + minSyncPeriod: 0s |
| 146 | + scheduler: "" |
| 147 | + syncPeriod: 30s |
| 148 | +kind: KubeProxyConfiguration |
| 149 | +metricsBindAddress: <%= @metrics_bind_address %>:10249 |
| 150 | +mode: "<%= @proxy_mode %>" |
| 151 | +nodePortAddresses: null |
| 152 | +oomScoreAdj: -999 |
| 153 | +portRange: "" |
| 154 | +udpIdleTimeout: 250ms |
0 commit comments