<p>I'm new to kubernetes tool, i'm trying to deploy the Angular application using docker + kubernetes, here the below Jenkins script.</p>

<pre><code>stage('Deploy') {
       container('kubectl') {        
            withCredentials([kubeconfigFile(credentialsId: 'KUBERNETES_CLUSTER_CONFIG', variable: 'KUBECONFIG')]) {
            def kubectl
               kubectl = "kubectl --kubeconfig=${KUBECONFIG} --context=demo"
               echo 'deployment to PRERELEASE!'
               sh "kubectl config get-contexts"
               sh "kubectl -n demo get pods"
               sh  "${kubectl} apply -f ./environment/pre-release -n=pre-release"
               } 
            }
            }
    }
</code></pre>

<p>Please find the below jenkins outputs </p>

<pre><code>/home/jenkins/agent/workspace/DevOps-CI_future-master-fix
[Pipeline] stage
[Pipeline] { (Deploy)
[Pipeline] container
[Pipeline] {
[Pipeline] withCredentials
Masking supported pattern matches of $KUBECONFIG
[Pipeline] {
[Pipeline] echo
deploy to deployment!!
[Pipeline] echo
deploy to PRERELEASE!
[Pipeline] sh
+ kubectl config get-contexts
CURRENT   NAME                          CLUSTER      AUTHINFO           NAMESPACE
*         demo                          kubernetes   kubernetes-admin   demo
          kubernetes-admin@kubernetes   kubernetes   kubernetes-admin   
[Pipeline] sh
+ kubectl -n demo get pods
NAME                                                      READY   STATUS    RESTARTS   AGE
worker-f99adee3-dedd-46ca-bc0d-6b24391e5865-qkd47-mwl3v   5/5     Running   0          26s
[Pipeline] sh
+ kubectl '--kubeconfig=****' '--context=demo' apply -f ./environment/pre-release '-n=pre-release'
deployment.apps/frontend-deploy unchanged
service/frontend unchanged
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
Finished: SUCCESS

</code></pre>

<p>Now the questions is after the deployment i am not able to see the pods and deployment in both machine master machine using below command, can you please some one help me how to access the application after the successful deployment .</p>

<pre><code>kubectl get pods
kubectl get services
kubectl get deployments
</code></pre>

<p>You're setting the namespace to <code>pre-release</code> when running <code>"${kubectl} apply -f ./environment/pre-release -n=pre-release"</code>.</p>

<p>To get pods in this namespace, use: <code>kubectl get pods -n pre-release</code>.</p>

<p>Namespaces are a way to separate different virtual clusters inside your single physical Kubernetes cluster. See <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/</a> for more detail.</p>
