Comments (2)
Hi @Bilal-io PRs are always welcomed, mostly because PRs that solve users' issues are always good examples of how to improve the code. In the specific case of the external interface mac +1 from my side, to do this you should add these steps:
1- An additional dict variable like:
mac: 52:54:00:10:57:05 (note that 52:54:00: is always required in libvirt)
2- Add the mac variable to the eth1 interface in all the supported distros like:
--network bridge={{ kubeinit_libvirt_external_service_interface.attached }},mac={{ kubeinit_libvirt_external_service_interface.mac }},model=virtio \
In:
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/roles/kubeinit_libvirt/tasks/10_rke_deploy_nodes.yml#L131
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/roles/kubeinit_libvirt/tasks/10_k8s_deploy_nodes.yml#L133
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/roles/kubeinit_libvirt/tasks/10_okd_deploy_service_nodes.yml#L128
3- The last step should be updating the interface template with an extra parameter like:
MACADDR={{ kubeinit_libvirt_external_service_interface.mac }}
With these steps you should be able to add a fixed mac address to this external interface.
Once you have this, a nice improvement can be to extract the IP's information from the libvirt role and put it in each env inventory, if you notice the variables here:
attached: "{{ kubeinit_inventory_network_bridge_external }}"
dev: eth1
ip: 10.19.41.157
gateway: 10.19.41.254
netmask: 255.255.255.0
Should be something like:
attached: "{{ kubeinit_inventory_network_bridge_external }}"
dev: "{{ kubeinit_inventory_network_bridge_external_dev }}"
ip: "{{ kubeinit_inventory_network_bridge_external_ip }}"
gateway: "{{ kubeinit_inventory_network_bridge_external_gateway }}"
netmask: "{{ kubeinit_inventory_network_bridge_external_netmask }}"
mac: "{{ kubeinit_inventory_network_bridge_external_mac }}"
And they should be defined in:
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/hosts/cdk/inventory#L16
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/hosts/k8s/inventory#L16
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/hosts/okd/inventory#L16
https://github.com/Kubeinit/kubeinit/blob/master/kubeinit/hosts/rke/inventory#L16
Like:
kubeinit_inventory_network_bridge_external_dev=eth1
kubeinit_inventory_network_bridge_external_ip=10.19.41.157
kubeinit_inventory_network_bridge_external_gateway=10.19.41.254
kubeinit_inventory_network_bridge_external_netmask=255.255.255.0
kubeinit_inventory_network_bridge_external_mac=52:54:00:10:57:05
The reasoning for this refactor is to have all the network details specified in the same place (the inventory for each distro).
I hope this is enough info :) and thanks for raising this issue.
Also, take into account the commit syntax check, you can add a single commit like:
feat: add fixed mac address to the external interface
This patch adds support for adding a fixed mac
address to the external interface in the service node.
Feel free to push a PR whenever you have some time and I'll review it for sure. Thanks!
from kubeinit.
You pretty much did all the work in that comment, so thank you!
from kubeinit.
Related Issues (20)
- Customization for openSUSE Leap 15.3 HOT 9
- OKD cluster failed to deploy - "container already in use" error is seen in bootstrap HOT 7
- How to create additional interfaces on compute nodes HOT 2
- Execute commands in worker nodes HOT 1
- FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_host'"} HOT 4
- DNS forwarding fails for private registry lookup HOT 1
- Kubic is dead for Ubuntu 20.04 HOT 2
- How to access the Web Console once the cluster is deployed? HOT 3
- CentOS Stream 9 guests not booting HOT 6
- Periodic jobs historic data results HOT 2500
- Pull Secret in OCP Cluster HOT 5
- Not having packages for aarch64
- ssh key generated as okdcluster_id_rsa, but playbook needs kubeinit_id_rsa HOT 5
- Might be useful to check/warn for obsolete/deprecated oci-systemd-hook HOT 1
- okdcluster-provision container fails due to updated python3-pyOpenSSL/cryptography, with load_pkcs7_data TypeError HOT 4
- Assign ipv6 address for guest vms HOT 2
- Periodic jobs historic data results HOT 2500
- Openshift VM becomes unreachable after reboot HOT 1
- Periodic jobs historic data results HOT 2500
- Kubeinit 20.04 repository is currently broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubeinit.