question stringlengths 11 28.2k | answer stringlengths 26 27.7k | tag stringclasses 130
values | question_id int64 935 78.4M | score int64 10 5.49k |
|---|---|---|---|---|
I am using deploying an outward facing service, that is exposed behind a nodeport and then an istio ingress. The deployment is using manual sidecar injection. Once the deployment, nodeport and ingress are running, I can make a request to the istio ingress.
For some unkown reason, the request does not route through to m... | Just in case, like me, you get curious... Even though in my scenario it was clear the case of the error...
Error cause: I had two versions of the same service (v1 and v2), and an Istio VirtualService configured with traffic route destination using weights. Then, 95% goes to v1 and 5% goes to v2. As I didn't have the v1... | Istio | 47,664,397 | 27 |
I have 4 microservices running on my laptop listening at various ports. Can I use Istio to create a service mesh on my laptop so the services can communicate with each other through Istio? All the links on google about Istio include kubernetes but I want to run Istio without Kubernetes. Thanks for reading.
| In practice, not really as of this writing, since pretty much all the Istio runbooks and guides are available for Kubernetes.
In theory, yes. Istio components are designed to be 'platform independent'. Quote from the docs:
While Istio is platform independent, using it with Kubernetes (or infrastructure) network polici... | Istio | 53,014,727 | 23 |
I'm currently looking through an Istio and Kubernetes talk and mention the management of services along with the use of sidecars. I'm not sure what that is.
| I think of them as helper containers. A pod can have 1 or more containers. A container should do only one thing, like a web server or load balancer. So if you need some extra work to be done inside the pod, like github sync or data processing, you create an additional container AKA sidecar.
| Istio | 45,847,796 | 23 |
How to disable Istio sidecar injection for the Kubernetes Job?
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: pod-restart
spec:
concurrencyPolicy: Forbid
schedule: '0 8 * * *'
jobTemplate:
metadata:
annotations:
sidecar.istio.io/inject: "false"
spec:
backoffLimit: 2
ac... | The annotation is in wrong place. You have to put it on the pod template.
apiVersion: batch/v1beta1
kind: CronJob
metadata:
spec:
jobTemplate:
spec:
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
There is working CronJob example with istio injection disable... | Istio | 65,807,748 | 19 |
I have read the docs, but seem not able to understand differences between Mixer and Pilot. Is there any overlap? I mean I would like to draw a definite boundary between them to understand their responsibilities and with respect to their communication with the envoy proxies in the mesh. Please add examples of different ... | The Istio Service Mesh provides the following functionalities:
Routing. For example 90% of the traffic goes to the version 1 of a
microservice and the remaining 10% goes to the version 2. Or some
specific requests go to the version 1 and all the others to the
version 2, according to some condition. And also: a) rewrit... | Istio | 48,639,660 | 17 |
Circuit breaker doesn't trip on httpConsecutiveErrors: 1 (for 500 response). All requests pass through and give a 500 instead .
Circuit breaker should trip and should return 503(Service Unavailable) instead .
Follow the steps Circuit breaker setup
.
Once httpbin is up you can simulate 500 with it
Request :
kubectl exec... | Yes, currently Circuit Breaker is not working in the case of HTTP-500, it only works with (Http-502/3/4) till now. But for making Http-500 is in the scope of the circuit breaker the work has been started. You can check this GitHub issue for more detail.
| Istio | 50,622,870 | 14 |
Here is something I noticed in my kubectl get events output
Warning FailedToUpdateEndpoint Endpoints Failed to update endpoint mynamespace/myservice: Operation cannot be fulfilled on endpoints "myservice": the object has been modified; please apply your changes to the latest version and try again
I... | It's common behaviour of k8s to let the k8s clients (Controllers) know to try again.
Kubernetes leverages the concept of resource versions to achieve optimistic concurrency. concurrency-control-and-consistency
It's populated by the system.
To enable clients to build a model of the current state of a cluster, all Ku... | Istio | 57,957,516 | 13 |
I have a mutual TLS enabled Istio mesh. My setup is as follows
A service running inside a pod (Service container + envoy)
An envoy gateway which stays in front of the above service. An Istio Gateway and Virtual Service attached to this. It routes /info/ route to the above service.
Another Istio Gateway configured for... | The problem is probably as follows: istio-ingressgateway initiates mTLS to hr--gateway-service on port 80, but hr--gateway-service expects plain HTTP connections.
There are multiple solutions:
Define a DestinationRule to instruct clients to disable mTLS on calls to hr--gateway-service
apiVersion: networking.istio.... | Istio | 54,160,215 | 13 |
So relatively new to Istio and have a question regarding Istio. Say that I want to rewrite a URI based on a path, but use part of that original uri in the rewrite, is that something I could do with Regex? I'm imagining something like this
http:
- match:
- uri:
regex: ^/(.*\s*)?(canary)(.*)?$
rewrite:
... | Only those rule, which contain StringMatch type of values can work with regex. For example HTTPMatchRequest.
Unfortunately NOT HTTPRewrite, which takes only strings as a value
| Istio | 56,476,847 | 11 |
We've used Zuul as API gateway for a while in Microservices scene, recently we decided to move to Kubernetes and choose a more cloud native way.
After some investigation and going through the Istio docs, we have some questions about API gateway selection in Kubernetes:
Which aspects should be considered when choosing ... | I assume that Zuul offers a lots of features as an edge service for traffic management, routing and security functions. It has to declare API Gateway the main point of accessing microservices by the external clients as per Microservice Architecture pattern Design. However, Zuul needs to somehow discover underlying micr... | Istio | 55,555,334 | 11 |
I am trying to setup ALB load balancer instead of default ELB loadbalancer in Kubernetes AWS.The loadbalancer has to be connected to the istio ingressgateway.I looked for solutions and only found one.
But the istio version mentioned is V1 and there has been so many changes in istio now.I tried to change service type to... |
Step 1 : Change istioingresssgateway service type as nodeport
Step 2 : Install ALB ingress controller
Step 3 : Write ingress.yaml for istioingressgateway as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: istio-system
name: ingress
labels:
app: ingress
annotations:
kubernet... | Istio | 62,407,364 | 10 |
I try to build istio (1.6.0+) using Jenkins and get an error:
docker: Error response from daemon: invalid mount config for type "bind":
bind mount source path does not exist: /home/jenkins/.docker
the slave contains .docker directory:
13:34:42 + ls -a /home/jenkins
13:34:42 .
13:34:42 ..
13:34:42 agent
13:34:42 .bash_... | As I mentioned in comments, workaround here could be to use
-v
instead of
--mount
Differences between -v and --mount behavior
Because the -v and --volume flags have been a part of Docker for a long time, their behavior cannot be changed. This means that there is one behavior that is different between -v and --mount.
... | Istio | 61,316,142 | 10 |
Our GKE cluster is shared to multiple teams in company. Each team can have different public domain (and hence want to have different CA cert setup and also different ingress gateway controller). How to do that in Istio? All the tutorial/introduction articles in Istio's website are using a shared ingress gateway. See th... | Okay, I found the answer after looking at the code of Istio installation via helm. So, basically the istio have an official way (but not really documented in their readme.md file) to add additional gateway (ingress and egress gateway). I know that because I found this yaml file in their github repo and read the comment... | Istio | 51,835,752 | 10 |
Why does k8s secrets need to be base64 encoded when configmaps does not?
When creating a configmap you simply do somthing like this:
apiVersion: v1
kind: ConfigMap
metadata:
name: my-configmap
data:
SOME_KEY: a string value
But when you want to create a secret you have to
echo -n "some secret string" | base64 and... | Secrets can contain binary data (the type is map[string][]byte), and byte arrays are base64-encoded in JSON serialization.
ConfigMaps only contain string data (the type is map[string]string), so the JSON serialization just outputs the string.
In 1.10, ConfigMaps have a new binaryData field that allows storing binary da... | Kubernetes | 49,046,439 | 41 |
I have a kustomize base that I'd like to re-use without editing it. Unfortunately, it creates a namespace I don't want to create. I'd like to simply remove that resource from consideration when compiling the manifests and add a resource for mine since I can't patch a namespace to change the name.
Can this be done? How?... | You can omit the specific resource by using a delete directive of Strategic Merge Patch like this.
Folder structure
$ tree .
.
├── base
│ ├── kustomization.yaml
│ └── namespace.yaml
└── overlays
├── dev
│ └── kustomization.yaml
└── prod
├── delete-ns-b.yaml
└── kustomization.yaml
File... | Kubernetes | 64,899,665 | 40 |
On AWS EKS
I'm adding deployment with 17 replicas (requesting and limiting 64Mi memory) to a small cluster with 2 nodes type t3.small.
Counting with kube-system pods, total running pods per node is 11 and 1 is left pending, i.e.:
Node #1:
aws-node-1
coredns-5-1as3
coredns-5-2das
kube-proxy-1
+7 app pod replicas ... | The real maximum number of pods per EKS instance are actually listed in this document.
For t3.small instances, it is 11 pods per instance. That is, you can have a maximum number of 22 pods in your cluster. 6 of these pods are system pods, so there remains a maximum of 16 workload pods.
You're trying to run 17 workload ... | Kubernetes | 57,970,896 | 40 |
Am using minikube to test out the deployment and was going through this link
And my manifest file for deployment is like
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: webapp
spec:
replicas: 1
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: weba... |
When using a single VM for Kubernetes, it’s useful to reuse Minikube’s built-in Docker daemon. Reusing the built-in daemon means you don’t have to build a Docker registry on your host machine and push the image into it. Instead, you can build inside the same Docker daemon as Minikube, which speeds up local experiments... | Kubernetes | 56,392,041 | 40 |
Is there a table that will tell me which set of API versions I should be using, given a k8s cluster version? Kubernetes docs always assume I always have a nice, up-to-date cluster (1.12 at time of writing) but platform providers don't always live on this bleeding edge so it can get frustrating quite quickly.
Better yet... | For getting a list of all the resource types and their latest supported version, run the following:
for kind in `kubectl api-resources | tail +2 | awk '{ print $1 }'`; do kubectl explain $kind; done | grep -e "KIND:" -e "VERSION:"
It should produce output like
KIND: Binding
VERSION: v1
KIND: ComponentStatus
V... | Kubernetes | 52,711,326 | 40 |
I have created a cluster using the google cloud platform (container engine) and deployed a pod using the following YAML file:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deployment-name
spec:
replicas: 1
template:
metadata:
name: pod-name
labels:
app: app-label
sp... | You have two options:
You could have multiple services, one for each port. As you pointed out, each service will end up with a different IP address
You could have a single service with multiple ports. In this particular case, you must give all ports a name.
In your case, the service becomes:
apiVersion: v1
kind: Serv... | Kubernetes | 45,147,664 | 40 |
The new ability to specify a HEALTHCHECK in a Dockerfile seems redundant with the Kubernetes probe directives. Any advice on what to use when?
| If you use Kubernetes, I'd suggest using only the Kubernetes liveness/readiness checks because Docker healthcheck has not been integrated in the Kubernetes as of now (release 1.12). This means that Kubernetes does not expose the check status in its api server, and the internal system components can not consume this inf... | Kubernetes | 41,475,088 | 40 |
We're using Kubernetes 1.1.3 with its default fluentd-elasticsearch logging.
We also use LivenessProbes on our containers to make sure they operate as expected.
Our problem is that lines we send out to the STDOUT from the LivenessProbe does not appear to reach Elastic Search.
Is there a way to make fluentd ship Livenes... | The output from the probe is swallowed by the Kubelet component on the node, which is responsible for running the probes (source code, if you're interested). If a probe fails, its output will be recorded as an event associated with the pod, which should be accessible through the API.
The output of successful probes isn... | Kubernetes | 34,455,040 | 40 |
I try to install gke-gcloud-auth-plugin on a Mac M1 with zsh, following the gcloud docs.
The installation ran without issue and trying to re-run gcloud components install gke-gcloud-auth-plugin I get the All components are up to date. message.
However, gke-gcloud-auth-plugin --version returns zsh: command not found: gk... | I had the same error and here's how I fixed it.
brew info google-cloud-sdk
which produces:
To add gcloud components to your PATH, add this to your profile:
for bash users
source "$(brew --prefix)/share/google-cloud-sdk/path.bash.inc"
for zsh users
source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.... | Kubernetes | 74,233,349 | 39 |
I need to copy dump data from pod to local. Below the commands I am trying but I am getting error: unexpected EOF
kubectl cp device-database-79fc964c8-q7ncc:tmp /Users/raja
error: unexpected EOF
or
kubectl cp device-database-79fc964c8-q7ncc:tmp/plsql_data/prod.dump /Users/raja/prod.dump
error: unexpected EOF
kubec... | For newer versions of kubectl, adding a retries=-1 flag may resolve the issue:
kubectl cp --retries=-1 pod-www-xxx-yyy-zzz:/path/to/remote/dir ~/local/dir
| Kubernetes | 67,624,630 | 39 |
I'm using mysql Kubernetes statefulset, i mapped PVs to host directory (CentOS 8 VM) but getting " pod has unbound immediate PersistentVolumeClaims"
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql-container
spec:
serviceName: mysql
replicas: 1
selector:
matchLabels:
app: mysql-container
... | PersistentVolumeClaims will remain unbound indefinitely if a matching PersistentVolume does not exist. The PersistentVolume is matched with accessModes and capacity. In this case capacity the PV is 10Gi whereas PVC has capacity of 3Gi.
The capacity in the PV needs to same as in the claim i.e 3Gi to fix the unbound imme... | Kubernetes | 60,774,220 | 39 |
I've created Hyper-V machine and tried to deploy Sawtooth on Minikube using Sawtooth YAML file :
https://sawtooth.hyperledger.org/docs/core/nightly/master/app_developers_guide/sawtooth-kubernetes-default.yaml
I changed the apiVersion i.e. apiVersion: extensions/v1beta1 to apiVersion: apps/v1, though I have launched Mi... | You need to fix your deployment yaml file. As you can see from your error message, the Deployment.spec.selector field can't be empty.
Update the yaml (i.e. add spec.selector) as shown in below:
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: sawtooth-0
template:
metada... | Kubernetes | 59,480,373 | 39 |
I have the following configuration for my pod:
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-app
labels:
app: my-app
spec:
serviceName: my-app
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
restartPolicy: Neve... | Please see https://github.com/kubernetes/kubernetes/issues/24725
It appears that only "Always" is supported.
| Kubernetes | 55,169,075 | 39 |
I am using Prometheus to monitor my Kubernetes cluster. I have set up Prometheus in a separate namespace. I have multiple namespaces and multiple pods are running. Each pod container exposes a custom metrics at this end point, :80/data/metrics . I am getting the Pods CPU, memory metrics etc, but how to configure Promet... | You have to add this three annotation to your pods:
prometheus.io/scrape: 'true'
prometheus.io/path: '/data/metrics'
prometheus.io/port: '80'
How it will work?
Look at the kubernetes-pods job of config-map.yaml you are using to configure prometheus,
- job_name: 'kubernetes-pods'
kubernetes_sd_configs:
... | Kubernetes | 53,365,191 | 39 |
DNS resolution looks fine, but I cannot ping my service. What could be the reason?
From another pod in the cluster:
$ ping backend
PING backend.default.svc.cluster.local (10.233.14.157) 56(84) bytes of data.
^C
--- backend.default.svc.cluster.local ping statistics ---
36 packets transmitted, 0 received, 100% packet l... | Ping doesn't work with service's cluster IPs like 10.233.14.157, as it is a virtual IP. You should be able to ping a specific pod, but no a service.
| Kubernetes | 50,852,542 | 39 |
Base question: When I try to use kube-apiserver on my master node, I get command not found error. How I can install/configure kube-apiserver? Any link to example will help.
$ kube-apiserver --enable-admission-plugins DefaultStorageClass
-bash: kube-apiserver: command not found
Details: I am new to Kubernetes and Docke... | You are asking two different questions here, one about kube-apiserver configuration, one about troubleshooting your StorageClass.
Here's an answer for your first question:
kube-apiserver is running as a Docker container on your master node. Therefore, the binary is within the container, not on your host system. It is s... | Kubernetes | 50,352,621 | 39 |
kubernetes PodSecurityPolicy set to runAsNonRoot, pods are not getting started post that Getting error Error: container has runAsNonRoot and image has non-numeric user (appuser), cannot verify user is non-root
We are creating the user (appuser) uid -> 999 and group (appgroup) gid -> 999 in the docker container, and we ... | Here is the implementation of the verification:
case uid == nil && len(username) > 0:
return fmt.Errorf("container has runAsNonRoot and image has non-numeric user (%s), cannot verify user is non-root", username)
And here is the validation call with the comment:
// Verify RunAsNonRoot. Non-root verification only su... | Kubernetes | 49,720,308 | 39 |
Deploying my service to production:
envsubst < ./kubernetes/pre-production/aks.yaml | kubectl apply -f -
I'm getting the following error:
The Deployment "moverick-mule-pre" is invalid:
spec.template.metadata.labels: Invalid value:
map[string]string{"commit":"750a26deebc3582bec4bfbb2426b3f22ee042eaa",
"app":"mov... | You need to add selector in spec of Deployment.
And also, these selector should match with labels in PodTemplate.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: moverick-mule-pre
spec:
replicas: 2
selector:
matchLabels:
app: moverick-mule-pre
commit: $CI_COMMIT_SHA
strategy:
type:... | Kubernetes | 48,582,951 | 39 |
Helm _helpers.tpl?
Helm allows for the use of Go templating in resource files for Kubernetes.
A file named _helpers.tpl is usually used to define Go template helpers with this syntax:
{{- define "yourFnName" -}}
{{- printf "%s-%s" .Values.name .Values.version | trunc 63 -}}
{{- end -}}
Which you can then use in your... | You can use (include ... ) syntax. Example of including previously defined template foo:
{{- define "bar" -}}
{{- printf "%s-%s" (include "foo" .) .Release.Namespace | trunc 63 | trimSuffix "-" -}}
{{- end -}}
| Kubernetes | 46,719,082 | 39 |
I use the yaml file, which is in the Kubernetes official document, to create a Deployment in Kubernetes, and it uses apiVersion: apps/v1beta1 at the top. Then I typed kubectl create -f deployment.yaml to create this Deployment, but it occured an error as following:
error: error validating "deployment.yaml": error ... | The apps API group will be where the v1 Deployment type lives. The apps/v1beta1 version was added in 1.6.0, so if you have a 1.5.x client or server, you should still use the extensions/v1beta1 version.
The apps/v1beta1 and extensions/v1beta1 Deployment types are identical, but when creating via the apps API, some impr... | Kubernetes | 43,163,625 | 39 |
I deployed my angular application(Static webpage) on kubernetes and tried launching it from Google Chrome. I see app is loading, however there is nothing displayed on the browser. Upon checking on browser console , I could see this error
"Failed to load module script: Expected a JavaScript module script but the server ... | This error usually happens because you deployment was into a subfolder, so it seems like Angular is fetching you app directly from your base URL, so your html is found when you go to your domain.com/mysubfolder/index.html, but as the Angular fetches your resources from domain.com/index.html instead of domain.com/mysubf... | Kubernetes | 72,070,748 | 38 |
Is it possible to know the progress of file transfer with kubectl cp for Google Cloud?
| No, this doesn't appear to be possible.
kubectl cp appears to be implemented by doing the equivalent of
kubectl exec podname -c containername \
tar cf - /whatever/path \
| tar xf -
This means two things:
tar(1) doesn't print any useful progress information. (You could in principle add a v flag to print out each fi... | Kubernetes | 54,293,353 | 38 |
This is a total noob Kubernetes question. I have searched for this, but can't seem to find the exact answer. But that may just come down to not having a total understanding of Kubernetes. I have some pods deployed across three nodes, and my questions are simple.
How do I check the total disk space on a node?
How do... | For calculating total disk space you can use
kubectl describe nodes
from there you can grep ephemeral-storage which is the virtual disk size This partition is also shared and consumed by Pods via emptyDir volumes, container logs, image layers and container writable layers
If you are using Prometheus you can calculat... | Kubernetes | 54,149,618 | 38 |
As I understand, Istio VirtualService is kind of abstract thing, which tries to add an interface to the actual implementation like the service in Kubernetes or something similar in Consul.
When use Kubernetes as the underlying platform for Istio, is there any difference between Istio VirtualService and Kubernetes Servi... | Kubernetes service
Kubernetes service manage a pod's networking. It specifies whether your pods are exposed internally (ClusterIP), externally (NodePort or LoadBalancer) or as a CNAME of other DNS entries (externalName).
As an example this foo-service will expose the pods with label app: foo. Any requests sent to the ... | Kubernetes | 53,743,219 | 38 |
I work in a multi-tenant node app, I know to create a new namespace in Kubernetes is possible to run a kubectl command as follow:
kubectl create namespace <namespace name>
How can I create a new namespace from node Microservices when a new customer make a sign up for a new account?
Is there some kubectl API to make a r... | It could be as simple as calling from a shell in your app:
kubectl create namespace <your-namespace-name>
Essentially, kubectl talks to the kube-apiserver.
You can also directly call the kube-apiserver. This is an example to list the pods:
$ curl -k -H 'Authorization: Bearer <token>' \
https://$KUBERNETE... | Kubernetes | 52,901,435 | 38 |
Kubernetes not able to find metric-server api.I am using Kubernetes with Docker on Mac. I was trying to do HPA from following example. However, when I execute command kubectl get hpa, My target still was unknown. Then I tried, kubectl describe hpa. Which gave me error like below:
Name: ... | Use official metrics server - https://github.com/kubernetes-sigs/metrics-server
If you use one master node, run this command to create the metrics-server:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
If you have HA (High availability) cluster, use this:
ku... | Kubernetes | 52,694,238 | 38 |
How do I run a docker image that I built locally on Google Container Engine?
| You can push your image to Google Container Registry and reference them from your pod manifest.
Detailed instructions
Assuming you have a DOCKER_HOST properly setup , a GKE cluster running the last version of Kubernetes and Google Cloud SDK installed.
Setup some environment variables
gcloud components update kubectl
g... | Kubernetes | 26,788,485 | 38 |
I'm currently facing an issue with my Kubernetes clusters and need some assistance. Everything was running smoothly until today. However, after performing an update on my Ubuntu system, I'm unable to establish a connection from my working environment to the kubernetes clusters.
When executing the command kubectl get po... | Try
kubectl get nodes -v=10
and look for the errors.
| Kubernetes | 76,841,889 | 37 |
I have microk8s v1.22.2 running on Ubuntu 20.04.3 LTS.
Output from /etc/hosts:
127.0.0.1 localhost
127.0.1.1 main
Excerpt from microk8s status:
addons:
enabled:
dashboard # The Kubernetes dashboard
ha-cluster # Configure high availability on the current node
ingress # In... | To fix the error error: unable to recognize "ingress.yaml": no matches for kind "Ingress" in version "extensions/v1beta1 you need to set apiVersion to the networking.k8s.io/v1. From the Kubernetes v1.16 article about deprecated APIs:
NetworkPolicy in the extensions/v1beta1 API version is no longer served
- Migra... | Kubernetes | 69,517,855 | 37 |
I have kubernetes pods running as shown in command "kubectl get all -A" :
and same pods are shown in command "kubectl get pod -A" :
I want to enter/login to any of these pod (all are in Running state). How can I do that please let me know the command?
| In addition to Jonas' answer above;
If you have more than one namespace, you need to specify the namespace your pod is currently using i.e kubectl exec -n <name space here> <pod-name> -it -- /bin/sh
After successfully accessing your pod, you can go ahead and navigate through your container.
| Kubernetes | 67,550,782 | 37 |
I found specifying like kubectl --context dev --namespace default {other commands} before kubectl client in many examples. Can I get a clear difference between them in a k8's environment?
| The kubernetes concept (and term) context only applies in the kubernetes client-side, i.e. the place where you run the kubectl command, e.g. your command prompt.
The kubernetes server-side doesn't recognise this term 'context'.
As an example, in the command prompt, i.e. as the client:
when calling the kubectl get pods... | Kubernetes | 61,171,487 | 37 |
I would like to know what is/are differences between an api gateway and Ingress controller. People tend to use these terms interchangeably due to similar functionality they offer. When I say, 'Ingress controller'; don't confuse it with Ingress objects provided by kubernetes. Also, it would be nice if you can explain th... | Ingress controller allows single ip-port to access all services running in k8s through ingress rules. The ingress controller service is set to load balancer so it is accessible from public internet.
An api gateway is used for application routing, rate limiting, security, request and response handling and other applicat... | Kubernetes | 59,071,842 | 37 |
How can I list the kubernetes services in k9s?
By default only the pods and deployments are shown.
It's possible as shown here and I'm using the current k9s version 0.7.11
| It's documented here:
Key Bindings
K9s uses aliases to navigate most K8s resources.
:alias View a Kubernetes resource aliases
So you have to type:
:svc
EDIT: Hotkeys
You can also configure custom hotkeys.
Here's my config file ~/.k9s/hotkey.yml
or ~/Library/Application Support/k9s/hotkey.yml
hotKey:
f1:
shortC... | Kubernetes | 56,823,971 | 37 |
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.
| 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) and all settings (Reset to factory defaults) or even u... | Kubernetes | 52,876,194 | 37 |
I am a beginner to Kubernetes and starting off with this tutorial. I installed VM and expected to be able to start a cluster by using the command:
minikube start
But I get the error:
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
E0911 13:34:45.394430 41676 start.go:174] Error starting host: Error
cr... | Figured out the issue. VirtualBox was not installed correctly as Mac had blocked it. It wasn't obvious at first.
Restarting won't work if VirtualBox isn't installed correctly.
System Preferences -> Security & Privacy -> Allow -> Then allow the software corporation (in this case Oracle)
Restart
Now it worked as exp... | Kubernetes | 52,277,019 | 37 |
I try to pull image from an ACR using a secret and I can't do it.
I created resources using azure cli commands:
az login
az provider register -n Microsoft.Network
az provider register -n Microsoft.Storage
az provider register -n Microsoft.Compute
az provider register -n Microsoft.ContainerService
az group create --nam... | The "old" way with AKS was to do create secret as you mentioned. That is no longer recommended.
The "new" way is to attach the container registry. This article explains the "new" way to attach ACR, and also provides a link to the old way to clear up confusion. When you create your cluster, attach with:
az aks create -n... | Kubernetes | 49,512,099 | 37 |
I'm attempting to create a Kubernetes CronJob to run an application every minute.
A prerequisite is that I need to get my application code onto the container that runs within the CronJob. I figure that the best way to do so is to use a persistent volume, a pvclaim, and then defining the volume and mounting it to the c... | A CronJob uses a PodTemplate as everything else based on Pods and can use Volumes. You placed your Volume specification directly in the CronJobSpec instead of the PodSpec, use it like this:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: update-db
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
... | Kubernetes | 46,578,331 | 37 |
I want to debug the pod in a simple way, therefore I want to start the pod without deployment.
But it will automatically create a deployment
$ kubectl run nginx --image=nginx --port=80
deployment "nginx" created
So I have to create the nginx.yaml file
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
contai... | kubectl run nginx --image=nginx --port=80 --restart=Never
--restart=Always: The restart policy for this Pod. Legal values [Always, OnFailure, Never]. If set to Always
a deployment is created, if set to OnFailure a job is created, if set to Never, a regular pod is created. For the latter two --replicas must be 1. D... | Kubernetes | 45,279,572 | 37 |
How do you get logs from kube-system pods? Running kubectl logs pod_name_of_system_pod does not work:
λ kubectl logs kube-dns-1301475494-91vzs
Error from server (NotFound): pods "kube-dns-1301475494-91vzs" not found
Here is the output from get pods:
λ kubectl get pods --all-namespaces
NAMESPACE NAME ... | Use the namespace param to kubectl : kubectl --namespace kube-system logs kubernetes-dashboard-rvm78
| Kubernetes | 45,185,015 | 37 |
Specific to Docker based deployment, what are the differences between those two? Since Google App Engine Flexible now also supports Dockerfile based deployment and it is also fully-managed service, seems it's more preferred option rather than configuring Kubernetes deployment on Container Engine, isn't it?
What are the... | They are different things. App Engine Flexible is focused on application development - i.e. you have an application and you want to be deployed and managed by Google). On the other hand, Kubernetes is more about having your own infrastructure. Obviously, you can also deploy applications in Kubernetes but, as it's your ... | Kubernetes | 44,899,828 | 37 |
Is there way to specify a custom NodePort port in a kubernetes service YAML definition?
I need to be able to define the port explicitly in my configuration file.
| You can set the type NodePort in your Service Deployment. Note that there is a Node Port Range configured for your API server with the option --service-node-port-range (by default 30000-32767). You can also specify a port in that range specifically by setting the nodePort attribute under the Port object, or the system ... | Kubernetes | 43,935,502 | 37 |
I am finding docker swarm, kubernetes quite similar and then there is docker which is a company and the above two are docker clustering tool. So what exactly all these tools are and differences between them?
| There are lots of articles out there which will explain the differences. In a nutshell:
Both are trying to solve the same problem - container orchestration over a large number of hosts. Essentially these problems can be broken down like so:
Scheduling containers across multiple hosts (taking into account resource u... | Kubernetes | 40,844,726 | 37 |
I will use a very specific way to explain my problem, but I think this is better to be specific than explain in an abstract way...
Say, there is a MongoDB replica set outside of a Kubernetes cluster but in a network. The ip addresses of all members of the replica set were resolved by /etc/hosts in app servers and db se... | There are 2 possible solutions for this problem now:
Pod-wise (Adding the changes to every pod needed to resolve these domains)
cluster-wise (Adding the changes to a central place which all pods have access to, Which is in our case is the DNS)
Let's begin with the pod-wise solution:
As of Kunbernetes 1.7, It's possib... | Kubernetes | 37,166,822 | 37 |
I currently have an Ingress configured on GKE (k8s 1.2) to forward requests towards my application's pods. I have a request which can take a long time (30 seconds) and timeout from my application (504). I observe that when doing so the response that i receive is not my own 504 but a 502 from what looks like the Google ... | Beginning with 1.11.3-gke.18, it is possible to configure timeout settings in kubernetes directly.
First add a backendConfig:
# For GKE < 1.16.8-gke.3 use "cloud.google.com/v1beta1" below
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: my-bsc-backendconfig
spec:
timeoutSec: 40
Then add an annot... | Kubernetes | 36,200,528 | 37 |
To exec into a container in a pod, I use the following two commands (note the template flag in the first command trims the output to print just the name of the pods):
$ kubectl get pods --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'
app-api-6421cdf4fd-x9tbk
app-worker-432f86f54-fknxw
app-frontend-87dd65... | You can exec into a pod using the deployment.
You can use the following command:
kubectl exec -it deploy/<deployment-name> -- bash
| Kubernetes | 63,626,842 | 36 |
I'm running kubernetes in azure.
I want to delete a specific deployment, with AZ AKS or kubectl.
The only info I've found is how to delete pods, but this is not what I'm looking for, since pods will regenerate once deleted.
I know I just can go to the ui and delete the deployment but i want to do it with az aks or kub... | Find out all deployments across all namespaces
kubectl get deploy -A
Then delete a deployment with deploymentname from namespace. deploymentname can be found from above command.
kubectl delete deploy deploymentname -n namespacename
Docs on how to configure kubectl to connect to AKS.
| Kubernetes | 61,058,684 | 36 |
I am using a Windows 10 Pro machine.
When I run netstat, it is showing kubernetes:port as foreign address in active connections.
What does this mean? I have checked and there is no kubernetes cluster running on my machine.
How do I close these connections?
Minikube status:
$ minikube status
host:
kubelet:
apise... | That happens because of the way netstat renders output. It has nothing to do with actual Kubernetes.
I have Docker Desktop for Windows and it adds this to the hosts file:
# Added by Docker Desktop
192.168.43.196 host.docker.internal
192.168.43.196 gateway.docker.internal
# To allow the same kube context to work on the ... | Kubernetes | 59,918,618 | 36 |
By default,according to k8s documentation, Services are assigned a DNS A record for a name of the form my-svc.my-namespace.svc.cluster-domain.example.
Is there a command to retrieve the full name of a service?
| You can do a DNS query from any pod and you would get the FQDN.
# nslookup api-server
Server: 10.96.0.10
Address: 10.96.0.10#53
Name: api-server.default.svc.cluster.local
Address: 10.104.225.18
root@api-server-6ff8c8b9c-6pgkb:/#
cluster-domain.example is just a example in the documentation. cluster.local is... | Kubernetes | 59,559,438 | 36 |
How do I determine which apiGroup any given resource belongs in?
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: default
name: thing
rules:
- apiGroups: ["<wtf goes here>"]
resources: ["deployments"]
verbs: ["get", "list"]
resourceNames: []
| To get API resources - supported by your Kubernetes cluster:
kubectl api-resources -o wide
example:
NAME SHORTNAMES APIGROUP NAMESPACED KIND VERBS
deployments deploy apps true ... | Kubernetes | 57,821,065 | 36 |
I want to get the value of a specific field of a secret in a shell script.
From the kubectl get secret documentation, it seems the standard way to get a secret returns the whole thing, in a specified format, with the values base64 encoded.
So, to get the bar field of the foo secret, output as an unencoded string, I'm d... | Try this
kubectl get secret foo --template={{.data.bar}} | base64 --decode
No need of jq.
| Kubernetes | 57,379,081 | 36 |
I setup a new k8s in a single node, which is tainted. But the PersistentVolume can not be created successfully, when I am trying to create a simple PostgreSQL.
There is some detail information below.
The StorageClass is copied from the official page: https://kubernetes.io/docs/concepts/storage/storage-classes/#local
k... | The app is waiting for the Pod, while the Pod is waiting for a PersistentVolume by a PersistentVolumeClaim.
However, the PersistentVolume should be prepared by the user before using.
My previous YAMLs are lack of a PersistentVolume like this:
kind: PersistentVolume
apiVersion: v1
metadata:
name: postgres-data
label... | Kubernetes | 55,044,486 | 36 |
I've found a documentation about how to configure your NginX ingress controller using ConfigMap: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/
Unfortunately I've no idea and couldn't find it anywhere how to load that ConfigMap from my Ingress controller.
My ingress controller:
hel... | I've managed to display what YAML gets executed by Helm using the: --dry-run --debug options at the end of helm install command. Then I've noticed that there controller is executed with the: --configmap={namespace-where-the-nginx-ingress-is-deployed}/{name-of-the-helm-chart}-nginx-ingress-controller.
In order to load y... | Kubernetes | 54,884,735 | 36 |
I understand that {{.Release.namespace}} will render the namespace where the application being installed by helm. In that case, helm template command will render it as empty string (since it doesn't know yet the release namespace).
However, what makes me surprise is helm upgrade --install command (i haven't tried othe... | The generated value .Release.Namespace is case-sensitive. The letter N in "namespace" should be capitalized.
| Kubernetes | 51,760,772 | 36 |
In Kubernetes object metadata, there are the concepts of resourceVersion and generation. I understand the notion of resourceVersion: it is an optimistic concurrency control mechanism—it will change with every update. What, then, is generation for?
| resourceVersion changes on every write, and is used for optimistic concurrency control
in some objects, generation is incremented by the server as part of persisting writes affecting the spec of an object.
some objects' status fields have an observedGeneration subfield for controllers to persist the generation that was... | Kubernetes | 47,100,389 | 36 |
I am failing to pull from my private Docker Hub repository into my local Kubernetes setup running on Vagrant:
Container "hellonode" in pod "hellonode-n1hox" is waiting to start: image can't be
pulled
Failed to pull image "username/hellonode": Error: image username/hellonode:latest not found
I have set up Kubernetes... | To pull a private DockerHub hosted image from a Kubernetes YAML:
Run these commands:
DOCKER_REGISTRY_SERVER=docker.io
DOCKER_USER=Type your dockerhub username, same as when you `docker login`
DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
DOCKER_PASSWORD=Type your dockerhub pw, same as when you... | Kubernetes | 36,232,906 | 36 |
We use Kubernetes Jobs for a lot of batch computing here and I'd like to instrument each Job with a monitoring sidecar to update a centralized tracking system with the progress of a job.
The only problem is, I can't figure out what the semantics are (or are supposed to be) of multiple containers in a job.
I gave it a s... | You can use the downward api to figure out your own podname from within the sidecar, and then retrieving your own pod from the apiserver to lookup exist status. Let me know how this goes.
| Kubernetes | 36,208,211 | 36 |
Is there any way to configure nodeSelector at the namespace level?
I want to run a workload only on certain nodes for this namespace.
| To achieve this you can use PodNodeSelector admission controller.
First, you need to enable it in your kubernetes-apiserver:
Edit /etc/kubernetes/manifests/kube-apiserver.yaml:
find --enable-admission-plugins=
add PodNodeSelector parameter
Now, you can specify scheduler.alpha.kubernetes.io/node-selector option in ... | Kubernetes | 52,487,333 | 35 |
I can run this command to create a docker registry secret for a kubernetes cluster:
kubectl create secret docker-registry regsecret \
--docker-server=docker.example.com \
--docker-username=kube \
--docker-password=PW_STRING \
--docker-email=my@email.com \
--namespace mynamespace
I would like to create the same secret... | You can write that yaml by yourself, but it will be faster to create it in 2 steps using kubectl:
Generate a 'yaml' file. You can use the same command but in dry-run mode and output mode yaml.
Here is an example of a command that will save a secret into a 'docker-secret.yaml' file for kubectl version < 1.18 (check th... | Kubernetes | 49,629,241 | 35 |
Where are documented the "types" of secrets that you can create in kubernetes?
looking at different samples I have found "generic" and "docker-registry" but I have no been able to find a pointer to documentation where the different type of secrets are documented.
I always end in the k8s doc:
https://kubernetes.io/docs/... | Here is a list of 'types' from the source code:
SecretTypeOpaque SecretType = "Opaque"
[...]
SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token"
[...]
SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg"
[...]
SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson"
[.... | Kubernetes | 49,614,439 | 35 |
I am new to all things Kubernetes so still have much to learn.
Have created a two node Kubernetes cluster and both nodes (master and worker) are ready to do work which is good:
[monkey@k8s-dp1 nginx-test]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-dp1 Ready master 2h v1.9.1
k... | Use kubectl describe pod <name> to see more info
| Kubernetes | 48,190,928 | 35 |
Using Helm templates, I'm trying to generate a list of server names based on a number in values.yaml. The dot for this template is set to the number (its a float64).
{{- define "zkservers" -}}
{{- $zkservers := list -}}
{{- range int . | until -}}
{{- $zkservers := print "zk-" . ".zookeeper" | append $zkservers -}}
{{... | For those from 2020+ it now can be achieved as simple as that:
{{ join "," .Values.some.array }}
It produces the correct output:
value: "test1,test2,test3"
At least it works with (more or less) recent versions of helm-cli:
Client: &version.Version{SemVer:"v2.16.2", GitCommit:"bbdfe5e7803a12bbdf97e94cd847859890cf4050",... | Kubernetes | 47,668,793 | 35 |
I started minikube with k8s version 1.5.2 and I would like to downgrade my kubectl so that it is also 1.5.2. Currently when I run kubectl version I get:
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08... | You can just download the previous version binary and replace the one you have now.
Linux:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
macOS:
curl -LO https://storage.googleapis.com/kubernetes-release/rele... | Kubernetes | 46,610,180 | 35 |
Traefik is a reverse HTTP proxy with several supported backends, Kubernetes included. How does Istio compare?
| It's something of an apples-to-oranges comparison.
Edge proxies like Traefik or Nginx are best compared to Envoy - the proxy that Istio leverages. An Envoy proxy is installed automatically by Istio adjacent to every pod.
Istio provides several higher level capabilities beyond Envoy, including routing, ACLing and servi... | Kubernetes | 44,212,356 | 35 |
I am getting a couple of errors with Helm that I can not find explanations for elsewhere. The two errors are below.
Error: no available release name found
Error: the server does not allow access to the requested resource (get configmaps)
Further details of the two errors are in the code block further below.
I have ins... | The solution given by kujenga from the GitHub issue worked without any other modifications:
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system till... | Kubernetes | 43,499,971 | 35 |
Currently, I'm using Docker Desktop with WSL2 integration. I found that Docker Desktop automatically had created a cluster for me. It means I don't have to install and use Minikube or Kind to create cluster.
The problem is that, how could I enable Ingress Controller if I use "built-in" cluster from Docker Desktop?
I tr... | Finally I found the way to fix. I have to deploy ingress Nginx by command:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.41.2/deploy/static/provider/cloud/deploy.yaml
(Follows the instruction at https://kubernetes.github.io/ingress-nginx/deploy/#docker-for-mac. It works just... | Kubernetes | 65,193,758 | 34 |
I'm trying to use NodePort with kind but somehow it doesn't want to work.
I've successfully deployed the following cluster:
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 80
hostPort: 30000
listenAddress: "0.0.0.0" # Optional, defaults to "0... | Kind cluster configuration needs to be like below
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30000
hostPort: 30000
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
protocol: tcp # Optional, defaults to tcp
- role: worker
T... | Kubernetes | 62,432,961 | 34 |
I am running a jenkins pipeline with the following command:
kubectl exec -it kafkacat-5f8fcfcc57-2txhc -- kafkacat -b cord-kafka -C -t BBSim-OLT-0-Events -o s@1585031458
which is running fine on the terminal of the machine the pipeline is running on, but on the actual pipeline I get the following error: "Unable to use... | For windows git bash:
alias kubectl='winpty kubectl'
$ kubectl exec -it <container>
Or just use winpty before the desired command.
| Kubernetes | 60,826,194 | 34 |
I need some advise on an issue I am facing with k8s 1.14 and running gitlab pipelines on it. Many jobs are throwing up exit code 137 errors and I found that it means that the container is being terminated abruptly.
Cluster information:
Kubernetes version: 1.14
Cloud being used: AWS EKS
Node: C5.4xLarge
After digging... | Exit Code 137 does not necessarily mean OOMKilled. It indicates failure as container received SIGKILL (some interrupt or ‘oom-killer’ [OUT-OF-MEMORY])
If pod got OOMKilled, you will see below line when you describe the pod
State: Terminated
Reason: OOMKilled
Edit on 2/2/2022
I see that you add... | Kubernetes | 59,729,917 | 34 |
I am using k8s with version 1.11 and CephFS as storage.
I am trying to mount the directory created on the CephFS in the pod. To achieve the same I have written the following volume and volume mount config
in the deployment configuration
Volume
{
"name": "cephfs-0",
"cephfs": {
"monitors": [
"10.0.1.165:67... | Unfortunately Kubernetes' volume system differs from Docker's, so this is not possible directly.
However, in case of a single file foo.conf you can use:
a mountPath ending in this file name and
a subPath containing this file name, like this:
volumeMounts:
- name: cephfs-0
mountPath: /opt/myapplication/c... | Kubernetes | 58,128,591 | 34 |
Please explain the difference between ResourceQuota vs LimitRange objects in Kubernetes...?
| LimitRange and ResourceQuota are objects used to control resource usage by a Kubernetes cluster administrator.
ResourceQuota is for limiting the total resource consumption of a namespace, for example:
apiVersion: v1
kind: ResourceQuota
metadata:
name: object-counts
spec:
hard:
configmaps: "10"
persistentvo... | Kubernetes | 54,929,714 | 34 |
I would like to do two things with MicroK8s:
Route the host machine (Ubuntu 18.04) ports 80/443 to Microk8s
Use something like the simple ingress defined in the kubernetes.io docs
My end goal is to create a single node Kubernetes cluster that sits on the Ubuntu host, then using ingress to route different domains to t... | TLDR
Update the annotation to be kubernetes.io/ingress.class: public
Why
For MicroK8s v1.21, running
microk8s enable ingress
Will create a DaemonSet called nginx-ingress-microk8s-controller in the ingress namespace.
If you inspect that, there is a flag to set the ingress class:
- args:
... omitted ...
... | Kubernetes | 54,506,269 | 34 |
I'm looking for a kubectl command to list / delete all completed jobs
I've try:
kubectl get job --field-selector status.succeeded=1
But I get:
enfield selector "status.succeeded=1": field label "status.succeeded" not supported for batchv1.Jobter code here
What are the possible fields for --fieldSelector when getting ... | you are almost there, you can do below to delete completed jobs
kubectl delete jobs --all-namespaces --field-selector status.successful=1
| Kubernetes | 53,539,576 | 34 |
I have kubeadm and Kubernetes v1.12 without AWS or Google Cloud.
I want to know if the Kubernetes cluster installed already has an ingress controller and if it has two what is the default.
Thanks :)
| You can check for pods implementing ingress controllers (actually with ingress in the name) with:
kubectl get pods --all-namespaces | grep ingress
And services exposing them with:
kubectl get service --all-namespaces | grep ingress
As @Prafull Ladha says, you won't have an ingress controller by default. The documentati... | Kubernetes | 53,299,238 | 34 |
I have recently installed minikube and VirtualBox on a new Mac using homebrew. I am following instructions from the official minikube tutorial.
This is how I am starting the cluster -
minikube start --vm-driver=hyperkit
On running kubectl cluster-info I get this
Kubernetes master is running at https://192.168.99.10... | stop the minikube:
minikube stop
clean up the current minikune config and data ( which is not working or gone bad)
rm -rf ~/.minikube
Start minikube again: ( a fresh instance )
minikube start
| Kubernetes | 52,916,548 | 34 |
This is the helm and tiller version:
> helm version --tiller-namespace data-devops
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
... | This is or has been a helm issue for a while. It only affects the situation where the first install of a chart fails and has up to helm 2.7 required a manual delete of the failed release before correcting the issue and installing again. However there is now a --force flag available to address this case - https://github... | Kubernetes | 51,760,640 | 34 |
In my gcloud console it shows the following error for my defined ingresses:
Error during sync: error while evaluating the ingress spec: service
"monitoring/kube-prometheus" is type "ClusterIP", expected "NodePort"
or "LoadBalancer"
I am using traefik as reverse proxy (instead of nginx) and therefore I define an ... | I don't know why that error happens, because it seems (to me) to be a valid configuration. But to clear the error, you can switch your service to a named NodePort. Then switch your ingress to use the port name instead of the number. For example:
Service:
apiVersion: v1
kind: Service
metadata:
name: testapp
spec:
... | Kubernetes | 51,572,249 | 34 |
Issue Redis POD creation on k8s(v1.10) cluster and POD creation stuck at "ContainerCreating"
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 30m de... | Ensure that /etc/cni/net.d and its /opt/cni/bin friend both exist and are correctly populated with the CNI configuration files and binaries on all Nodes. For flannel specifically, one might make use of the flannel cni repo
| Kubernetes | 51,169,728 | 34 |
How to delete all the contents from a kubernetes node? Contents include deployments, replica sets etc. I tried to delete deplyoments seperately. But kubernetes recreates all the pods again. Is there there any ways to delete all the replica sets present in a node?
| If you are testing things, the easiest way would be
kubectl delete deployment --all
Althougth if you are using minikube, the easiest would probably be delete the machine and start again with a fresh node
minikube delete
minikube start
If we are talking about a production cluster, Kubernetes has a built-in feature to ... | Kubernetes | 48,077,931 | 34 |
I've found jsonpath examples for testing multiple values but not extracting multiple values.
I want to get image and name from kubectl get pods.
this gets me name
kubectl get pods -o=jsonpath='{.items[*].spec.containers[*].name}' | xargs -n 1
this gets me image
kubectl get pods -o=jsonpath='{.items[*].spec.containe... | Use below command to get name and image:
kubectl get pods -Ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@.spec.template.spec.containers[].image}{"\n"}{end}'
It will give output like below:
name image
| Kubernetes | 46,229,072 | 34 |
Just curious about the intent for this default namespace.
| That namespace exists in clusters created with kubeadm for now. It contains a single ConfigMap object, cluster-info, that aids discovery and security bootstrap (basically, contains the CA for the cluster and such). This object is readable without authentication.
If you are courious:
$ kubectl get configmap -n kube-publ... | Kubernetes | 45,929,548 | 34 |
I am trying to setup an Ingress in GCE Kubernetes. But when I visit the IP address and path combination defined in the Ingress, I keep getting the following 502 error:
Here is what I get when I run: kubectl describe ing --namespace dpl-staging
Name: dpl-identity
Namespace: dpl-staging
Address: 3... | Your backend k8s-be-32396--5fc40252fadea594 is showing as "UNHEALTHY".
Ingress will not forward traffic if the backend is UNHEALTHY, this will result in the 502 error you are seeing.
It will be being marked as UNHEALTHY becuase it is not passing it's health check, you can check the health check setting for k8s-be-32396... | Kubernetes | 42,967,763 | 34 |
is there a way to tell kubectl that my pods should only deployed on a certain instance pool?
For example:
nodeSelector:
pool: poolname
Assumed i created already my pool with something like:
gcloud container node-pools create poolname --cluster=cluster-1 --num-nodes=10 --machine-type=n1-highmem-32
| Ok, i found out a solution:
gcloud creates a label for the pool name. In my manifest i just dropped that under the node selector. Very easy.
Here comes my manifest.yaml: i deploy ipyparallel with kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ipengine
spec:
replicas: 1
template:
me... | Kubernetes | 40,154,907 | 34 |
If I do kubectl get deployments, I get:
$ kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
analytics-rethinkdb 1 1 1 1 18h
frontend 1 1 1 1 6h
queue 1 1 ... | Object names are immutable in Kubernetes. If you want to change a name, you can export/edit/recreate with a different name
| Kubernetes | 39,428,409 | 34 |
How can I tell whether or not I am running inside a kubernetes cluster? With docker I can check if /.dockerinit exist. Is there an equivalent?
| You can check for KUBERNETES_SERVICE_HOST environment variable.
This variable is always exported in an environment where the container is executed.
Refer to https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#environment-variables
| Kubernetes | 36,639,062 | 34 |
my web application is running as a Kubernetes pod behind an nginx reverse proxy for SSL. Both the proxy and my application use Kubernetes services for load balancing (as described here).
The problem is that all of my HTTP request logs only show the internal cluster IP addresses instead of the addresses of the actual HT... | As of 1.5, if you are running in GCE (by extension GKE) or AWS, you simply need to add an annotation to your Service to make HTTP source preservation work.
...
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/external-traffic: OnlyLocal
...
It basically exposes the service directly via nodeports i... | Kubernetes | 32,112,922 | 34 |
I am getting the below error when installing the latest stable Rancher Desktop in my Virtual Machine.
Could someone please help?
Error:
Error: wsl.exe exited with code 4294967295
Command:
wsl --distribution rancher-desktop --exec mkdir -p /mnt/wsl/rancher-desktop/run/data
Logs:
2022-02-02T09:58:39.490Z: Running comm... | I met the same issue in Windows 10.
Below solution helped me:
1. Quit Rancher Desktop
2. Run below command in Windows command line:
wsl --update
3. After update completed, open Rancher Desktop again.
Rancher Desktop works well now.
After completed installing Rancher desktop, you can use the docker and kubectl comman... | Kubernetes | 70,953,842 | 33 |
The command helm init does not work any longer as of version 3.
Running helm --help lists all available commands, amongst which init is no longer present.
Why is that?
| According to the official documentation, the helm init command has been removed without replacement:
The helm init command has been removed. It performed two primary functions. First, it installed Tiller. This is no longer needed. Second, it setup directories and repositories where Helm configuration lived. This is ... | Kubernetes | 59,261,340 | 33 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.