2020-02-18 20:47:28 +08:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: cloud-controller-manager
|
|
|
|
namespace: kube-system
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: openstack-cloud-controller-manager
|
|
|
|
namespace: kube-system
|
|
|
|
labels:
|
|
|
|
k8s-app: openstack-cloud-controller-manager
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: openstack-cloud-controller-manager
|
|
|
|
updateStrategy:
|
|
|
|
type: RollingUpdate
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: openstack-cloud-controller-manager
|
|
|
|
spec:
|
|
|
|
nodeSelector:
|
2021-01-22 00:13:03 +08:00
|
|
|
node-role.kubernetes.io/control-plane: ""
|
2020-02-18 20:47:28 +08:00
|
|
|
securityContext:
|
2021-03-24 02:03:37 +08:00
|
|
|
runAsUser: 999
|
2020-02-18 20:47:28 +08:00
|
|
|
tolerations:
|
|
|
|
- key: node.cloudprovider.kubernetes.io/uninitialized
|
|
|
|
value: "true"
|
|
|
|
effect: NoSchedule
|
2021-01-22 00:13:03 +08:00
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
effect: NoSchedule
|
2020-02-18 20:47:28 +08:00
|
|
|
serviceAccountName: cloud-controller-manager
|
|
|
|
containers:
|
|
|
|
- name: openstack-cloud-controller-manager
|
|
|
|
image: {{ docker_image_repo }}/k8scloudprovider/openstack-cloud-controller-manager:{{ external_openstack_cloud_controller_image_tag }}
|
|
|
|
args:
|
|
|
|
- /bin/openstack-cloud-controller-manager
|
|
|
|
- --v=1
|
|
|
|
- --cloud-config=$(CLOUD_CONFIG)
|
|
|
|
- --cloud-provider=openstack
|
2020-12-18 00:23:09 +08:00
|
|
|
- --cluster-name={{ cluster_name }}
|
2020-02-18 20:47:28 +08:00
|
|
|
- --use-service-account-credentials=true
|
2023-04-05 06:57:40 +08:00
|
|
|
- --bind-address={{ external_openstack_cloud_controller_bind_address }}
|
2020-10-03 01:14:48 +08:00
|
|
|
{% for key, value in external_openstack_cloud_controller_extra_args.items() %}
|
|
|
|
- "{{ '--' + key + '=' + value }}"
|
|
|
|
{% endfor %}
|
2020-02-18 20:47:28 +08:00
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /etc/kubernetes/pki
|
|
|
|
name: k8s-certs
|
|
|
|
readOnly: true
|
|
|
|
- mountPath: /etc/ssl/certs
|
|
|
|
name: ca-certs
|
|
|
|
readOnly: true
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if ssl_ca_dirs | length %}
|
2023-05-29 10:43:42 +08:00
|
|
|
{% for dir in ssl_ca_dirs %}
|
|
|
|
- name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
|
|
|
|
mountPath: {{ dir }}
|
|
|
|
readOnly: true
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2021-05-26 15:35:21 +08:00
|
|
|
- mountPath: /etc/config/cloud.conf
|
2020-02-18 20:47:28 +08:00
|
|
|
name: cloud-config-volume
|
|
|
|
readOnly: true
|
2021-05-26 15:35:21 +08:00
|
|
|
subPath: cloud.conf
|
2020-02-18 20:47:28 +08:00
|
|
|
- mountPath: {{ kube_config_dir }}/external-openstack-cacert.pem
|
2021-05-26 15:35:21 +08:00
|
|
|
name: cloud-config-volume
|
2020-02-18 20:47:28 +08:00
|
|
|
readOnly: true
|
2021-05-26 15:35:21 +08:00
|
|
|
subPath: ca.cert
|
2020-09-11 15:34:14 +08:00
|
|
|
{% if kubelet_flexvolumes_plugins_dir is defined %}
|
2020-02-18 20:47:28 +08:00
|
|
|
- mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
|
|
|
|
name: flexvolume-dir
|
2020-09-11 15:34:14 +08:00
|
|
|
{% endif %}
|
2020-02-18 20:47:28 +08:00
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
cpu: 200m
|
|
|
|
env:
|
|
|
|
- name: CLOUD_CONFIG
|
|
|
|
value: /etc/config/cloud.conf
|
|
|
|
hostNetwork: true
|
2023-12-05 09:52:17 +08:00
|
|
|
dnsPolicy: ClusterFirstWithHostNet
|
2020-02-18 20:47:28 +08:00
|
|
|
volumes:
|
2020-09-11 15:34:14 +08:00
|
|
|
{% if kubelet_flexvolumes_plugins_dir is defined %}
|
2023-05-29 10:43:42 +08:00
|
|
|
- name: flexvolume-dir
|
|
|
|
hostPath:
|
2020-08-04 20:28:35 +08:00
|
|
|
path: "{{ kubelet_flexvolumes_plugins_dir }}"
|
2020-02-18 20:47:28 +08:00
|
|
|
type: DirectoryOrCreate
|
2020-09-11 15:34:14 +08:00
|
|
|
{% endif %}
|
2023-05-29 10:43:42 +08:00
|
|
|
- name: k8s-certs
|
|
|
|
hostPath:
|
2020-02-18 20:47:28 +08:00
|
|
|
path: /etc/kubernetes/pki
|
|
|
|
type: DirectoryOrCreate
|
2023-05-29 10:43:42 +08:00
|
|
|
- name: ca-certs
|
|
|
|
hostPath:
|
2020-02-18 20:47:28 +08:00
|
|
|
path: /etc/ssl/certs
|
|
|
|
type: DirectoryOrCreate
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if ssl_ca_dirs | length %}
|
2023-05-29 10:43:42 +08:00
|
|
|
{% for dir in ssl_ca_dirs %}
|
|
|
|
- name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
|
|
|
|
hostPath:
|
|
|
|
path: {{ dir }}
|
|
|
|
type: DirectoryOrCreate
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-02-18 20:47:28 +08:00
|
|
|
- name: cloud-config-volume
|
|
|
|
secret:
|
|
|
|
secretName: external-openstack-cloud-config
|