kubectl

What are generators in kubernetes kubectl?

不羁的心 提交于 2019-12-06 04:05:30
When I want to generate yaml by running kubectl , it denotes that I should denote --generator=something flag within the command. For example, to get the deployment template via kubectl , I should run the below command: kubectl run --generator=deployment/v1beta1 nginx --image=nginx --dry-run -o yaml Without mentioning --generator flag the CLI states in some kind that I should mention the generator flag with a proper value (e.g. run-pod/v1 ). My question is, what is essentially a generator? What does it do? Are they some sort of object creation templates or something else? That was introduced in

TLS handshake timeout with kubernetes in GKE

流过昼夜 提交于 2019-12-06 02:23:10
I've created a cluster on Google Kubernetes Engine (previously Google Container Engine) and installed the Google Cloud SDK and the Kubernetes tools with it on my Windows machine. It worked well for some time, and, out of nowhere, it stopped working. Every command I'm issuing with kubectl provokes the following: Unable to connect to the server: net/http: TLS handshake timeout I've searched Google, the Kubernetes Github Issues, Stack Overflow, Server Fault ... without success. I've tried the following: Restart my computer Change wifi connection Check that I'm not somehow using a proxy Delete and

kubectl delete/create secret forbidden (Google cloud platform)

拟墨画扇 提交于 2019-12-06 01:51:44
问题 I was following the following tutorial on continuous integration using gitlab and Kubernetes (in my case on google cloud): https://about.gitlab.com/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/. At some point in the tutorial you will have to first delete and then create a secret for the image registry of Gitlab: - kubectl delete secret registry.gitlab.com - kubectl create secret docker-registry registry.gitlab.com --docker-server=https://registry

K8s Dashboard not logging in (k8s version 1.11)

风流意气都作罢 提交于 2019-12-05 18:05:14
I did K8s(1.11) cluster using kubeadm tool. It 1 master and one node in the cluster. I applied dashboard UI there. kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml Created service account (followed this link: https://github.com/kubernetes/dashboard/wiki/Creating-sample-user ) apiVersion: v1 kind: ServiceAccount metadata: name: admin-user namespace: kube-system and apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: admin-user roleRef: apiGroup: rbac.authorization.k8s.io kind:

How to edit a kubernetes resource from a shell script

给你一囗甜甜゛ 提交于 2019-12-05 16:54:51
I went through the documentation to edit kubernetes resource using kubectl edit command. Once I execute the command, the file in YAML-format is opened in the editor where I can change the values as per requirement and save it. I am trying to execute these steps by means of sed . How can the following steps be achieved? Execute kubectl edit for a deployment resource Set a value from true to false (using sed) Save the changes I tried to achieve this in the following way : $ kubectl edit deployment tiller-deploy -n kube-system | \ sed -i "s/\(automountServiceAccountToken:.*$\)

kubectl unable to connect to server: x509: certificate signed by unknown authority

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 15:11:17
问题 i'm getting an error when running kubectl one one machine (windows) the k8s cluster is running on CentOs 7 kubernetes cluster 1.7 master, worker Here's my .kube\config apiVersion: v1 clusters: - cluster: certificate-authority-data: REDACTED server: https://10.10.12.7:6443 name: kubernetes contexts: - context: cluster: kubernetes user: system:node:localhost.localdomain name: system:node:localhost.localdomain@kubernetes current-context: system:node:localhost.localdomain@kubernetes kind: Config

Kubernetes RBAC unable to upgrade connection: Forbidden (user=system:anonymous, verb=create, resource=nodes, subresource=proxy)

夙愿已清 提交于 2019-12-05 13:21:59
I'm running Kubernetes 1.6.2 with RBAC enabled. I've created a user kube-admin that has the following Cluster Role binding kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: k8s-admin subjects: - kind: User name: kube-admin apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: cluster-admin apiGroup: rbac.authorization.k8s.io When I attempt to kubectl exec into a running pod I get the following error. kubectl -n kube-system exec -it kubernetes-dashboard-2396447444-1t9jk -- /bin/bash error: unable to upgrade connection: Forbidden (user=system

Azure Kubernetes: TLS handshake timeout

那年仲夏 提交于 2019-12-05 12:45:49
I created a new cluster as per the Azure guide and created the cluster without issue but when I enter the kubectl get nodes to list the nodes I only get this response Unable to connect to the server: net/http: TLS handshake timeout . I tried once in the Cloud Shell and once on my machine using the latest version of the Azure CLI (2.0.20). I saw that there was a similar earlier issue regarding Service Principal credentials , which I updated but that didn't seem to solve my issue either. Any guidance would be greatly appreciated. Piling on: we are adding capacity as fast as possible for the

kubernetes + coreos cluster - replacing certificates

荒凉一梦 提交于 2019-12-05 12:09:34
I have a coreos kubernetes cluster, which I started by following this article: kubernetes coreos cluster on AWS TLDR; > kube-aws init > kube-aws render > kube-aws up Everything worked good and I had a kubernetes coreos cluster on AWS. In the article there is a warning that said: PRODUCTION NOTE: the TLS keys and certificates generated by kube-aws should not be used to deploy a production Kubernetes cluster. Each component certificate is only valid for 90 days, while the CA is valid for 365 days. If deploying a production Kubernetes cluster, consider establishing PKI independently of this tool

no endpoints available for service \“kubernetes-dashboard\”

末鹿安然 提交于 2019-12-05 01:39:47
问题 This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated last year . I'm trying to follow GitHub - kubernetes/dashboard: General-purpose web UI for Kubernetes clusters. deploy/access: # export KUBECONFIG=/etc/kubernetes/admin.conf # kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml secret/kubernetes-dashboard-certs created serviceaccount/kubernetes-dashboard