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. If it's about code running inside the pod, it's probably OK.
60,323
questions
649
votes
34
answers
418k
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?
...
544
votes
27
answers
558k
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 ...
533
votes
11
answers
306k
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 ...
473
votes
11
answers
173k
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 ...
457
votes
13
answers
167k
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
140k
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 ...
398
votes
11
answers
131k
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:...
372
votes
20
answers
526k
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?
337
votes
21
answers
378k
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: ...
324
votes
1
answer
65k
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 ...
319
votes
32
answers
358k
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: ...
315
votes
16
answers
149k
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
...
310
votes
21
answers
320k
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 ...
306
votes
9
answers
214k
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?
296
votes
35
answers
401k
views
Namespace "stucked" as Terminating, How I removed it
I've had a "stuck" namespace that I deleted showing in this eternal "terminating" status.
294
votes
17
answers
535k
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 ...
292
votes
25
answers
268k
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 ...
286
votes
12
answers
319k
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 ...
279
votes
7
answers
311k
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 ...
274
votes
24
answers
390k
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 ...
273
votes
15
answers
182k
views
How to switch kubectl clusters between gcloud and minikube
I have Kubernetes working 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). ...
264
votes
8
answers
358k
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 ...
256
votes
20
answers
469k
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....
252
votes
6
answers
246k
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 ...
252
votes
13
answers
262k
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 ...
251
votes
14
answers
220k
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 ...
249
votes
4
answers
255k
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 ...
236
votes
20
answers
201k
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.
236
votes
7
answers
325k
views
How kubectl port-forward works?
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 ...
227
votes
14
answers
300k
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 ...
224
votes
9
answers
71k
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
9
answers
313k
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 ...
221
votes
12
answers
323k
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
6
answers
210k
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 ...
217
votes
3
answers
99k
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 ...
216
votes
22
answers
402k
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-...
211
votes
19
answers
668k
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 ...
209
votes
14
answers
132k
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 ...
207
votes
16
answers
432k
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 ...
204
votes
7
answers
126k
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 ...
196
votes
14
answers
221k
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/...
196
votes
19
answers
299k
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 ...
192
votes
14
answers
209k
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 ...
189
votes
16
answers
273k
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 ...
185
votes
9
answers
207k
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?
181
votes
8
answers
248k
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?
178
votes
10
answers
283k
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 ...
174
votes
9
answers
90k
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?