mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-27 03:03:10 +01:00
Compare commits
4 Commits
dfe4b8ac8f
...
e9abd4d1d9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9abd4d1d9 | ||
|
|
53b2154124 | ||
|
|
5dcfb06c23 | ||
|
|
03ae8de0d5 |
2
.github/workflows/cache.yml
vendored
2
.github/workflows/cache.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the codebase
|
- name: Check out the codebase
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the codebase
|
- name: Check out the codebase
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
|
||||||
- name: Ensure SHA pinned actions
|
- name: Ensure SHA pinned actions
|
||||||
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@0901cf7b71c7ea6261ec69a3dc2bd3f9264f893e # 3.0.12
|
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@0901cf7b71c7ea6261ec69a3dc2bd3f9264f893e # 3.0.12
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the codebase
|
- name: Check out the codebase
|
||||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ cilium_bgp: false
|
|||||||
cilium_exportPodCIDR: true # noqa var-naming
|
cilium_exportPodCIDR: true # noqa var-naming
|
||||||
cilium_bgp_my_asn: 64513
|
cilium_bgp_my_asn: 64513
|
||||||
cilium_bgp_peer_asn: 64512
|
cilium_bgp_peer_asn: 64512
|
||||||
|
cilium_bgp_neighbors: []
|
||||||
|
cilium_bgp_neighbors_groups: ['k3s_all']
|
||||||
cilium_bgp_lb_cidr: 192.168.31.0/24
|
cilium_bgp_lb_cidr: 192.168.31.0/24
|
||||||
cilium_hubble: true
|
cilium_hubble: true
|
||||||
cilium_mode: native
|
cilium_mode: native
|
||||||
|
|||||||
@@ -66,6 +66,14 @@ argument_specs:
|
|||||||
description: BGP peer address
|
description: BGP peer address
|
||||||
default: ~
|
default: ~
|
||||||
|
|
||||||
|
cilium_bgp_neighbors:
|
||||||
|
description: List of BGP peer ASN & address pairs
|
||||||
|
default: []
|
||||||
|
|
||||||
|
cilium_bgp_neighbors_groups:
|
||||||
|
description: Inventory group in which to search for additional cilium_bgp_neighbors parameters to merge.
|
||||||
|
default: ['k3s_all']
|
||||||
|
|
||||||
cilium_bgp_lb_cidr:
|
cilium_bgp_lb_cidr:
|
||||||
description: BGP load balancer IP range
|
description: BGP load balancer IP range
|
||||||
default: 192.168.31.0/24
|
default: 192.168.31.0/24
|
||||||
|
|||||||
@@ -221,6 +221,11 @@
|
|||||||
- name: Configure Cilium BGP
|
- name: Configure Cilium BGP
|
||||||
when: cilium_bgp
|
when: cilium_bgp
|
||||||
block:
|
block:
|
||||||
|
- name: Set _cilium_bgp_neighbors fact
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
_cilium_bgp_neighbors: "{{ lookup('community.general.merge_variables', '^cilium_bgp_neighbors__.+$', initial_value=cilium_bgp_neighbors, groups=cilium_bgp_neighbors_groups) }}" # yamllint disable-line rule:line-length
|
||||||
|
when: cilium_bgp_neighbors | length > 0
|
||||||
|
|
||||||
- name: Copy BGP manifests to first master
|
- name: Copy BGP manifests to first master
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: cilium.crs.j2
|
src: cilium.crs.j2
|
||||||
|
|||||||
@@ -7,6 +7,19 @@ spec: # CiliumBGPPeeringPolicySpec
|
|||||||
- localASN: {{ cilium_bgp_my_asn }}
|
- localASN: {{ cilium_bgp_my_asn }}
|
||||||
exportPodCIDR: {{ cilium_exportPodCIDR | default('true') }}
|
exportPodCIDR: {{ cilium_exportPodCIDR | default('true') }}
|
||||||
neighbors: # []CiliumBGPNeighbor
|
neighbors: # []CiliumBGPNeighbor
|
||||||
|
{% if _cilium_bgp_neighbors | length > 0 %}
|
||||||
|
{% for item in _cilium_bgp_neighbors %}
|
||||||
|
- peerAddress: '{{ item.peer_address + "/32"}}'
|
||||||
|
peerASN: {{ item.peer_asn }}
|
||||||
|
eBGPMultihopTTL: 10
|
||||||
|
connectRetryTimeSeconds: 120
|
||||||
|
holdTimeSeconds: 90
|
||||||
|
keepAliveTimeSeconds: 30
|
||||||
|
gracefulRestart:
|
||||||
|
enabled: true
|
||||||
|
restartTimeSeconds: 120
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
- peerAddress: '{{ cilium_bgp_peer_address + "/32"}}'
|
- peerAddress: '{{ cilium_bgp_peer_address + "/32"}}'
|
||||||
peerASN: {{ cilium_bgp_peer_asn }}
|
peerASN: {{ cilium_bgp_peer_asn }}
|
||||||
eBGPMultihopTTL: 10
|
eBGPMultihopTTL: 10
|
||||||
@@ -16,6 +29,7 @@ spec: # CiliumBGPPeeringPolicySpec
|
|||||||
gracefulRestart:
|
gracefulRestart:
|
||||||
enabled: true
|
enabled: true
|
||||||
restartTimeSeconds: 120
|
restartTimeSeconds: 120
|
||||||
|
{% endif %}
|
||||||
serviceSelector:
|
serviceSelector:
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
- {key: somekey, operator: NotIn, values: ['never-used-value']}
|
- {key: somekey, operator: NotIn, values: ['never-used-value']}
|
||||||
|
|||||||
Reference in New Issue
Block a user