2023-01-31 16:24:55 +08:00
|
|
|
# Inspired by https://github.com/kube-vip/kube-vip/blob/v0.5.8/pkg/kubevip/config_generator.go#L13
|
2022-04-08 01:37:57 +08:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Pod
|
|
|
|
metadata:
|
|
|
|
creationTimestamp: null
|
|
|
|
name: kube-vip
|
|
|
|
namespace: kube-system
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- args:
|
|
|
|
- manager
|
|
|
|
env:
|
|
|
|
- name: vip_arp
|
|
|
|
value: {{ kube_vip_arp_enabled | string | to_json }}
|
|
|
|
- name: port
|
2022-10-24 09:00:24 +08:00
|
|
|
value: {{ kube_apiserver_port | string | to_json }}
|
2022-05-18 14:48:55 +08:00
|
|
|
{% if kube_vip_interface %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: vip_interface
|
2022-05-18 14:48:55 +08:00
|
|
|
value: {{ kube_vip_interface | string | to_json }}
|
|
|
|
{% endif %}
|
|
|
|
{% if kube_vip_services_interface %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: vip_servicesinterface
|
|
|
|
value: {{ kube_vip_services_interface | string | to_json }}
|
2022-05-18 14:48:55 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_vip_cidr %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: vip_cidr
|
|
|
|
value: {{ kube_vip_cidr | string | to_json }}
|
2022-05-18 14:48:55 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_vip_controlplane_enabled %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: cp_enable
|
|
|
|
value: "true"
|
|
|
|
- name: cp_namespace
|
|
|
|
value: kube-system
|
|
|
|
- name: vip_ddns
|
|
|
|
value: {{ kube_vip_ddns_enabled | string | to_json }}
|
2022-05-18 14:48:55 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_vip_services_enabled %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: svc_enable
|
|
|
|
value: "true"
|
2022-05-18 14:48:55 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_vip_leader_election_enabled %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: vip_leaderelection
|
|
|
|
value: "true"
|
|
|
|
- name: vip_leaseduration
|
|
|
|
value: "5"
|
|
|
|
- name: vip_renewdeadline
|
|
|
|
value: "3"
|
|
|
|
- name: vip_retryperiod
|
|
|
|
value: "1"
|
2022-05-18 14:48:55 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if kube_vip_bgp_enabled %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: bgp_enable
|
|
|
|
value: "true"
|
|
|
|
- name: bgp_routerid
|
|
|
|
value: {{ kube_vip_bgp_routerid | string | to_json }}
|
|
|
|
- name: bgp_as
|
|
|
|
value: {{ kube_vip_local_as | string | to_json }}
|
|
|
|
- name: bgp_peeraddress
|
|
|
|
value: {{ kube_vip_bgp_peeraddress | to_json }}
|
|
|
|
- name: bgp_peerpass
|
|
|
|
value: {{ kube_vip_bgp_peerpass | to_json }}
|
|
|
|
- name: bgp_peeras
|
2022-10-24 09:00:24 +08:00
|
|
|
value: {{ kube_vip_bgp_peeras | string | to_json }}
|
2022-05-18 14:48:55 +08:00
|
|
|
{% if kube_vip_bgppeers %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: bgp_peers
|
2022-10-24 09:00:24 +08:00
|
|
|
value: {{ kube_vip_bgppeers | join(',') | to_json }}
|
2022-05-18 14:48:55 +08:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2022-04-08 01:37:57 +08:00
|
|
|
- name: address
|
|
|
|
value: {{ kube_vip_address | to_json }}
|
2023-01-03 10:35:33 +08:00
|
|
|
{% if kube_vip_enableServicesElection %}
|
|
|
|
- name: enableServicesElection
|
|
|
|
value: "true"
|
|
|
|
{% endif %}
|
2022-04-08 01:37:57 +08:00
|
|
|
image: {{ kube_vip_image_repo }}:{{ kube_vip_image_tag }}
|
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
|
|
name: kube-vip
|
|
|
|
resources: {}
|
|
|
|
securityContext:
|
|
|
|
capabilities:
|
|
|
|
add:
|
|
|
|
- NET_ADMIN
|
|
|
|
- NET_RAW
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /etc/kubernetes/admin.conf
|
|
|
|
name: kubeconfig
|
|
|
|
hostAliases:
|
|
|
|
- hostnames:
|
|
|
|
- kubernetes
|
|
|
|
ip: 127.0.0.1
|
|
|
|
hostNetwork: true
|
|
|
|
volumes:
|
|
|
|
- hostPath:
|
|
|
|
path: /etc/kubernetes/admin.conf
|
|
|
|
name: kubeconfig
|
|
|
|
status: {}
|
|
|
|
|