You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.7 KiB

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: kube-apiserver
  5. namespace: kube-system
  6. labels:
  7. k8s-app: kube-apiserver
  8. spec:
  9. hostNetwork: true
  10. containers:
  11. - name: kube-apiserver
  12. image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
  13. imagePullPolicy: {{ k8s_image_pull_policy }}
  14. command:
  15. - /hyperkube
  16. - apiserver
  17. - --advertise-address={{ ip | default(ansible_default_ipv4.address) }}
  18. - --etcd-servers={{ etcd_access_endpoint }}
  19. - --etcd-quorum-read=true
  20. - --etcd-cafile={{ etcd_cert_dir }}/ca.pem
  21. - --etcd-certfile={{ etcd_cert_dir }}/node.pem
  22. - --etcd-keyfile={{ etcd_cert_dir }}/node-key.pem
  23. - --insecure-bind-address={{ kube_apiserver_insecure_bind_address }}
  24. - --apiserver-count={{ kube_apiserver_count }}
  25. - --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota
  26. - --service-cluster-ip-range={{ kube_service_addresses }}
  27. - --service-node-port-range={{ kube_apiserver_node_port_range }}
  28. - --client-ca-file={{ kube_cert_dir }}/ca.pem
  29. - --basic-auth-file={{ kube_users_dir }}/known_users.csv
  30. - --tls-cert-file={{ kube_cert_dir }}/apiserver.pem
  31. - --tls-private-key-file={{ kube_cert_dir }}/apiserver-key.pem
  32. - --token-auth-file={{ kube_token_dir }}/known_tokens.csv
  33. - --service-account-key-file={{ kube_cert_dir }}/apiserver-key.pem
  34. - --secure-port={{ kube_apiserver_port }}
  35. - --insecure-port={{ kube_apiserver_insecure_port }}
  36. {% if kube_api_runtime_config is defined %}
  37. {% for conf in kube_api_runtime_config %}
  38. - --runtime-config={{ conf }}
  39. {% endfor %}
  40. {% endif %}
  41. {% if enable_network_policy is defined and enable_network_policy == True %}
  42. - --runtime-config=extensions/v1beta1/networkpolicies=true
  43. {% endif %}
  44. - --v={{ kube_log_level }}
  45. - --allow-privileged=true
  46. {% if cloud_provider is defined and cloud_provider in ["openstack", "azure"] %}
  47. - --cloud-provider={{ cloud_provider }}
  48. - --cloud-config={{ kube_config_dir }}/cloud_config
  49. {% elif cloud_provider is defined and cloud_provider == "aws" %}
  50. - --cloud-provider={{ cloud_provider }}
  51. {% endif %}
  52. livenessProbe:
  53. httpGet:
  54. host: 127.0.0.1
  55. path: /healthz
  56. port: 8080
  57. initialDelaySeconds: 30
  58. timeoutSeconds: 10
  59. volumeMounts:
  60. - mountPath: {{ kube_config_dir }}
  61. name: kubernetes-config
  62. readOnly: true
  63. - mountPath: /etc/ssl/certs
  64. name: ssl-certs-host
  65. readOnly: true
  66. - mountPath: {{ etcd_cert_dir }}
  67. name: etcd-certs
  68. readOnly: true
  69. volumes:
  70. - hostPath:
  71. path: {{ kube_config_dir }}
  72. name: kubernetes-config
  73. - hostPath:
  74. path: /etc/ssl/certs/
  75. name: ssl-certs-host
  76. - hostPath:
  77. path: {{ etcd_cert_dir }}
  78. name: etcd-certs