kubectl

Update kubernetes secrets doesn't update running container env vars

↘锁芯ラ 提交于 2020-08-21 04:36:18
问题 Currenly when updating a kubernetes secrets file, in order to apply the changes, I need to run kubectl apply -f my-secrets.yaml . If there was a running container, it would still be using the old secrets. In order to apply the new secrets on the running container, I currently run the command kubectl replace -f my-pod.yaml . I was wondering if this is the best way to update a running container secret, or am I missing something. Thanks. 回答1: The secret docs for users say this: Mounted Secrets

How to get list of pods which are “ready”?

我只是一个虾纸丫 提交于 2020-08-19 16:55:44
问题 I am using kubectl in order to retrieve a list of pods: kubectl get pods --selector=artifact=boot-example -n my-sandbox The results which I am getting are: NAME READY STATUS RESTARTS AGE boot-example-757c4c6d9c-kk7mg 0/1 Running 0 77m boot-example-7dd6cd8d49-d46xs 1/1 Running 0 84m boot-example-7dd6cd8d49-sktf8 1/1 Running 0 88m I would like to get only those pods which are " ready " (passed readinessProbe). Is there any kubectl command which returns only " ready " pods? If not kubectl

How to get list of pods which are “ready”?

拟墨画扇 提交于 2020-08-19 16:52:24
问题 I am using kubectl in order to retrieve a list of pods: kubectl get pods --selector=artifact=boot-example -n my-sandbox The results which I am getting are: NAME READY STATUS RESTARTS AGE boot-example-757c4c6d9c-kk7mg 0/1 Running 0 77m boot-example-7dd6cd8d49-d46xs 1/1 Running 0 84m boot-example-7dd6cd8d49-sktf8 1/1 Running 0 88m I would like to get only those pods which are " ready " (passed readinessProbe). Is there any kubectl command which returns only " ready " pods? If not kubectl

How do I update kubernetes deployment image and command?

╄→гoц情女王★ 提交于 2020-07-31 03:12:30
问题 I see that I can use the "kubectl set image" command to update a container used in a deployment, like this: kubectl set image deployment/myapp myapp=repo.mycompany.com/myapp/ui:beta.119 But, i would also like to use a different startup command in some situations. Is there a way to update both the image AND the command used for the container? 回答1: You could use kubectl patch for that. Run kubectl patch --help to get the docs, but as far as I can tell something like this should do it: $ kubectl

Why tty hangs after command is finished?

ε祈祈猫儿з 提交于 2020-07-23 08:04:57
问题 I want to run a command like this: kubectl run busybox -it --rm --restart=Never --image=busybox --command -- sh -c "env" Expected to run command and delete pod. It prints the variables, but then terminal freezes, although pod is in completed state, but --rm not works. Same thing works ok with docker: docker run -it --rm busybox sh -c "env" 来源: https://stackoverflow.com/questions/62589468/why-tty-hangs-after-command-is-finished

Why tty hangs after command is finished?

允我心安 提交于 2020-07-23 08:03:10
问题 I want to run a command like this: kubectl run busybox -it --rm --restart=Never --image=busybox --command -- sh -c "env" Expected to run command and delete pod. It prints the variables, but then terminal freezes, although pod is in completed state, but --rm not works. Same thing works ok with docker: docker run -it --rm busybox sh -c "env" 来源: https://stackoverflow.com/questions/62589468/why-tty-hangs-after-command-is-finished

Why tty hangs after command is finished?

杀马特。学长 韩版系。学妹 提交于 2020-07-23 08:01:06
问题 I want to run a command like this: kubectl run busybox -it --rm --restart=Never --image=busybox --command -- sh -c "env" Expected to run command and delete pod. It prints the variables, but then terminal freezes, although pod is in completed state, but --rm not works. Same thing works ok with docker: docker run -it --rm busybox sh -c "env" 来源: https://stackoverflow.com/questions/62589468/why-tty-hangs-after-command-is-finished

Kubernetes check serviceaccount permissions

天涯浪子 提交于 2020-07-16 16:14:48
问题 When deploying a service via a Helm Chart, the installation failed because the tiller serviceaccount was not allowed to create a ServiceMonitor resource. Note: ServiceMonitor is a CRD defined by the Prometheus Operator to automagically get metrics of running containers in Pods. Helm Tiller is installed in a single namespace and the RBAC has been setup using Role and RoleBinding. I wanted to verify the permissions of the tiller serviceaccount. kubectl has the auth can-i command, queries like

Where exactly do the logs of kubernetes pods come from (at the container level)?

强颜欢笑 提交于 2020-07-10 00:27:21
问题 I'm looking to redirect some logs from a command run with kubectl exec to that pod's logs, so that they can be read with kubectl logs <pod-name> (or really, /var/log/containers/<pod-name>.log ). I can see the logs I need as output when running the command, and they're stored inside a separate log directory inside the running container. Redirecting the output (i.e. >> logfile.log ) to the file which I thought was mirroring what is in kubectl logs <pod-name> does not update that container's

Where exactly do the logs of kubernetes pods come from (at the container level)?

帅比萌擦擦* 提交于 2020-07-10 00:26:41
问题 I'm looking to redirect some logs from a command run with kubectl exec to that pod's logs, so that they can be read with kubectl logs <pod-name> (or really, /var/log/containers/<pod-name>.log ). I can see the logs I need as output when running the command, and they're stored inside a separate log directory inside the running container. Redirecting the output (i.e. >> logfile.log ) to the file which I thought was mirroring what is in kubectl logs <pod-name> does not update that container's