Comments (6)
I have verified that all nodes have the same certificate-authority-data
in their /root/.kube/config
.
from ansible-role-kubernetes.
A shot in the dark, but I added a full package update and reboot to see if that solved the issue. It was unsuccessful.
---
- hosts: kube
become: true
handlers:
- name: reboot
reboot:
pre_tasks:
# adding to see if updating all packages will resolve the issue of
# Configure Flannel networking task failing on worker nodes.
- name: update all packages # noqa 403
apt:
name: '*'
state: latest
update_cache: true
notify: reboot
# ensure handlers are flushed before moving on to geerlingguys roles.
- name: flush handlers
meta: flush_handlers
# Geerlingguy's roles per Ansible for Kubernetes page 77 (2021Sep30).
roles:
- geerlingguy.security
- geerlingguy.docker
- geerlingguy.swap
- geerlingguy.kubernetes
from ansible-role-kubernetes.
I'm thinking maybe this issue should be in https://github.com/geerlingguy/ansible-for-kubernetes?
from ansible-role-kubernetes.
I ran an ansible ad-hoc command to get all of the /etc/kubernetes/admin.conf
files from my nodes so I could inspect them all on my local machine:
ansible -m fetch -a "src=/etc/kubernetes/admin.conf dest=/tmp/fetch" -i inventory/hosts.yml all -b
I did a diff across all the files and saw that I was mistaken. The certificate-authority-data
was different across the board. As a quick test I copied the certificate-authority-data
from my master node's admin.conf
on my local to my second node's admin.conf
on my local and then pushed that file back out to node02. I sshed to node02 and switched to the root user. Then just a kubectl get nodes
and boom, no certificate errors. However, I did get an error about not being a logged in user.
root@node05:~# kubectl get nodes
error: You must be logged in to the server (Unauthorized)
from ansible-role-kubernetes.
Replaced all worker nodes with the exact same /etc/kubernetes/admin.conf
I fetched to my local from node01 one with a quick script:
#!/bin/bash
for i in 2 3 4 5
do
ansible -m copy -a "src=/tmp/fetch/node01/etc/kubernetest/admin.conf dest=/etc/kubernetes/admin.conf" -i inventory/hosts.yml all -b --limit node0$1
done
Then ran the playbook again and was met with a completed execution but still only seeing node01 when I check on all the nodes:
root@node01:~# kubectl get nodes
NAME STATUS ROLES AGE VERSION
node01.test.local Ready <none> 45h v1.20.11
from ansible-role-kubernetes.
I completely missed the kubernetes_role
in the inventory on page 74 of Ansible for Kubernetes. I delete and redeployed my nodes in my test environment. I modified my inventory like so:
all:
children:
kube:
children:
kubemaster:
kubeworker:
kubemaster:
hosts:
node01:
kubeworker:
hosts:
node0[2:5]:
inventory/group_vars/kubemaster.yml
---
# Kubernetes master configuration.
kubernetes_role: master
inventory/group_vars/kubeworker.yml
---
# Kubernetes worker configuration.
kubernetes_role: node
I reran the playbook and logged back in node one and I could see all of the worker nodes in the cluster! 🎉
root@node01:~# kubectl get nodes
NAME STATUS ROLES AGE VERSION
node01.test.local Ready control-plane,master 60s v1.20.11
node02.test.local Ready <none> 32s v1.20.11
node03.test.local Ready <none> 33s v1.20.11
node04.test.local Ready <none> 33s v1.20.11
node05.test.local Ready <none> 31s v1.20.11
Sorry for the confusion and opening up a ticket unnecessarily. Thanks for all the work you do!
from ansible-role-kubernetes.
Related Issues (20)
- Issue with apt update cache adding repo HOT 2
- Add Suse Enterprise Linux support? HOT 2
- Can't install any K8s version other than 1.20
- No kubeconfig in ~/.kube HOT 5
- Execution issue with kubernetes version HOT 5
- Role failing on play "Configure Calico networking" HOT 3
- Fail to install on fresh OS HOT 11
- Upgrade to new kubernetes versions HOT 3
- APT ignores version pinning on Ubuntu HOT 4
- CI Currently broken - kubelet won't start in GitHub Actions HOT 18
- Support JoinConfiguration HOT 2
- kube-flannel-rbac.yml not found HOT 3
- Put a hold on packages HOT 2
- Could not find the requested service kubelet: host HOT 2
- User "system:anonymous" cannot get resource "configmaps" in API group HOT 4
- `kubernetes-join-command` not delegated to any host except master HOT 6
- Ubuntu 22.04 needs to Forward IPv4 and letting iptables see bridged traffic HOT 4
- memory, br_netfilter and iptables issues when installing on 2023-05-03 Raspbian 64-bit HOT 4
- Changes to the location of Linux packages for Kubernetes 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 ansible-role-kubernetes.