OKD Build process cannot resolve host - openshift

I cannot build pods in OKD as Github cannot be resolved and the build fails.
The error:
Cloning "https://github.com/MeMyselfI/okd-hello-world " ...
error: fatal: unable to access 'https://github.com/MeMyselfI/okd-hello-world/': Could not resolve host: github.com; Unknown error
How OKD is started:
sudo oc cluster up --routing-suffix=192.168.2.20.xip.io --public-hostname=192.168.2.20
OC client version:
me#server:~$ sudo oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO
ping from SSH prompt:
me#server:~$ ping github.com
PING github.com (192.30.253.113) 56(84) bytes of data.
64 bytes from lb-192-30-253-113-iad.github.com (192.30.253.113): icmp_seq=1 ttl=52 time=33.4 ms
64 bytes from lb-192-30-253-113-iad.github.com (192.30.253.113): icmp_seq=2 ttl=52 time=34.0 ms
ping from local, manually launched, Docker container:
me#server:~$ sudo docker exec -it hwnodemongo_web_1 /bin/bash
root#7c2db2faacf7:/usr/src/app# ping github.com
PING github.com (192.30.253.112) 56(84) bytes of data.
64 bytes from lb-192-30-253-112-iad.github.com (192.30.253.112): icmp_seq=1 ttl=52 time=28.3 ms
64 bytes from lb-192-30-253-112-iad.github.com (192.30.253.112): icmp_seq=2 ttl=52 time=27.4 ms
Output of resolv.conf
me#server:~$ cat /etc/resolv.conf
nameserver 8.8.8.8
dnsmasq is running:
dnsmasq 1479 0.0 0.0 51580 376 ? S 12:07 0:00 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,19036,8,2,49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 --trust-anchor=.,20326,8,2,e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
dig from SSH:
me#server.com:~$ dig github.com
; <<>> DiG 9.11.3-1ubuntu1.5-Ubuntu <<>> github.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20999
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;github.com. IN A
;; ANSWER SECTION:
github.com. 59 IN A 192.30.253.113
github.com. 59 IN A 192.30.253.112
;; Query time: 46 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Apr 05 13:23:47 ADT 2019
;; MSG SIZE rcvd: 71
Update:
I redid the install on another machine. I used oc cluster up (without any other parameters) and got the same results (by accessing localhost:8443/console).

Related

DNS configuration to use on tryhackme

I wanna modify /etc/resolv.conf to change the DNS server.
my new DNS configuration:
$ cat /etc/resolv.conf
nameserver 10.200.4.101
search za.tryhackme.com
my tests:
$ ping 10.200.4.101
PING 10.200.4.101 (10.200.4.101) 56(84) bytes of data.
64 bytes from 10.200.4.101: icmp_seq=1 ttl=127 time=20.2 ms
$ nslookup ntlmauth.za.tryhackme.com
Server: 10.200.4.101
Address: 10.200.4.101#53
Name: ntlmauth.za.tryhackme.com
Address: 10.200.4.201
but
dig
;; communications error to 10.200.4.101#53: timed out
;; communications error to 10.200.4.101#53: timed out
;; communications error to 10.200.4.101#53: timed out
; <<>> DiG 9.18.7-1-Debian <<>>
;; global options: +cmd
;; no servers could be reached
$ ping ntlmauth.za.tryhackme.com
ping: ntlmauth.za.tryhackme.com: Nom ou service inconnu
I don't understand why with this configuration, I am not able to use the DNS with Ip adress 10.200.4.201.

Cannot connect to mysql running in docker container from another

I know this seems like a common situation but nothing which I've found helps.
I'm following the docker 'getting-started' guide verbatim, literally copy and pasting the commands. But when I get to this step:
docker run -dp 3000:3000 \
-w /app -v "$(pwd):/app" \
--network todo-app \
-e MYSQL_HOST=mysql \
-e MYSQL_USER=root \
-e MYSQL_PASSWORD=secret \
-e MYSQL_DB=todos \
node:12-alpine \
sh -c "yarn install && yarn run dev"
The log output is as follows:
{ Error: connect EHOSTUNREACH 172.18.0.2:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'EHOSTUNREACH',
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '172.18.0.2',
port: 3306 }
Here is the catch, I can successfully connect to mysql running in the container from the host system:
$ mysql -h172.18.0.2 -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.27 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
Furthermore from the 'app' container, I can successfully ping the 'mysql' host. 'nc' is unable to connect though:
[mmorsi#localhost app]$ docker exec e8df2d36914 ping -c 3 mysql
PING mysql (172.18.0.2): 56 data bytes
64 bytes from 172.18.0.2: seq=0 ttl=64 time=0.071 ms
64 bytes from 172.18.0.2: seq=1 ttl=64 time=0.173 ms
64 bytes from 172.18.0.2: seq=2 ttl=64 time=0.176 ms
--- mysql ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.071/0.140/0.176 ms
[mmorsi#localhost app]$ docker exec e8df2d36914 nc -z -v mysql 3306
nc: mysql (172.18.0.2:3306): Host is unreachable
Other things I've tried:
Running the latest mysql docker image
Running the 'app' on the centos:latest image (with the necessary steps to install deps)
My host system is Fedora 33. On the host, the docker0 interface is running in the 'trusted' zone (target: ACCEPT):
[mmorsi#localhost app]$ sudo firewall-cmd --get-active-zones
FedoraWorkstation
interfaces: enp0s31f6
trusted
interfaces: docker0
[mmorsi#localhost app]$ man firewall-cmd
[mmorsi#localhost app]$ sudo firewall-cmd --info-zone=trusted
trusted (active)
target: ACCEPT
icmp-block-inversion: no
interfaces: docker0
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
I'm all out of ideas. Any help or insights would be highly appreciated.
Figured it out!
(Courtesy of https://fedoramagazine.org/docker-and-fedora-32/)
A simple:
sudo firewall-cmd --permanent --zone=FedoraWorkstation --add-masquerade
So as to allow docker to make local connections was all that was needed! (in addition to the other steps listed there which I had previously run).
[Proceeds to pat self on back]

Redhat codeready container deployment throwing error query DNS from host: Invalid IP for foo.apps-crc.testing

I ma trying to install redhat openshift using CRC by using this doc https://computingforgeeks.com/setup-local-openshift-cluster-with-codeready-containers/. But while strating container it is giving below exception
[crc#openshift ~]$ crc start
INFO Checking if oc binary is cached
INFO Checking if podman remote binary is cached
INFO Checking if goodhosts binary is cached
INFO Checking minimum RAM requirements
INFO Checking if running as non-root
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if libvirt daemon is running
INFO Checking if a supported libvirt version is installed
INFO Checking if crc-driver-libvirt is installed
INFO Checking if libvirt 'crc' network is available
INFO Checking if libvirt 'crc' network is active
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists
INFO Starting CodeReady Containers VM for OpenShift 4.5.9...
INFO CodeReady Containers VM is running
INFO Starting network time synchronization in CodeReady Containers VM
INFO Verifying validity of the cluster certificates ...
INFO Adding 8.8.8.8 as nameserver to the instance ...
INFO Check internal and public DNS query ...
INFO Check DNS query from host ...
WARN foo.apps-crc.testing resolved to [127.0.0.1] but 192.168.130.11 was expected
ERRO Failed to query DNS from host: Invalid IP for foo.apps-crc.testing
Failed to query DNS from host: Invalid IP for foo.apps-crc.testing
Os which I am using is RHEL8. I am not getting why it is giving the above error. If I run host -R 3 foo.apps-crc.testing I am geting below response:
[crc#openshift ~]$ host -R 3 foo.apps-crc.testing
foo.apps-crc.testing has address 127.0.0.1
/etc/resolv.conf:
# Generated by NetworkManager
search 8.8.4.4
nameserver 127.0.0.1
.
[crc#openshift ~]$ ping foo.apps-crc.testing
PING foo.apps-crc.testing (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.036 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.050 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.066 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.062 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.066 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.068 ms
64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.051 ms
64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.054 ms
64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.053 ms

Permission denied # rb_sysopen - /tmp/github_api_headers20180618-21004-yrr75i error.

I am attempting to install mysql using homebrew but I keep getting
Permission denied # rb_sysopen - /tmp/github_api_headers20180618-21004-yrr75i
This is my brew config
HOMEBREW_VERSION: 1.6.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: c814199a791867ab75f90a22715e2475706b13d8
Last commit: 7 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c58fde35d617490bad4de8faeaa9e9f1c81341ea
Core tap last commit: 6 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.1 build 902
Git: 2.15.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_144, 1.8.0_111
macOS: 10.13.5-x86_64
CLT: 9.4.1.0.1.1528165917
Xcode: 9.4.1
XQuartz: N/A
OS information
MacOS High Sierra
version 10.13.5
I tried to chown my tmp file but I realize that the permission are fine.
drwxr-xr-x 11 _mysql _mysql 352 Jun 18 15:42 tmp
How do I correct this issue?

CentOS error while compiling Bind with DLZ "/usr/bin/ld: cannot find -lmysqlclient"

So I am trying to compile Bind with DLZ ( mysql ) support on CentOS 7
After doing
./configure --prefix=/usr --sysconfdir=/etc/bind --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl=/usr --with-gssapi=/usr --with-gnu-ld --with-dlz-postgres=no --with-dlz-mysql=yes --with-dlz-bdb=no --with-dlz-filesystem=yes --with-dlz-stub=yes --enable-ipv6
and
make
I get the error:
/opt/bind/bind-9.11.0-P3/lib/isc/.libs/libisc.so ../../lib/isc/.libs/libisc.so -lcrypto -L/usr/lib/mysql -lmysqlclient -lcrypt -lm -ldl -lz -lpthread
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
make[2]: *** [named] Error 1
make[2]: Leaving directory `/opt/bind/bind-9.11.0-P3/bin/named'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/opt/bind/bind-9.11.0-P3/bin'
make: *** [subdirs] Error 1
I have gotten it to work on one CentOS 7 box, however I installed all sorts of whacky stuff while trying to get it to work. I don't actually know why it compiles on that machine, and I would like to be able to replicate the process. So I created a fresh install of CentOS 7 and try and find out how to compile Bind with DLZ support. Bind 9.11.0-P3.
I have mariadb-libs installed and the /usr/lib64/mysql directory looks like this.
ll /usr/lib64/mysql/
total 16884
-rw-r--r--. 1 root root 2687 Nov 14 15:15 INFO_BIN
-rw-r--r--. 1 root root 170 Sep 12 2016 INFO_SRC
lrwxrwxrwx. 1 root root 17 Mar 29 16:40 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx. 1 root root 20 Mar 29 16:40 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx. 1 root root 24 Mar 29 16:40 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rwxr-xr-x. 1 root root 3135736 Nov 14 15:17 libmysqlclient.so.18.0.0
lrwxrwxrwx. 1 root root 15 Mar 29 16:40 libmysqld.so -> libmysqld.so.18
-rwxr-xr-x. 1 root root 14116296 Nov 14 15:17 libmysqld.so.18
-rwxr-xr-x. 1 root root 10474 Nov 14 15:14 mysqlbug
-rwxr-xr-x. 1 root root 6758 Nov 14 15:15 mysql_config
drwxr-xr-x. 2 root root 4096 Mar 29 16:40 plugin
The /usr/lib/mysql directory looks like this.
ll /usr/lib/mysql/
total 0
drwxr-xr-x. 2 root root 6 Mar 29 21:36 plugin
On the machine that Bind Compiles on the /usr/lib/mysql folder looks different, and when I do yum whatprovides on the other machine I get this result:
yum whatprovides /usr/lib/mysql/libmysqlclient.so.18.0.0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.ca.planethoster.net
* extras: centos.mirror.ca.planethoster.net
* updates: mirror.it.ubc.ca
* webtatic: us-east.repo.webtatic.com
1:mariadb-libs-5.5.52-1.el7.i686 : The shared libraries required for MariaDB/MySQL clients
Repo : base
Matched from:
Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0
1:mariadb-libs-5.5.52-1.el7.x86_64 : The shared libraries required for MariaDB/MySQL clients
Repo : #base
Matched from:
Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0
On the fresh install I have installed these mariadb packages.
yum list mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.its.sfu.ca
* extras: centos.bhs.mirrors.ovh.net
* updates: mirror.its.sfu.ca
Installed Packages
mariadb.x86_64 1:5.5.52-1.el7 #base
mariadb-bench.x86_64 1:5.5.52-1.el7 #base
mariadb-devel.x86_64 1:5.5.52-1.el7 #base
mariadb-embedded.x86_64 1:5.5.52-1.el7 #base
mariadb-embedded-devel.x86_64 1:5.5.52-1.el7 #base
mariadb-libs.x86_64 1:5.5.52-1.el7 #base
mariadb-server.x86_64 1:5.5.52-1.el7 #base
mariadb-test.x86_64 1:5.5.52-1.el7 #base
Available Packages
Please help me figure out how to install Bind with DLZ support on CentOS 7!
Add 'LDFLAGS="-I/usr/include/mysql -L/usr/lib64/mysql"'
on to the ./configure command
like so
./configure --prefix=/usr --sysconfdir=/etc/bind --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl=/usr --with-gssapi=/usr --with-gnu-ld --with-dlz-postgres=no --with-dlz-mysql=yes --with-dlz-bdb=no --with-dlz-filesystem=yes --with-dlz-stub=yes --enable-ipv6 LDFLAGS="-I/usr/include/mysql -L/usr/lib64/mysql"