kubectl

What are generators in kubernetes kubectl?

旧时模样 提交于 2019-12-22 08:06:15
问题 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?

delete kubernetes cluster on docker-for-desktop OSX

眉间皱痕 提交于 2019-12-22 03:22:31
问题 What is the equivalent command for minikube delete in docker-for-desktop on OSX As I understand, minikube creates a VM to host its kubernetes cluster but I do not understand how docker-for-desktop is managing this on OSX. 回答1: Tear down Kubernetes in Docker for OS X is quite an easy task. Go to Preferences , open Reset tab, and click Reset Kubernetes cluster . All object that have been created with Kubectl before that will be deleted. You can also reset docker VM image ( Reset disk image )

Minikube not working in Windows 8

痞子三分冷 提交于 2019-12-21 09:18:29
问题 I'm new to Kubernetes. With the help of Kubernetes documentation , I installed minikube (v0.24.1) and kubectl in my Windows machine. VirtualBox(Version 5.1.18) is also installed in my machine. Before starting the minikube , i have executed set HTTP_PROXY=xx.xx.xx:8080 and set NO_PROXY=localhost,127.0.0.0/8,192.0.0.0/8 in Windows command prompt Started minikube by passing Proxy Details : C:\minikube>minikube start --memory 4096 --vm-driver=virtualbox --docker-env http_proxy=xx.xx.xx:8080 -

How do I access this Kubernetes service via kubectl proxy?

风格不统一 提交于 2019-12-21 07:29:17
问题 I want to access my Grafana Kubernetes service via the kubectl proxy server, but for some reason it won't work even though I can make it work for other services. Given the below service definition, why is it not available on http://localhost:8001/api/v1/proxy/namespaces/monitoring/services/grafana? grafana-service.yaml apiVersion: v1 kind: Service metadata: namespace: monitoring name: grafana labels: app: grafana spec: type: NodePort ports: - name: web port: 3000 protocol: TCP nodePort: 30902

kops / kubectl - how do i import state created on a another server?

核能气质少年 提交于 2019-12-20 14:21:53
问题 i setup my kubernetes cluster using kops, and I did so from local machine. So my .kube directory is stored on my local machine, but i setup kops for state storage in s3 . Im in the process of setting up my CI server now, and I want to run my kubectl commands from that box. How do i go about importing the existing state to that server? 回答1: To run kubectl command, you will need the cluster's apiServer URL and related credentials for authentication. Those data are by convention stored in ~/

Is there anyway to get the external ports of the kubernetes cluster

痞子三分冷 提交于 2019-12-20 09:46:19
问题 I have exposed a service on an external port on all nodes in a kubernetes cluster from: kubectl create -f nginx-service.yaml You have exposed your service on an external port on all nodes in your cluster. If you want to expose this service to the external internet, you may need to set up firewall rules for the service port(s) (tcp:30002) to serve traffic. See http://releases.k8s.io/release-1.2/docs/user-guide/services-firewalls.md for more details. service "nginx-service" created.` Is there

kubectl not able to pull the image from private repository

牧云@^-^@ 提交于 2019-12-20 09:39:48
问题 I am running kubeadm alpha version to set up my kubernates cluster. From kubernates , I am trying to pull docker images which is hosted in nexus repository. When ever I am trying to create a pods , It is giving "ImagePullBackOff" every time. Can anybody help me on this ? Detail for this are present in https://github.com/kubernetes/kubernetes/issues/41536 Pod definition : apiVersion: v1 kind: Pod metadata: name: test-pod labels: name: test spec: containers: - image: 123.456.789.0:9595/test

kubectl run is deprecated - looking for alternative

北城以北 提交于 2019-12-20 09:29:39
问题 I'm using kubectl run with environment parameters to create temporary docker containers for me (e.g. some forwarding for debugging purposes). Since several weeks kubectl is complaining about kubectl run being deprecated. Unfortunately I can't find an appropriate replacement. This is the old command: $KUBECTL run -i -t --attach=false --image djfaze/port-forward --env="REMOTE_HOST=$REMOTE_HOST" --env="REMOTE_PORT=$REMOTE_PORT" $POD_NAME When issuing this, kubectl complains with this message:

Kubernetes sort pods by age

╄→尐↘猪︶ㄣ 提交于 2019-12-20 08:56:01
问题 I can sort my Kubernetes pods by name using: kubectl get pods --sort-by=.metadata.name How can I sort them (or other resoures) by age using kubectl ? 回答1: Pods have status, which you can use to find out startTime. I guess something like kubectl get po --sort-by=.status.startTime should work. You could also try: kubectl get po --sort-by='{.firstTimestamp}' . kubectl get pods --sort-by=.metadata.creationTimestamp Thanks @chris Also apparently in 1.7 release sort-by is broken. https://github.com

Kubernetes POD arguments are not passing to service, however Docker arguments are passing correctly

丶灬走出姿态 提交于 2019-12-20 05:40:32
问题 Problem Statement: I have a created a Docker image successfully from docker.io/joethecoder2/spring-boot-web . It has been tested with command line arguments, and those work correctly locally with Docker. I am trying to pass java arguments that are passed to Docker to a Kubernetes POD that is defined with a single image docker.io/joethecoder2/spring-boot-web The purpose of passing the arguments is to let the POD know what the IP address and port number are for the database service. Problem