Trying to Install Kubernetes with Vagrant and Ansible on Ubuntu 16.04 lab

So I am trying to install Kubernetes on a lab with Vagrant and Ansible.
I am using the following documentation on Ubuntu 16.04:

https://kubernetes.io/blog/2019/03/15/kubernetes-setup-using-ansible-and-vagrant/

Several Problems I encounter:

  1. The Vagrant File fails to initialize
  2. The Node does not successfully provision the node IP Address with Extra Args
  3. While specifying the documented version of Calico in the Ansible Playbook it fails.

For number 1, here is the vagrant file:

IMAGE_NAME = "bento/ubuntu-16.04"
N = 2

Vagrant.configure("2") do |config|
    config.ssh.insert_key = false

    config.vm.provider "virtualbox" do |v|
        v.memory = 1024
        v.cpus = 2
    end
      
    config.vm.define "k8s-master" do |master|
        master.vm.box = IMAGE_NAME
        master.vm.network "private_network", ip: "192.168.50.10"
        master.vm.hostname = "k8s-master"
        master.vm.provision "ansible" do |ansible|
            ansible.playbook = "kubernetes-setup/master-playbook.yml"
            ansible.extra_vars = {
                node_ip: "192.168.50.10",
            }
        end
    end

    (1..N).each do |i|
        config.vm.define "node-#{i}" do |node|
            node.vm.box = IMAGE_NAME
            node.vm.network "private_network", ip: "192.168.50.#{i + 10}"
            node.vm.hostname = "node-#{i}"
            node.vm.provision "ansible" do |ansible|
                ansible.playbook = "kubernetes-setup/node-playbook.yml"
                ansible.extra_vars = {
                    node_ip: "192.168.50.#{i + 10}",
                }
            end
        end
    end

Am I missing something within the Vagrantfile?

For number 2, I am seeing the following issue within the master-playbook.yaml, if fails at this step:

  - name: Configure node ip
    lineinfile:
      path: /etc/default/kubelet
      line: KUBELET_EXTRA_ARGS=--node-ip={{ node_ip }}

For number 3 I encountered an issue with the Calico Task within Ansible:

  - name: Install calico pod network
    become: false
    command: kubectl create -f https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml

I get the following Message on that task:

TASK (Install calico pod network) **********************************************
fatal: (k8s-master): FAILED! => {"changed": true, "cmd": ("kubectl", "create", "-f", "https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml"), "delta": "0:00:01.460979", "end": "2020-08-21 01:57:36.395550", "failed": true, "rc": 1, "start": "2020-08-21 01:57:34.934571", "stderr": "unable to recognize "https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml": no matches for kind "DaemonSet" in version "extensions/v1beta1"nunable to recognize "https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"", "stderr_lines": ("unable to recognize "https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml": no matches for kind "DaemonSet" in version "extensions/v1beta1"", "unable to recognize "https://docs.projectcalico.org/v3.4/getting-started/kubernetes/installation/hosted/calico.yaml": no matches for kind "Deployment" in version "extensions/v1beta1""), "stdout": "configmap/calico-config creatednsecret/calico-etcd-secrets creatednserviceaccount/calico-node creatednserviceaccount/calico-kube-controllers creatednclusterrole.rbac.authorization.k8s.io/calico-kube-controllers creatednclusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers creatednclusterrole.rbac.authorization.k8s.io/calico-node creatednclusterrolebinding.rbac.authorization.k8s.io/calico-node created", "stdout_lines": ("configmap/calico-config created", "secret/calico-etcd-secrets created", "serviceaccount/calico-node created", "serviceaccount/calico-kube-controllers created", "clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created", "clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created", "clusterrole.rbac.authorization.k8s.io/calico-node created", "clusterrolebinding.rbac.authorization.k8s.io/calico-node created")}

RUNNING HANDLER (docker status) ************************************************
    to retry, use: --limit @/home/sto/Vagrant/Kubernetes/kubernetes-setup/master-playbook.retry

PLAY RECAP *********************************************************************
k8s-master                 : ok=15   changed=14   unreachable=0    failed=1

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Furthermore, what is interesting is even though it fails on this task, if I choose version Calico 3.14.

  - name: Install calico pod network
    become: false
    command: kubectl create -f https://docs.projectcalico.org/v3.14/getting-started/kubernetes/installation/hosted/calico.yaml

Also, by replacing the URL from 3.4 to 3.14, the resources for the CNI underlay still will get created and they will still fail inside of the Vagrant machines:

vagrant@k8s-master:~$ kubectl get pods --all-namespaces
NAMESPACE     NAME                                      READY   STATUS              RESTARTS   AGE
kube-system   calico-kube-controllers-6bb5db574-p2w9c   0/1     CrashLoopBackOff    10         31m
kube-system   calico-node-6wsm7                         0/1     CrashLoopBackOff    7          13m
kube-system   calico-node-flf89                         0/1     Running             12         31m
kube-system   calico-node-fwk84                         0/1     CrashLoopBackOff    6          12m
kube-system   coredns-66bff467f8-cdrb8                  0/1     ContainerCreating   0          31m
kube-system   coredns-66bff467f8-lgcf8                  0/1     ContainerCreating   0          31m
kube-system   etcd-k8s-master                           1/1     Running             0          31m
kube-system   kube-apiserver-k8s-master                 1/1     Running             0          31m
kube-system   kube-controller-manager-k8s-master        1/1     Running             1          31m
kube-system   kube-proxy-79pw8                          1/1     Running             0          31m
kube-system   kube-proxy-g8gnm                          1/1     Running             0          12m
kube-system   kube-proxy-tvwlq                          1/1     Running             0          13m
kube-system   kube-scheduler-k8s-master                 1/1     Running             3          31m

Here are the messages:

vagrant@k8s-master:~$ kubectl logs -f calico-node-4q2xz -n kube-system
2020-08-22 21:35:41.194 (INFO)(8) startup/startup.go 299: Early log level set to info
2020-08-22 21:35:41.194 (INFO)(8) startup/startup.go 319: Using HOSTNAME environment (lowercase) for node name
2020-08-22 21:35:41.194 (INFO)(8) startup/startup.go 327: Determined node name: node-1
2020-08-22 21:35:41.195 (INFO)(8) startup/startup.go 106: Skipping datastore connection test
vagrant@k8s-master:~$ kubectl logs -f calico-kube-controllers-6bb5db574-m6b5j -n kube-system
2020-08-22 21:32:06.445 (INFO)(1) main.go 88: Loaded configuration from environment config=&config.Config{LogLevel:"info", WorkloadEndpointWorkers:1, ProfileWorkers:1, PolicyWorkers:1, NodeWorkers:1, Kubeconfig:"", DatastoreType:"etcdv3"}
I0822 21:32:06.513751       1 client.go:357) parsed scheme: "endpoint"
I0822 21:32:06.514122       1 endpoint.go:68) ccResolverWrapper: sending new addresses to cc: ({http://<ETCD_IP>:<ETCD_PORT> 0  <nil>})
W0822 21:32:06.515723       1 client_config.go:541) Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
W0822 21:32:06.538019       1 clientconn.go:1120) grpc: addrConn.createTransport failed to connect to {http://<ETCD_IP>:<ETCD_PORT> 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp: address http://<ETCD_IP>:<ETCD_PORT>: too many colons in address". Reconnecting...
2020-08-22 21:32:06.568 (INFO)(1) main.go 109: Ensuring Calico datastore is initialized
W0822 21:32:07.541048       1 clientconn.go:1120) grpc: addrConn.createTransport failed to connect to {http://<ETCD_IP>:<ETCD_PORT> 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp: address http://<ETCD_IP>:<ETCD_PORT>: too many colons in address". Reconnecting...
W0822 21:32:09.309376       1 clientconn.go:1120) grpc: addrConn.createTransport failed to connect to {http://<ETCD_IP>:<ETCD_PORT> 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp: address http://<ETCD_IP>:<ETCD_PORT>: too many colons in address". Reconnecting...
W0822 21:32:12.223003       1 clientconn.go:1120) grpc: addrConn.createTransport failed to connect to {http://<ETCD_IP>:<ETCD_PORT> 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp: address http://<ETCD_IP>:<ETCD_PORT>: too many colons in address". Reconnecting...
W0822 21:32:15.736676       1 clientconn.go:1120) grpc: addrConn.createTransport failed to connect to {http://<ETCD_IP>:<ETCD_PORT> 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp: address http://<ETCD_IP>:<ETCD_PORT>: too many colons in address". Reconnecting...
{"level":"warn","ts":"2020-08-22T21:32:16.668Z","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"endpoint://client-286ade6d-d04a-4dac-848b-231ef01101d2/http://<ETCD_IP>:<ETCD_PORT>","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest connection error: connection error: desc = "transport: Error while dialing dial tcp: address http://<ETCD_IP>:<ETCD_PORT>: too many colons in address""}
2020-08-22 21:32:16.877 (ERROR)(1) client.go 261: Error getting cluster information config ClusterInformation="default" error=context deadline exceeded
2020-08-22 21:32:16.907 (FATAL)(1) main.go 114: Failed to initialize Calico datastore error=context deadline exceeded

Is this probably related to how the API gets provisioned in the Master-Playbook task within master-playbook.yml?

  - name: Initialize the Kubernetes cluster using kubeadm
    command: kubeadm init --apiserver-advertise-address="192.168.20.10" --apiserver-cert-extra-sans="192.168.20.10"  --node-name k8s-master --pod-network-cidr=192.168.0.0/16

Here is a link where you can clone into an Ubuntu 16.04 env and it will have the same issues, more than Likely. Since this post was flagged for deletion, I decided to re-word this and make it more impactful as I still think it is very worthwhile to have up on Stackoverflow. More experienced people than me had a lot of problems with the Kubernetes Guide and even asked me.

Here is the link to that.
Single Lab Link with Vagrant and Ansible

Ensure that you have the following tree structure when trying this out.
My main issue is basically how to get these Calico Pods working now:

sto@suplab02:~/Vagrant/Kubernetes$ tree
.
├── connect.sh
├── init.sh
├── join.sh
├── kubernetes-setup
│   ├── master-playbook.yml
│   └── node-playbook.yml
├── rename_roles.sh
└── Vagrantfile

apt – dpkg error processing linux-image after upgrade from 16.04 to 18.04

I just upgraded to Ubuntu MATE 18.04 from 16.04. There were some hurdles that I would later describe below, but right now, the upgrade is “complete” except for the following set of errors while dpkg is setting up packages, resulting in failure when trying to update anything.

Bus error (core dumped)
dpkg: error processing package linux-image-4.15.0-112-generic (--configure):
 installed linux-image-4.15.0-112-generic package post-installation script subprocess returned error exit status 135
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-4.15.0-112-generic; however:
  Package linux-image-4.15.0-112-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-modules-extra-4.15.0-112-generic:
 linux-modules-extra-4.15.0-112-generic depends on linux-image-4.15.0-112-generic | linux-image-unsigned-4.15.0-112-generic; however:
  Package linux-image-4.15.0-112-generic is not configured yet.
  Package linux-image-unsigned-4.15.0-112-generic is not installed.

dpkg: error processing package linux-modules-extra-4.15.0-112-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.15.0.112.100); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.15.0-112-generic
 linux-image-generic
 linux-modules-extra-4.15.0-112-generic
 linux-generic

I have tried apt-get install -f, apt-get clean, apt-get autoremove, and dpkg –configure -a but it’s still broken. I haven’t tried purging and reinstalling those packages manually in case of a broken download, because these packages look very important.

As for the chronology:

  1. I first ran do-release-upgrade at work, but I stopped the download quite early on because the Internet wasn’t stable.
  2. I noticed my Apache is not working properly, so I tried do-release-upgrade again. I got a warning saying I should upgrade to the latest patch, and I found that it’s “up to date” with around 1500 packages “kept back”
  3. After a bit of browsing, I ran apt-get install -f. It downloaded around 650mb of packages, and after I restarted, the OS ran but with a broken GUI that looks like Windows 98.
  4. I ran apt-get dist-upgrade and it downloaded around 1.5gb of packages. After it finished, I rebooted and the OS is working “fine” except the errors above. Though Apache is still not working properly.

I’m sorry if I broke any rule. This is my first post. I’d be really grateful for any help from this community. Right now I’m making a backup of important files in case I end up having to reinstall my Linux, but I really hope I can keep going with this one. Thank you for reading.

16.04 – Installing duplicity via the ppa fails

I’m trying to follow the instructions here for setting up duplicity on ubuntu 16.04 server. but:

$ sudo add-apt-repository ppa:duplicity-team/ppa
Cannot add PPA: 'ppa:~duplicity-team/ubuntu/ppa'.
The team named '~duplicity-team' has no PPA named 'ubuntu/ppa'
Please choose from the following available PPAs:
 * 'duplicity-develop-git':  duplicity-develop-git
 * 'duplicity-release-git':  duplicity-release-git

I try following the suggestion:

$ sudo add-apt-repository ppa:duplicity-release-git/ppa
Cannot add PPA: 'ppa:~duplicity-release-git/ubuntu/ppa'.
ERROR: '~duplicity-release-git' user or team does not exist.

How can I install 0.7.12 or newer?

networking – Ubuntu 16.04 wired internet stopped working

I’m having a dual boot machine, with windows and ubuntu 16.04. Today I switched back to ubuntu after few days. I saw that I can’t connect to wired internet anymore. I was using static connection (dhcp was never working for me). I have exactly the same address, gate and mask as in windows (the connection works smoothly on windows). It shows that I’m connected to the network but I can’t ping the gate (router). Any idea where to look for the problem? I’m a beginner with linux. Thanks!

16.04 – Configure Proxy setting in a headless server

Environment:
virtualBox, ubuntu 16.04

What I am trying to do:
Setup proxy in a headless 16.04 server

What I have tried so far:
I have followed this guide in setting up.

  • Install squid and done the configuration accordingly
  • Setting up the client (50%)

What I am stuck at:

Full disclosure: I am new to this, please be patient with me, any advice is appreciated

oracle – Oracle12c giving error during installation on ubuntu 16.04 – “/usr/bin/ld: cannot find -lngsmshd12”

I am trying to install oracle 12c Enterprise Edition on ubuntu 16.04.
During installation it is giving below error.

Error During Installation

And log is

INFO: Linking RDBMS Executables
INFO: Linking RDBMS Executables
INFO: The output of this make operation is also available at: '/u01/app/oracle/product/12/dbhome_2/install/make.log'
INFO: 

INFO: Start output from spawned process:
INFO: ----------------------------------
INFO: 

INFO: chmod 755 /u01/app/oracle/product/12/dbhome_2/bin

INFO: rm -f oracle dbv tstshm maxmem orapwd dbfsize cursize genoci extproc extproc32 hsalloci hsots hsdepxa dgmgrl dumpsga mapsga osh sbttest expdp impdp imp exp sqlldr rman /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dg4odbc mkpatch oputil /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dg4db2 /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dg4ifmx /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dg4msql /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dg4sybs /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dg4tera nid ad
INFO: rci wrc extjob extjobo jssu genezi kfod amdu kfed uidrvci diskmon setasmgid renamedg orion asmlg skgxpinfo drdactl drdalsnr drdaproc /u01/app/oracle/product/12/dbhome_2/rdbms/lib/ksms.s /u01/app/oracle/product/12/dbhome_2/rdbms/lib/ksms.o

INFO: 

INFO:  - Linking DB*Verify utility (dbv)

INFO: rm -f /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dbv

INFO: /u01/app/oracle/product/12/dbhome_2/bin/orald -o /u01/app/oracle/product/12/dbhome_2/rdbms/lib/dbv -m64 -z noexecstack -Wl,--disable-new-dtags -L/u01/app/oracle/product/12/dbhome_2/rdbms/lib/ -L/u01/app/oracle/product/12/dbhome_2/lib/ -L/u01/app/oracle/product/12/dbhome_2/lib/stubs/   /u01/app/oracle/product/12/dbhome_2/rdbms/lib/s0kudbv.o  -ldbtools12 -lclntsh -lclntshcore -lsnls12 -lunls12 -lnls12 -laio -lclntsh -lclntshcore  `cat /u01/app/oracle/product/12/dbhome_2/lib/ldflags`    -lncrypt12 -lnsgr12 -ln
INFO: zjs12 -ln12 -lnl12 -lngsmshd12 -lnro12 `cat /u01/app/oracle/product/12/dbhome_2/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lngsmshd12 -lnnz12 -lzt12 -lztkg12 -lztkg12 -lclient12 -lnnetd12  -lvsn12 -lcommon12 -lgeneric12 -lmm -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 `cat /u01/app/oracle/product/12/dbhome_2/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lngsmshd12 -lnro12 `cat /u01/app/oracle/p
INFO: roduct/12/dbhome_2/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lngsmshd12 -lclient12 -lnnetd12  -lvsn12 -lcommon12 -lgeneric12   -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 -lclient12 -lnnetd12  -lvsn12 -lcommon12 -lgeneric12 -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12   `cat /u01/app/oracle/product/12/dbhome_2/lib/syslibli
INFO: st` -Wl,-rpath,/u01/app/oracle/product/12/dbhome_2/lib -lm    `cat /u01/app/oracle/product/12/dbhome_2/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/12/dbhome_2/lib -lons

INFO: /usr/bin/ld: cannot find -lngsmshd12
/usr/bin/ld: cannot find -lngsmshd12
/usr/bin/ld: cannot find -lngsmshd12
/usr/bin/ld: cannot find -lngsmshd12

INFO: collect2: error: ld returned 1 exit status

INFO: make: *** (/u01/app/oracle/product/12/dbhome_2/rdbms/lib/dbv) Error 1

INFO: /u01/app/oracle/product/12/dbhome_2/rdbms/lib/ins_rdbms.mk:974: recipe for target '/u01/app/oracle/product/12/dbhome_2/rdbms/lib/dbv' failed

INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'all_no_orcl' of makefile '/u01/app/oracle/product/12/dbhome_2/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2020-08-09_04-44-30PM.log' for details.
Exception Severity: 1

I am new in ubuntu. Any help will be appreciated.
I have completed all the pre configuration in ubuntu.

You can find here what I have done.

https://medium.com/venturenxt/install-oracle-database-12c-on-ubuntu-16-04-c081d51c0f9d

Anyone can help me out with this?
Thank you.

sudo apt-get update not working ( Ubuntu 16.04 )

I’m aware there are other similar questions asked previously but I couldn’t solve the problem.
I have ubuntu 16.04.6. When I run sudo apt-get update I get the following error.

Reading package lists… Done
E: Failed to fetch http://iq.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/by-hash/SHA256/80072611fed265613ccc008c0d8d907243709ea50965b11609ba4909e4508617 Hash Sum mismatch
E: Failed to fetch http://iq.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/binary-amd64/by-hash/SHA256/458cfcc42fea94019c8f376037a9a6692664122c63c372b80044b891d0e6235d
E: Some index files failed to download. They have been ignored, or old ones used instead.

16.04 – Squid IP addresses do not work properly

Good afternoon,
I have a problem that some IP addresses from my subnet which is assigned to a server do not work as a proxy. I have assigned all IP addresses to my server in the same way. A large part of this works without problems but some IPs cause problems. These cannot be pinged, but the working ones do. Has anybody ever had such a problem and can you help me?
I am using Ubuntu 16.04 and Squid Proxy.
Thanks a lot!

usb – how can I get Viking, on Ubuntu 16.04, to recognize my gps unit, a Garmin eTrex 20x?

How can I get Viking, or any other interface program, while using Ubuntu 16.04, to recognize my gps unit, a Garmin eTrex 20x?
My gps device is recognized to some extent by my computer.
The output of lsusb shows it can see it.
“Bus 007 Device 008: ID 091e:28ca Garmin International”

I have followed through several on-line tutorials and advice. As such I have changed the udev rules:

“sudo nano /etc/udev/rules.d/51-garmin.rules”
adding the following:
SUBSYSTEM==”usb”, ATTR{idVendor}==”091e”, ATTRS{idProduct}==”28ca” MODE=”0666″, GROUP=”plugdev”

This gave me read-write permission:
“ls -al /dev/bus/usb/007/008”
crw-rw-rw- 1 root plugdev 189, 775 Jul 19 17:52 /dev/bus/usb/007/008

I also blacklisted my device in power settings:
“sudo nano /etc/default/tlp”
USB_BLACKLIST=”091e:28ca”

I’ve downloaded Viking, gpsd, gpsBabel, gpsMan, others…

Yet nothing seems to see it or be able to communicate with it. Ultimately, I really just want to be able to upload a decent map to my gps unit, but nothing seems to be able to interact with it.

Any ideas??