<p><s>I set up a Kubernetes cluster in my private network and managed to deploy a test pods:</p>
<p>now I want to expose an external ip for the service:</p>
<p>but when I run:</p>
<pre><code>kubectl get deployments kube-verify
</code></pre>
<p>i get:</p>
<pre><code>Error from server (NotFound): deployments.apps &quot;kube-verify&quot; not found
</code></pre>
</s>
<p><strong>EDIT</strong>
Ok I try a new approach:
i have made a namespace called: verify-cluster</p>
<p>My deployment.yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: verify-cluster
  namespace: verify-cluster
  labels:
    app: verify-cluster
spec:
  replicas: 1
  selector:
    matchLabels:
      app: verify-cluster
  template:
    metadata:
      labels:
        app: verify-cluster
    spec:
      containers:
      - name: nginx
        image: nginx:1.18.0
        ports:
        - containerPort: 80
</code></pre>
<p>and service.yaml:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: verify-cluster
  namespace: verify-cluster
spec:
  type: NodePort
  selector:
    app: verify-cluster
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 30007
</code></pre>
<p>then I run:</p>
<pre><code>kubectl create -f deployment.yaml
kubectl create -f service.yaml
</code></pre>
<p>than checking</p>
<pre><code>kubectl get all -n verify-cluster
</code></pre>
<p>but than I want to check deployment with:</p>
<pre><code>kubectl get all -n verify-cluster
</code></pre>
<p>and get:</p>
<pre><code>Error from server (NotFound): deployments.apps &quot;verify-cluster&quot; not found
</code></pre>
<p>hope that's better for reproduction ?</p>
<p><strong>EDIT 2</strong>
when I deploy it to default namespace it runs directly so the issue must be something in the namespace</p>

Penryn
<p>I guess that you might have forgotten to create the namespace:</p>
<p>File my-namespace.yaml</p>
<pre><code>apiVersion: v1
kind: Namespace
metadata:
  name: &lt;insert-namespace-name-here&gt;
</code></pre>
<p>Then:</p>
<pre><code>kubectl create -f ./my-namespace.yaml
</code></pre>
