minikube: could not find capabilities for domaintype=kvm - kubernetes

What are installed for minikube:
$ ls -al /usr/local/bin/
-rwxr-xr-x 1 root root 26406912 Jun 14 12:05 docker-machine
-rwxrwxr-x 1 me libvirtd 11889064 Jun 14 12:07 docker-machine-driver-kvm
-rwxrwxr-x 1 me me 70232912 Jun 14 11:58 kubectl
-rwxrwxr-x 1 me me 82512696 Jun 14 11:57 minikube
Trying to start cluster by minikube
$ minikube start --vm-driver=kvm
Starting local Kubernetes v1.6.4 cluster...
Starting VM...
E0614 12:07:39.515994 14655 start.go:127] Error starting host: Error creating host: Error creating machine: Error in driver during machine creation: virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for domaintype=kvm ').
Retrying.
E0614 12:07:39.517076 14655 start.go:133] Error starting host: Error creating host: Error creating machine: Error in driver during machine creation: virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for domaintype=kvm ')
I am new to kubernetes. Any idea how to fix it? Thanks
UPDATE
sudo /usr/sbin/kvm-ok
INFO: /dev/kvm does not exist
HINT: sudo modprobe kvm_intel
INFO: Your CPU supports KVM extensions
INFO: KVM (vmx) is disabled by your BIOS
HINT: Enter your BIOS setup and enable Virtualization Technology (VT),
and then hard poweroff/poweron your system
KVM acceleration can NOT be used
$ dmesg | grep kvm
[ 2.114855] kvm: disabled by bios
[ 2.327746] kvm: disabled by bios
[ 120.423249] kvm: disabled by bios
[ 222.250977] kvm: disabled by bios

My update is close to the solution. The solution is to enable virtualization in the BIOS.
1, Power on your PC and open the BIOS.
2, Go to the security section and enable virtualization.

you need to install the kvm package refer package.
https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm-driver
# Install libvirt and qemu-kvm on your system, e.g.
# Debian/Ubuntu
$ sudo apt install libvirt-bin qemu-kvm
# Fedora/CentOS/RHEL
$ sudo yum install libvirt-daemon-kvm kvm
# Add yourself to the libvirtd group (use libvirt group for rpm based distros) so you don't need to sudo
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
$ sudo usermod -a -G libvirtd $(whoami)
# Fedora/CentOS/RHEL
$ sudo usermod -a -G libvirt $(whoami)
# Update your current session for the group change to take effect
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
$ newgrp libvirtd
# Fedora/CentOS/RHEL
$ newgrp libvirt

Related

Fail to start Minikube on Debian

I installed Minikube on my Debian 10, but when I try to start it, I
get these errors:
$ minikube start
* minikube v1.25.2 on Debian 10.1
* Unable to pick a default driver. Here is what was considered, in preference order:
- docker: Not healthy: "docker version --format {{.Server.Os}}-{{.Server.Version}}" exit status 1: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/version: dial unix /var/run/docker.sock: connect: permission denied
- docker: Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG docker $USER && newgrp docker' <https://docs.docker.com/engine/install/linux-postinstall/>
- kvm2: Not healthy: /usr/bin/virsh domcapabilities --virttype kvm failed:
error: failed to get emulator capabilities
error: invalid argument: KVM is not supported by '/usr/bin/qemu-system-x86_64' on this host
exit status 1
- kvm2: Suggestion: Follow your Linux distribution instructions for configuring KVM <https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/>
* Alternatively you could install one of these drivers:
- podman: Not installed: exec: "podman": executable file not found in $PATH
- vmware: Not installed: exec: "docker-machine-driver-vmware": executable file not found in $PATH
- virtualbox: Not installed: unable to find VBoxManage in $PATH
I added my user to the docker group using:
sudo usermod -aG docker $USER
and I insalled kvm without any apparent problems as far as I understand:
kvm --version
QEMU emulator version 3.1.0 (Debian 1:3.1+dfsg-8~deb10u1)
Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers
$ lsmod | grep kvm
kvm 729088 0
irqbypass 16384 1 kvm
$ sudo virsh list --all
Id Name State
-----------------------------
1 debian10-MK running
What could be the problem and solution then?
Thanks,
Tamar

Grafana-server Init Failed - Ubuntu 20.04

Using Grafana 8.3 in Ubuntu 20.04. When I went to the desktop environment to use Grafana, it wouldn’t connect. In the command line, when I type:
sudo netstat -lp
I noticed port 3000 wasn’t listed anymore.
starting the grafana server i get this below
a#a:~$ grafana-server
Grafana-server Init Failed: Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
when checking the status, I get this:
● grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-01-05 16:06:11 MST; 11min ago
Docs: http://docs.grafana.org
Process: 4621 ExecStart=/usr/sbin/grafana-server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default.paths.lo>
Main PID: 4621 (code=exited, status=1/FAILURE)
Jan 05 16:06:11 antonio- systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Jan 05 16:06:11 antonio- systemd[1]: Stopped Grafana instance.
Jan 05 16:06:11 antonio- systemd[1]: grafana-server.service: Start request repeated too quickly.
Jan 05 16:06:11 antonio- systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Jan 05 16:06:11 antonio- systemd[1]: Failed to start Grafana instance.
thte only way I can get grafana to work in the desktop envionment is if I use and keep this open in the terminal:
$ sudo grafana-server -homepath /usr/share/grafana
Why has this happened and how can I use grafana without have to do this terminal step everytime?
thanks, I basically solved the problem by not solving the problem.
sudo apt-get purge grafana
sudo apt-get remove grafana
sudo apt-get remove --auto-remove grafana
then I deleted the config folder (contains the config file)
rm -R /etc/grafana/
then I reinstalled grafana
$ sudo apt-get install -y gnupg2 curl
$ curl https://packages.grafana.com/gpg.key | sudo apt-key add -
$ sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
$ sudo apt-get update
$ sudo apt-get -y install grafana
$ sudo systemctl start grafana-server
Now its running as before, with default port 3000 on startup

RPMs for Kubernetes do not exist anymore on https://packages.cloud.google.com/

After following the Kubernetes installation guide I found than all the RPMS were removed from the YUM repository https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/Packages. However, on the release notes page you can see the links to binaries but not RPMs (for example: https://dl.k8s.io/v1.18.0/kubernetes-server-linux-amd64.tar.gz).
Can someone point me to the location of the RPMs? I'm aware Fedora comes with their own RPMS but these are older compared to the ones offered from the website (For example, Fedora 29 offers 1.10 while the website offers 1.18).
Thanks in advance.
--Jose
They are not gone, they are just not visible with the web browser (I dunno why). If you follow instructions on adding yum repository to your system, you will be able to install RPMs from that repository. Although kubernetes server related RPMs are not there.
$cat /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=0
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
$dnf list --disablerepo='*' --enablerepo=kubernetes --available
Last metadata expiration check: 0:06:26 ago on Mon 13 Jul 2020 21:24:45 CEST.
Available Packages
cri-tools.x86_64 1.13.0-0 kubernetes
kubeadm.x86_64 1.18.5-0 kubernetes
kubelet.x86_64 1.18.5-0 kubernetes
kubernetes-cni.x86_64 0.8.6-0 kubernetes
rkt.x86_64 1.27.0-1 kubernetes
Thanks, I did this on a CentOS 8.2 but had to make one tweak.
In this file
/etc/yum.repos.d/kubernetes.repo
I changed this line to have it enabled, so I changed it from:
enabled=0
to:
enabled=1
So my /etc/yum.repos.d/kubernetes.repo file looks like:
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
I then was able to do (for CentOS 8.x or Red Hat 8.x you can use dnf instead of yum, the actual command is dnf but on 8.x they do an alias of some sort to point yum to dnf)
mkdir /tmp/k8s
yum -y install --downloadonly --downloaddir=/tmp/k8s kubeadm kubelet kubectl
This downloaded the 3 rpms and dependencies. So my output was
14bfe6e75a9efc8eca3f638eb22c7e2ce759c67f95b43b16fae4ebabde1549f3-cri-tools-1.13.0-0.x86_64.rpm
b1b077555664655ba01b2c68d13239eaf9db1025287d0d9ccaeb4a8850c7a9b7-kubectl-1.19.2-0.x86_64.rpm
conntrack-tools-1.4.4-10.el8.x86_64.rpm
d0ba40edfc0fdf3aeec3dd8e56c01ff0d3a511cc0012aabce55d9a83d9bf2b69-kubeadm-1.19.2-0.x86_64.rpm
d9d997cdbfd6562824eb7786abbc7f4c6a6825662d0f451793aa5ab8c4a85c96-kubelet-1.19.2-0.x86_64.rpm
db7cb5cb0b3f6875f54d10f02e625573988e3e91fd4fc5eef0b1876bb18604ad-kubernetes-cni-0.8.7-0.x86_64.rpm
libnetfilter_cthelper-1.0.0-15.el8.x86_64.rpm
libnetfilter_cttimeout-1.0.0-11.el8.x86_64.rpm
libnetfilter_queue-1.0.2-11.el8.x86_64.rpm
socat-1.7.3.3-2.el8.x86_64.rpm
An alternate way, I also did the following
yum install -y yum-utils
then ran these 3 commands
yumdownloader kubeadm
yumdownloader kubelet
yumdownloader kubectl
This got me these 3 files in the current directory that you ran the command from
-rw-r--r-- 1 root root 9450186 Oct 8 10:11 b1b077555664655ba01b2c68d13239eaf9db1025287d0d9ccaeb4a8850c7a9b7-kubectl-1.19.2-0.x86_64.rpm
-rw-r--r-- 1 root root 8725678 Oct 8 10:10 d0ba40edfc0fdf3aeec3dd8e56c01ff0d3a511cc0012aabce55d9a83d9bf2b69-kubeadm-1.19.2-0.x86_64.rpm
-rw-r--r-- 1 root root 20438926 Oct 8 10:11 d9d997cdbfd6562824eb7786abbc7f4c6a6825662d0f451793aa5ab8c4a85c96-kubelet-1.19.2-0.x86_64.rpm
FYI to download a specific version of kubectl run this command
yum --showduplicates list kubectl
This will show you all the versions available in the 2nd column. The syntax to download a specific version is:
yumdownloader <packagename>-<version number>.x86_64
So for example to download kubectl version 1.18.9.0 for the x86_64 platform run
yumdownloader kubectl-1.18.9-0.x86_64
See here on how to download specific versions of packages
https://www.thegeekdiary.com/centos-rhel-how-to-install-a-specific-version-of-rpm-package-using-yum
For completeness, I decided to post how to get the RPMS using DNF:
sudo dnf install kubelet kubeadm kubectl --disableexcludes=kubernetes -v --downloaddir=/tmp/k8s --downloadonly
Dependencies resolved.
Excludes in repo kubernetes: kubeadm, kubectl, kubelet
===========================================================================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================================================================
Installing:
kubeadm x86_64 1.19.2-0 kubernetes 8.3 M
kubectl x86_64 1.19.2-0 kubernetes 9.0 M
kubelet x86_64 1.19.2-0 kubernetes 19 M
Installing dependencies:
cri-tools x86_64 1.13.0-0 kubernetes 5.1 M
kubernetes-cni x86_64 0.8.7-0 kubernetes 19 M
conntrack-tools x86_64 1.4.4-8.fc29 strike-os 200 k
ebtables x86_64 2.0.10-28.fc29 strike-os 132 k
libnetfilter_cthelper x86_64 1.0.0-14.fc29 strike-os 22 k
libnetfilter_cttimeout x86_64 1.0.0-12.fc29 strike-os 22 k
libnetfilter_queue x86_64 1.0.2-12.fc29 strike-os 26 k
Transaction Summary
===========================================================================================================================================================================================================
Install 10 Packages
Total size: 61 M
Installed size: 261 M
DNF will only download packages for the transaction.
Is this ok [y/N]:
The rpms will be waiting for you on /tmp/k8s

Docker Unable to connect to mongodb cloud

Unable to connect to mongodb cloud using mongoshell from Docker.
Working on Opensuse 42.3 linux platform. IP_FORWARD has been enabled, firewall has been disabled.
./mongodbshell/bin/mongo "mongodb+srv://cluster0-ry2xn.mongodb.net/test" --username
However it works fine from outside docker. Given below is my docker environment info.
$ sudo docker info
Containers: 17
Running: 1
Paused: 0
Stopped: 16
Images: 21
Server Version: 17.04.0-ce
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: active
NodeID: kh7m6ppbeg3ktkk3tueqoiyen
Is Manager: true
ClusterID: izl7e06qo269ccagfa0eknz16
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Node Address: 192.168.2.14
Manager Addresses:
192.168.2.14:2377
Runtimes: oci runc
Default Runtime: runc
Init Binary:
containerd version: (expected: 422e31ce907fd9c3833a38d7b8fdd023e5a76e73)
runc version: N/A (expected: 9c2d8d184e5da67c95d601382adf14862e4f2228)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
apparmor
Kernel Version: 4.4.104-39-default
Operating System: openSUSE Leap 42.3
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.45GiB
Name: linux-xleg.suse
ID: SFKG:TIYZ:65WL:TKCG:ZOSW:7ZJI:CW6E:2HJJ:UV7A:ZVXM:V2IN:JZU4
Docker Root Dir: /home/maggi/docker-data
Debug Mode (client): false
Debug Mode (server): false
Username: magnusmel
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
WARNING: No kernel memory limit support
Docker oS based on kali linux -
cat /etc/os-release
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2016.2"
VERSION_ID="2016.2"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.kali.org/"
SUPPORT_URL="http://forums.kali.org/"
BUG_REPORT_URL="http://bugs.kali.org/"
MongodB Client Info is given below
/opt/mongodbshell/bin/mongo --version
MongoDB shell version v3.6.2
git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
allocator: tcmalloc
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
ERROR OUTPUT:
> connecting to: mongodb+srv://cluster0-ry2xn.mongodb.net/test
> 2018-01-30T18:54:38.451+0000 I NETWORK [thread1] Starting new replica
> set monitor for
> Cluster0-shard-0/cluster0-shard-00-00-ry2xn.mongodb.net.:27017,cluster0-shard-00-02-ry2xn.mongodb.net.:27017,cluster0-shard-00-01-ry2xn.mongodb.net.:27017
> 2018-01-30T18:54:39.679+0000 W NETWORK [thread1] Unable to reach
> primary for set Cluster0-shard-0 2018-01-30T18:54:39.679+0000 I
> NETWORK [thread1] Cannot reach any nodes for set Cluster0-shard-0.
> Please check network connectivity and the status of the set. This has
> happened for 1 checks in a row. 2018-01-30T18:54:41.879+0000 W NETWORK
> [thread1] Unable to reach primary for set Cluster0-shard-0
> 2018-01-30T18:54:41.879+0000 I NETWORK [thread1] Cannot reach any
> nodes for set Cluster0-shard-0. Please check network connectivity and
> the status of the set. This has happened for 2 checks in a row.
Is this related to not setting up, SSL/TLS based auth ? Any help will be appreciated very much.
IP_FORWARD is not enough, you need masquerade (or NAT) between those different networks. It is possible also do with static routing, if there is one common gateway between networks.
Kali linux is not a supported distro by mongo.
So one needs, to verify if /usr/bin/mongo --version does not return with openssl mentioned in the output.
Then, in such a case uninstall all the existing mongodb tools & server & client.
And then reinstall with a mongo client built for debian 7/8 platform depending on the Kali linux distro Version being used. (in my case debian version 8 )
That solves the issue for running a mongo client with ssl on docker:
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list
apt-get update
For full mongodb installation that includes server, do run as given below:
apt-get install -y mongodb-org=3.6.2 mongodb-org-server=3.6.2 mongodb-org-shell=3.6.2 mongodb-org-mongos=3.6.2 mongodb-org-tools=3.6.2
For installing only mongo client & tools specific to a version:
apt-get install -y mongodb-org-shell=3.6.2 mongodb-org-tools=3.6.2
For installing only mongo client & tools default:
apt-get install -y mongodb-org-shell mongodb-org-tools
My mongo output on docker - kali linux image now shows ssl configured:
MongoDB shell version v3.6.2
git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
allocator: tcmalloc
modules: none
build environment:
distmod: debian81
distarch: x86_64
target_arch: x86_64

Failed to start puppetserver Service

While trying to run a puppet update form a node:
sudo /opt/puppetlabs/bin/puppet agent -t
I get an error:
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Connection refused - connect(2) for "puppet" port 8140`
Elsewhere indicates this is likely a problem with the puppetserver service, and suggests to reboot the server. Restarting didn't help, and when I try to restart the service I get failure:
~$ sudo service puppetserver restart
Job for puppetserver.service failed because the control process exited with error code. See "systemctl status puppetserver.service" and "journalctl -xe" for details.
I've looked at these logs, and as a puppet/linux noob, I'm not sure what to do next.
systemctl status puppetserver.service
● puppetserver.service - puppetserver Service
Loaded: loaded (/lib/systemd/system/puppetserver.service; enabled; vendor preset: enabled)
Active: activating (start-post) since Fri 2016-09-02 15:54:26 PDT; 2s ago
Process: 22301 ExecStartPre=/usr/bin/install --directory --owner=puppet --group=puppet --mode=775 /var/run/puppetlabs/puppetserver (code=exited
Main PID: 22306 (java); : 22307 (bash)
Tasks: 17
Memory: 335.7M
CPU: 5.535s
CGroup: /system.slice/puppetserver.service
├─22306 /usr/bin/java -Xms6g -Xmx6g -XX:MaxPermSize=256m -XX:OnOutOfMemoryError=kill -9 %p -Djava.security.egd=/dev/urandom -cp /opt/p
└─control
├─22307 /bin/bash /opt/puppetlabs/server/apps/puppetserver/ezbake-functions.sh wait_for_app
└─22331 sleep 1
Sep 02 15:54:26 puppet systemd[1]: Starting puppetserver Service...
Sep 02 15:54:26 puppet java[22306]: OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
puppet version 4.6.1
The puppet master communicates with the other node using port number 8140.
I don't think a restart will help, since this looks like a connection issue between the server and the node.
please try the following -
first make sure that the puppet master is actually listening on port 8140. run the following command on the puppetmaster -
netstat -ntlp | grep 8140
this command should return something like this -
tcp 0 0 0.0.0.0:8140 0.0.0.0:* LISTEN 1783/puppetmaster
If you don't get the same output, your puppetmaster is not listening, and therefore can not compile catalogs for the node.
Try checking the puppet master log at /var/log/puppetmaster.log
check that the node can communicate with the puppetmaster on the relevant port. you can check this quickly with the telnet command. run this on your node -
telnet < puppetmaster ip address \ dns name> 8140
you should get something like -
Connected to <puppet-master-IP/DNS-name>
Escape character is '^]'.
if you don't get this output, this means that something is blocking you from accessing the puppetmaster. try opening the port in your firewall to access the puppetmaster.
if you're still stuck try using the --debug flag for verbose output and edit your question.
Could be 2 things: (1) in puppet.conf you have configured more memory than you have on your machine. Or (2) You installed both apt-get install puppetserver and apt-get install puppet.
If you get failed to start puppet.service: unit not found. error on slave machine while connecting to puppet.
Close the putty and then again open and connect it.The issue wont come while starting putty on slave.
The error occurs because there is not enough RAM and to fix the error, open the Puppet server configuration file:
sudo nano /etc/sysconfig/puppetserver
And reduce the amount of allocated RAM for the Puppet server (for example, I specified 512m instead of 2g):
JAVA_ARGS="-Xms512m -Xmx512m"
Now let’s start the Puppet server:
sudo systemctl start puppetserver