Kubernetes deployment for Local Machine

8/25/2019

I have a Oracle OCI Kubernetes Cluster. I tested a sample nginx with Loadbalancer and it works fine and can access externally. Now I have a DB & Weblogic docker container image on my Local machine(not on cluster nodes). When I try to deploy them I get an error saying it is not found in registry. I haven't uploaded the image to registry. My question is, is there a way to directly reference the image on my local box running kubectl and deploy it ?

sample nginx works

root@docker-forms-ubuntu:/docker/kubernetes# docker images
REPOSITORY                                         TAG                 IMAGE ID            CREATED             SIZE
oracle/database                                    12.2.0.1-ee         190ad0c5e1c8        46 hours ago        6.12GB
localhost/oracle/formsreports                      12.2.1.3            cd673b530298        3 days ago          14.7GB
oracle/fmw-infrastructure                          12.2.1.3            a167bf2e519e        3 days ago          6.29GB
oracle/serverjdk                                   8                   f34272b9b150        3 days ago          642MB
iad.ocir.io/orasenatdpublicsector05/guru/oracldb   12.2.1.3            331e9a596394        3 days ago          6.12GB
nginx                                              latest              5a3221f0137b        9 days ago          126MB
oraclelinux                                        7-slim              874477adb545        2 weeks ago         118MB
oraclelinux                                        latest              5f993b1aafe5        2 weeks ago         235MB
hello-world                                        latest              fce289e99eb9        7 months ago        1.84kB
root@docker-forms-ubuntu:/docker/kubernetes#

  Normal   Scheduled  22s                default-scheduler   Successfully assigned default/database-7d95f6774f-bl55h to 10.0.10.2
  Normal   BackOff    19s (x2 over 20s)  kubelet, 10.0.10.2  Back-off pulling image "oracle/database:12.2.0.1-ee"
  Warning  Failed     19s (x2 over 20s)  kubelet, 10.0.10.2  Error: ImagePullBackOff
  Normal   Pulling    5s (x2 over 21s)   kubelet, 10.0.10.2  pulling image "oracle/database:12.2.0.1-ee"
  Warning  Failed     4s (x2 over 21s)   kubelet, 10.0.10.2  Failed to pull image "oracle/database:12.2.0.1-ee": rpc error: code = Unknown desc = pull access denied for oracle/database, repository does not exist or may require 'docker login'
  Warning  Failed     4s (x2 over 21s)   kubelet, 10.0.10.2  Error: ErrImagePull
-- Gururaj Mohan
kubernetes

2 Answers

8/25/2019

Well if it is for testing purposes use docker save then use scp to copy to node(s) then set imagePullPolicy to Never. But just don't use that for production, use a container registry and if you don't have any, use this helm chart to deploy one to your cluster it'll be private.

-- Akın Özer
Source: StackOverflow

8/25/2019

is there a way to directly reference the image on my local box

No. You all but have to be running or have access to a Docker registry server to use Kubernetes.

You can't directly download things from other systems' Docker daemons. Kubernetes doesn't even store images within the cluster: when a pod spec has an image:, each individual node that runs it separately goes off and retrieves the image content. The upshot of this is that you have to upload your image to somewhere, so that the Kubernetes nodes can download it, and that "somewhere" is a Docker registry service (Docker Hub, a privately-run registry, cloud services like Amazon ECR, ...).

The various Kubernetes-on-your-workstation installations (minikube, kind, ...) generally have some way to either directly use the Kubernetes node's Docker daemon or upload an image into "the cluster", but that doesn't sound like the situation you have.

-- David Maze
Source: StackOverflow