Skip to content
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

Deployment of version 0.7.0 failed on-prem (spec.hostname) #1336

Closed
rafzei opened this issue Jun 4, 2020 · 1 comment
Closed

Deployment of version 0.7.0 failed on-prem (spec.hostname) #1336

rafzei opened this issue Jun 4, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@rafzei
Copy link
Contributor

rafzei commented Jun 4, 2020

Error:
{"asctime": "15:08:36", "levelname": "INFO", "name": "cli.engine.ansible.AnsibleCommand", "message": "fatal: [master]: FAILED! => {\"attempts\": 30, \"changed\": false, \"cmd\": \"kubectl wait --for=condition=Ready pods -l app=flannel --field-selector=spec.nodeName=$(hostname --long) -n kube-system --timeout=10s\", \"delta\": \"0:00:00.096575\", \"end\": \"2020-06-03 11:08:36.416725\", \"msg\": \"non-zero return code\", \"rc\": 1, \"start\": \"2020-06-03 11:08:36.320150\", \"stderr\": \"error: no matching resources found\", \"stderr_lines\": [\"error: no matching resources found\"], \"stdout\": \"\", \"stdout_lines\": []}"} {"asctime": "15:08:36", "levelname": "INFO", "name": "cli.engine.ansible.AnsibleCommand", "message": ""}

Environment:
This issue appeared only on-prem. Tested on CentOS7.8 so far.

Problem:
If spec.hostname in manifest is different than on target VM, deployment will fail. Epicli set only transient hostname.

---
kind: infrastructure/machine
provider: any
name: default-k8s-master
specification:
  hostname: master
  ip: 192.168.100.101
[centos@master ~]$ hostnamectl status                                                                                                                  
   Static hostname: localhost.localdomain
Transient hostname: master
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 25d20838a8a8f747b140a5174222adf7
           Boot ID: e164b8e2196d4f3bbc3f4fc4629bdeeb
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1127.el7.x86_64
      Architecture: x86-64

Deployment uses:
kubectl wait --for=condition=Ready pods -l {{ selectors[network_plugin] }} --field-selector=spec.nodeName=$(hostname --long) -n kube-system --timeout=10s
hostname --long return transtient hostname but k8s components uses static one:

[centos@master ~]$ kubectl get node                        
NAME                    STATUS   ROLES    AGE     VERSION
localhost.localdomain   Ready    master   6h27m   v1.17.4
[centos@master ~]$ kubectl get pods -n kube-system -o yaml | grep -n nodeName
85:    nodeName: localhost.localdomain
240:    nodeName: localhost.localdomain
382:    nodeName: localhost.localdomain
527:    nodeName: localhost.localdomain
670:    nodeName: localhost.localdomain
836:    nodeName: localhost.localdomain
978:            fieldPath: spec.nodeName
1001:    nodeName: localhost.localdomain
1150:    nodeName: localhost.localdomain
@rafzei rafzei added the type/bug label Jun 4, 2020
@rafzei rafzei added this to the S20200729 milestone Jul 23, 2020
@sk4zuzu sk4zuzu self-assigned this Jul 27, 2020
@toszo toszo modified the milestones: S20200729, S20200813 Jul 30, 2020
@mkyc mkyc modified the milestones: S20200813, S20200729 Jul 30, 2020
@przemyslavic przemyslavic self-assigned this Jul 31, 2020
@przemyslavic
Copy link
Collaborator

After the fix, the hostname is set correctly as configured in the yaml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants