Questions tagged [kubernetes-deployment]
260 questions
5
votes
2 answers
Cannot create a deployment that requests more than 2Gi memory
My deployment pod was evicted due to memory consumption:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning Evicted 1h …

Mugen
- 8,301
- 10
- 62
- 140
5
votes
1 answer
How to edit all the deployment of kubernetes at a time
We have hundreds of deployment and in the config we have imagePullPolicy set as “ifnotpresent” for most of them and for few it is set to “always” now I want to modify all deployment which has ifnotpresent to always.
How can we achieve this with at a…

Nishanth
- 161
- 2
- 11
5
votes
1 answer
Get replica set of the deployment
I can get the ReplicaSet if given the replica-set-name using the api as below:
GET /apis/apps/v1/namespaces/{namespace}/replicasets/{name}
But how can I get the ReplicaSet based on the deployment?
Any help is appreciated.
Thank you

surazzarus
- 772
- 5
- 17
- 32
5
votes
1 answer
What is the difference between current and available pod replicas in kubernetes deployment?
I am trying to get my hands dirty on Kubernetes. I am firing following command:
kubectl get deployment
and I get the following headers in the output:
I can't find the difference between current and available columns in the following output?
I know…

Mangu Singh Rajpurohit
- 10,806
- 4
- 68
- 97
4
votes
1 answer
Using pod Anti Affinity to force only 1 pod per node
I am trying to get my deployment to only deploy replicas to nodes that aren't running rabbitmq (this is working) and also doesn't already have the pod I am deploying (not working).
I can't seem to get this to work. For example, if I have 3 nodes (2…

J Kent
- 43
- 4
4
votes
1 answer
Can a deployment be completed even when readiness probe is failing
I have an application running in Kubernetes as a StatefulSet that starts 2 pods. It has configured a liveness probe and a readiness probe.
The liveness probe call a simple /health endpoint that responds when the server is done loading
The readiness…

jesantana
- 1,241
- 2
- 14
- 27
4
votes
0 answers
InitContainer not idempotent, how to prevent it from running twice?
My Kubernetes deployment contains an init container:
apiVersion: apps/v1
kind: Deployment
spec:
spec:
initContainers:
- name: init-stuff
image: myregistry.azurecr.io/myinitstuff:latest
containers:
- name:…

Max
- 9,220
- 10
- 51
- 83
4
votes
1 answer
Setting ConfigMapRef and SecretRef for Deployment in Golang K8s client
I have got messed with this bug for hours and still dont know why!
I created a simple Configmap and a Secret called config1 and secret1 respectively.
(Yaml files for these are within this repo: https://github.com/hoangphanthai/test)
After that I…

Thai
- 91
- 7
4
votes
1 answer
Remove volume from deployment using patch_namespaced_deployment not working
I'm trying to patch a deployment and remove its volumes using patch_namespaced_deployment (https://github.com/kubernetes-client/python) with the following arguments, but it's not working.
patch_namespaced_deployment(
…

Mehdi Khlifi
- 405
- 8
- 21
4
votes
2 answers
In Kubernetes (k8s) why do deployments supports replicas?
In K8S, the below creates a deployment with n replicas -
$ kubectl run nginx --imaage nginx --replicas 6
But how can these replicas be accessed in a load balanced way as they don't have any common entry point (like service wrapped around them).
So…

samshers
- 1
- 6
- 37
- 84
4
votes
3 answers
Can't upgrade Deployment from apiVersion extensions/v1beta1 to apps/v1, it uses extensions/v1beta1 automatically
I currently have a GKE Kubernetes 1.15 cluster and I'm planning to upgrade to 1.16. Since 1.16 doesn't support certain APIs I have to change my deployments from extensions/v1beta1 to apps/v1.
Using this simple deployment.yml:
apiVersion:…

codependent
- 23,193
- 31
- 166
- 308
4
votes
2 answers
kubernetes - exposing container info as environment variables
I'm trying to expose some of the container info as env variables reading the values from the pod's spec.template.spec.containers[0].name which seems to be not working. What would be the apiSpec for referencing the container fields inside the…

Avi
- 1,453
- 4
- 18
- 43
4
votes
1 answer
Sticky session for ASP.NET Core on Kubernetes deployment
I try to port an ASP.NET Core 1 application with Identity to Kubernetes. The login doesn't work and I got different errors like The anti-forgery token could not be decrypted. The problem is that I'm using a deployment with three replica sets so that…

Daniel
- 968
- 3
- 13
- 32
4
votes
1 answer
Kubernetes PodDisruptionBudget, HorizontalPodAutoscaler & RollingUpdate Interaction?
If I have the following Kubernetes objects:
Deployment with rollingUpdate.maxUnavailable set to 1.
PodDisruptionBudget with maxUnavailable set to 1.
HorizontalPodAutoscaler setup to allow auto scaling.
Cluster auto-scaling is enabled.
If the…

Muhammad Rehan Saeed
- 35,627
- 39
- 202
- 311
4
votes
1 answer
Relation between preStop hook and terminationGracePeriodSeconds
Basically I am trying to do is play around with pod lifecycle and check if we can do some cleanup/backup such as copy logs before the pod terminates.
What I need :
Copy logs/heapdumps from container to a hostPath/S3 before terminating
What I…

Prathamesh dhanawade
- 493
- 5
- 27