Questions tagged [kubernetes]

Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users declared intentions. Using the concepts of "labels" and "pods", it groups the containers which make up an application into logical units for easy management and discovery.

Filter by
Sorted by
Tagged with
254 votes
5 answers
290k views

Kubernetes stuck on ContainerCreating

A pod in my Kubernetes cluster is stuck on "ContainerCreating" after running a create. How do I see logs for this operation in order to diagnose why it is stuck? kubectl logs doesn't seem to work ...
four43's user avatar
  • 2,795
118 votes
8 answers
137k views

Is it possible to rerun kubernetes job?

I have the following Kubernetes Job configuration: --- apiVersion: batch/v1 kind: Job metadata: name: dbload creationTimestamp: spec: template: metadata: name: dbload spec: ...
Bostone's user avatar
  • 1,313
74 votes
4 answers
65k views

Why disable swap on kubernetes

Since Kubernetes 1.8, it seems I need to disable swap on my nodes (or set --fail-swap-on to false). I cannot find the technical reason why Kubernetes insists on the swap being disabled. Is this for ...
Jeroen Jacobs's user avatar
66 votes
5 answers
113k views

How do I tell when/if/why a container in a kubernetes cluster restarts?

I have a single node kubernetes cluster in google container engine to play around with. Twice now, a small personal website I host in it has gone offline for a couple minutes. When I view the logs ...
Marc Hughes's user avatar
35 votes
6 answers
49k views

How to increase disk size in a stateful set

I'm managing an Elasticsearch deployment in Kubernetes. I see that the disk storage is getting close to full, so I would like to increase the size of the persistent volumes. I want to change this ...
Brent Bradburn's user avatar
31 votes
7 answers
31k views

rsync files to a kubernetes pod

I need to rsync a file tree to a specific pod in a kubernetes cluster. It seems it should be possible if only one can convince rsync that kubectl acts sort of like rsh. Something like: rsync --rsh='...
Bittrance's user avatar
  • 3,070
31 votes
8 answers
95k views

Kubernetes always gives 503 Service Temporarily Unavailable with multiple TLS Ingress

I have a kubernetes cluster setup by kops on Amazon Web Services I have a 2 sites setup. One is secured via SSL/TLS/https and the other is just http. Both are Wordpress sites. Domains changed to ...
Greg Pagendam-Turner's user avatar
31 votes
13 answers
141k views

kubectl get nodes error: You must be logged in to the server (Unauthorized) - how to fix

Without changes in infrastructure If I execute any kubectl command, ie: kubectl get nodes I got error You must be logged in to the server (Unauthorized) And I had working kubernetes cluster and did ...
Wojtas.Zet's user avatar
30 votes
2 answers
18k views

What is spec - selector - matchLabels used for while creating a deployment?

From Kubernetes documentation: The selector field defines how the Deployment finds which Pods to manage. But, when creating deployment, I already specify the pod template as part of the ...
Paddy's user avatar
  • 455
29 votes
3 answers
90k views

How to mount volume with specific UID in Kubernetes Pod?

So, I'm trying to get Nexus running based off of this image in Kubernetes, but it's failing with: mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied mkdir: cannot create ...
srkiNZ84's user avatar
  • 571
28 votes
5 answers
8k views

Expose port 80 and 443 on Google Container Engine without load balancer

Currently I'm working on a small hobby project which I'll make open source once it's ready. This service is running on Google Container Engine. I chose GCE to avoid configuration hassle, the costs are ...
Ruben Ernst's user avatar
24 votes
5 answers
18k views

Is microk8s suitable for production environments, or is it just for development?

microk8s appears to be an easy way to install Kubernetes on Ubuntu. Several places refer to it as an alternative to minikube, which is not aimed at production environments, and this post seems to ...
Travis's user avatar
  • 375
21 votes
4 answers
34k views

Using environment variables in Kubernetes deployment spec

I currently use a Kubernetes spec Deployment.yaml for deploying a service. The spec includes a verbatim reference to a specific IP address (marked as <static-ip-address> below): spec: type: ...
Drux's user avatar
  • 676
21 votes
4 answers
27k views

kubernetes dns resolver in nginx

I was developing locally in docker-compose, and had an nginx container doing a simple proxy_pass like so: location /app/ { proxy_pass http://webapp:3000/; proxy_http_version 1.1; ...
sharif9876's user avatar
19 votes
1 answer
91k views

Back-off restarting failed container - Error syncing pod in Minikube

I'm facing this error when trying to create pods. It is occurring with even very common images like Ubuntu,Alpine also. I'm fairly new to Kubernetes and using a Minikube Node ( version v0.24.1 ) ...
Ram Krishnan's user avatar
18 votes
9 answers
36k views

failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint

I have installed kubelet 1.26.0 on Ubuntu 22.04 using apt install kubelet command, but when I try journalctl -xeu kubelet I get the following result: ░░ ░░ The unit kubelet.service has entered the '...
best_of_man's user avatar
18 votes
3 answers
22k views

How to choose the external IP address of a Kubernetes load balancer in Google Kubernetes Engine

I'm deploying a web app using Google Kubernetes Engine and I want to make it accessible via a load balancer on an existing static IP address that I control as part of the same project in Google Cloud ...
Ben's user avatar
  • 283
18 votes
3 answers
63k views

How could I find the Kubernetes POD restart reasons

In have scaled my pods to 20 in my cluster and when I see the next day the few of the scaled pods were recreated. When I say POD recreated, it is getting deleted and created freshly and the timestamp ...
Nikhil's user avatar
  • 241
17 votes
5 answers
55k views

How to find the service principal assigned to a newly created AKS cluster?

I have just created an AKS cluster using a standard az aks create ... --ssh-key-value .... According to https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal, an AKS cluster is ...
JoaoCC's user avatar
  • 295
15 votes
6 answers
18k views

How to list all containers in Kubernetes?

How do i list all containers in Kubernetes cluster using kubectl? Current documentation doesn't mention anything like 'container' resource. kubectl get pod -o json lists all pods which contains ...
czerny's user avatar
  • 265
15 votes
3 answers
62k views

How do i view logs for my Kubernetes Ingress Controller?

I have recently started to learn about Kubernetes and i'm trying understand why my ingress controller is giving a 502 error. i'm working with google cloud platform. i can see my service of type: ...
X0r0N's user avatar
  • 265
14 votes
2 answers
4k views

Kubernetes - can I avoid using the GCE Load Balancer to reduce cost?

I'm deploying a Kubernetes cluster on GCE using Gitlab-CI. I'd like to keep the cost to a minimum - here's my current setup: Nodes run on 3 f1-micro instances A system pod running Traefik configured ...
Mitkins's user avatar
  • 255
14 votes
1 answer
5k views

Enable VPC-native (alias IP) on an existing GKE cluster

Is there a way to enable Alias IP on existing GKE cluster (with disabled Alias IP)? (Besides using https://github.com/bowei/k8s-custom-iptables to create NATs on each node)
vtemian's user avatar
  • 181
13 votes
4 answers
6k views

Error creating GCE load balancer: requested address ip is neither static nor assigned to LB

I have a situation where Kubernetes apparently can no longer assign an external IP address to a service upon kubectl create -f Deployment.yaml. kubectl describe service <my-service> reports the ...
Drux's user avatar
  • 676
13 votes
3 answers
36k views

Kubernetes nginx ingress: How to redirect foo.example.org to example.org?

My ingress currently looks like this: apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress annotations: kubernetes.io/ingress.class: nginx cert-manager.io/cluster-...
mpen's user avatar
  • 423
13 votes
1 answer
6k views

Kubernetes v1.24.3 upgrade broke ingress-nginx

After upgrading our AKS kubernetes cluster to from v1.23.8 to v1.24.3 our ingress stopped working properly. No errors logged in events and the ingress-nginx pod does not report any errors on the ...
sevenam's user avatar
  • 421
13 votes
2 answers
41k views

How to rewrite url to backend while preserving browser url in nginx ingress?

I'm trying to rewrite the path to the service while preserving the browser url with nginx ingress on kubernetes. What I need is this: http://example.com/path => http://service http://example.com/...
Natan's user avatar
  • 233
13 votes
1 answer
2k views

Graceful shutdown of Kubernetes cluster

We have a 4 node Kubernetes cluster, installed using Juju 2.0 and the official canonical Kubernetes charm. The sole purpose of this very local and private installation is development and testing. One ...
Kamil Tamiola's user avatar
12 votes
3 answers
4k views

HorizontalPodAutoscaling on Amazon EKS

When trying to setup a HorizontalPodAutoscaler on Amazon EKS, the TARGETS column always displays <unknown>/50% and when describing the HPA, I see Warning FailedGetResourceMetric 17s (x50 ...
James Mills's user avatar
11 votes
4 answers
29k views

How do I check the max pod capacity of a Kubernetes node

I am busy setting up new k8s cluster. I am using rke with the --max-pods: 200 kubelet: # https://rancher.com/docs/rke/latest/en/config-options/services/services-extras/#extra-args extra_args: ...
nelaaro's user avatar
  • 644
11 votes
2 answers
33k views

Can host aliases be assigned to deployments in Kubernetes? If so, how?

This article describes how to assign host aliases to pods in kubernetes, is there anyway to do it for a deployment and not for a pod as such? Any other suggestions to add host entries in kubernetes ...
Ulukai's user avatar
  • 919
11 votes
2 answers
17k views

Is there a regex function for kubernetes helm templates available?

I'm trying to implement an ingress helm template encoding the current application version into the url. This shall allow users to do soft migration by providing them different versions of the ...
Oliver Probst's user avatar
11 votes
1 answer
7k views

minikube/k8s/kubectl "failed to watch file [ ... ]: no space left on device"

I'm fairly new to k8s and minikube, and could use help understanding the frequent-but-not-ubiquitous error I get when running kubectl logs -f <POD NAME> I get this, sometimes, and ...
Ben's user avatar
  • 251
11 votes
1 answer
6k views

Can a Kubernetes pod span nodes?

The Docs say... A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), the shared storage for those containers, and options about how to run the ...
Bruno Bronosky's user avatar
11 votes
3 answers
30k views

How do I give a docker container its own routable IP on the original network?

Main question Imagine this scenario. A network of 192.168.0.0/24. A computer with hostname 'Docker-Host' is running a docker engine at 192.168.0.2 'Docker-Host' has sshd server running On 'Docker-...
TrevorKS's user avatar
  • 263
9 votes
4 answers
7k views

kube-proxy won't start in Minikube because of permission denied issue with /proc/sys/net/netfilter/nf_conntrack_max

After updating Arch Linux (sudo pacman -Syu) and restarting the system, Minikube fails to start because of kube-proxy. The logs show it was trying to modify /proc/sys/net/netfilter/nf_conntrack_max ...
RedGiant's user avatar
  • 211
9 votes
1 answer
3k views

NGINX vs. GCE Kubernetes ingress classes

When setting up a Kubernetes ingress on Google Container Engine, you can choose the ingress class (gce or nginx). I realize that the GCE class provisions a load balancer on Google's Cloud Platform, ...
Wes Cossick's user avatar
9 votes
1 answer
16k views

Amazon EKS: how to configure S3 access for worker nodes?

How can I configure an EKS cluster to automatically allow S3 access from worker nodes? I've set up an EKS cluster following the Getting Started guide and have run the example Guest Book app. Now I ...
jackkamm's user avatar
  • 251
9 votes
1 answer
8k views

Detecting Kubernetes OOMKilled Events in GKE Logs

I'd like to set up instrumentation for OOMKilled events, which look like this when examining a pod: Name: pnovotnak-manhole-123456789-82l2h Namespace: test Node: test-cluster-cja8smaK-oQSR/10.x....
pnovotnak's user avatar
  • 260
9 votes
1 answer
11k views

How to find out PID of the container using crictl

Kubernetes is deprecating Docker as CRI engine. Now there is containerd and CRI-O, which can be used as an alternative to it. Both can be managed via crictl from cri-tools. I need some common way to ...
kvaps's user avatar
  • 263
9 votes
2 answers
22k views

Kubernetes pod /etc/resolv.conf has the wrong nameserver

I have a 4-node cluster setup at home that I am playing with, and ran into a problem when I started trying to do pod-to-pod communications. I used Kubespray to install the nodes (1 "server/controller"...
CodeChimp's user avatar
  • 323
9 votes
1 answer
1k views

Tailing logs with GCE and stackdriver

I have a running Kubernetes cluster that aggregates it's logfiles in stackdriver and would like to tail the aggregated logs on the command line. But so far I am only able to view the json stream float ...
keyboardsamurai's user avatar
8 votes
1 answer
7k views

Worker Group VS Node Group EKS

I am trying to use https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/12.2.0(Terraform AWS EKS provider) What is the difference between worker nodes and node group?
Alex Kok's user avatar
8 votes
2 answers
23k views

Pod keeps restarting and is in a CrashLoopBackOff state

One of our pods won't start and is constantly restarting and is in a CrashLoopBackOff state: NAME READY STATUS RESTARTS AGE ...
Dexter J.'s user avatar
8 votes
1 answer
17k views

Kubernetes deployment "failed to pull image" with local registry, minikube

I'm getting a "Failed to pull image" error on my deployment in minikube with a local registry, despite other deployments using the same image registry working as expected. My workflow is to build ...
Ben's user avatar
  • 251
8 votes
3 answers
12k views

Kubernetes - how to map docker run command-line parameters to kubectl command line

I need to run this Docker command in Kubernetes: docker run -p 8080:8080 sagemath/sagemath sage -notebook I can map everything across except "-notebook" - does anyone know how to do that? Here is ...
A X's user avatar
  • 479
8 votes
2 answers
15k views

Kubernetes: relation between Service IP's and pod IP's

I'm trying to understand a bit more about Kubernetes networking. That's why I've deployed a cluster in google cloud and checked the networking: gcloud container clusters describe cluster0 | grep -i ...
DenCowboy's user avatar
  • 323
8 votes
1 answer
5k views

Static IP with "kubectl expose" on Google Container Engine stays in <pending> state forever

I am trying to expose a kubernetes "deployment" via the kubectl expose command, wih a static IP address, on Google Container Engine. With an ephemeral IP, everything works fine: kubectl expose ...
Adrian Smith's user avatar
7 votes
1 answer
8k views

400 Error with nginx-ingress to Kubernetes Dashboard

I have an ingress that connects to Kubernetes Dashboard, but I'm getting a 400 error when trying to access it. --- apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: kubernetes-...
cclloyd's user avatar
  • 593
7 votes
1 answer
2k views

SECURITY: Should containers run TLS or can they rely on its sidecar?

I wonder how security experts think about making container traffic secure. Let's take a simple K8S cluster as an example. I guess we all agree that running HTTPS instead of HTTP within each container ...
xpepermint's user avatar

1
2 3 4 5
51