-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Design Proposal] Setting proxy for Kaniko Pod #2064
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
535b83a
Merge branch 'master' of github.com:GoogleContainerTools/skaffold
prary 7d0bec8
Syncing
prary 7ee6503
Merge branch 'master' of https://github.com/GoogleContainerTools/skaf…
prary 8085534
Design for setting proxy for kaniko pod
prary b8eecc5
Update docs/design_proposals/kaniko-proxy-setting.md
tejal29 82fd042
Clean up design proposal
tejal29 c35f637
fix rendering
tejal29 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Title | ||
|
||
* Author(s): Prashant Arya | ||
* Design Shepherd: Tejal Desai | ||
* Date: 3rd April 2018 | ||
* Status: | ||
|
||
## Background | ||
|
||
At present if you run skaffold in seperate lab environment which doesn't have direct internet access | ||
and need proxy setting then skaffold can directly access the envrionment variable of the lab and can | ||
access the artifactory or registry but on the other hand builder like kaniko which spins up a seperate | ||
pod fails to build and push the built image to registry as it doesn't have proxy environment set. | ||
Hence skaffold run fails. | ||
|
||
To overcome this problem we can set proxy in environment variable of kaniko pod defination and get the | ||
skaffold running. We can take proxy variable in kaniko config section. | ||
|
||
|
||
Please provide a brief explanation for the following questions: | ||
|
||
1. Why is this required? So that skaffold can run in lab environment where access to internet is via proxy | ||
2. If this is a redesign, what are the drawbacks of the current implementation? I don't have idea about the other builder, | ||
3. Is there any another workaround, and if so, what are its drawbacks? I can't think of drawback | ||
4. Mention related issues, if there are any. NA | ||
|
||
Here is an example snippet for a new feature: | ||
|
||
___ | ||
Setting proxy variable in pod definition | ||
```yaml | ||
Containers: []v1.Container{ | ||
{ | ||
Name: constants.DefaultKanikoContainerName, | ||
Image: image, | ||
Args: args, | ||
ImagePullPolicy: v1.PullIfNotPresent, | ||
Env: []v1.EnvVar{ | ||
{ | ||
Name: "GOOGLE_APPLICATION_CREDENTIALS", | ||
Value: "/secret/kaniko-secret", | ||
} | ||
{ | ||
Name: "http_proxy", | ||
Value: "somevalue", | ||
} | ||
{ | ||
Name: "https_proxy", | ||
Value: "somevalue", | ||
} | ||
}, | ||
}, | ||
``` | ||
Setting the proxy would give kaniko pod internet access. Where it can contact gcr or linux update server(any install command). | ||
___ | ||
|
||
## Design | ||
|
||
Please describe your solution. Please list any: | ||
|
||
* new config changes | ||
* interface changes | ||
* design assumptions | ||
|
||
For a new config change, please mention: | ||
|
||
* Is it backwards compatible? If not, what is the deprecation policy? No idea | ||
|
||
```yaml | ||
// ClusterDetails *beta* describes how to do an on-cluster build. | ||
type ClusterDetails struct { | ||
|
||
// http_proxy | ||
http_proxy string `yaml:"http_proxy,omitempty"` | ||
|
||
// https_proxy | ||
https_proxy string `yaml:"http_proxys,omitempty"` | ||
// PullSecret is the path to the secret key file. | ||
PullSecret string `yaml:"pullSecret,omitempty"` | ||
|
||
// PullSecretName is the name of the Kubernetes secret for pulling the files | ||
// from the build context and pushing the final image. | ||
// Defaults to `kaniko-secret`. | ||
PullSecretName string `yaml:"pullSecretName,omitempty"` | ||
|
||
// Namespace is the Kubernetes namespace. | ||
// Defaults to current namespace in Kubernetes configuration. | ||
Namespace string `yaml:"namespace,omitempty"` | ||
|
||
// Timeout is the amount of time (in seconds) that this build is allowed to run. | ||
// Defaults to 20 minutes (`20m`). | ||
Timeout string `yaml:"timeout,omitempty"` | ||
|
||
// DockerConfig describes how to mount the local Docker configuration into a pod. | ||
DockerConfig *DockerConfig `yaml:"dockerConfig,omitempty"` | ||
|
||
// Resources define the resource requirements for the kaniko pod. | ||
Resources *ResourceRequirements `yaml:"resources,omitempty"` | ||
} | ||
|
||
``` | ||
|
||
### Open Issues/Question | ||
#2163 | ||
Please list any open questions here in the format. | ||
|
||
**\<Question\>** | ||
Do we need to set proxy for other builders as well. | ||
|
||
## Implementation plan | ||
As a team, we've noticed that larger PRs can go unreviewed for long periods of | ||
time. Small incremental changes get reviewed faster and are also easier for | ||
reviewers. | ||
|
||
For a design feature, list a summary of tasks breakdown for e.g.: | ||
For the example artifact sync proposal, some of the smaller tasks could be: | ||
___ | ||
|
||
1. Add new field to cluster struct | ||
2. Add logic to put all the environment variable in collection | ||
3. Pass the collection to kaniko pod definition | ||
___ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @prary, are https_proxy and http_proxys the new config values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding these 2 fields is not a big issue. I think the team is ok with it!
Would you be able to submit a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will make the changes and raise a PR for the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any deadline to raise PR?