kubectl

Access application deployed on Kubernetes

▼魔方 西西 提交于 2020-04-18 05:39:09
问题 I have my image hosted on GCR. I deployed my application on local Kubernetes cluster(mac). This is my deployment file - apiVersion: apps/v1 kind: Deployment metadata: name: sv-premier spec: selector: matchLabels: app: sv-premier template: metadata: labels: app: sv-premier spec: volumes: - name: google-cloud-key secret: secretName: gcp-key containers: - name: sv-premier image: gcr.io/proto/premiercore1:latest imagePullPolicy: Always command: ["echo", "Done deploying sv-premier"] volumeMounts:

Unable to curl to external IP

大城市里の小女人 提交于 2020-04-18 01:04:23
问题 I am unable to curl to the external IP of the service. My Kubernetes cluster is deployed on GKE. $ kubectl run kubia-container --image=australia/kubia_py --port=8080 --generator=run/v1 kubectl run --generator=run/v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead. replicationcontroller/kubia-container created $ kubectl get pods NAME READY STATUS RESTARTS AGE kubia-container-6b2cs 1/1 Running 0 25s $ kubectl expose rc

helm and kubectl context mismatch

只谈情不闲聊 提交于 2020-04-16 02:48:06
问题 I'm having trouble understanding helm 's use of helm --kube-context=microk8s install ... should install into the context microk8s thus into my local microk8s cluster rather than the remote GKE cluster which I once connected to. This however fails due to Error: could not get Kubernetes config for context "microk8s": context "microk8s" does not exist if I run e.g. helm --kube-context=microk8s install --name mereet-kafka after successfully running helm init and adding necessary repositories. The

What is command to find detailed information about Kubernetes master(s) using kubectl?

烂漫一生 提交于 2020-04-07 14:00:32
问题 Let say I want to find the kubelet and apiserver version of my k8s master(s), what's the best way to do it? I am aware of the following commands: kubectl cluster-info which only shows the endpoints. kubectl get nodes; kubectl describe node <node>; which shows very detail information but only the nodes and not master. There's also kubectl version but that only shows the kubectl version and not the kubelet or apiserver version. What other commands can I use to identify the properties of my

Can I set a default namespace in Kubernetes?

自作多情 提交于 2020-03-13 07:23:30
问题 Can I set the default namespace? That is: $ kubectl get pods -n NAMESPACE It saves me having to type it in each time especially when I'm on the one namespace for most of the day. 回答1: Yes, you can set the namespace as per the docs like so: $ kubectl config set-context $(kubectl config current-context) --namespace=NAMESPACE Alternatively, you can use kubectx for this. 回答2: You can also use a temporary linux alias: alias k='kubectl -n kube-system ' Then use it like k get pods That's it ;) 来源:

Can I set a default namespace in Kubernetes?

爱⌒轻易说出口 提交于 2020-03-13 07:20:20
问题 Can I set the default namespace? That is: $ kubectl get pods -n NAMESPACE It saves me having to type it in each time especially when I'm on the one namespace for most of the day. 回答1: Yes, you can set the namespace as per the docs like so: $ kubectl config set-context $(kubectl config current-context) --namespace=NAMESPACE Alternatively, you can use kubectx for this. 回答2: You can also use a temporary linux alias: alias k='kubectl -n kube-system ' Then use it like k get pods That's it ;) 来源:

kubectl deployment failing

耗尽温柔 提交于 2020-02-06 09:31:35
问题 I am working on setting up CI CD pipeline for Spring boot application on GKE. The CI build step worked correctly but the delivery build step is failing due to 'error: no objects passed to apply' error. I could see below logs in the cloud build Starting Step #0 - "Deploy" Step #0 - "Deploy": Already have image (with digest): gcr.io/cloud-builders/kubectl Step #0 - "Deploy": Running: gcloud container clusters get-credentials --project="location-finder-kubernetes" --zone="us-central1-b"

kubectl deployment failing

余生长醉 提交于 2020-02-06 09:31:07
问题 I am working on setting up CI CD pipeline for Spring boot application on GKE. The CI build step worked correctly but the delivery build step is failing due to 'error: no objects passed to apply' error. I could see below logs in the cloud build Starting Step #0 - "Deploy" Step #0 - "Deploy": Already have image (with digest): gcr.io/cloud-builders/kubectl Step #0 - "Deploy": Running: gcloud container clusters get-credentials --project="location-finder-kubernetes" --zone="us-central1-b"

Cloud Build Bazel Error: “kubectl toolchain was not properly configured so apply cannot be executed”

a 夏天 提交于 2020-02-05 05:50:07
问题 I am trying to use rules_k8s for Bazel to deploy to my Kubernetes cluster. Thus I have this cloudbuild.yaml file, which is executed by Google Cloud Build: steps: - name: gcr.io/cloud-builders/bazel args: ['run', '//:kubernetes.apply'] ( //:kubernetes is just a k8s_objects) On my local machine running bazel run //:kubernetes.apply works fine, but although the Google Cloud Build succeeds, it logs those errors. So the configuration is not applied to my Kubernetes cluster: Target //:kubernetes

how to check whether RBAC is enabled, using kubectl

风流意气都作罢 提交于 2020-01-28 17:32:06
问题 I'm trying to install a helm package on a kubernetes cluster which allegedly has RBAC disabled. I'm getting a permission error mentioning clusterroles.rbac.authorization.k8s.io , which is what I'd expect if RBAC was enabled . Is there a way to check with kubectl whether RBAC really is disabled? What I've tried: kubectl describe nodes --all-namespaces | grep -i rbac : nothing comes up kubectl describe rbac --all-namespaces | grep -i rbac : nothing comes up kubectl config get-contexts | grep -i