kubectl

Running a ECR image locally with helm and Kubernetes

南楼画角 提交于 2021-02-04 21:35:44
问题 I'm new to Kubernetes and as a tutorial for myself I've been working on deploying a basic project to Kubernetes with helm (v3). I have an image in AWS's ECR as well as a local helm chart for this project. However, I am struggling to run my image with Kubernetes. My image is set up correctly. If I try something like docker run my_image_in_ecr locally it behaves as expected (after configuring my IAM access credentials locally). My helm chart is properly linted and in my image map, it specifies:

Can I get events from other resources in addition to the pod in Kubernetes?

你。 提交于 2021-01-29 14:28:54
问题 When running this command for resources ( deployment, ReplicaSet ...) other than Pod $ kubectl describe deployment xxx-deployment ---- ------ ------ Events: <none> I have deployed several resources, but I haven't seen the event yet except for Pod. What type of event will occur if events occur in other resources? Could you recommend any materials to refer to? 回答1: Good explanation what is event in Kubernetes you can find in Types of Kubernetes Events article. Author also mentioned about types

Kubernetes - How to get pod logs within container

大兔子大兔子 提交于 2021-01-29 07:36:13
问题 I have two containers within my pod, one container is an app, that write logs (stdout/stderr), and second container is to read the logs of the app container, and to write it logs.txt file. My question is, how can I tell the second container to read the logs of the app container? When I'm on the host (with k8s), I can run: $kubectl logs -f my_pod >> logs.txt and get the logs of pod. But how can I tell one container to read the logs of another container inside same pod? I did something similar

Use kubectl patch to add DNS Rewrite Rule to CoreDNS Configmap

﹥>﹥吖頭↗ 提交于 2021-01-29 05:07:10
问题 I want to use the kubectl patch command to add a DNS rewrite rule to the coredns configmap, as described at Custom DNS Entries For Kubernetes. The default config map looks like this: apiVersion: v1 data: Corefile: | .:53 { log errors health kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure upstream fallthrough in-addr.arpa ip6.arpa ttl 30 } prometheus :9153 forward . /etc/resolv.conf cache 30 loop reload loadbalance } kind: ConfigMap .... and I want to add the line rewrite name

Getting kubectl config use-context error when trying to switch context

二次信任 提交于 2021-01-28 19:22:42
问题 When I am trying to switch kubectl configuration using " kubectl config use-context new-context " where new-context is my desired context, I am getting the following error on my Mac machine: error: open some-context.lock: file exists where some-context is another kubectl configuration. However, some-context is not the active context. I see the same error when try " kubectl config set-context new-context " as well. How can I fix the issue? I am using MacOS Mojava, version: 10.14.6. 回答1: The

Getting kubectl config use-context error when trying to switch context

血红的双手。 提交于 2021-01-28 18:51:57
问题 When I am trying to switch kubectl configuration using " kubectl config use-context new-context " where new-context is my desired context, I am getting the following error on my Mac machine: error: open some-context.lock: file exists where some-context is another kubectl configuration. However, some-context is not the active context. I see the same error when try " kubectl config set-context new-context " as well. How can I fix the issue? I am using MacOS Mojava, version: 10.14.6. 回答1: The

Not able to deploy to Kubernetes cluster using Kompose

我们两清 提交于 2021-01-28 12:15:31
问题 I'm currently deploying a project on a kubernetes cluster by using Kompose (http://www.kompose.io) to convert the docker-compose configuration to kubernetes configuration files. This is a project for a master class at my university and they took care of the kubernetes cluster, so I'm almost certain that the configuration for it is done properly. FYI, this is the version of that kubernetes cluster; $ kubectl version Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3",

Add a second master node for high availabity in kubernetes

北城以北 提交于 2021-01-28 03:48:37
问题 I was able to follow the documentation and get a kubernetes cluster up. But I would like to add a second master node I tried this on the second node but seeing an error [root@kubemaster02 ~]# kubeadm init --apiserver-advertise- address=10.122.161.XX --pod-network-cidr=10.244.0.0/16 --kubernetes- version=v1.10.0 [init] Using Kubernetes version: v1.10.0 [init] Using Authorization modes: [Node RBAC] [preflight] Running pre-flight checks. [WARNING SystemVerification]: docker version is greater

Kubectl rollout restart for statefulset

早过忘川 提交于 2021-01-27 05:46:51
问题 As per the kubectl docs, kubectl rollout restart is applicable for deployments, daemonsets and statefulsets. It works as expected for deployments. But for statefulsets, it restarts only one pod of the 2 pods. ✗ k rollout restart statefulset alertmanager-main (playground-fdp/monitoring) statefulset.apps/alertmanager-main restarted ✗ k rollout status statefulset alertmanager-main (playground-fdp/monitoring) Waiting for 1 pods to be ready... Waiting for 1 pods to be ready... statefulset rolling

kubectl: describe vs get -o <format>

你离开我真会死。 提交于 2021-01-26 03:19:40
问题 In kubectl, both describe and get -o <format> can be used to get the details of a resource, I'm wondering what's the difference between the two? why does describe even exist if get can do the same thing and more? 回答1: kubectl get shows tables by default. (You can view/visualize large no of objects easily) kubectl describe shows the detailed description. (Better for a single object) kubectl describe is more flattened, has lesser data and easier to read than the full object data given by