Skip to content

Instantly share code, notes, and snippets.

@just1689
Last active May 24, 2019 11:15
Show Gist options
  • Save just1689/31e522afb069d8ea63c33ded5c045749 to your computer and use it in GitHub Desktop.
Save just1689/31e522afb069d8ea63c33ded5c045749 to your computer and use it in GitHub Desktop.
Getting around Corporate firewall Kubernetes setup
# On your laptop - connected to the Internet
## Start the registry
docker run -d -p 5000:5000 --name registry registry:2
## Pull Kubernetes Images
docker pull k8s.gcr.io/kube-apiserver:v1.14.1
docker pull k8s.gcr.io/kube-controller-manager:v1.14.1
docker pull k8s.gcr.io/kube-scheduler:v1.14.1
docker pull k8s.gcr.io/kube-proxy:v1.14.1
docker pull k8s.gcr.io/pause:3.1
docker pull k8s.gcr.io/etcd:3.3.10
docker pull k8s.gcr.io/coredns:1.3.1
## Put Kubernetes images into local registry running in container
docker tag k8s.gcr.io/kube-apiserver:v1.14.1 localhost:5000/kube-apiserver:v1.14.1
docker push localhost:5000/kube-apiserver:v1.14.1
docker tag k8s.gcr.io/kube-controller-manager:v1.14.1 localhost:5000/kube-controller-manager:v1.14.1
docker push localhost:5000/kube-controller-manager:v1.14.1
docker tag k8s.gcr.io/kube-scheduler:v1.14.1 localhost:5000/kube-scheduler:v1.14.1
docker push localhost:5000/kube-scheduler:v1.14.1
docker tag k8s.gcr.io/kube-proxy:v1.14.1 localhost:5000/kube-proxy:v1.14.1
docker push localhost:5000/kube-proxy:v1.14.1
docker tag k8s.gcr.io/pause:3.1 localhost:5000/pause:3.1
docker push localhost:5000/pause:3.1
docker tag k8s.gcr.io/etcd:3.3.10 localhost:5000/etcd:3.3.10
docker push localhost:5000/etcd:3.3.10
docker tag k8s.gcr.io/coredns:1.3.1 localhost:5000/coredns:1.3.1
docker push localhost:5000/coredns:1.3.1
# Now we'll get them onto the server... From the laptop:
# Get back on the network and then run on the laptop
ssh -R 5000:127.0.0.1:5000 user@serverhostname
# Now in that terminal session run the following
docker pull localhost:5000/kube-apiserver:v1.14.1
docker pull localhost:5000/kube-controller-manager:v1.14.1
docker pull localhost:5000/kube-scheduler:v1.14.1
docker pull localhost:5000/kube-proxy:v1.14.1
docker pull localhost:5000/pause:3.1
docker pull localhost:5000/etcd:3.3.10
docker pull localhost:5000/coredns:1.3.1
# Still in the server terminal... retag them as what they should be
docker tag localhost:5000/kube-apiserver:v1.14.1 k8s.gcr.io/kube-apiserver:v1.14.1
docker tag localhost:5000/kube-controller-manager:v1.14.1 k8s.gcr.io/kube-controller-manager:v1.14.1
docker tag localhost:5000/kube-scheduler:v1.14.1 k8s.gcr.io/kube-scheduler:v1.14.1
docker tag localhost:5000/kube-proxy:v1.14.1 k8s.gcr.io/kube-proxy:v1.14.1
docker tag localhost:5000/pause:3.1 k8s.gcr.io/pause:3.1
docker tag localhost:5000/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10
docker tag localhost:5000/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment