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

HTTP/HTTPs Proxy for kaniko pod while running in isolated environment #2063

Closed
prary opened this issue May 3, 2019 · 2 comments
Closed

HTTP/HTTPs Proxy for kaniko pod while running in isolated environment #2063

prary opened this issue May 3, 2019 · 2 comments

Comments

@prary
Copy link
Contributor

prary commented May 3, 2019

Expected behavior

Run skaffold in lab environment where access to internet is via proxy and use kaniko as image builder. Now skaffold spins up kaniko pod which doesn't have proxy set which results in base image pull failure, hence both kaniko and skaffold fails

Actual behavior

skaffold should run seamless irrespective of environment.

Possible Solution

Kaniko config should have http_proxy and https_proxy field and they should be passed as the environment variable to the kaniko pod.

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",
                        }
                    },
                },

Information

  • Skaffold version: latest
  • Operating system: rhel
  • Contents of skaffold.yaml:
apiVersion: skaffold/
kind: Config
build:
  artifacts:
# denotes the user’s image push location in artifactory, ensure user write permission in artifactory, this should be the same location referenced in your respective deployment yml
  - image: www.a.com/kube/pythonserver
    context: .
    sync:
      '*.py': .
  kaniko:
    buildContext:
      localDir: {}
    namespace: 103000-prash-dev
    podGracePeriodSeconds: 10
    dockerConfig:
      path: C:\Users\prashant\.docker\config.json
deploy:
  kubectl:
    manifests:
#must match the kubernetes deploy file name of application
      - deploy.yml

Steps to reproduce the behavior

  1. Run skaffold in lab environment where access to internet is via proxy
  2. Skaffold fails at kaniko image building phase
@prary prary changed the title Proxy for kaniko pod while running in isolated environment HTTP/HTTPs Proxy for kaniko pod while running in isolated environment May 3, 2019
@priyawadhwa
Copy link
Contributor

Design doc here: #2064

@prary
Copy link
Contributor Author

prary commented Jul 24, 2019

closing the issue since #2283 does the job.

@prary prary closed this as completed Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants