Installing kubernetes on localhost using LXD - kubernetes

I am trying to install kubernetes on localhost using LXD but facing issue. I am using conjure-up for this but on proceeding localhost option is not highlighted stating that LXD not found.
[Error]
I have installed LXD as per commands given. Do I need to provide path somewhere so that conjure-up finds the path or is there some other issue?

This worked for me:
sudo apt install snapd
sudo snap install lxd
sudo snap install conjure-up --classic
sudo lxd init --auto
/snap/bin/lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
conjure-up kubernetes

Edit: I had to sudo apt purge lxd first
Then
sudo apt upgrade
After installing lxd as suggested on conjure
sudo snap install lxd
/snap/bin/lxd init
Disabled IPV6 with the wizard
And then conjure-up
Don't forget to logout and login after adding the user to the group
(I actually did a reboot)

You'll also need to create an LXD "dir" storage. Else no pods will launch correctly. This is a known issue with conjure-up. You can specify this when you run lxd init.
https://docs.conjure-up.io/stable/en/spellbooks/kubernetes#limitations

Related

Cinder Db Sync Timeout Error in OpenStack Installation

I am trying to install OpenStack on CentOS 7 using PackStack. The commands I am using for installation are:
sudo systemctl disable NetworkManager
sudo systemctl stop NetworkManager
sudo systemctl disable firewalld
sudo systemctl stop firewalld
sudo systemctl enable network
sudo systemctl start network
sudo yum update -y
sudo yum install centos-release-openstack-train
sudo yum install -y openstack-packstack
After this I am editing Neutron Db Sync timeout form 300 to 900, by using the command:
sudo nano /usr/share/openstack-puppet/modules/neutron/manifests/db/sync.pp
The last command I am using for installation is
sudo packstack --allinone
All installation goes well, but in the end getting the following error:
ERROR : Error appeared during Puppet run: 10.0.2.15_controller.pp
Error: /Stage[main]/Cinder::Db::Sync/Exec[cinder-manage db_sync]: Failed to call refresh: Command exceeded timeout
You will find full trace in log /var/tmp/packstack/20210527-145513-WSj_DO/manifests/10.0.2.15_controller.pp.log
Please check log file /var/tmp/packstack/20210527-145513-WSj_DO/openstack-setup.log for more information
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20210527-145514.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
The content of /var/tmp/packstack/20210527-145513-WSj_DO/manifests/10.0.2.15_controller.pp.log is uploaded here:
The content of /var/tmp/packstack/20210527-145513-WSj_DO/openstack-setup is uploaded here
Can someone help me out to resolve this error? Thanks in advance.

Unable to bootstrap (cloud type: localhost) - Error when installing Kuberneters cluster locally with LXD/Conjure-up

Using Ubuntu 18.04.
I am trying to install a kubernetes cluster on my local machine (localhost) using this guide (LXD + conjure-up kubernetes):
https://kubernetes.io/docs/getting-started-guides/ubuntu/local/#before-you-begin
When I run:
conjure-up kubernetes
I select the following installation:
and select localhost for "Choose a cloud" and use the defaults for the rest of the install wizard. It then starts to install and after 30-40 minutes it completes with this error:
Here is the log:
https://pastebin.com/raw/re1UvrUU
Where one error says:
2018-07-25 20:09:38,125 [ERROR] conjure-up/canonical-kubernetes - events.py:161 - Unhandled exception in <Task finished coro=<BaseBootstrapController.run() done, defined at /snap/conjure-up/1015/lib/python3.6/site-packages/conjureup/controllers/juju/bootstrap/common.py:15> exception=BootstrapError('Unable to bootstrap (cloud type: localhost)',)>
but that does not really help much.
Any suggestion to why the install wizard/conjure-up fails?
Also based on this post:
https://github.com/conjure-up/conjure-up/issues/1308
I have tried to first disable firewall:
sudo ufw disable
and then re-run installation/conjure install wizard. But I get the same error.
Some more details on how I installed and configured LXD/conjure-up below:
$ snap install lxd
lxd 3.2 from 'canonical' installed
$ /snap/bin/lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, ceph, dir, lvm) [default=btrfs]:
Create a new BTRFS pool? (yes/no) [default=yes]:
Would you like to use an existing block device? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=26GB]:
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
Would you like LXD to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
Configured group membership:
sudo usermod -a -G lxd $USER
newgrp lxd
Next installed:
sudo snap install conjure-up --classic
And then ran installation:
conjure-up kubernetes
I wasn't able to reproduce your exact problem but i got conjure-up + lxd installed and in the end Kubernetes on my newly installed VirtualBox Ubuntu 18.04 (Desktop) VM. Hopefully this answer could help you somehow!
I looked through the kubernetes.io documentation page and that one lacked tiny bits of information, it does mention lxd but not the part with lxd init which i assume you picked up in the conjure-up user manual.
So with that said, i followed the conjure-up user manual with some minor changes on the way. I'm assuming that it's OK for you to use the edge version of conjure-up, i started off with the stable one but changed to edge when testing different combinations.
Also please ensure that you have the recommended resources available stated by the user manual, conjure-up and the Canoncial Distribution of Kubernetes launches a number of containers for you. You might not need 3 x etcd, 3 x worker nodes and 2 x Master, and if you don't just tune the number of containers down in the conjure-up wizard.
These are the steps i performed (as my local user):
Make sure your Ubuntu box are updated: sudo apt update && sudo apt upgrade
Install conjure-up by running: sudo snap install conjure-up --classic --edge
Install lxd by running: sudo snap install lxd
With lxd comes the client part which is lxc, if you run e.g. lxc list you should get an empty table (no containers started yet). I got an permission error at this time, i ran the following: sudo chown -R lxd:lxd /var/snap/lxd/ to change owner and group of the lxd directory containing the socket you'll be communicating with using lxc.
Add your user to the lxdgroup: sudo usermod -a -G lxd $USER && newgrp lxd, log off and on to make this permanent and not only active in your current shell.
Now create a lxd bridge manually with the following command: lxc network create lxdbr1 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
Now let's run the init part of lxd with lxd init. Remember to answer no when being asked to create a new local network bridge?, in the next prompt provide your newly created network bridge instead (lxdbr1). The rest of the answers to the questions can be left as default.
Now continue with running conjure-up kubernetes and choose localhost as your type. For me the localhost choice was greyed out from the beginning, it worked when i created the network bridge manually and not via the lxd init step.
Skip the additional components you can install like Rancher, Prometheus etc.
Choose your new network bridge and the default storage pool, proceed to the next step.
In the next step customize your Kubernetes cluster if needed and then hit Deploy. And now you wait!
You can always troubleshoot and list all containers created with the lxc tool. If you've ever used Docker the lxc tool feels a lot like the docker client.
And finally some thoughts and observations, there's a lot of moving parts to conjure-up as you might have seen. It's actually described as: conjure-up is a thin layer spanning a few different underlying technologies - Juju, MAAS and LXD.
For reference, i ended up having the following versions installed:
lxd version 3.3
conjure-up version 2.6.1

OpenStack: Keystone and nova-network inactive after reboot

After Installing RDO (OpenStack Packstack) on CentOS 7.2 (7.2.1511) I always end up with following:
Once OpenStack is successfully installed I can use OpenStack as intended.
Even that openstack-status returns:
..
openstack-nova-network: inactive (disabled on boot)
openstack-keystone: inactive (disabled on boot)
mysqld: inactive (disabled on boot)
.. (and some more)
After a reboot of the system I cannot access Keystone anymore (since it's disabled on boot) but also if I try to start the service manually with:
service openstack-nova-network restart
or all services with
openstack-service start
end in a timeout. So basically - once I've reboot the VM where I installed OpenStack I cannot use OpenStack anymore..
I installed with following commands:
sudo -i
systemctl disable NetworkManager firewalld
systemctl enable network
vi /etc/selinux/config
SELINUX=permissive
sync;reboot
vi /etc/enviroment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
yum install -y centos-release-openstack-mitaka
yum update -y
yum install -y openstack-packstack
packstack --allinone
I had the some issue with openstack mitaka on centos 7 and this solved the issue:
systemctl restart httpd.service
Since those services are disabled, they will not start when rebooted. You first need to enable the service and then start it. Refer to this.
systemctl enable openstack-keystone.service
systemctl start openstack-keystone.service

Cannot use commands 'postgres' or 'pg_ctl'

I am on Unix. I have got postgresql-9.3 installed.
When I want to start the server using pg_ctl or postgres, the terminal gives me:
The program 'postgres' is currently not installed. You can install it by typing:
sudo apt-get install postgres-xc
Can't I start the server without this postgres-xc?
This must be remnants of the postgres-xc package you had installed previously.
Since you just installed postgresql-9.3 and don't seem to have any databases in use, yet, I suggest to completely purge all postgres packages.
sudo apt-get purge postgresql-9.2
sudo apt-get purge postgresql-xc
...
Until there's nothing left:
dpkg -l | grep postgres
Then start from scratch. Your instance of pg_ctl seems to belong to the package postgres-xc. This should be gone after you've uninstalled the package. Find out with one of these commands:
dpkg -S pg_ctl
dlocate pg_ctl
apt-file search pg_ctl
pg_ctlcluster is provided by the package postgresql-common.
pg_ctl is provided by the package postgresql-9.3.
More about starting Postgres in the manual.
It is possible you might be missing a few things.
Try:
sudo apt-get install postgresql-client and
sudo apt-get install postgresql postgresql-contrib
The message about installing xc is a dud, it's probably suggesting that based on what it scanned inside the xc repositories.
Here's a good reference to this problem and its solution:
https://dba.stackexchange.com/questions/72580/missing-the-pg-ctl-package-in-postgres-9-3-installation
Due to reasons a normal install of postgres will not place the postgres binary file in the path.
Adding the right directory to the path solves the problem (temporarily).
PATH=/usr/lib/postgresql/9.3/bin:$PATH
To make it permanent on my Ubuntu machine I added the line to /etc/environment this makes it work for all users.
The correct way to set the PATH is different for different systems, for more info see see:
How to permanently set $PATH on Linux?
You must install postgresql-client:
sudo install postgresql-client
Try to enter this command to the console:
sudo -u postgres psql

reconfigure bsd-mailx on ubuntu

I tried apt-get remove bsd-mailx and apt-get purge bsd-mailx
to see if with apt-get install bsd-mailxI would get the default configuration screen of it, but don't get it. How might I get to completely remove bsd-mailx to get once again the configuration screen, or how to toggle the configuration screen somehow as when it is first installed to apply a different configuration.
Debian bsd-mailx package uses postfix as default agent (service) for outside of localhost mail delivery. If you missed config step or wish to re-configure bsd-mailx, do:
sudo dpkg-reconfigure postfix
Check you running config /etc/postfix/main.cf and service status
sudo service postfix status
sudo dpkg-reconfigure -plow bsd-mailx