kubectl

Restart Kubernetes API server with different options

孤街浪徒 提交于 2019-11-30 18:17:11
I'm pretty new to Kubernetes and clusters so this might be very simple. I set up a Kubernetes cluster with 5 nodes using kubeadm following this guide . I got some issues but it all worked in the end. So now I want to install the Web UI (Dashboard) . To do so I need to set up authentication: Please note, this works only if the apiserver is set up to allow authentication with username and password. This is not currently the case with the some setup tools (e.g., kubeadm). Refer to the authentication admin documentation for information on how to configure authentication manually. So I got to read

Kubernetes: understanding memory usage for “kubectl top node”

可紊 提交于 2019-11-30 17:26:12
How do I interpret the memory usage returned by "kubectl top node". E.g. if it returns: NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% ip-XXX.ec2.internal 222m 11% 3237Mi 41% ip-YYY.ec2.internal 91m 9% 2217Mi 60% By comparison, if I look in the Kubernetes dashboard for the same node, I get: Memory Requests: 410M / 7.799 Gi kubernetes dashboard How do I reconcile the difference? kubectl top node is reflecting the actual usage to the VM(nodes), and k8s dashboard is showing the percentage of limit/request you configured. E.g. Your EC2 instance has 8G memory and you actually use 3237MB so it's 41%. In

How to pass image pull secret while using 'kubectl run' command?

ぐ巨炮叔叔 提交于 2019-11-30 13:10:10
问题 I am trying to use kubectl run command to pull an image from private registry and run a command from that. But I don't see an option to specify image pull secret. It looks like it is not possible to pass image secret as part for run command. Is there any alternate option to pull a container and run a command using kubectl? The command output should be seen on the console. Also once the command finishes the pod should die. 回答1: You can use the overrides if you specify it right, it's an array

The connection to the server localhost:8080 was refused - did you specify the right host or port?

ε祈祈猫儿з 提交于 2019-11-30 07:28:53
问题 when i am trying to test the configuration of kubectl kubectl get svc i am getting this error: the server doesn't have a resource type "svc" when I try this command kubectl get services i am getting error:The connection to the server localhost:8080 was refused - did you specify the right host or port? and i am following this userguide to deploy a kubernetes application on my mac https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#eks-create-cluster Admins-MacBook-Pro:~

How to pass image pull secret while using 'kubectl run' command?

早过忘川 提交于 2019-11-30 06:41:34
I am trying to use kubectl run command to pull an image from private registry and run a command from that. But I don't see an option to specify image pull secret. It looks like it is not possible to pass image secret as part for run command. Is there any alternate option to pull a container and run a command using kubectl? The command output should be seen on the console. Also once the command finishes the pod should die. You can use the overrides if you specify it right, it's an array in the end, that took me a bit to figure out, the below works on Kubernetes of at least 1.6: --overrides='{

Restart Kubernetes API server with different options

戏子无情 提交于 2019-11-30 03:10:40
问题 I'm pretty new to Kubernetes and clusters so this might be very simple. I set up a Kubernetes cluster with 5 nodes using kubeadm following this guide. I got some issues but it all worked in the end. So now I want to install the Web UI (Dashboard). To do so I need to set up authentication: Please note, this works only if the apiserver is set up to allow authentication with username and password. This is not currently the case with the some setup tools (e.g., kubeadm). Refer to the

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: understanding memory usage for “kubectl top node”

大城市里の小女人 提交于 2019-11-30 01:00:13
问题 How do I interpret the memory usage returned by "kubectl top node". E.g. if it returns: NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% ip-XXX.ec2.internal 222m 11% 3237Mi 41% ip-YYY.ec2.internal 91m 9% 2217Mi 60% By comparison, if I look in the Kubernetes dashboard for the same node, I get: Memory Requests: 410M / 7.799 Gi kubernetes dashboard How do I reconcile the difference? 回答1: kubectl top node is reflecting the actual usage to the VM(nodes), and k8s dashboard is showing the percentage of

coredns pods have CrashLoopBackOff or Error state

自古美人都是妖i 提交于 2019-11-29 07:54:15
I'm trying to set up the Kubernetes master, by issuing: kubeadm init --pod-network-cidr=192.168.0.0/16 followed by: Installing a pod network add-on (Calico) followed by: Master Isolation issue: coredns pods have CrashLoopBackOff or Error state: # kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE calico-node-lflwx 2/2 Running 0 2d coredns-576cbf47c7-nm7gc 0/1 CrashLoopBackOff 69 2d coredns-576cbf47c7-nwcnx 0/1 CrashLoopBackOff 69 2d etcd-suey.nknwn.local 1/1 Running 0 2d kube-apiserver-suey.nknwn.local 1/1 Running 0 2d kube-controller-manager-suey.nknwn.local 1/1 Running 0 2d kube

How to format the output of kubectl describe to JSON

 ̄綄美尐妖づ 提交于 2019-11-29 05:31:01
kubectl get command has this flag -o to format the output. Is there a similar way to format the output of the kubectl describe command? For example: kubectl describe -o="jsonpath={...}" pods my-rc would print a JSON format for the list of pods in my-rc replication controller. But -o is not accepted for the describe command. janetkuo kubectl describe doesn't support -o or equivalent. It's meant to be human-readable rather than script-friendly. You can achieve what you described with kubectl get pods -l <selector_of_your_rc> -o <output_format> , for example: $ kubectl get pods -l app=guestbook