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.

81 lines
2.9 KiB

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: kube-apiserver
  5. namespace: {{system_namespace}}
  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. {% if kube_api_anonymous_auth is defined and kube_version | version_compare('v1.5', '>=') %}
  53. - --anonymous-auth={{ kube_api_anonymous_auth }}
  54. {% endif %}
  55. livenessProbe:
  56. httpGet:
  57. host: 127.0.0.1
  58. path: /healthz
  59. port: 8080
  60. initialDelaySeconds: 30
  61. timeoutSeconds: 10
  62. volumeMounts:
  63. - mountPath: {{ kube_config_dir }}
  64. name: kubernetes-config
  65. readOnly: true
  66. - mountPath: /etc/ssl/certs
  67. name: ssl-certs-host
  68. readOnly: true
  69. - mountPath: {{ etcd_cert_dir }}
  70. name: etcd-certs
  71. readOnly: true
  72. volumes:
  73. - hostPath:
  74. path: {{ kube_config_dir }}
  75. name: kubernetes-config
  76. - hostPath:
  77. path: /etc/ssl/certs/
  78. name: ssl-certs-host
  79. - hostPath:
  80. path: {{ etcd_cert_dir }}
  81. name: etcd-certs