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

Install kubectl in gcloud builder #2

Closed
wants to merge 1 commit into from

Conversation

viglesiasce
Copy link
Contributor

No description provided.

@skelterjohn
Copy link
Contributor

Thanks, and sorry that it took so long to notice this PR.

Unfortunately we cannot accept PRs to this repo - it is currently "mirror-out" from our internal codebase. I'll add it from the inside.

@skelterjohn
Copy link
Contributor

Now that I think about usage a bit, I'm not so sure that this PR is sufficient. kubectl also needs to fetch IP/user/pass for the cluster, and store that on disk to be used. The only fs that persists from step to step is in /workspace and that's not a good place to put things. I'll think about the best way to integrate this into our toolbox and update this issue when we've got something.

@viglesiasce
Copy link
Contributor Author

Sounds good @skelterjohn. I was going to go about it by doing something like this for the command:

gcloud container clusters get-credentials blah && kubectl apply -f deployment.yaml

@skelterjohn
Copy link
Contributor

That would work, certainly, but doesn't sit well with me for usage I want to document or put in examples :)

Maybe a kubectl builder that uses the gcloud builder as a base image, and has a wrapper script that checks some env vars? In this case, we could piggy-back on the env already used by gcloud and have people set CLOUDSDK_CONTAINER_CLUSTER=foobar, and the wrapper script does as you indicate.

@viglesiasce
Copy link
Contributor Author

viglesiasce commented Feb 21, 2017

<opinion>The UX of having it all spelled out and obvious in the command seems much better than a tucked in interpretation of an env variable with a wrapper script.</opinion>

@skelterjohn
Copy link
Contributor

Thanks, I appreciate your thoughts there. I've got something that allows either to work - you can spell it out like you do in your example (if you use sh as the entrypoint), or you can provide the env vars necessary.

Unfortunately, this is blocked on the scopes we give to your build. Soon-ish we hope to give your builds the https://www.googleapis.com/auth/cloud-platform scope (ie, everything) and rely on the robot permissions for restrictions. But right now the scopes don't allow getting credentials for the cluster.

When this changes, I'll update this thread.

skelterjohn pushed a commit that referenced this pull request Apr 4, 2017
ed8bfb2 broke the build

```
Step #2: Already have image: gcr.io/argo-integration-testing/bazel
Starting Step #2
Step #2: INFO: Reading 'startup' options from /root/.bazelrc: --output_base=/workspace
Step #2: ..................
Step #2: Blaze should not be called from a Blaze output directory. The pertinent workspace directory is: '/workspace/examples'
Finished Step #2
```
@ahmetb ahmetb mentioned this pull request Apr 20, 2017
@regner
Copy link

regner commented Apr 22, 2017

Don't suppose any progress has been made on this? Would really love to be able to deploy more easily to my GKE cluster from Cloud Builder.

@DocBradfordSoftware
Copy link

DocBradfordSoftware commented Apr 22, 2017

Would really love to be able to deploy more easily to my GKE cluster from Cloud Builder.

Did you see this discussion. #22

@regner
Copy link

regner commented Apr 22, 2017

I did not so thanks for linking that. :)

@bendory bendory mentioned this pull request May 18, 2017
@zonorti
Copy link

zonorti commented May 30, 2017

As there is a workaround to get kubectl working in #22, I guess, there is nothing wrong with having kubectl installed inside the image. WDYT?

@skelterjohn
Copy link
Contributor

It's certainly possible for people to use kubectl today, with some stretching. But for a version we officially support, it's important that it work well out of the box. Hopefully resolved soon, stay tuned!

@bendory
Copy link
Member

bendory commented Jun 19, 2017

Closing; we now have a supported kubectl Build Step. Please re-open (or open a new PR or issue) if our supported kubectl does not meet your needs.

(Note: since @skelterjohn's original reply on Feb 21, we are now able to accept PRs.)

@bendory bendory closed this Jun 19, 2017
@mehmetific mehmetific mentioned this pull request May 30, 2019
k0uki pushed a commit to OLTAInc/cloud-builders that referenced this pull request Oct 5, 2021
…ate-docs

Update README with more instructions.
k0uki pushed a commit to OLTAInc/cloud-builders that referenced this pull request Oct 5, 2021
@JohnGale87 JohnGale87 mentioned this pull request Jun 1, 2023
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

Successfully merging this pull request may close these issues.

6 participants