Questions tagged [kubernetes]
KUBERNETES QUESTIONS MUST BE SPECIFICALLY RELATED TO SOFTWARE DEVELOPMENT. Configuration and deployment is off-topic here. A good rule of thumb is, if it happens outside the pod, it's probably off-topic - DevOps Stack Exchange or Server Fault may be more appropriate. If it's about code running inside the pod, it's probably OK.
kubernetes
60,251
questions
657
votes
34
answers
431k
views
How can I use local Docker images with Minikube?
I have several Docker images that I want to use with Minikube. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?
...
549
votes
27
answers
589k
views
Pods stuck in Terminating status [closed]
I tried to delete a ReplicationController with 12 pods and I could see that some of the pods are stuck in Terminating status.
My Kubernetes cluster consists of one control plane node and three ...
537
votes
11
answers
311k
views
Difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?
Question 1 - I'm reading the documentation and I'm slightly confused with the wording. It says:
ClusterIP: Exposes the service on a cluster-internal IP. Choosing this value makes the service only ...
475
votes
11
answers
175k
views
kubectl apply vs kubectl create?
What I understood by the documentation is that:
kubectl create
Creates a new k8s resource in the cluster
kubectl replace
Updates a resource in the live cluster
kubectl apply
If I want to do ...
459
votes
13
answers
171k
views
Ingress vs Load Balancer
I am quite confused about the roles of Ingress and Load Balancer in Kubernetes.
As far as I understand Ingress is used to map incoming traffic from the internet to the services running in the cluster....
448
votes
5
answers
144k
views
What's the difference between Docker Compose and Kubernetes?
While diving into Docker, Google Cloud and Kubernetes, and without clearly understanding all three of them yet, it seems to me these products are overlapping, yet they're not compatible.
For example, ...
426
votes
7
answers
119k
views
What's the difference between Apache's Mesos and Google's Kubernetes
What exactly is the difference between Apache's Mesos and Google's Kubernetes?
I understand both are server cluster management software. Can anyone elaborate where the main differences are - when ...
403
votes
11
answers
134k
views
What is the difference between a pod and a deployment?
I have been creating pods with type:deployment but I see that some documentation uses type:pod, more specifically the documentation for multi-container pods:
apiVersion: v1
kind: Pod
metadata:
name:...
375
votes
21
answers
540k
views
Command to delete all pods in all kubernetes namespaces
Upon looking at the docs, there is an API call to delete a single pod, but is there a way to delete all pods in all namespaces?
344
votes
21
answers
391k
views
How do I force Kubernetes to re-pull an image?
I have the following replication controller in Kubernetes on GKE:
apiVersion: v1
kind: ReplicationController
metadata:
name: myapp
labels:
app: myapp
spec:
replicas: 2
selector:
app: ...
339
votes
1
answer
70k
views
Where does the convention of using /healthz for application health checks come from?
In the Kubernetes/Docker ecosystem there is a convention of using /healthz as a health-check endpoint for applications.
Where does the name 'healthz' come from, and are there any particular semantics ...
323
votes
32
answers
370k
views
Kubernetes service external ip pending
I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2,
I have deployed nginx with 3 replica, YAML file is below,
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ...
321
votes
21
answers
336k
views
How do I get logs from all pods of a Kubernetes replication controller?
Running kubectl logs shows me the stderr/stdout of one Kubernetes container.
How can I get the aggregated stderr/stdout of a set of pods, preferably those created by a certain replication ...
320
votes
17
answers
156k
views
Difference between targetPort and port in Kubernetes Service definition
A Kubernetes Service can have a targetPort and port in the service definition:
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
...
315
votes
9
answers
230k
views
How can I trigger a Kubernetes Scheduled Job manually?
I've created a Kubernetes Scheduled Job, which runs twice a day according to its schedule. However, I would like to trigger it manually for testing purposes. How can I do this?
302
votes
35
answers
433k
views
Namespace "stucked" as Terminating, How I removed it
I've had a "stuck" namespace that I deleted showing in this eternal "terminating" status.
302
votes
12
answers
345k
views
How to switch namespace in kubernetes
Say, I have two namespaces k8s-app1 and k8s-app2
I can list all pods from specific namespace using the below command
kubectl get pods -n <namespace>
We need to append namespace to all ...
299
votes
18
answers
558k
views
How can I keep a container running on Kubernetes?
I'm now trying to run a simple container with shell (/bin/bash) on a Kubernetes cluster.
I thought that there was a way to keep a container running on a Docker container by using pseudo-tty and ...
293
votes
25
answers
276k
views
Kubernetes pod gets recreated when deleted
I have started pods with command
$ kubectl run busybox \
--image=busybox \
--restart=Never \
--tty \
-i \
--generator=run-pod/v1
Something went wrong, and now I can't delete this Pod.
I tried using ...
283
votes
7
answers
326k
views
Service located in another namespace
I have been trying to find a way to define a service in one namespace that links to a Pod running in another namespace. I know that containers in a Pod running in namespaceA can access serviceX ...
283
votes
25
answers
416k
views
Get YAML for deployed Kubernetes services?
I am trying to deploy my app to Kubernetes running in Google Container
Engine.
The app can be found at: https://github.com/Industrial/docker-znc.
The Dockerfile is built into an image on Google ...
278
votes
15
answers
191k
views
How to switch kubectl clusters between gcloud and minikube
I have Kubernetes operating well in two different environments, namely in my local environment (MacBook running minikube) and as well as on Google's Container Engine (GCE, Kubernetes on Google Cloud). ...
265
votes
8
answers
371k
views
Kubernetes how to make Deployment to update image
I do have deployment with single pod, with my custom docker image like:
containers:
- name: mycontainer
image: myimage:latest
During development I want to push new latest version and make ...
265
votes
21
answers
495k
views
How to copy files from kubernetes Pods to local system
I'm trying to copy files from Kubernetes Pods to my local system. I am getting the below error while running following command:
kubectl cp aks-ssh2-6cd4948f6f-fp9tl:/home/azureuser/test.cap ./test....
260
votes
14
answers
233k
views
kubectl logs - continuously
kubectl logs <pod-id>
gets latest logs from my deployment - I am working on a bug and interested to know the logs at runtime - How can I get continuous stream of logs ?
edit: corrected ...
257
votes
13
answers
272k
views
Restart pods when configmap updates in Kubernetes?
How do I automatically restart Kubernetes pods and pods associated with deployments when their configmap is changed/updated?
I know there's been talk about the ability to automatically restart pods ...
256
votes
6
answers
258k
views
Kubernetes API - Get Pods on Specific Nodes
Reading the Kubernets documentation it looks to be possible to select a certain range of pods based on labels. I want to select all the pods on one node but I don't want to label each pod on their ...
251
votes
4
answers
261k
views
Kubernetes: How do I delete clusters and contexts from kubectl config?
kubectl config view shows contexts and clusters corresponding to clusters that I have deleted.
How can I remove those entries?
The command
kubectl config unset clusters
appears to delete all ...
242
votes
20
answers
212k
views
Is there a way to share secrets across namespaces in Kubernetes?
Is there a way to share secrets across namespaces in Kubernetes?
My use case is: I have the same private registry for all my namespaces and I want to avoid creating the same secret for each.
240
votes
8
answers
335k
views
How does kubectl port-forward create a connection?
kubectl exposes commands that can be used to create a Service for an application and assigns an IP address to access it from internet.
As far as I understand, to access any application within ...
231
votes
9
answers
328k
views
How to delete all resources from Kubernetes one time? [closed]
Include:
Daemon Sets
Deployments
Jobs
Pods
Replica Sets
Replication Controllers
Stateful Sets
Services
...
If has replicationcontroller, when delete some deployments they will regenerate. Is there a ...
227
votes
14
answers
308k
views
How can I debug "ImagePullBackOff"?
All of a sudden, I cannot deploy some images which could be deployed before. I got the following pod status:
[root@webdev2 origin]# oc get pods
NAME READY STATUS ...
225
votes
6
answers
219k
views
What's the best way to share/mount one file into a pod?
I was considering using secrets to mount a single file but it seems that you can only mount directory that will overwrites all the other content. How can I share a single config file without mounting ...
224
votes
9
answers
74k
views
Multiple environments (Staging, QA, production, etc) with Kubernetes [closed]
What is considered a good practice with K8S for managing multiple environments (QA, Staging, Production, Dev, etc)?
As an example, say that a team is working on a product which requires deploying a ...
223
votes
14
answers
142k
views
At least one invalid signature was encountered
I am trying to build and deploy microservices images to a single-node Kubernetes cluster running on my development machine using minikube. I am using the cloud-native microservices demo application ...
222
votes
12
answers
334k
views
How to set multiple commands in one yaml file with Kubernetes?
In this official document, it can run command in a yaml config file:
https://kubernetes.io/docs/tasks/configure-pod-container/
apiVersion: v1
kind: Pod
metadata:
name: hello-world
spec: # ...
220
votes
3
answers
108k
views
What is a headless service, what does it do/accomplish, and what are some legitimate use cases for it?
I've read a couple of passages from some books written on Kubernetes as well as the page on headless services in the docs. But I'm still unsure what it really actually does and why someone would use ...
217
votes
19
answers
709k
views
Checking Kubernetes pod CPU and memory utilization
I am trying to see how much memory and CPU is utilized by a kubernetes pod. I ran the following command for this:
kubectl top pod podname --namespace=default
I am getting the following error:
W0205 ...
217
votes
22
answers
414k
views
My kubernetes pods keep crashing with "CrashLoopBackOff" but I can't find any log
This is what I keep getting:
[root@centos-master ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
nfs-server-h6nw8 1/1 Running 0 1h
nfs-...
210
votes
16
answers
441k
views
Restart container within pod
I have a pod test-1495806908-xn5jn with 2 containers. I'd like to restart one of them called container-test. Is it possible to restart a single container within a pod and how? If not, how do I restart ...
208
votes
19
answers
326k
views
Decoding Kubernetes secret
I inherited a Kubernetes/Docker setup, and I accidentally crashed the pod by changing something relating to the DB password.
I am trying to troubleshoot this.
I don't have much Kubernetes or Docker ...
206
votes
7
answers
129k
views
Kubernetes Deployments vs StatefulSets
I've been doing a lot of digging on Kubernetes, and I'm liking what I see a lot! One thing I've been unable to get a clear idea about is what the exact distinctions are between the Deployment and ...
199
votes
14
answers
226k
views
How to sign in kubernetes dashboard?
I just upgraded kubeadm and kubelet to v1.8.0. And install the dashboard following the official document.
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/...
199
votes
14
answers
235k
views
Listing all resources in a namespace
I would like to see all resources in a namespace.
Doing kubectl get all will, despite of the name, not list things like services and ingresses.
If I know the the type I can explicitly ask for that ...
192
votes
16
answers
291k
views
How do you cleanly list all the containers in a kubernetes pod?
I am looking to list all the containers in a pod in a script that gather's logs after running a test. kubectl describe pods -l k8s-app=kube-dns returns a lot of info, but I am just looking for a ...
188
votes
9
answers
217k
views
How can I update a secret on Kubernetes when it is generated from a file?
I've created a secret using
kubectl create secret generic production-tls \
--from-file=./tls.key \
--from-file=./tls.crt
If I'd like to update the values - how can I do this?
184
votes
8
answers
264k
views
Kubernetes: list all pods and its nodes
I have 3 nodes, running all kinds of pods. I would like to have a list of nodes and pods, for an example:
NODE1 POD1
NODE1 POD2
NODE2 POD3
NODE3 POD4
How can this please be achieved?
184
votes
10
answers
298k
views
kubectl get events only for a pod
When I run kubectl -n abc-namespace describe pod my-pod-zl6m6, I get a lot of information about the pod along with the Events in the end.
Is there a way to output just the Events of the pod either ...
182
votes
9
answers
95k
views
Clean up "Replica Sets" when updating deployments?
Every time a deployment gets updated, a new replica set is added to a long list. Should the old rs be cleaned?