Questions tagged [kubernetes-deployment]
260 questions
10
votes
2 answers
K8S deployments with shared environment variables
We have a set of deployments (sets of pods) that are all using same docker image. Examples:
web api
web admin
web tasks worker nodes
data tasks worker nodes
...
They all require a set of environment variables that are common, for example location…

pjotr_dolphin
- 1,207
- 9
- 34
9
votes
1 answer
What is the need of defining .spec.selectors in Kubernetes Deployment.yaml file?
The .spec.selector field defines how the Deployment finds which Pods to manage. But we also defines labels inside template then what is the extra things we are getting with .spec.selectors field because Deployment can find the Pods to be managed…

Pulkit Sharma
- 390
- 2
- 14
9
votes
2 answers
Kubernetes Secret TLS Certificate P12 and Spring Boot Deployment doesn't work
I'm currently stuck and don`t know how to proceed.
This is my Spring Boot…

Philip Petrov
- 95
- 1
- 1
- 11
8
votes
1 answer
Kubernetes spread pods across nodes using podAntiAffinity vs topologySpreadConstraints
I am currently using the following to attempt to spread Kubernetes pods in a given deployment across all Kubernetes nodes evenly:
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
…

Justin
- 42,716
- 77
- 201
- 296
8
votes
2 answers
kubectl drain and rolling update, downtime
Does kubectl drain first make sure that pods with replicas=1 are healthy on some other node?
Assuming the pod is controlled by a deployment, and the pods can indeed be moved to other nodes.
Currently as I see it only evict (delete pods) from the…

user3599803
- 6,435
- 17
- 69
- 130
7
votes
2 answers
helm rollback fails to identify the failed deployments when re-triggered
I have a scenario like below,
Have two releases - Release-A and Release-B.
Currently, I am on Release-A and need an upgrade of all the microservices to Release-B.
I tried performing the helm upgrade of microservice - "mymicroservice" with the below…

sriniev
- 81
- 1
- 3
7
votes
1 answer
Helm wait till dependency deployment are ready on kubernetes
I'm using helm chart to deploy my application on kubernetes. But services that I'm using in my stack depends on other services how do I make sure helm will not deploy until the dependencies are up?

Cycl0n3
- 611
- 1
- 6
- 25
6
votes
3 answers
how to set different environment variables of Deployment replicas in kubernetes
I have 4 k8s pods by setting the replicas of Deployment to 4 now.
apiVersion: v1
kind: Deployment
metadata:
...
spec:
...
replicas: 4
...
The POD will get items in a database and consume it, the items in database has a column class_name.
now…

hxidkd
- 61
- 1
- 1
- 2
6
votes
2 answers
Kubernetes Persistent Volume Claim mounted with wrong gid
I'm creating a Kubernetes PVC and a Deploy that uses it.
In the yaml it is specified that uid and gid must be 1000.
But when deployed the volume is mounted with different IDs so I have no write access on it.
How can I specify effectively uid and gid…

JuanMatias
- 87
- 1
- 1
- 10
5
votes
1 answer
Why are my deployment/replicaset controllers not interfering with pods created with the same selectors?
I am trying to test the theory of deployment controllers fighting over pods when creating two Deployments with exactly the same selector.
Here's my deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment
spec:
replicas:…

Govind Rai
- 14,406
- 9
- 72
- 83
5
votes
1 answer
How to perform helm update on deployment with pvc and initContainer?
I am fairly new to helm and kubernetes so I'm not sure if this is a bug or I'm doing something wrong. I have looked everywhere for answer however before posting and can't find anything that answers my question.
I have a deployment which uses a…

Tom Greenwood
- 1,502
- 14
- 17
5
votes
2 answers
How to copy files to container in kubernetes yaml
I understand that files / folders can be copied into a container using the command:
kubectl cp /tmp/foo_dir :/tmp/bar_dir
However, I am looking to do this in a yaml file
How would I go about doing this? (Assuming that I am using a…

Kyle Blue
- 311
- 1
- 2
- 11
5
votes
1 answer
StatefulSets vs Deployments for stateless applications on Kubernetes
I find tons of articles and documentation describing the advantages of StatefulSets over Deployments for stateful applications on Kubernetes. What I haven't been able to figure out is the opposite: the disadvantages of StatefulSets when compared to…

chrisvdb
- 2,080
- 2
- 20
- 28
5
votes
4 answers
Passing java_opts to spring boot applications in kubernetes
Currently, we are building Docker images with an entrypoint and passing this image to a Kubernetes deployment.
Is there any way to pass the entrypoint directly to Kubernetes dynamically so that it starts spring boot applications?
What are the…

magic
- 254
- 2
- 10
- 19
5
votes
1 answer
Deleting Kubernetes cluster should not delete persistance disk
I have created a kubernetes cluster using terraform with persistance disk (pd-ssd). I have also created storage class and persistance volume claim as well.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-claim
…

klee
- 1,554
- 2
- 19
- 31