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

etcdctl v3: k8s changes its internal format to proto, and the etcdctl result is unreadable. #44670

Closed
strugglingyouth opened this issue Apr 19, 2017 · 4 comments

Comments

@strugglingyouth
Copy link

@strugglingyouth strugglingyouth commented Apr 19, 2017

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

BUG REPORT

Kubernetes version (use kubectl version):

kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.0", GitCommit:"fff5156092b56e6bd60fff75aad4dc9de6b6ef37", GitTreeState:"clean", BuildDate:"2017-03-28T16:36:33Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): CentOS Linux release 7.2.1511 (Core)
  • Kernel (e.g. uname -a): 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
  • Others:
$ etcdctl version
etcdctl version: 3.1.3
API version: 3.1

I want to get minion by command line. The command as follow:

$ etcdctl --endpoints=https://xxxx:2379 --cert=/etc/ssl/etcd/tmp/member0.pem --key=/etc/ssl/etcd/tmp/member0-key.pem --cacert=/etc/ssl/etcd/tmp/ca.pem get --prefix /registry/minions -w  fields

.....
"Key" : "/registry/minions/xxxx"
"CreateRevision" : 2909257
"ModRevision" : 4433260
"Version" : 51261
"Value" : "k8s\x00\n\n\n\x02v1\x12\x04Node\x12\x83\x1e\n\xb0\x02\n\fxxxx\x12\x00\x1a\x00\"\x19/api/v1/nodesxxxx*$cc1b0c58-1ffb-11e7-9c4a-6c92bf3b24412\x008\x00B\b\b\x9d\xe9\xbb\xc7\x05\x10\x00Z&\n\x16kubernetes.io/hostname\x12\xxxx \n\x17beta.kubernetes.io/arch\x12\x05amd64Z\x1e\n\x15beta.kubernetes.io/os\x12\x05linuxb!\n\x1cnode.alpha.kubernetes.io/ttl\x12\x010b>\n6volumes.kubernetes.io/controller-managed-attach-detach\x12\x04truez\x00\x12\x14\n\x00\x12\fxxxx\x1a\x00 \x00\x1a\xb7\x1b\n\v\n\x03cpu\x12\x04\n\x0248\n\x17\n\x06memory\x12\r\n\v263905032Ki\n\r\n\x04pods\x12\x05\n\x03110\x12\r\n\x04pods\x12\x05\n\x03110\x12\v\n\x03cpu\x12\x04\n\x0248\x12\x17\n\x06memory\x12\r\n\v263802632Ki\x1a\x00\"m\n\tOutOfDisk\x12\x05False\x1a\b\b؞\xdc\xc7\x05\x10\x00\"\b\b\xe6\xd7\xdb\xc7\x05\x10\x00*\x18KubeletHasSufficientDisk2+kubelet has sufficient disk space available\"p\n\x0eMemoryPressure\x12\x05False\x1a\b\b؞\xdc\xc7\x05\x10\x00\"\b\b\xe6\xd7\xdb\xc7\x05\x10\x00*\x1aKubeletHasSufficientMemory2'kubelet has sufficient memory available\"a\n\fDiskPressure\x12\x05False\x1a\b\b؞\xdc\xc7\x05\x10\x00\"\b\b\xe6\xd7\xdb\xc7\x0
....

"Lease" : %!d(string=)
"More" : false
"Count" : 10

And the result is unreadable.Follow is my create issue in etcd,but etcd's member xiang90 says that is k8s problem.

etcd-io/etcd#7774

xiang90 commented an hour ago

k8s changes its internal format to proto, which is a binary protocol. it has nothing to do with etcd.

please create k8s related issue in k8s repo.

@ncdc

This comment has been minimized.

Copy link
Member

@ncdc ncdc commented Apr 19, 2017

You could try adapting https://github.com/openshift/origin/blob/master/tools/etcdhelper/etcdhelper.go to work for you (i.e. remove the OpenShift imports).

@strugglingyouth

This comment has been minimized.

Copy link
Author

@strugglingyouth strugglingyouth commented Apr 20, 2017

@ncdc

Is there any other command line tool? Or this problem will be solved in which version of k8s?

@liggitt

This comment has been minimized.

Copy link
Member

@liggitt liggitt commented Apr 20, 2017

this problem will be solved in which version of k8s?

it's not a bug, this is working as designed.

if you want to integrate JSON-reading tools directly against etcd, that is not recommended, but you can continue to do that by making k8s continue to store JSON in etcd with --storage-media-type=application/json

@chestack

This comment has been minimized.

Copy link
Contributor

@chestack chestack commented Nov 1, 2018

@ncdc , thanks a lot. the openshift tool works.
But it's really more convenient to have a command line tool to read the values in etcd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.