Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x509: certificate is valid for 10.0.2.15, not 10.1.2.2 #11

Open
jannie-louwrens opened this issue Apr 14, 2017 · 0 comments
Open

x509: certificate is valid for 10.0.2.15, not 10.1.2.2 #11

jannie-louwrens opened this issue Apr 14, 2017 · 0 comments

Comments

@jannie-louwrens
Copy link

jannie-louwrens commented Apr 14, 2017

I am new to CDK & docker & kubernetes & fabric8 and need some help, please.

I'm having problems using 'mvn -Pf8-build' on the hola-springboot project:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.14.2:build (default-cli) on project hola-springboot: Unable to check image [docker.io/fabric8/java-jboss-openjdk8-jdk:1.0.10]: hostname in certificate didn't match: <10.1.2.2> != <example.com> OR <10.0.2.15> -> [Help 1]

When I executing 'docker info' on my desktop it returns the error:

error during connect: Get https://10.1.2.2:2376/v1.21/info: x509: certificate is valid for 10.0.2.15, not 10.1.2.2

If I SSH into the cdkv2 image with 'vagrant ssh' and execute 'docker info' on the virtual machine it gives the results:

[vagrant@rhel-cdk ~]$ docker info
Containers: 0
Images: 18
Server Version: 1.9.1
Storage Driver: devicemapper
 Pool Name: VolGroup00-docker--pool
 Pool Blocksize: 524.3 kB
 Base Device Size: 107.4 GB
 Backing Filesystem: xfs
 Data file: 
 Metadata file: 
 Data Space Used: 1.708 GB
 Data Space Total: 13.6 GB
 Data Space Available: 11.89 GB
 Metadata Space Used: 360.4 kB
 Metadata Space Total: 46.14 MB
 Metadata Space Available: 45.78 MB
 Udev Sync Supported: true
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Library Version: 1.02.107-RHEL7 (2015-12-01)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-327.18.2.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
CPUs: 2
Total Memory: 2.781 GiB
Name: rhel-cdk
ID: K346:DVPZ:SZRL:DSUH:PI6T:EMVL:7PQA:PASO:7GTV:IDCC:NEAG:4HGS
WARNING: bridge-nf-call-ip6tables is disabled

I am stuck for days now on this point trying to resolve the "x509: certificate is valid for 10.0.2.15, not 10.1.2.2" error without any success.

Here is the IP information from the vagrant box:

[vagrant@rhel-cdk ~]$ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:82:54:85 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
       valid_lft 80645sec preferred_lft 80645sec
    inet6 fe80::5054:ff:fe82:5485/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:5b:5f:ac brd ff:ff:ff:ff:ff:ff
    inet 10.1.2.2/24 brd 10.1.2.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe5b:5fac/64 scope link 
       valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 02:42:36:fd:cd:0f brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:36ff:fefd:cd0f/64 scope link 
       valid_lft forever preferred_lft forever

From what I understand (or not) it looks like the docker certificates were generated from ETH0 network adapter with address 10.0.2.15, instead of ETH1 with IP 10.1.2.2 which is also the DOCKER_HOST=tcp://10.1.2.2:2376 environment variable when executing 'vagrant service-manager env docker':

jannie rhel-ose $ vagrant service-manager env docker
# Copying TLS certificates to /home/jannie/Developer/cdk/cdk/components/rhel/rhel-ose/.vagrant/machines/default/virtualbox/docker
# Set the following environment variables to enable access to the
# docker daemon running inside of the vagrant virtual machine:
export DOCKER_HOST=tcp://10.1.2.2:2376
export DOCKER_CERT_PATH=/home/jannie/Developer/cdk/cdk/components/rhel/rhel-ose/.vagrant/machines/default/virtualbox/docker
export DOCKER_TLS_VERIFY=1
export DOCKER_API_VERSION=1.21

# run following command to configure your shell:
# eval "$(vagrant service-manager env docker)"

Any help would be appreciated, thank you.

PS. I have vagrant 1.9.3 and virtualbox 5.1.14r112924 installed, in case this matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant