Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

webhook-create-signed-cert.sh and kubectl 1.10 + missing fields #261

Closed
visheyra opened this issue Mar 30, 2018 · 18 comments
Closed

webhook-create-signed-cert.sh and kubectl 1.10 + missing fields #261

visheyra opened this issue Mar 30, 2018 · 18 comments

Comments

@visheyra
Copy link

Kind: BUG

istioctl version

Version: 0.6.0
GitRevision: 2cb09cdf040a8573330a127947b11e5082619895
User: root@a28f609ab931
Hub: docker.io/istio
GolangVersion: go1.9
BuildStatus: Clean

kubectl version

Client Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.0-rc.1", GitCommit:"2106a5910f6de3c07b8f329c7adaca38a0d3f825", GitTreeState:"clean", BuildDate:"2018-03-19T23:38:18Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

In kubectl 1.10+ version when you do a dry run then output it as yaml or json the following fields are missing: Kind, APIVersion

Since you just pipe the output to kubectl to apply the secret, it can happen because those mandatory fields are unset.

How to reproduce it:
You should have a kubectl client in 1.10+ at least and istio installedm then use this script to install the secret and vcertificate for the webhook => webhook-create-signed-cert.sh.

At this point you should see the following error:

error: error validating "STDIN": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false
@visheyra visheyra changed the title webhook-create-signed-cert.sh and kubectl 1.10 + webhook-create-signed-cert.sh and kubectl 1.10 + missing fields Mar 30, 2018
@jsenon
Copy link
Member

jsenon commented Mar 30, 2018

Link to kubernetes/kubectl#384

@mikedoug
Copy link

mikedoug commented Apr 4, 2018

I too ran into this problem, but worked around it for the time being by changing the bottom of the script to read:

# create the secret with CA cert and server cert/key
echo "apiVersion: v1" > ${tmpdir}/create-secret.yaml
echo "kind: Secret" >> ${tmpdir}/create-secret.yaml
kubectl create secret generic ${secret} \
        --from-file=key.pem=${tmpdir}/server-key.pem \
        --from-file=cert.pem=${tmpdir}/server-cert.pem \
        --dry-run -o yaml >> ${tmpdir}/create-secret.yaml
kubectl -n ${namespace} apply -f ${tmpdir}/create-secret.yaml

@jsenon
Copy link
Member

jsenon commented Apr 4, 2018

It seems that bug is corrected in 1.10.1 beta, will be available soon on stable version

@linsun
Copy link
Member

linsun commented Apr 4, 2018

@ayj could you help triage this?

@linsun
Copy link
Member

linsun commented Apr 4, 2018

maybe this could be just a limitation to document in our istio.io for kubectl 1.10

@jsenon
Copy link
Member

jsenon commented Apr 4, 2018

I think so, I can update docs if needed

@jsenon
Copy link
Member

jsenon commented Apr 4, 2018

Still have issue with v1.10.1 beta

./kubectl.dms create secret generic toto -o yaml --dry-run
metadata:
  creationTimestamp: null
  name: toto
./kubectl.dms version
Client Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.1-beta.0", GitCommit:"75861c097c6499acc662c1094b3e95de851bd87a", GitTreeState:"clean", BuildDate:"2018-03-26T17:27:29Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}

@ayj ayj assigned yusuoh and unassigned ayj Apr 4, 2018
@ayj
Copy link

ayj commented Apr 4, 2018

istio/istio#4466 replaced the webhook scripts. Install is now more automatic and depends on Istio CA for cert provisioning.

cc @yusuoh

@jsenon
Copy link
Member

jsenon commented Apr 5, 2018

Has mention by @nikhita : This was fixed in kubernetes/kubernetes#61808. This patch was cherry-picked into release-1.10 - kubernetes/kubernetes#61836.

@Vikash082
Copy link

Vikash082 commented Apr 12, 2018

I installed Istio today and getting same error.

@jsenon
Copy link
Member

jsenon commented Apr 12, 2018

Have you kubectl in version 1.10?

@Vikash082
Copy link

Yes

kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:55:54Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

@jsenon
Copy link
Member

jsenon commented Apr 12, 2018

You right, it's fixed on version 1.11

@Vikash082
Copy link

will only kubectl update will fix the issue ?

@Vikash082
Copy link

Don't see any version 1.11. Meanwhile, is there any work around ?

@jsenon
Copy link
Member

jsenon commented Apr 12, 2018

Have you tested the workaround from @mikedoug ?

@Vikash082
Copy link

Thanks, it worked fine.

@sakshigoel12
Copy link
Contributor

closing as @Vikash082 mentioned it is working. Please reopen if something is pending

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

No branches or pull requests

8 participants