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
1.9 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. - --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 %}
  14. - --admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota
  15. - --service-cluster-ip-range={{ kube_service_addresses }}
  16. - --client-ca-file={{ kube_cert_dir }}/ca.pem
  17. - --basic-auth-file={{ kube_users_dir }}/known_users.csv
  18. - --tls-cert-file={{ kube_cert_dir }}/apiserver.pem
  19. - --tls-private-key-file={{ kube_cert_dir }}/apiserver-key.pem
  20. - --service-account-key-file={{ kube_cert_dir }}/apiserver-key.pem
  21. - --secure-port={{ kube_apiserver_port }}
  22. - --insecure-port={{ kube_apiserver_insecure_port }}
  23. {% if kube_api_runtime_config is defined %}
  24. {% for conf in kube_api_runtime_config %}
  25. - --runtime-config={{ conf }}
  26. {% endfor %}
  27. {% endif %}
  28. - --token-auth-file={{ kube_token_dir }}/known_tokens.csv
  29. - --v={{ kube_log_level | default('2') }}
  30. - --allow-privileged=true
  31. ports:
  32. - containerPort: {{ kube_apiserver_port }}
  33. hostPort: {{ kube_apiserver_port }}
  34. name: https
  35. - containerPort: {{ kube_apiserver_insecure_port }}
  36. hostPort: {{ kube_apiserver_insecure_port }}
  37. name: local
  38. volumeMounts:
  39. - mountPath: {{ kube_config_dir }}
  40. name: kubernetes-config
  41. readOnly: true
  42. - mountPath: /etc/ssl/certs
  43. name: ssl-certs-host
  44. readOnly: true
  45. volumes:
  46. - hostPath:
  47. path: {{ kube_config_dir }}
  48. name: kubernetes-config
  49. - hostPath:
  50. path: /usr/share/ca-certificates
  51. name: ssl-certs-host