cluster-autoscaler.j2 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. apiVersion: extensions/v1beta1
  3. kind: Deployment
  4. metadata:
  5. labels:
  6. app: {{ openshift_cluster_autoscaler_name }}
  7. name: {{ openshift_cluster_autoscaler_name }}
  8. namespace: {{ openshift_cluster_autoscaler_namespace }}
  9. spec:
  10. replicas: 1
  11. selector:
  12. matchLabels:
  13. app: {{ openshift_cluster_autoscaler_name }}
  14. role: infra
  15. template:
  16. metadata:
  17. labels:
  18. app: {{ openshift_cluster_autoscaler_name }}
  19. role: infra
  20. spec:
  21. containers:
  22. - args:
  23. - --alsologtostderr
  24. - --v={{ openshift_cluster_autoscaler_version }}
  25. - --skip-nodes-with-local-storage={{ openshift_cluster_autoscaler_skip_nodes_local_storage }}
  26. - --leader-elect-resource-lock=configmaps
  27. - --namespace={{ openshift_cluster_autoscaler_namespace }}
  28. {% if openshift_cluster_autoscaler_scale_down_delay is defined %}
  29. - --scale-down-delay={{ openshift_cluster_autoscaler_scale_down_delay }}
  30. {% endif %}
  31. - --cloud-provider={{ openshift_cluster_autoscaler_cloud_provider }}
  32. {% for group in openshift_cluster_autoscaler_node_groups %}
  33. - --nodes={{ group.min }}:{{ group.max }}:{{ group.name }}
  34. {% endfor %}
  35. {% if openshift_cluster_autoscaler_cloud_provider == 'aws' %}
  36. env: {{ openshift_cluster_autoscaler_aws_env_vars | union(openshift_cluster_autoscaler_env_vars) | to_json }}
  37. {% else %}
  38. env: {{ openshift_cluster_autoscaler_env_vars }}
  39. {% endif %}
  40. image: {{ openshift_cluster_autoscaler_image }}
  41. name: autoscaler
  42. {% if openshift_cluster_autoscaler_cloud_provider == 'aws' %}
  43. volumeMounts:
  44. - mountPath: {{ openshift_cluster_autoscaler_aws_creds_path | dirname }}
  45. name: {{ openshift_cluster_autoscaler_aws_creds_name }}
  46. readOnly: true
  47. {% endif %}
  48. nodeSelector: {{ openshift_cluster_autoscaler_node_selector | to_json }}
  49. dnsPolicy: ClusterFirst
  50. serviceAccountName: {{ openshift_cluster_autoscaler_serviceaccount }}
  51. terminationGracePeriodSeconds: 30
  52. {% if openshift_cluster_autoscaler_cloud_provider == 'aws' %}
  53. volumes:
  54. - name: {{ openshift_cluster_autoscaler_aws_creds_name }}
  55. secret:
  56. defaultMode: 420
  57. secretName: {{ openshift_cluster_autoscaler_aws_secret_name }}
  58. {% endif %}