sayems / lxc.resources Goto Github PK
View Code? Open in Web Editor NEWLXC/LXD Tutorial
License: GNU General Public License v3.0
LXC/LXD Tutorial
License: GNU General Public License v3.0
I followed all instructions:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
$ ansible-playbook playbook.yml
TASK [Initializing the Kubernetes cluster] *************************************
task path: /home/maroci/Workspace/clusterk8s/lxc.resources/playbook.yml:31
redirecting (type: connection) ansible.builtin.lxd to community.general.lxd
ESTABLISH LXD CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp
"&& mkdir "echo /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773
" && echo ansible-tmp-1635276399.5168507-65370-106172082959773="echo /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773
" ) && sleep 0'
PUT /home/maroci/Workspace/clusterk8s/lxc.resources/scripts/k8s.sh TO /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773/k8s.sh
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773/ /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773/k8s.sh && sleep 0'
EXEC /bin/sh -c ' /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773/k8s.sh && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1635276399.5168507-65370-106172082959773/ > /dev/null 2>&1 && sleep 0'
redirecting (type: connection) ansible.builtin.lxd to community.general.lxd
ESTABLISH LXD CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
changed: [localhost -> k8s-master] => (item=k8s-master) => {
"ansible_loop_var": "item",
"changed": true,
"item": "k8s-master",
"rc": 0,
"stderr": "mkdir: cannot create directory '/root/.kube': File exists\ntimed out waiting for the condition\nTo see the stack trace of this error execute with --v=5 or higher\n",
"stderr_lines": [
"mkdir: cannot create directory '/root/.kube': File exists",
"timed out waiting for the condition",
"To see the stack trace of this error execute with --v=5 or higher"
],
"stdout": "[TASK 1] Install docker container engine\n[TASK 2] Enable and start docker service\n[TASK 3] Add yum repo file for kubernetes\n[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)\n[TASK 5] Enable and start kubelet service\n[TASK 6] Install and configure ssh\n[TASK 7] Set root password\n[TASK 8] Install additional packages\n[TASK 9] Initialize Kubernetes Cluster\n[TASK 10] Copy kube admin config to root user .kube directory\n[TASK 11] Deploy flannel network\n[TASK 12] Generate and save cluster join command to /joincluster.sh\n",
"stdout_lines": [
"[TASK 1] Install docker container engine",
"[TASK 2] Enable and start docker service",
"[TASK 3] Add yum repo file for kubernetes",
"[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)",
"[TASK 5] Enable and start kubelet service",
"[TASK 6] Install and configure ssh",
"[TASK 7] Set root password",
"[TASK 8] Install additional packages",
"[TASK 9] Initialize Kubernetes Cluster",
"[TASK 10] Copy kube admin config to root user .kube directory",
"[TASK 11] Deploy flannel network",
"[TASK 12] Generate and save cluster join command to /joincluster.sh"
]
}
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp
"&& mkdir "echo /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454
" && echo ansible-tmp-1635276527.665844-65370-250134256780454="echo /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454
" ) && sleep 0'
PUT /home/maroci/Workspace/clusterk8s/lxc.resources/scripts/k8s.sh TO /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454/k8s.sh
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454/ /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454/k8s.sh && sleep 0'
EXEC /bin/sh -c ' /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454/k8s.sh && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1635276527.665844-65370-250134256780454/ > /dev/null 2>&1 && sleep 0'
redirecting (type: connection) ansible.builtin.lxd to community.general.lxd
The full traceback is:
NoneType: None
failed: [localhost -> k8s-node-1] (item=k8s-node-1) => {
"ansible_loop_var": "item",
"changed": true,
"item": "k8s-node-1",
"msg": "non-zero return code",
"rc": 127,
"stderr": "",
"stderr_lines": [],
"stdout": "[TASK 1] Install docker container engine\n[TASK 2] Enable and start docker service\n[TASK 3] Add yum repo file for kubernetes\n[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)\n[TASK 5] Enable and start kubelet service\n[TASK 6] Install and configure ssh\n[TASK 7] Set root password\n[TASK 8] Install additional packages\n[TASK 9] Join node to Kubernetes Cluster\n",
"stdout_lines": [
"[TASK 1] Install docker container engine",
"[TASK 2] Enable and start docker service",
"[TASK 3] Add yum repo file for kubernetes",
"[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)",
"[TASK 5] Enable and start kubelet service",
"[TASK 6] Install and configure ssh",
"[TASK 7] Set root password",
"[TASK 8] Install additional packages",
"[TASK 9] Join node to Kubernetes Cluster"
]
}
ESTABLISH LXD CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp
"&& mkdir "echo /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294
" && echo ansible-tmp-1635276544.4413297-65370-136146627739294="echo /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294
" ) && sleep 0'
PUT /home/maroci/Workspace/clusterk8s/lxc.resources/scripts/k8s.sh TO /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294/k8s.sh
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294/ /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294/k8s.sh && sleep 0'
EXEC /bin/sh -c ' /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294/k8s.sh && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1635276544.4413297-65370-136146627739294/ > /dev/null 2>&1 && sleep 0'
redirecting (type: connection) ansible.builtin.lxd to community.general.lxd
ESTABLISH LXD CONNECTION FOR USER: root
The full traceback is:
NoneType: None
EXEC /bin/sh -c 'echo ~root && sleep 0'
failed: [localhost -> k8s-node-2] (item=k8s-node-2) => {
"ansible_loop_var": "item",
"changed": true,
"item": "k8s-node-2",
"msg": "non-zero return code",
"rc": 127,
"stderr": "",
"stderr_lines": [],
"stdout": "[TASK 1] Install docker container engine\n[TASK 2] Enable and start docker service\n[TASK 3] Add yum repo file for kubernetes\n[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)\n[TASK 5] Enable and start kubelet service\n[TASK 6] Install and configure ssh\n[TASK 7] Set root password\n[TASK 8] Install additional packages\n[TASK 9] Join node to Kubernetes Cluster\n",
"stdout_lines": [
"[TASK 1] Install docker container engine",
"[TASK 2] Enable and start docker service",
"[TASK 3] Add yum repo file for kubernetes",
"[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)",
"[TASK 5] Enable and start kubelet service",
"[TASK 6] Install and configure ssh",
"[TASK 7] Set root password",
"[TASK 8] Install additional packages",
"[TASK 9] Join node to Kubernetes Cluster"
]
}
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp
"&& mkdir "echo /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062
" && echo ansible-tmp-1635276560.5819032-65370-222723061203062="echo /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062
" ) && sleep 0'
PUT /home/maroci/Workspace/clusterk8s/lxc.resources/scripts/k8s.sh TO /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062/k8s.sh
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062/ /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062/k8s.sh && sleep 0'
EXEC /bin/sh -c ' /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062/k8s.sh && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1635276560.5819032-65370-222723061203062/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
NoneType: None
failed: [localhost -> k8s-node-3] (item=k8s-node-3) => {
"ansible_loop_var": "item",
"changed": true,
"item": "k8s-node-3",
"msg": "non-zero return code",
"rc": 127,
"stderr": "",
"stderr_lines": [],
"stdout": "[TASK 1] Install docker container engine\n[TASK 2] Enable and start docker service\n[TASK 3] Add yum repo file for kubernetes\n[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)\n[TASK 5] Enable and start kubelet service\n[TASK 6] Install and configure ssh\n[TASK 7] Set root password\n[TASK 8] Install additional packages\n[TASK 9] Join node to Kubernetes Cluster\n",
"stdout_lines": [
"[TASK 1] Install docker container engine",
"[TASK 2] Enable and start docker service",
"[TASK 3] Add yum repo file for kubernetes",
"[TASK 4] Install Kubernetes (kubeadm, kubelet and kubectl)",
"[TASK 5] Enable and start kubelet service",
"[TASK 6] Install and configure ssh",
"[TASK 7] Set root password",
"[TASK 8] Install additional packages",
"[TASK 9] Join node to Kubernetes Cluster"
]
}
The instances are up:
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------------+---------+----------------------+------+-----------+-----------+
| k8s-master | RUNNING | 172.17.0.1 (docker0) | | CONTAINER | 0 |
| | | 10.254.34.181 (eth0) | | | |
+------------+---------+----------------------+------+-----------+-----------+
| k8s-node-1 | RUNNING | 172.17.0.1 (docker0) | | CONTAINER | 0 |
| | | 10.254.34.40 (eth0) | | | |
+------------+---------+----------------------+------+-----------+-----------+
| k8s-node-2 | RUNNING | 172.17.0.1 (docker0) | | CONTAINER | 0 |
| | | 10.254.34.133 (eth0) | | | |
+------------+---------+----------------------+------+-----------+-----------+
| k8s-node-3 | RUNNING | 172.17.0.1 (docker0) | | CONTAINER | 0 |
| | | 10.254.34.99 (eth0) | | |
kubectl get nodes -o wide:
Unable to connect to the server: dial tcp 10.254.34.182:6443: connect: no route to hos
t
however, the ip address is different:
ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:b3:3a:3e:87 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
7: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:92:18:ff brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet x.x.x.181/24 brd 10.254.34.255 scope global dynamic eth0
valid_lft 3506sec preferred_lft 3506sec
inet6 fe80::216:3eff:fe92:18ff/64 scope link
valid_lft forever preferred_lft forever
Can you help me understand what I did wrong, please?
Thank you
In the future Stephane Graber has mentioned on the linuxcontainers.org LXD forum that the SNAP version of LXD will become the only version for Ubuntu.
He said that an apt-get version or repository version for other distro's could be built using source by other maintainers but that the LXD team will be focusing only on the SNAP version in the future since it can be installed on many distro's without adding a lot of additional work onto the core LXD development team.
https://discuss.linuxcontainers.org/t/lxd-snap-call-for-testing/446
Why a snap?
The snap packaging format lets us as the upstream publish a tested, blessed build of LXD and anything that it needs which can be used on a wide range of Linux distributions.This makes it easy to get the exact same experience regardless of Linux distribution and greatly simplifies support on our end as we can reproduce bit for bit any installation.
**Moving forward, we will be phasing out our Ubuntu PPAs and then our backports to older Ubuntu releases. Both of those use cases will be transitioned over to the snap.
This will significantly reduce the amount of time we have to spend on building and testing all of those packages and the machinery used to publish them.**
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.