Skip to content

add additional role settings#1685

Merged
Despire merged 8 commits intomasterfrom
feat/role-settings
Mar 12, 2025
Merged

add additional role settings#1685
Despire merged 8 commits intomasterfrom
feat/role-settings

Conversation

@Despire
Copy link
Copy Markdown
Contributor

@Despire Despire commented Mar 11, 2025

Closes #1683

Adds additional settings for the role:
proxyProtocol - the role will use the proxy protocol for any forwarded traffic
stickySessions - the traffic will be forwarded to the same node based on the hash of the source ip.

stream{
{{- range $role := .Roles }}
upstream {{ $role.Role.Name }}{
{{- if $role.Role.Settings.StickySessions }}
hash $remote_addr consistent;
{{- end }}
{{- range $node := $role.TargetNodes}}
server {{$node.Private}}:{{$role.Role.TargetPort}} max_fails=3 fail_timeout=10s;
{{- end}}
}
server {
listen {{ $role.Role.Port }};
proxy_pass {{ $role.Role.Name}};
proxy_next_upstream on;
{{- if $role.Role.Settings.ProxyProtocol }}
{{- if ne $role.Role.Port 6443 }}
proxy_protocol on;
{{- end }}
{{- end }}
}
{{- end }}
}

The lb role will now have the following structure

  loadBalancers:
    roles:
      - name: example-role
        protocol: tcp
        port: 6443
        targetPort: 6443
        targetPools:
          - htz-kube-nodes
        # added
        settings:
          proxyProtocol: off (default will be on)
          stickySession: on. (default will be off)

@Despire Despire added the test-set-ordinary Will select ordinary test-sets that tests the general functionally of building/modifying clusters label Mar 11, 2025
@Despire Despire added the test-set-rolling-update Will select rolling-update related test sets label Mar 11, 2025
@Despire Despire added this pull request to the merge queue Mar 12, 2025
Merged via the queue into master with commit 5beeeb3 Mar 12, 2025
@Despire Despire deleted the feat/role-settings branch March 12, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-set-ordinary Will select ordinary test-sets that tests the general functionally of building/modifying clusters test-set-rolling-update Will select rolling-update related test sets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Custom LoadBalancer config

2 participants