kubernetes-deployment

Relation between preStop hook and terminationGracePeriodSeconds

梦想与她 提交于 2019-12-06 06:29:11
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 tried: I used a preStop hook with a bash command to echo a message (just to see if it works !!). Used terminationGracePeriodSeconds with a delay to preStop and toggle them to see if the process works. Ex. keep terminationGracePeriodSeconds:30 sec (default) and set preStop command to sleep by 50 sec and the message should not be generated since the

Is there a concept of inheritance for Kubernetes deployments?

好久不见. 提交于 2019-12-04 23:46:05
Is there a way to create a tree of inheritance for Kubernetes deployments? I have a number of deployments which are similar but not identical. They share many ENV vars but not all. They all use the same image. For example, I have a dev deployment which is configured almost identical to a production deployment but has env vars pointing to a different database backend. I have a celery deployment which is configured the same as the production deployment, however, it has a different run command. Helm is what many people are using for this. It let's you create templates for kubernetes descriptors

Helm wait till dependency deployment are ready on kubernetes

时间秒杀一切 提交于 2019-12-04 05:30:47
问题 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? 回答1: Typically you don't; you just let Helm (or kubectl apply -f ) start everything in one shot and let it retry starting everything. The most common pattern is for a container process to simply crash at startup if an external service isn't available; the Kubernetes Pod mechanism will restart the

Why labels are mentioned three times in a single deployment

徘徊边缘 提交于 2019-12-01 08:26:21
I've gone over the following docomentation page: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ The example deployment yaml is as follows: apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 We can see here three different times where the label app: nginx is mentioned. Why do we need each of them? I had a hard time understanding it from the official documentation. The

Why labels are mentioned three times in a single deployment

99封情书 提交于 2019-12-01 06:42:03
问题 I've gone over the following docomentation page: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ The example deployment yaml is as follows: apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 We can see here three different times where the label app: nginx is mentioned

Kubernetes create deployment unexpected SchemaError

浪子不回头ぞ 提交于 2019-11-30 01:10:31
I'm following that tutorial ( https://www.baeldung.com/spring-boot-minikube ) I want to create Kubernetes deployment in yaml file (simple-crud-dpl.yaml): apiVersion: apps/v1 kind: Deployment metadata: name: simple-crud spec: selector: matchLabels: app: simple-crud replicas: 3 template: metadata: labels: app: simple-crud spec: containers: - name: simple-crud image: simple-crud:latest imagePullPolicy: Never ports: - containerPort: 8080 but when I run kubectl create -f simple-crud-dpl.yaml i got: error: SchemaError(io.k8s.api.autoscaling.v2beta2.MetricTarget): invalid object doesn't have

Kubernetes create deployment unexpected SchemaError

十年热恋 提交于 2019-11-28 20:45:50
问题 I'm following that tutorial (https://www.baeldung.com/spring-boot-minikube) I want to create Kubernetes deployment in yaml file (simple-crud-dpl.yaml): apiVersion: apps/v1 kind: Deployment metadata: name: simple-crud spec: selector: matchLabels: app: simple-crud replicas: 3 template: metadata: labels: app: simple-crud spec: containers: - name: simple-crud image: simple-crud:latest imagePullPolicy: Never ports: - containerPort: 8080 but when I run kubectl create -f simple-crud-dpl.yaml i got: