travisghansen / kubernetes-pfsense-controller

Integrate Kubernetes and pfSense
Apache License 2.0
197 stars 22 forks source link

Unable to set bool parameters in haproxy-declarative #13

Closed duckblaster closed 3 years ago

duckblaster commented 3 years ago

I am trying to enable sll and sslcheck for a backend node created by haproxy-declarative, but am unable to get it to actually set the xml values correctly. I have tried setting the values as:

None of which work, the only one that doesn't result in an empty value in the xml was 1, but that was still not read as a yes.

haproxy-declarative config:

resources:
  - type: backend
    definition:
      name: metallb-nginx-ingress-https
      monitor_uri: /healthz
    ha_servers:
      # declare dynamic nodes by using the backing service
      - type: node-service
        # serviceNamespace: optional, uses namespace of the ConfigMap by default
        # service must be type NodePort or LoadBalancer
        serviceNamespace: ingress-nginx
        serviceName: metallb-nginx-ingress
        servicePort: 443
        definition:
          name: metallb-nginx-ingress-https
          status: active
          ssl: true
          checkssl: true

Resulting xml:

<item>
    <name>metallb-nginx-ingress-https</name>
    <monitor_uri>/healthz</monitor_uri>
    <ha_servers>
        <item>
            <name>metallb-nginx-ingress</name>
            <status>active</status>
            <ssl></ssl>
            <checkssl></checkssl>
            <address>10.1.2.0</address>
            <port>443</port>
        </item>
    </ha_servers>
</item>

Expected xml (confirmed by selecting the checkboxes in the GUI and saving):

<item>
    <name>metallb-nginx-ingress-https</name>
    <monitor_uri>/healthz</monitor_uri>
    <ha_servers>
        <item>
            <name>metallb-nginx-ingress</name>
            <status>active</status>
            <ssl>yes</ssl>
            <checkssl>yes</checkssl>
            <address>10.1.2.0</address>
            <port>443</port>
        </item>
    </ha_servers>
</item>

GUI: image

travisghansen commented 3 years ago

It's a nuance of yaml trying to be overly smart with boolean values. Try setting the value(s) to "yes" instead of yes.

duckblaster commented 3 years ago

That fixed it, thanks!