0

I'm trying to deploy a docker image (https://hub.docker.com/r/digitorus/eramba-db) to Kubernetes. My workflow is using docker pull digitorus/eramba-db to pull the image and using the below .yaml file to deploy to a separate namespace (eramba-1)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: eramba
  namespace: eramba-1
  labels:
     app: eramba               
spec:
  replicas: 1
  selector:
    matchLabels:
      app: eramba
  template:
    metadata:
      labels:
        app: eramba
    spec:
      containers:
      - name: eramba
        image: docker.io/digitorus/eramba:latest
        ports:
        - containerPort: 80

The master node has a status of (notReady) and the pod is pending.

David Maze
  • 130,717
  • 29
  • 175
  • 215
Bryan
  • 67
  • 7

1 Answers1

4
Taints:             node.kubernetes.io/not-ready:NoSchedule
...
Namespace                 Name
---------                 ----
kube-system               etcd-osboxes
kube-system               kube-apiserver-osboxes
kube-system               kube-controller-manager-osboxes
kube-system               kube-proxy-hhgwr
kube-system               kube-scheduler-osboxes
...

After you ran kubeadm that installed core k8s components, your cluster needs to have network plugin installed and functioning so your node can be ready for workload deployment. Then you can remove the "master" taint kubectl taint nodes --all node-role.kubernetes.io/master- so that pod can be deploy on this single node.

gohm'c
  • 13,492
  • 1
  • 9
  • 16
  • I deployed the in a separate namespace inside the cluster. Does this still apply? Thanks – Bryan Jan 07 '22 at 01:42
  • Apply as namespace is not node specific. You can see the taint by `kubectl describe node `, checkout the taint section. – gohm'c Jan 07 '22 at 01:44
  • Thank you - I've tried running the command. The deployed is still pending. And yea your right. I only have one node and that's the master node. The status of the master node is NotReady btw. Not sure if that is causing the issue. Appreciate you! – Bryan Jan 07 '22 at 02:09
  • After you ran kubeadm that installed core k8s components, what follows is the [network plugin](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network). You can start with [kubenet](https://serverfault.com/a/1079727/827162), or a comprehensive one like [Calico](https://projectcalico.docs.tigera.io/getting-started/kubernetes/helm). Make sure your computer has enough memory for all these. – gohm'c Jan 07 '22 at 02:26
  • Ahh it worked! Thanks! Another problem tho, the application isn't accessible via the IP and port. I have the pod CIDAR at 10.20.0.0/24 and when accessing 10.20.0.3:80, it just says cant establish. I've posed the describe node output above – Bryan Jan 07 '22 at 02:44
  • It's not a problem, you just need to get familiar with exposing your deployment using [service](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport). For the time being, you can use `kubectl port-forward --namespace eramba-1 pod/eramba-7455b5bb8-fnw7v 8888:80`. You can then browse http://localhost:8888. – gohm'c Jan 07 '22 at 03:02
  • Hey so when I run the port forwarding rule, it immediately "lost connection to pod" (see update in question for output). I've also check the port the container exposes is the same as the one shown in (port 80) – Bryan Jan 07 '22 at 03:32
  • 1
    There could be tweaking required in your kubelet setting. This is a question outside of your original question. Stackoverflow observes the 1 question 1 answer rule . Can you mark this as Answer (not up-vote) and start a new question regarding the port-forwarding. Please also state your operating system info and output of `kubectl version` in the new question. – gohm'c Jan 07 '22 at 03:44
  • Ahhh I see! Thank you for the help! – Bryan Jan 07 '22 at 03:46
  • Btw my new post is at if you can lend a hand :) https://stackoverflow.com/questions/70616516/cant-access-kubernetes-pod-via-ipport-port-forwarding – Bryan Jan 07 '22 at 04:13