kubectl

Kubernetes set image missing resource type 'deployment'

萝らか妹 提交于 2019-12-02 05:27:27
I'm trying to update an image in Kubernetes by using the following command: kubectl set image deployment/ms-userservice ms-userservice=$DOCKER_REGISTRY_NAME/$BITBUCKET_REPO_SLUG:$BITBUCKET_COMMIT --insecure-skip-tls-verify But when I receive the following error: error: the server doesn't have a resource type "deployment" I have checked that i am in the right namespace, and that the pod with the name exists and is running. I can't find any meaningful resources in regards to this error. Sidenote: I'm doing this through Bitbucket and a pipeline, which also builds the image i want to use. Any

Error: forwarding ports: error upgrading connection: Upgrade request required

早过忘川 提交于 2019-12-02 02:34:42
问题 Has any one seen this error Error: forwarding ports: error upgrading connection: Upgrade request required in Kubernetes 回答1: I have seen this before and there were a couple of issues to address: The Nginx that was proxying requests did not contain the following config (required for HTTP2 support): proxy_set_header Upgrade 'websocket'; proxy_set_header Connection 'Upgrade'; And we also had to switch our Classic Load Balancer on AWS (ELB) with an Application Load Balancer (ALB). TBH, the

How to stop Replicaset from restarting?

限于喜欢 提交于 2019-12-02 02:33:27
I started a test if my kubernetes installation is running well, with: $ kubectl run -it hello --image=busybox -- sh However it didn't work. Now I want to just clean up everything before I figure out how to continue. But if I delete the pod it gets restarted, I suppose by a corresponding replicaset. But this gets restarted as well if I delete it . What can I do now to clean up whatever kubectl run did? The run command creates a deployment which controls the replicaset please run the following commands to verify and solve: kubectl get deployments kubectl delete deployment hello 来源: https:/

How to stop Replicaset from restarting?

戏子无情 提交于 2019-12-02 02:27:31
问题 I started a test if my kubernetes installation is running well, with: $ kubectl run -it hello --image=busybox -- sh However it didn't work. Now I want to just clean up everything before I figure out how to continue. But if I delete the pod it gets restarted, I suppose by a corresponding replicaset. But this gets restarted as well if I delete it . What can I do now to clean up whatever kubectl run did? 回答1: The run command creates a deployment which controls the replicaset please run the

kubectl and seeing (cluster)roles assigned to subjects

空扰寡人 提交于 2019-12-01 17:36:15
I can use kubectl to see to which subjects a cluster role is applied, eg: kubectl get clusterrolebindings system:node --all-namespaces -o json { "apiVersion": "rbac.authorization.k8s.io/v1beta1", "kind": "ClusterRoleBinding", .... .... "subjects": [ { "apiGroup": "rbac.authorization.k8s.io", "kind": "Group", "name": "system:nodes" } ] } I would like to get this info the other way around, eg: I want to list all policies applied to the "system:nodes" subject. How can I do that? There is no API for the reverse index. You can look up bindings and filter on ones containing the expected subject. For

kubectl and seeing (cluster)roles assigned to subjects

我们两清 提交于 2019-12-01 16:30:09
问题 I can use kubectl to see to which subjects a cluster role is applied, eg: kubectl get clusterrolebindings system:node --all-namespaces -o json { "apiVersion": "rbac.authorization.k8s.io/v1beta1", "kind": "ClusterRoleBinding", .... .... "subjects": [ { "apiGroup": "rbac.authorization.k8s.io", "kind": "Group", "name": "system:nodes" } ] } I would like to get this info the other way around, eg: I want to list all policies applied to the "system:nodes" subject. How can I do that? 回答1: There is no

kubectl: Use custom-columns output with maps

天大地大妈咪最大 提交于 2019-12-01 13:08:54
I want to get the specific value of an annotation into a kubectl custom columns field. I can get all the current annotations on a resource like so: kubectl get pvc -o custom-columns=NAME:.metadata.name,"ANNOTATIONS":.metadata.annotations -n monitoring This returns a map: NAME ANNOTATIONS prometheus-k8s-db-prometheus-k8s-0 map[pv.kubernetes.io/bind-completed:yes pv.kubernetes.io/bound-by-controller:yes volume.beta.kubernetes.io/storage-provisioner:kubernetes.io/aws-ebs] prometheus-k8s-db-prometheus-k8s-1 map[pv.kubernetes.io/bind-completed:yes pv.kubernetes.io/bound-by-controller:yes volume

'kubectl patch' works on Linux Bash but not in Windows Powershell ISE

吃可爱长大的小学妹 提交于 2019-12-01 11:32:49
The following command works fine on Ubuntu bash: kubectl patch deployment wapi-backend-d1 --patch '{"spec": {"template": {"metadata": {"labels": {"date": "test"}}}}}' The same command does not work in Windows Powershell Console (ISE). The error is: kubectl : Error from server (BadRequest): invalid character 's' looking for beginning of object key string At line:1 char:1 + kubectl patch deployment wapi-backend-d1 --patch '{"spec": {"template ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Error from serv...ject key string:String) [],

How to config simple login/pass authentication for kubernetes desktop UI

大兔子大兔子 提交于 2019-12-01 06:38:04
I'm pretty new in kubernetes, I just install kubernetes via kubeadm and run dashboard UI but can't config access to it. Following docs I add line --basic-auth-file=/etc/kubernetes/auth.csv to /etc/kubernetes/manifests/kube-apiserver.yaml, create file and put in one string like pass,admin,admin . But after that api server crashed and back to normal after deleting this string and reboot the server. How I can pass this parametr to api server without api server crashing, and maybe something else need add or remove from this file? Here is my kube-apiserver.yaml apiVersion: v1 kind: Pod metadata:

How to config simple login/pass authentication for kubernetes desktop UI

别说谁变了你拦得住时间么 提交于 2019-12-01 03:30:59
问题 I'm pretty new in kubernetes, I just install kubernetes via kubeadm and run dashboard UI but can't config access to it. Following docs I add line --basic-auth-file=/etc/kubernetes/auth.csv to /etc/kubernetes/manifests/kube-apiserver.yaml, create file and put in one string like pass,admin,admin . But after that api server crashed and back to normal after deleting this string and reboot the server. How I can pass this parametr to api server without api server crashing, and maybe something else