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
115
votes
4answers
95k 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 ...
43
votes
3answers
28k 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: ...
37
votes
4answers
27k 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 ...
32
votes
3answers
25k 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 ...
25
votes
5answers
5k 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 ...
18
votes
4answers
26k 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: ...
18
votes
1answer
8k 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 ...
16
votes
2answers
16k 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 ...
14
votes
3answers
30k 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 ...
14
votes
1answer
46k 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 ) ...
13
votes
4answers
18k 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 ...
13
votes
1answer
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 ...
12
votes
3answers
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 ...
12
votes
1answer
2k 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)
11
votes
4answers
17k 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 ...
10
votes
2answers
3k 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 ...
9
votes
2answers
6k 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 ...
9
votes
1answer
4k 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....
8
votes
3answers
2k 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 ...
8
votes
2answers
7k 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; ...
8
votes
3answers
7k 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 ...
8
votes
1answer
930 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 ...
7
votes
2answers
17k 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 ...
7
votes
1answer
2k 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 ...
7
votes
2answers
1k views

From docker containers to Google Kubernetes

This one is a little theoretical but please bear with me. Currently I have a server running a few Docker containers (4 or 5, depending on day and time). I plan to add another one, just like the first,...
7
votes
1answer
4k 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 ...
6
votes
5answers
8k 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='...
6
votes
4answers
7k 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 ...
6
votes
1answer
5k views

Connect AWS route53 domain name with K8s LoadBalancer Service

What I'm trying to do Create a Kubernetes environment with a single API gateway service that is mapped to a DNS address. What I have done: 1) I went to AWS Route53 service and created a subdomain. 2)...
6
votes
1answer
2k 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, ...
6
votes
2answers
5k views

Unable to run Hyperkube (kubernetes) locally via Docker

I have followed this tutorial in order to run kubernetes cluster locally in a Docker container. When I run kubectl get nodes, I get: The connection to the server localhost:8080 was refused - did ...
6
votes
2answers
6k 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: ...
6
votes
1answer
1k views

How to secure a docker host to not allow rooting

I am trying to make docker on a server more secure. The main problem is that most people say "if a person has access to docker, they can be root too" for an administrator point of few this is not ...
5
votes
1answer
3k 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 ...
5
votes
3answers
3k 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 ...
5
votes
1answer
4k views

kubectl patch: add port to deployment's pod template

I have a deployment running one pod consisting of an unique container. The deployment is currently up & running, and I want to modify its pod template to add a port to the container. Here are the ...
5
votes
3answers
4k views

Resize kubernetes cluster with a different machine type?

I want to add a new node in existing kubernetes cluster, but with a different machine type. For the new node I will add label for it so that only some application will run on it. I tried the ...
5
votes
1answer
4k 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 ...
5
votes
1answer
1k views

Kops / Kubernetes: No context set in kubecfg, name is required

Someone else in my org did the initial setup Kubernetes setup with Kops on AWS, so we already have the S3 bucket config and the cluster running. My local env KOPS_STATE_STORE is pointing to the ...
5
votes
1answer
680 views

WEBRTC MCU/SFU inside kubernetes - Port Ranges?

I am using janus-gateway as a webrtc media server for group videocalling. Previously I had deployed it in a single node using docker-compose but now I want to be able to scale it horizontally. For ...
5
votes
2answers
639 views

Google Cloud Run - How to mount FileStore / NFS?

Our application requires the presence of data on two filestores. On our current Kubernetes configuration, we use a persistent volume like so: apiVersion: v1 kind: PersistentVolume metadata: name: ...
5
votes
0answers
695 views

Heapster + InfluxDB on Google Container Engine (GKE)

I am trying to figure out what the best way to run Grafana/Heapster/InfluxDB on my GKE Kubernetes cluster. From what I understand I cannot modify the kube-system namespace unless I want google to ...
5
votes
1answer
1k views

Intermittent DNS failures in Google Container Engine

[Question rewritten with details of findings.] I am running a Google Container Engine cluster with about 100 containers which perform about 100,000 API calls a day. Some of the pods started getting ...
4
votes
6answers
5k views

AWS EKS update-kubeconfig does not respect --role-arn flag

Whenever I run the following command with the role that that was used to create the eks cluster... aws eks update-kubeconfig --name eks-cluster --role-arn arn:aws:iam::999999999999:role/...
4
votes
3answers
2k views

Schedule a disk snapshot on GKE

I'd like to schedule this command line to run every 12h on Google Container Engine: gcloud compute --project "qvitoo-com" disks snapshot \ "SPECIFIC_INSTANCE_ID" --zone "europe-west1-c" --snapshot-...
4
votes
1answer
3k views

In AWS EKS, what security group allows access to master node from kubernetes client?

When I create a EKS cluster, I can access the master node from anywhere. Even though, the control plane security group only allows the worker to control plane connectivity (default configuration). ...
4
votes
1answer
1k views

Unable to list services in AWS EKS

I'm setting up my first Kubernetes EKS cluster by following the Getting Started guide but I can't get past the step that verifies access with kubectl get svc. Instead of the list of services I'm ...
4
votes
3answers
6k views

AWS could not get token: AccessDenied: User: ARN is not authorized to perform: sts:AssumeRole on resource: Role:ARN

I am following the step guide to set up and kubernetes environment on AWS. https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#role-create It already had some gochchas.. and they ...
4
votes
2answers
2k views

Kubernetes - External Connection through single IP

I need to find a way to have 1 IP that is used by all pods everytime they need to connect to the "outside world". FULL VERSION: I'm trying to integrate my application with a Payments Gateway service....
4
votes
2answers
692 views

Is there any way to attach an existing volume (one I just restored from a snapshot) to a PVC?

I have a mongodb-replicaset created with the helm chart. The chart creates PVCs based on the StorageClass I provide. I annotate my volumes with a tag picked up by a cron job that snapshots the volumes....

1 2 3 4 5 19