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

Instructions for using stdin with kubectl #1289

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

gfvirga
Copy link
Contributor

@gfvirga gfvirga commented May 27, 2020

Description
Instructions for using stdin with kubectl
#1139 (comment)

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.
Output of running the example in a test environment with docker.config and ssl certificates loaded.

Examples of user facing changes:
$ echo -e 'FROM jfrog.prod.com/docker/alpine \nRUN echo "created from standard input"' > Dockerfile | tar -cf - Dockerfile | gzip -9 | kubectl run kanikotest \
> --rm --stdin=true \
> --image=gcr.io/kaniko-project/executor:latest --restart=Never \
> --overrides='{ 
>   "apiVersion": "v1",
>   "spec": {
>     "containers": [
>     {
>       "name": "kanikotest",
>       "image": "gcr.io/kaniko-project/executor:latest",
>       "stdin": true,
>       "stdinOnce": true,
>       "args": [
>   "--dockerfile=Dockerfile",
>   "--context=tar://stdin",
>   "--no-push" ],
>       "volumeMounts": [
>         { 
>           "name": "cabundle",
>           "mountPath": "/kaniko/ssl/certs/"
>         },
>         { 
>           "name": "docker-config", 
>           "mountPath": "/kaniko/.docker/"
>       }]
>     }],
>     "volumes": [
>     {
>       "name": "cabundle",
>       "configMap": {
>         "name": "cabundle"}},
>     { 
>       "name": "docker-config",
>       "configMap": { 
>         "name": "docker-config" }}
>     ]
>   }
> }'
If you don't see a command prompt, try pressing enter.
INFO[0000] Retrieving image manifest bar.prod.com/docker/alpine 
E0527 21:36:05.583917       1 aws_credentials.go:77] while getting AWS credentials NoCredentialProviders: no valid providers in chain. Deprecated.
        For verbose messaging see aws.Config.CredentialsChainVerboseErrors
INFO[0016] Retrieving image manifest jfrog.prod.com/docker/alpine 
INFO[0018] Built cross stage deps: map[]                
INFO[0018] Retrieving image manifest jfrog.prod.com/docker/alpine 
INFO[0020] Retrieving image manifest jfrog.prod.com/docker/alpine 
INFO[0021] Executing 0 build triggers                   
INFO[0021] Unpacking rootfs as cmd RUN echo "created from standard input" requires it. 
INFO[0022] RUN echo "created from standard input"       
INFO[0022] Taking snapshot of full filesystem...        
INFO[0022] Resolving 483 paths                          
INFO[0022] cmd: /bin/sh                                 
INFO[0022] args: [-c echo "created from standard input"] 
INFO[0022] Running: [/bin/sh -c echo "created from standard input"] 
created from standard input
INFO[0022] Taking snapshot of full filesystem...        
INFO[0022] Resolving 483 paths                          
INFO[0022] No files were changed, appending empty layer to config. No layer added to image. 
INFO[0022] Skipping push to container registry due to --no-push flag 
pod "kanikotest" deleted

Example on README of how to run kaniko using kubectl and standard input
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no CLA not signed by all commit authors label May 27, 2020
@gfvirga
Copy link
Contributor Author

gfvirga commented May 27, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes CLA signed by all commit authors and removed cla: no CLA not signed by all commit authors labels May 27, 2020
@tejal29 tejal29 merged commit 6f9490c into GoogleContainerTools:master Jun 2, 2020
@kvaps
Copy link
Contributor

kvaps commented Aug 28, 2020

Hi, I was inspired by this and created kaniko plugin for kubectl
https://github.com/kvaps/kubectl-kaniko

@kvaps kvaps mentioned this pull request Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants