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.

52 lines
2.0 KiB

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: kube-apiserver
  5. spec:
  6. hostNetwork: true
  7. containers:
  8. - name: kube-apiserver
  9. image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
  10. command:
  11. - /hyperkube
  12. - apiserver
  13. - --advertise-address={{ ip | default(ansible_default_ipv4.address) }}
  14. - --etcd-servers={% for srv in groups['etcd'] %}http://{{ hostvars[srv]['access_ip'] | default(hostvars[srv]['ip']|default(hostvars[srv]['ansible_default_ipv4']['address'])) }}:2379{% if not loop.last %},{% endif %}{% endfor %}
  15. - --admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota
  16. - --service-cluster-ip-range={{ kube_service_addresses }}
  17. - --client-ca-file={{ kube_cert_dir }}/ca.pem
  18. - --basic-auth-file={{ kube_users_dir }}/known_users.csv
  19. - --tls-cert-file={{ kube_cert_dir }}/apiserver.pem
  20. - --tls-private-key-file={{ kube_cert_dir }}/apiserver-key.pem
  21. - --service-account-key-file={{ kube_cert_dir }}/apiserver-key.pem
  22. - --secure-port={{ kube_apiserver_port }}
  23. - --insecure-port={{ kube_apiserver_insecure_port }}
  24. {% if kube_api_runtime_config is defined %}
  25. {% for conf in kube_api_runtime_config %}
  26. - --runtime-config={{ conf }}
  27. {% endfor %}
  28. {% endif %}
  29. - --token-auth-file={{ kube_token_dir }}/known_tokens.csv
  30. - --v={{ kube_log_level | default('2') }}
  31. - --allow-privileged=true
  32. ports:
  33. - containerPort: {{ kube_apiserver_port }}
  34. hostPort: {{ kube_apiserver_port }}
  35. name: https
  36. - containerPort: {{ kube_apiserver_insecure_port }}
  37. hostPort: {{ kube_apiserver_insecure_port }}
  38. name: local
  39. volumeMounts:
  40. - mountPath: {{ kube_config_dir }}
  41. name: kubernetes-config
  42. readOnly: true
  43. - mountPath: /etc/ssl/certs
  44. name: ssl-certs-host
  45. readOnly: true
  46. volumes:
  47. - hostPath:
  48. path: {{ kube_config_dir }}
  49. name: kubernetes-config
  50. - hostPath:
  51. path: /etc/ssl/certs/
  52. name: ssl-certs-host