apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ kolla_kubernetes.cli.args.resource_name }}
  namespace: {{ kolla_kubernetes_namespace }}
data:
  keepalived.conf: |
    vrrp_instance kolla_internal_vip_{{ keepalived_virtual_router_id|default(51) }} {
        state MASTER
        nopreempt
        interface {{ api_interface }}
        virtual_router_id {{ keepalived_virtual_router_id|default(51) }}
        priority 1
        advert_int 1
        virtual_ipaddress {
            {{ kolla_kubernetes_external_vip }} dev {{ api_interface }}
        }
        authentication {
            auth_type PASS
            auth_pass {{ keepalived_password }}
        }
    }
  config.json: |
    {
        "command": "/usr/sbin/keepalived -nld -p /run/keepalived.pid",
        "config_files": [
            {
                "source": "/var/lib/kolla/config_files/keepalived.conf",
                "dest": "/etc/keepalived/keepalived.conf",
                "owner": "root",
                "perm": "0644"
            }
        ]
    }
