Bug 1397756 - [etcd3]Run etcdctl3 command failed due to etcd_hostname is different from hostname
Summary: [etcd3]Run etcdctl3 command failed due to etcd_hostname is different from hos...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Scott Dodson
QA Contact: Johnny Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-23 10:14 UTC by Gaoyun Pei
Modified: 2017-08-24 20:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-24 20:48:09 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Gaoyun Pei 2016-11-23 10:14:52 UTC
Description of problem:
When etcd_hostname used in etcd configuration is not the same as the hostname of etcd host, etcdctl3 command will fail for x509 cert error.

Version-Release number of selected component (if applicable):
openshift-ansible-3.4.26-1.git.0.882474b.el7.noarch.rpm

How reproducible:
Always

Steps to Reproduce:
1.The hostname of etcd host:
[root@jialiu1-share-master-etcd-zone2-1 ~]# hostname
jialiu1-share-master-etcd-zone2-1.c.openshift-gce-devel.internal

The ETCD_NAME used in etcd.conf
[root@jialiu1-share-master-etcd-zone2-1 ~]# grep ETCD_NAME /etc/etcd/etcd.conf
ETCD_NAME=jialiu1-share-master-etcd-zone2-1

The Subject CN in /etc/etcd/peer.crt
[root@jialiu1-share-master-etcd-zone2-1 ~]# openssl x509 -in /etc/etcd/peer.crt -text |grep Subject:
        Subject: CN=jialiu1-share-master-etcd-zone2-1


2.Run etcdctl3 command
[root@jialiu1-share-master-etcd-zone2-1 ~]# etcdctl3 member list
2016/11/23 04:51:15 Failed to dial jialiu1-share-master-etcd-zone2-1.c.openshift-gce-devel.internal:2379: connection error: desc = "transport: x509: certificate is valid for jialiu1-share-master-etcd-zone2-1, not jialiu1-share-master-etcd-zone2-1.c.openshift-gce-devel.internal"; please retry.
Error:  grpc: timed out when dialing


Actual results:


Expected results:
etcdctl3 command should work well.
Maybe we could consider using a more reliable way to detect the etcd_hostname, such as getting it from etcd.conf, instead of just using `hostname`

Additional info:


Note You need to log in before you can comment on or make changes to this bug.