-
Notifications
You must be signed in to change notification settings - Fork 516
OPNET-782: Render BGP VIP static pods instead of keepalived #6326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mkowalski
wants to merge
4
commits into
openshift:main
Choose a base branch
from
mkowalski:OPNET-595-mco-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
33db6ae
template: render BGP VIP static pods instead of keepalived
mkowalski 53c5ab9
operator: bootstrap and day-2 support for BGP VIP static pods
mkowalski 5d24d83
template: per-family kube-vip instances for dual-stack VIPs
mkowalski 963e35e
template: enable vip_skipdad on the kube-vip static pods
mkowalski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| --- | ||
| kind: Pod | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: frr-k8s | ||
| namespace: openshift-frr-k8s | ||
| labels: | ||
| app: frr-k8s | ||
| spec: | ||
| # hostNetwork: the BGP session must originate from the node IP and the | ||
| # advertised VIP routes live in the host routing table (keepalived parity). | ||
| hostNetwork: true | ||
| shareProcessNamespace: true | ||
| priorityClassName: system-node-critical | ||
| # 10s (not the upstream DaemonSet's 0): a SIGTERM'd bgpd sends a Cease | ||
| # NOTIFICATION, which hard-resets the session; after a SIGKILL a peer in | ||
| # graceful-restart helper mode may retain stale VIP routes on bare TCP | ||
| # loss until the restart timer expires. | ||
| terminationGracePeriodSeconds: 10 | ||
| tolerations: | ||
| - operator: Exists | ||
| initContainers: | ||
| - name: render-config-frr | ||
| image: {{ .Images.BaremetalRuntimeCfgBootstrap }} | ||
| command: | ||
| - /usr/bin/runtimecfg | ||
| - render | ||
| - /etc/kubernetes/kubeconfig | ||
| - --api-vips | ||
| - {{ onPremPlatformAPIServerInternalIP .ControllerConfig }} | ||
| - --ingress-vips | ||
| - {{ onPremPlatformIngressIP .ControllerConfig }} | ||
| - "--cluster-config" | ||
| - "/opt/openshift/manifests/cluster-config.yaml" | ||
| - /config/frr.conf.tmpl | ||
| - --out-dir | ||
| - /etc/frr | ||
| - --peer-file | ||
| - /config/frr-peers.json | ||
| env: | ||
| - name: IS_BOOTSTRAP | ||
| value: "yes" | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| resources: | ||
| requests: | ||
| cpu: 10m | ||
| memory: 50Mi | ||
| limits: | ||
| cpu: 100m | ||
| memory: 128Mi | ||
| terminationMessagePolicy: FallbackToLogsOnError | ||
| volumeMounts: | ||
| - name: resource-dir | ||
| mountPath: /config | ||
| readOnly: true | ||
| - name: frr-conf | ||
| mountPath: /etc/frr | ||
| - name: kubeconfig | ||
| mountPath: /etc/kubernetes | ||
| readOnly: true | ||
| - name: manifests | ||
| mountPath: "/opt/openshift/manifests" | ||
| mountPropagation: HostToContainer | ||
| readOnly: true | ||
| - name: cp-frr-files | ||
| image: {{ .Images.FRRK8sBootstrap }} | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| - | | ||
| set -eu | ||
| cp -f /tmp/frr/daemons /etc/frr/daemons | ||
| cp -f /tmp/frr/vtysh.conf /etc/frr/vtysh.conf | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| securityContext: | ||
| runAsUser: 100 | ||
| runAsGroup: 101 | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| resources: | ||
| requests: | ||
| cpu: 10m | ||
| memory: 20Mi | ||
| limits: | ||
| cpu: 100m | ||
| memory: 128Mi | ||
| terminationMessagePolicy: FallbackToLogsOnError | ||
| volumeMounts: | ||
| - name: frr-startup | ||
| mountPath: /tmp/frr | ||
| readOnly: true | ||
| - name: frr-conf | ||
| mountPath: /etc/frr | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| containers: | ||
| - name: frr | ||
| image: {{ .Images.FRRK8sBootstrap }} | ||
| command: | ||
| - /bin/sh | ||
| - -c | ||
| - /sbin/tini -- /usr/lib/frr/docker-start | ||
| env: | ||
| - name: TINI_SUBREAPER | ||
| value: "true" | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 200Mi | ||
| limits: | ||
| cpu: 500m | ||
| memory: 512Mi | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| # Mirrors the frr container of the frr-k8s DaemonSet shipped by CNO | ||
| # (upstream metallb/frr-k8s parity). No drop ALL: FRR's | ||
| # privilege-separated startup (watchfrr as root spawning daemons as | ||
| # the frr user) additionally relies on root's implicit capabilities | ||
| # (SETUID/SETGID/DAC_OVERRIDE/CHOWN); dropping ALL and re-adding | ||
| # only the network capabilities was tested and prevents the FRR | ||
| # daemons from starting. SYS_ADMIN is required by docker-start/ | ||
| # watchfrr process supervision. | ||
| add: | ||
| - NET_ADMIN | ||
| - NET_RAW | ||
| - SYS_ADMIN | ||
| - NET_BIND_SERVICE | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| terminationMessagePolicy: FallbackToLogsOnError | ||
| volumeMounts: | ||
| - name: frr-sockets | ||
| mountPath: /var/run/frr | ||
| - name: frr-conf | ||
| mountPath: /etc/frr | ||
| - name: frr-lib | ||
| mountPath: /var/lib/frr | ||
| - name: frr-tmp | ||
| mountPath: /var/tmp/frr | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| volumes: | ||
| - name: resource-dir | ||
| hostPath: | ||
| path: /etc/kubernetes/static-pod-resources/frr-k8s | ||
| - name: frr-conf | ||
| emptyDir: {} | ||
| - name: frr-sockets | ||
| emptyDir: {} | ||
| - name: frr-lib | ||
| emptyDir: {} | ||
| - name: frr-tmp | ||
| emptyDir: {} | ||
| - name: frr-startup | ||
| hostPath: | ||
| path: /etc/kubernetes/static-pod-resources/frr-k8s/startup | ||
| - name: kubeconfig | ||
| hostPath: | ||
| path: /etc/kubernetes | ||
| - name: manifests | ||
| hostPath: | ||
| path: "/opt/openshift/manifests" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| kind: Pod | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: kube-vip-api | ||
| namespace: openshift-kube-vip | ||
| labels: | ||
| app: kube-vip | ||
| component: api | ||
| spec: | ||
| hostNetwork: true | ||
| priorityClassName: system-node-critical | ||
| tolerations: | ||
| - operator: Exists | ||
| containers: | ||
| - name: kube-vip | ||
| image: {{ .Images.KubeVIPBootstrap }} | ||
| args: | ||
| - manager | ||
| env: | ||
| - name: address | ||
| value: "{{ onPremPlatformAPIServerInternalIP .ControllerConfig }}" | ||
| - name: k8s_config_file | ||
| value: "/etc/kubernetes/kubeconfig" | ||
| - name: kubernetes_addr | ||
| value: "https://127.0.0.1:6443" | ||
| - name: port | ||
| value: "6443" | ||
| - name: cp_enable | ||
| value: "true" | ||
| - name: vip_leaderelection | ||
| value: "true" | ||
| - name: vip_routingtable | ||
| value: "true" | ||
| - name: vip_cleanroutingtable | ||
| value: "true" | ||
| - name: vip_skipdad | ||
| # health-gated ECMP: every advertiser deliberately holds the VIP | ||
| # (anycast); DAD would blackhole the second and later advertisers | ||
| value: "true" | ||
| - name: vip_routingtableid | ||
| value: "198" | ||
| - name: vip_routingtableprotocol | ||
| value: "248" | ||
| - name: backend_health_check_interval | ||
| value: "5" | ||
| resources: | ||
| requests: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| limits: | ||
| cpu: 200m | ||
| memory: 256Mi | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| add: | ||
| - NET_ADMIN | ||
| - NET_RAW | ||
| volumeMounts: | ||
| - name: kubeconfig | ||
| mountPath: /etc/kubernetes | ||
| readOnly: true | ||
| volumes: | ||
| - name: kubeconfig | ||
| hostPath: | ||
| path: /etc/kubernetes | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| --- | ||
| kind: Pod | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: kube-vip-api-secondary | ||
| namespace: openshift-kube-vip | ||
| labels: | ||
| app: kube-vip | ||
| component: api-secondary | ||
| spec: | ||
| hostNetwork: true | ||
| priorityClassName: system-node-critical | ||
| tolerations: | ||
| - operator: Exists | ||
| containers: | ||
| - name: kube-vip | ||
| image: {{ .Images.KubeVIPBootstrap }} | ||
| args: | ||
| - manager | ||
| env: | ||
| - name: address | ||
| value: "{{ if gt (len (onPremPlatformAPIServerInternalIPs .ControllerConfig)) 1 }}{{ index (onPremPlatformAPIServerInternalIPs .ControllerConfig) 1 }}{{ end }}" | ||
| - name: k8s_config_file | ||
| value: "/etc/kubernetes/kubeconfig" | ||
| - name: kubernetes_addr | ||
| value: "https://127.0.0.1:6443" | ||
| - name: port | ||
| value: "6443" | ||
| - name: cp_enable | ||
| value: "true" | ||
| - name: vip_leaderelection | ||
| value: "true" | ||
| - name: vip_routingtable | ||
| value: "true" | ||
| - name: vip_cleanroutingtable | ||
| value: "true" | ||
| - name: vip_skipdad | ||
| # health-gated ECMP: every advertiser deliberately holds the VIP | ||
| # (anycast); DAD would blackhole the second and later advertisers | ||
| value: "true" | ||
| - name: vip_routingtableid | ||
| value: "198" | ||
| - name: vip_routingtableprotocol | ||
| value: "248" | ||
| - name: backend_health_check_interval | ||
| value: "5" | ||
| resources: | ||
| requests: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
| limits: | ||
| cpu: 200m | ||
| memory: 256Mi | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| add: | ||
| - NET_ADMIN | ||
| - NET_RAW | ||
| volumeMounts: | ||
| - name: kubeconfig | ||
| mountPath: /etc/kubernetes | ||
| readOnly: true | ||
| volumes: | ||
| - name: kubeconfig | ||
| hostPath: | ||
| path: /etc/kubernetes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {{- .ControllerConfig.BGPVIPPeersJSON -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| zebra=yes | ||
| bgpd=yes | ||
| ospfd=no | ||
| ospf6d=no | ||
| ripd=no | ||
| ripngd=no | ||
| isisd=no | ||
| pimd=no | ||
| ldpd=no | ||
| nhrpd=no | ||
| eigrpd=no | ||
| babeld=no | ||
| sharpd=no | ||
| pbrd=no | ||
| bfdd=yes | ||
| fabricd=no | ||
| vrrpd=no | ||
| pathd=no | ||
|
|
||
| vtysh_enable=yes | ||
| zebra_options=" -A 127.0.0.1 -s 90000000" | ||
| bgpd_options=" -A 127.0.0.1" | ||
| bfdd_options=" -A 127.0.0.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| service integrated-vtysh-config |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.