4,855 questions
1
vote
1
answer
30k
views
How do I test a ClusterIssuer solver?
I'm attempting to deploy a Kubernetes cluster with an SSL certificate using LetsEncrypt on DigitalOcean. I followed these instructions, and everything works right up until the challenge order is ...
684
votes
36
answers
473k
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?
...
331
votes
31
answers
404k
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: ...
103
votes
6
answers
192k
views
Expose port in minikube [closed]
In minikube, how to expose a service using nodeport ?
For example, I start a kubernetes cluster using the following command and create and expose a port like this:
$ minikube start
$ kubectl run ...
310
votes
19
answers
636k
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 ...
181
votes
6
answers
329k
views
pod has unbound PersistentVolumeClaims
When I push my deployments, for some reason, I'm getting the error on my pods:
pod has unbound PersistentVolumeClaims
Here are my YAML below:
This is running locally, not on any cloud solution.
...
557
votes
11
answers
330k
views
Difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes? [closed]
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 ...
232
votes
12
answers
366k
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: # ...
222
votes
25
answers
451k
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-...
161
votes
13
answers
405k
views
Kubernetes: how to set VolumeMount user group and file permissions
I'm running a Kubernetes cluster on AWS using kops. I've mounted an EBS volume onto a container and it is visible from my application but it's read only because my application does not run as root. ...
291
votes
7
answers
377k
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 ...
149
votes
8
answers
281k
views
How to pull environment variables with Helm charts
I have my deployment.yaml file within the templates directory of Helm charts with several environment variables for the container I will be running using Helm.
Now I want to be able to pull the ...
272
votes
10
answers
411k
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 ...
6
votes
1
answer
11k
views
Why container memory usage is doubled in cAdvisor metrics?
I tested those queries. The first query was half the value of the second query:
sum(container_memory_working_set_bytes{image!="",name=~"^k8s_.*",pod=~"$pod"}) by (pod)
...
245
votes
7
answers
361k
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 ...
331
votes
17
answers
179k
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
...
154
votes
18
answers
256k
views
Kubernetes Pod Warning: 1 node(s) had volume node affinity conflict
I try to set up Kubernetes cluster. I have Persistent Volume, Persistent Volume Claim and Storage class all set-up and running but when I wan to create pod from deployment, pod is created but it hangs ...
144
votes
12
answers
130k
views
How do I access the Kubernetes api from within a pod container?
I used to be able to curl
https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1beta3/namespaces/default/
as my base URL, but in kubernetes 0.18.0 it gives me "unauthorized". The ...
140
votes
20
answers
197k
views
How to set dynamic values with Kubernetes yaml file
For example, a deployment yaml file:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: guestbook
spec:
replicas: 2
template:
metadata:
labels:
app: guestbook
...
76
votes
3
answers
94k
views
Helm install in certain order
I am trying to create a Helm Chart with the following resources:
Secret
ConfigMap
Service
Job
Deployment
These are also in the order that I would like them to be deployed. I have put a hook in the ...
115
votes
10
answers
189k
views
How to share storage between Kubernetes pods?
I am evaluating Kubernetes as a platform for our new application. For now, it looks all very exciting! However, I’m running into a problem: I’m hosting my cluster on GCE and I need some mechanism to ...
83
votes
9
answers
105k
views
Mount local directory into pod in minikube
I am running minikube v0.24.1. In this minikube, I will create a Pod for my nginx application. And also I want to pass data from my local directory.
That means I want to mount my local $HOME/go/src/...
59
votes
8
answers
51k
views
Pass environment variable into a Vue App at runtime
How can I access environment variables in Vue, that are passed to the container at runtime and not during the build?
Stack is as follows:
VueCLI 3.0.5
Docker
Kubernetes
There are suggested solutions ...
25
votes
6
answers
12k
views
Minikube expose MySQL running on localhost as service
I have minikube version v0.17.1 running on my machine. I want to simulate the environment I will have in AWS, where my MySQL instance will be outside of my Kubernetes cluster.
Basically, how can I ...
484
votes
11
answers
182k
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 ...
128
votes
7
answers
99k
views
Tell when Job is Complete
I'm looking for a way to tell (from within a script) when a Kubernetes Job has completed. I want to then get the logs out of the containers and perform cleanup.
What would be a good way to do this? ...
73
votes
7
answers
92k
views
How to run kubectl commands inside a container?
In a container inside a pod, how can I run a command using kubectl? For example, if i need to do something like this inside a container:
kubectl get pods
I have tried this : In my dockerfile, I ...
10
votes
5
answers
56k
views
chown: changing ownership of '/data/db': Operation not permitted
Can we use nfs volume plugin to maintain the High Availability and Disaster Recovery among the kubernetes cluster?
I am running the pod with MongoDB. Getting the error
chown: changing ownership ...
270
votes
15
answers
307k
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 ...
248
votes
19
answers
854k
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 ...
232
votes
6
answers
248k
views
What's the best way to share/mount one file into a pod? [closed]
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 ...
99
votes
20
answers
357k
views
kubectl unable to connect to server: x509: certificate signed by unknown authority
i'm getting an error when running kubectl one one machine (windows)
the k8s cluster is running on CentOs 7 kubernetes cluster 1.7
master, worker
Here's my .kube\config
apiVersion: v1
clusters:
- ...
45
votes
3
answers
59k
views
Service account secret is not listed. How to fix it?
I have used kubectl create serviceaccount sa1 to create service account. Then I used kubectl get serviceaccount sa1 -oyaml command to get service account info. But it returns as below.
apiVersion: v1
...
12
votes
2
answers
18k
views
kubernetes pod memory - java gc logs
On the kubernetes dashboard, there's a pod wherein the Memory Usage (bytes) is displayed as 904.38Mi.
This pod holds the java app that was ran with -Xms512m -Xmx1024m, and on kubernetes deployment ...
471
votes
14
answers
184k
views
Ingress vs Load Balancer [closed]
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....
66
votes
10
answers
54k
views
How to force SSL for Kubernetes Ingress on GKE
Is there a way to force an SSL upgrade for incoming connections on the ingress load-balancer? Or if that is not possible with, can I disable port :80? I haven't found a good documentation pages that ...
58
votes
5
answers
79k
views
How to create a kubectl config file for serviceaccount
I have a kubernetes cluster on Azure and I created 2 namespaces and 2 service accounts because I have two teams deploying on the cluster.
I want to give each team their own kubeconfig file for the ...
365
votes
21
answers
441k
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: ...
256
votes
3
answers
148k
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 ...
238
votes
14
answers
353k
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 ...
154
votes
20
answers
385k
views
Exec commands on kubernetes pods with root access
I have one pod running with name 'jenkins-app-2843651954-4zqdp'. I want to install few softwares temporarily on this pod. How can I do this?
I am trying this- kubectl exec -it jenkins-app-2843651954-...
88
votes
10
answers
101k
views
Can a PVC be bound to a specific PV?
This was discussed by k8s maintainers in https://github.com/kubernetes/kubernetes/issues/7438#issuecomment-97148195:
Allowing users to ask for a specific PV breaks the separation between them
I don't ...
67
votes
3
answers
70k
views
Kubernetes Persistent Volume Access Modes: ReadWriteOnce vs ReadOnlyMany vs ReadWriteMany
As per this official document, Kubernetes Persistent Volumes support three types of access modes.
ReadOnlyMany
ReadWriteOnce
ReadWriteMany
The given definitions of them in the document is very high-...
62
votes
6
answers
100k
views
Kubernetes - wait for other pod to be ready [closed]
I have two applications - app1 and app2, where app1 is a config server that holds configs for app2. I have defined /readiness endpoint in app1 and need to wait till it returns OK status to start up ...
58
votes
16
answers
320k
views
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html"
I deployed my angular application(Static webpage) on kubernetes and tried launching it from Google Chrome. I see app is loading, however there is nothing displayed on the browser. Upon checking on ...
47
votes
11
answers
100k
views
Allow scheduling of pods on Kubernetes master?
I set up Kubernetes on CoreOS on bare metal using the generic install scripts. It's running the current stable release, 1298.6.0, with Kubernetes version 1.5.4.
We'd like to have a highly available ...
35
votes
3
answers
56k
views
How to assign a namespace to certain nodes?
Is there any way to configure nodeSelector at the namespace level?
I want to run a workload only on certain nodes for this namespace.
20
votes
5
answers
55k
views
Kubernetes Cross Namespace Ingress Network [closed]
I have a simple ingress network, I want to access services at different namespaces, from this ingress network.
How I can do this?
My ingress network yaml file:
apiVersion: extensions/v1beta1
kind: ...
235
votes
14
answers
333k
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 ...
126
votes
9
answers
126k
views
Can you connect to Amazon ElastiСache Redis outside of Amazon? [closed]
I'm able to connect to an ElastiCache Redis instance in a VPC from EC2 instances. But I would like to know if there is a way to connect to an ElastiCache Redis node outside of Amazon EC2 instances, ...