kubernetes-pod

How to recycle pods in Kubernetes

和自甴很熟 提交于 2019-12-04 13:20:28
I want my pods to be gracefully recycled from my deployments after certain period of time such as every week or month. I know I can add a cron job for that if I know the Kubernetes command. The question is what is the best approach to do this in Kubernetes. Which command will let me achieve this goal? Thank you very much for helping me out on this. You should be managing your Pods via a higher-level controller like a Deployment or a StatefulSet. If you do, and you change any detail of the embedded pod spec, the Deployment/StatefulSet/... will restart all of your pods for you. Probably the most

Kubernetes pod unable to connect to rabbit mq instance running locally

我的未来我决定 提交于 2019-11-29 17:09:59
I am moving my application from docker to kubernetes \ helm - and so far I have been successful except for setting up incoming \ outgoing connections. One particular issue I am facing is that I am unable to connect to the rabbitmq instance running locally on my machine on another docker container. app-deployment.yaml: apiVersion: extensions/v1beta1 kind: Deployment metadata: name: jks labels: app: myapp spec: replicas: 1 template: metadata: labels: app: myapp spec: imagePullSecrets: - name: ivsecret containers: - env: - name: JOBQUEUE value: jks_jobqueue - name: PORT value: "80" image: repo

Executing multiple commands( or from a shell script) in a kubernetes pod

你说的曾经没有我的故事 提交于 2019-11-29 13:44:20
I'm writing a shell script which needs to login into the pod and execute a series of commands in a kubernetes pod. below is my sample_script.sh kubectl exec octavia-api-worker-pod-test -c octavia-api bash unset http_proxy https_proxy mv /usr/local/etc/octavia/octavia.conf /usr/local/etc/octavia/octavia.conf-orig /usr/local/bin/octavia-db-manage --config-file /usr/local/etc/octavia/octavia.conf upgrade head After running this script, I'm not getting any output. Any help will be greatly appreciated Are you running all these commands as a single line command? First of all, there's no ; or &&