<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>

<p>First you need to get the deployment by</p>
<pre><code>$ kubectl get deployment
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
test-deployment   1/1     1            1           15m
</code></pre>
<p>If you have used any namespace then</p>
<pre><code>$ kubectl get deployment -n your-namesapce
</code></pre>
<p>Then use the exact name in further commands example</p>
<pre><code>kubectl scale deployment test-deployment --replicas=10
</code></pre>
