Open XionZhao opened 5 years ago
You need to mount a ConfigMap over the HAProxy template(!). But you'd need to do some trickery with subPath as the HAProxy template is not in a directory of its own. As a consequence changes to the ConfigMap after start of the container won't be reflected in it because a bind mount is used to implement the subPath feature. Define a volume like this:
- name: haproxy-tmpl
configMap:
name: kube-apiserver-vip-haproxy-tmp
defaultMode: 0422
And reference it like this in the kube-keepalived-d/keepalived container definition:
- name: haproxy-tmpl
mountPath: /haproxy.tmpl
subPath: haproxy.tmpl
readOnly: true
The key name in the ConfigMap needs to be haproxy.tmpl
.
You could also derive a new image and replace /haproxy.tmpl
with a new a file or a symlink to a separate directory where you then mount the ConfigMap.
The above method is available and is currently in effect in my environment, thank you 👍
I want to add a configuration to haproxy.cfg The
I created a configmap of haproxy. CFG, but it was not successful. May I ask how to operate it if I want to increase the configuration of haproxy
kube-keepalived-vip-configmap configuration