Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I got this structure:</p> <pre><code>├── root │   ├── app A │   ├── app B │   ├── app C </code></pre> <p>The root folder is initialized as git folder so I can easily push the whole project. Now I am wondering where to place the <code>kubernetes yaml</code> files. My idea would be something like this:</p> <pre><co...
elp
<p>This is completely subjective and you should do whatever works for you. My preference, however, is:</p> <pre><code># Each application has - opt - kubernetes - deployment.yaml - helm - values.yaml </code></pre> <p>I like using <code>./opt</code>, as it is familiar to most with Unix experience.</p>
Rawkode
<p>I'm trying to pass the JVM settings to a Java application which is configured to use JKube Maven plugin to deploy on Openshift. I've added in deployment.yaml file the following settings:</p> <pre><code>spec: template: spec: containers: - env: - name: JAVA_OPTS value: '-Xms128m -Xm...
Carla
<p>You have to use the GC_MAX_METASPACE_SIZE environment variable to define the maximum size of the Metaspace. For example:</p> <pre><code>- name: GC_MAX_METASPACE_SIZE value: 256 </code></pre> <p>Specifically, there's an example here: <a href="http://www.mastertheboss.com/other/java-stuff/solving-java-lang-outofmemo...
Francesco Marchioni
<p>I'm trying to patch the nginx ingress controller that follows the minikube vm.</p> <p>Patching is successful using this command:</p> <pre><code>$ kubectl patch deployment nginx-ingress-controller --type 'json' --namespace kube-system -p '[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "-...
leifcr
<p>Due to minikube running only 1 node, and the ingress using the hostPort, rolling updates will not work for the ingress deployment.</p> <p>After patching the ingress to use recreate instead, patching the ingress config works as expected.</p> <p>Command to set the ingress controller to 'recreate':</p> <pre><code>ku...
leifcr
<p>I'm working on kubernetes. Now I tried Digital Ocean's kubernetes which is very easy to install and access, but how can I install metric-server in it? how can I auto scale in kubernetes by DO? Please reply as soon as possible.</p>
AATHITH RAJENDRAN
<p>The Metrics Server can be installed to your cluster with Helm:</p> <p><a href="https://github.com/helm/charts/tree/master/stable/metrics-server" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/metrics-server</a></p> <pre><code>helm init helm upgrade --install metrics-server --namespace=...
Rawkode
<p>I have a Django application running in a container that I would like to probe for readiness. The kubernetes version is 1.10.12. The settings.py specifies to only allow traffic from a specific domain:</p> <pre class="lang-py prettyprint-override"><code>ALLOWED_HOSTS = ['.example.net'] </code></pre> <p>If I set up m...
Ali H
<p>This problem is fixed in Kubernetes 1.2.3+ — see <a href="https://github.com/kubernetes/kubernetes/issues/24288" rel="nofollow noreferrer">kubernetes/kubernetes#24288</a>. I've configured one of my deployments in a similar way (for similar reasons). This is for a Craft CMS instance which doesn't require authenticati...
Steven Shaw
<p>Among a big stack of orchestrated k8s pods, I have following two pods of interest:</p> <ol> <li>Elasticsearch pod attached to a PV</li> <li>A tomcat based application pod that serves as administrator for all other pods</li> </ol> <p>I want to be able to query and display very minimal/basic disk availability and usag...
A.R.K.S
<p>You need get the PV details from kubernetes cluster API, where ever you are.</p> <h3>Accessing the Kubernetes cluster API from within a Pod</h3> <p>When accessing the API from within a Pod, locating and authenticating to the API server are slightly different to the external client case described above.</p> <p>The ea...
BMW
<h1><strong>Failed to connect to localhost port 80: Connection refused</strong></h1> <p>I recently switched from Windows 10 to Ubuntu 20.04.2 LTS and now I wanted to keep on learning kubernetes. However currently I cannot acess my kubernetes deployment for some reason.</p> <h1></h1> <p><em><strong><code>Deployment.yml<...
Chrizz
<p>why do you think you can access it via localhost directly?</p> <p>If you need, please do the <code>port forward</code>, such as:</p> <pre><code>kubectl port-forward service/hello-service-9878228b 80:80 </code></pre> <p>and you need keeping the console on.</p> <p>then you should be fine to access it via http://localh...
BMW
<p>I have Kubernetes cluster and deployed kibana using Nginx as ingress controller. Could anyone tell me how to can I access kibana dashboard and how do I know that my deployment is right ??</p>
ashique
<p>The default kibana port is 5601. You may open kibana by opening <code>localhost:5601</code> or <code>IP_ADDRESS:5601</code> or <code>http://YOURDOMAIN.com:5601</code> in your browser. Ypu may find more details here: <a href="https://www.elastic.co/guide/en/kibana/current/access.html" rel="nofollow noreferrer">https:...
Alfred
<p>We are using kustomize for our kubernetes deployments in this way:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: ...
KiteUp
<p>You have to create a <code>kustomization.yaml</code> file containing the customizations.</p> <p>i.e:</p> <pre><code># kustomization.yaml bases: - ../base images: - name: nginx-pod newTag: 1.15 newName: nginx-pod-2 </code></pre> <p>And for the templates, you create a base folder containing the kustomizat...
Diego Mendes
<p>Where are documented the "types" of secrets that you can create in kubernetes?</p> <p>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.</p> <p>I always end in the k8s doc: <a href=...
Jxadro
<p>Here is a list of 'types' from the <a href="https://github.com/kubernetes/kubernetes/blob/7693a1d5fe2a35b6e2e205f03ae9b3eddcdabc6b/pkg/apis/core/types.go#L4394-L4478" rel="noreferrer">source code</a>:</p> <pre><code>SecretTypeOpaque SecretType = "Opaque" [...] SecretTypeServiceAccountToken SecretType = "kubernetes....
Eyal Levin
<p>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...
Agung Pratama
<p>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 <a href="https://github.com/istio/istio/blob/3a0...
Agung Pratama
<p>I want to add envoy proxy to an existing Kubernetes deployment as a sidecar. I tried following multiple blog posts and that did not seem to help. I was wondering if anyone has done it, and if so, how to?</p> <p>Thank you!</p>
Parvathy Geetha
<p>To add <a href="https://stackoverflow.com/a/51777604/476917">Kun Li's anwer</a>, if your case is the kubernetes cluster already has many services running, it is safer to do that by set the <code>autoInjection</code> policy as <code>disabled</code> by default, and let the service owner set it explicitly that it wants...
Agung Pratama
<p>I'm trying to enable <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#yaml" rel="nofollow noreferrer">Workload Identity</a> in GKE and followed the entire linked how-to. I then went through the <a href="https://cloud.google.com/kubernetes-engine/docs/troubleshooting/troubleshooting-s...
Jason
<p>It turns out this was user error and the bucket I was trying to access was simply called 'config'. Since buckets have a global namespace I obviously do not have access to this bucket so the error was correct. HOWEVER, it would be nice if the bucket name was added to the error message to help with debugging. Somethin...
Jason
<p>I install Jenkins via Helm charts on my Kubernetes Cluster. I follow the rules described in: <a href="https://www.jenkins.io/doc/book/installing/kubernetes/" rel="nofollow noreferrer">https://www.jenkins.io/doc/book/installing/kubernetes/</a></p> <p>When I look at the pods, I get the following error:</p> <pre><code>...
Stefan Papp
<p>If you use the default settings from the documentation, ensure that the PVC are correctly set and ensure that all objects are in the same namespace.</p> <p>The solution to my problem was:</p> <ul> <li>getting everything under the same namespace</li> <li>reverting to standard values</li> <li>when using an ingress res...
Stefan Papp
<p>We are deploying Spring Cloud Data Flow v2.2.1.RELEASE in Kubernetes. Everything or almost seems to work but scheduling is not. In fact, even when running tasks by manual launch using the UI (or api) we see an error log. That same log is generated when trying to schedule but this time, it makes the schedule creation...
Eric Giguere
<p>I've finally found the source of the error by debugging live Data Flow. The problem arises when CronJob that are not created by Data Flow are present in the namespace, which is by my evaluation a problem. The scheduler launches a process that loops on Kubernetes CronJob resources and tries to process them.</p> <p>D...
Eric Giguere
<p><strong>kubectl get all -n migration:</strong></p> <pre><code>NAME READY STATUS RESTARTS AGE pod/nginx2-7b8667968c-zxtq7 0/1 ImagePullBackOff 0 5m38s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/nginx2 0/1 1 ...
kkpareek
<p>Here is your errror:</p> <pre> Warning Failed 14s (x2 over 34s) kubelet Failed to pull image "nginx": rpc error: code = Unknown desc = Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.doc...
OpenBSDNinja
<p>Kubernetes kubeflow scaling is not working</p> <p>I have installed kubernetes, kubectl and ksonnet as per suggested.</p> <p>I have created kubeflow namespace and deployed kubeflow core components.</p> <p>Then, I have created ksonnet app and namespace and h2o3-scaling component.</p> <p>Then, I have tried to run s...
Test admin
<p>I'm not sure about H2O3, but Kubeflow itself doesn't really support autoscaling. There are few components:</p> <ol> <li>Tf-operator - it doesn't run training itself, it runs pods that run training and you specify number of replicas in TFJob definition, so no autoscaling.</li> <li>Tf-serving - potentially could do a...
inc0
<p>I have an AKS deployed in its own vnet (using Azure CNI instead of Kubenet). In the cluster there is an ingress-nginx deployed by Helm/ArgoCD with the annotation:</p> <pre><code>service.beta.kubernetes.io/azure-load-balancer-internal: true </code></pre> <p>The LoadBalancer looks good:</p> <pre><code>kubectl get svc ...
Sven
<p>Thanks to the blazingly fast and skillful K8s people in the r/kubernetes Reddit group this problem was solved.</p> <p>When AKS is created there is a <em>new</em> Resource Group created for the cluster, even though you ask Azure to use a specific Resource Group. The new RG is named <code>MC_rg_[cluster name]</code>. ...
Sven
<p>Assume that Kubernetes has scheduled two pods A and B in a node N. If the resource capacity of the Node N is (30 CPU, 70 Memory) and pod A requests (5 CPU, 8 memory) and pod B requestes (4 CPU, 10 memory), is it possible to share the resources among two pods in a way that we maintain the efficieny of the cluster and...
HamiBU
<p>Kubernetes already does that.</p> <p><em>Resource Requests</em> are soft reservations, that means, the scheduler will consider it as a requirement when placing the pod in the node, it will allocate the resource to a POD but won't reserve the resources to be used exclusively by the pod that requested it.</p> <p>If ...
Diego Mendes
<p>I am spinning up a container (pod/Job) from a GKE.</p> <p>I have set up the appropriate Service Account on the cluster's VMs.</p> <p>Therefore, when I <strong>manually</strong> perform a <code>curl</code> to a specific CloudRun service endpoint, I can perform the request (and get authorized and have <code>200</cod...
pkaramol
<p>In your Job, <code>gcloud auth print-identity-token</code> likely does not return any tocken. The reason is that locally, gcloud uses your identity to mint a token, but in a Job, you are not logged into gcloud.</p>
Steren
<p>I want exposing various services with a single ingress.</p> <pre><code>rules: - http: paths: # The path is the URL prefix for the service, e.g. /api/* or just /* # Note that the service will receive the entire URL with the prefix - path: /service1/* backend: serviceName: ...
znat
<p>This might be what you are looking for;</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: ingress.kubernetes.io/rewrite-target: / name: rewrite namespace: default spec: rules: - host: rewrite.bar.com http: paths: - backend: serviceName: echohe...
Sage
<p>I'm trying to build a web app where each user gets their own instance of the app, running in its own container. I'm new to kubernetes so I'm probably not understanding something correctly.</p> <p>I will have a few physical servers to use, which in kubernetes as I understand are called nodes. For each node, there is...
dolgion
<p>The main issue in having too many pods in a node is because it will degrade the node performance and makes is slower(and sometimes unreliable) to manage the containers, each pod is managed individually, increasing the amount will take more time and more resources. </p> <p>When you create a POD, the runtime need to ...
Diego Mendes
<p>Are the metrics for vertical and horizontal scaling in kubernetes the same. So does the cpu,memory and custom metrics work with both concepts?</p>
Java
<p>Yes, Both use the CPU or Memory metrics provided by the metrics server.</p> <p>For CPU or Memory metrics you can use either VPA or HPA, not both together. Using both together will have undesirable behaviour, because they will be competing to scale up/down/in/out at same time.</p> <p>Using custom metrics is possibl...
Diego Mendes
<p>I'm having issues when accessing a service present in another namespace.</p> <p>I have 2 namespaces (in the same cluster) airflow-dev and dask-dev.</p> <p><img src="https://i.stack.imgur.com/UrA7u.jpg" alt="enter image description here" /></p> <p>In dask-dev namespace, I have dask cluster(dask scheduler and workers)...
Subba
<p>You can use a local service to reference an external service (a service in a different namespace) using the service <a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="nofollow noreferrer">externalName Type</a>.</p> <p><code>ExternalName</code> services do not have selectors,...
Highway of Life
<p>If I have a set of deployments that are connected using a NetworkPolicy ingress. It's work! However, if I have to connect from outside (IP got from kubectl get ep), I have to set another ingress to the endpoint? or egress policy?</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: namespace: nginx anno...
sincorchetes
<p>It looks like you're using the <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="nofollow noreferrer">Network Policy</a> <em>as</em> an ingress for incoming traffic, but what you probably want to be using is an <a href="https://kubernetes.io/docs/concepts/services-networking/in...
Highway of Life
<p>I have implemented a CLI using go and I display the status of kubernetese cells. The command is <code>cellery ps</code></p> <pre><code>func ps() error { cmd := exec.Command("kubectl", "get", "cells") stdoutReader, _ := cmd.StdoutPipe() stdoutScanner := bufio.NewScanner(stdoutReader) go func() { ...
Madhuka Wickramapala
<p>Basically what you want is to listen to the event of a cell become ready. You can register to the events in a cluster and act upon them. A good example can be found <a href="https://github.com/bitnami-labs/kubewatch" rel="nofollow noreferrer">here</a> </p>
avivl
<p>How to get more details about what is actually the problem?</p> <pre><code>kubtectl logs foo-app-5695559f9c-ntrqf Error from server (BadRequest): container &quot;foo&quot; in pod &quot;foo-app-5695559f9c-ntrqf&quot; is waiting to start: trying and failing to pull image </code></pre> <p>I would like to see th...
guettli
<p>If a container has not started, then there are no container logs from that pod to view, as appears to be the case.</p> <p>To get more information about the pod or why the container may not be starting, you can use <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#describe" rel="nofollo...
Highway of Life
<p>I sent 2000 short-lived jobs to my kube cluster very quickly, and I observed a couple of minutes delay between a job was created and a pod for the job started pending. Does anybody have any clue about what may be the bottleneck?</p> <p>Could etcd be the bottleneck?</p>
tiancai
<p>From a 10.000 foot view, the process is:</p> <ul> <li><p>Every time you schedule a pod/job, it gets added to a queue.</p></li> <li><p>The scheduler reads that queue and assign the POD to a node.</p></li> <li><p>When a node receives an assignment of a pod, it handles the creation by calling the runtime and requestin...
Diego Mendes
<p>What is the significance of having this section - <code>spec.template.metadata</code>? It does not seem to be mandatory. However I would like to know where it would be very useful! Otherwise what is the point of repeating all the selectors?</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: hello...
KitKarson
<p>What makes you think it is not required?</p> <p>If you don't provide the <code>Metadata</code> for a deployment template, it will fail with a message like this:</p> <pre><code>The Deployment &quot;nginx&quot; is invalid: spec.template.metadata.labels: Invalid value: map[string]string(nil): `selector` does not match...
Diego Mendes
<p>What is most simple way to start Kubernetes job with the http request (webhook)? I need to build docker image after push to github and have to do it inside cluster.</p>
Jonas
<p>I think you are looking for <a href="https://www.knative.dev/docs/" rel="nofollow noreferrer">KNative</a>. Mainly the <a href="https://github.com/knative/build" rel="nofollow noreferrer">Build</a> part of it.</p> <p>KNative is still on early stages, but is pretty much what you need. If the build features does not a...
Diego Mendes
<p>I have started to learn Minikube using <a href="https://kubernetes.io/docs/setup/minikube/" rel="nofollow noreferrer">some of this tutorial</a> and <a href="https://kubernetes.io/docs/tutorials/hello-minikube/" rel="nofollow noreferrer">a bit of this one</a>. My plan is to use the "none" driver to use Docker rather ...
halfer
<p>It looks like I needed the rubber-ducking of this question in order to find an answer. The Go crash was the thing to have researched, and is <a href="https://github.com/kubernetes/minikube/issues/2510" rel="nofollow noreferrer">documented in this bug report</a>.</p> <p>The commands to create a missing role is:</p> ...
halfer
<p>I have some dilemma to choose what should be the right request and limit setting for a pod in Openshift. Some data:</p> <ol> <li>during start up, the application requires at least 600 millicores to be able to fulfill the readiness check within 150 seconds.</li> <li>after start up, 200 millicores should be sufficien...
bLaXjack
<p>I think you didn't get the idea of <em>Requests vs Limits</em>, I would recommend you take a look on the <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-limits-are-run" rel="noreferrer">docs</a> before you take that decision.</p> <p>In a brief ex...
Diego Mendes
<p>While architecting an application I have two constraints</p> <ol> <li>I have to use Microservice architecture</li> <li>I have to deploy using Kubernetes</li> </ol> <p>I was thinking to deploy in Serverless because scalability and availability is main drive for my application. As far as I know when I use Serverless...
Sazzad Hissain Khan
<p>Disclaimer: I work on that project </p> <p>Have you taken a look at Knative <a href="https://github.com/knative/docs" rel="nofollow noreferrer">here</a></p> <p>Serverless on k8s is very much what Knative does. It extends Kubernetes through CRDs and provides more app/service developer friendly interface with autosc...
mchmarny
<p>I have a Deployment with three replicas, everyone started on a different node, behing an ingress. For tests and troubleshooting, I want to see which pod/node served my request. How is this possible? </p> <p>The only way I know is to open the logs on all of the pods, do my request and search for the pod that has my ...
Daniel
<p>AFAIK, there is no feature like that out of the box.</p> <p>The easiest way I can think of, is adding these information as headers yourself from your API.</p> <p>You technically have to <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/" rel="nofollow nor...
Diego Mendes
<p>To be specific, here is the permalink to the relevant line of code: <a href="https://github.com/istio/istio/blob/e3a376610c2f28aef40296aac722c587629123c1/install/kubernetes/helm/istio/templates/sidecar-injector-configmap.yaml#L84" rel="nofollow noreferrer">https://github.com/istio/istio/blob/e3a376610c2f28aef40296aa...
Agung Pratama
<p>I got the answer after posting the same question on the Istio's google group <a href="https://groups.google.com/forum/#!topic/istio-users/0dfU_y06n1Q" rel="nofollow noreferrer">here</a>. Without discrediting the author who answering me in the google group, the answer is yes it is a template of a template. The templa...
Agung Pratama
<p>I want to reject all docker registries except my own one. I'm looking for a some kind of policies for docker registries and their images.</p> <p>For example my registry name is <code>registry.my.com</code>. I want to make kubernetes pulling/running images only from <code>registry.my.com</code>, so:</p> <pre><code>...
Konstantin Vustin
<p><a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/" rel="noreferrer">Admission Controllers</a> is what you are looking for.</p> <p>Admission controllers intercept operations to validate what should happen before the operation is committed by the api-server.</p> <p>An example is...
Diego Mendes
<p>how can I enable the <strong><em>record</em></strong> parameter by default each time I want to create a new pod? My goal is change the default behaviour of the record parameter in order to avoid to use the --record=true eache time I want to instantiate new pod.</p> <p>This is an example:</p> <pre><code>kubectl cre...
carlo.zermo
<p>AFAIK, you can't define default values for commands parameters</p> <p>Your alternatives are:</p> <ul> <li><p>create a bash function with the default parameters and call it with the parameters you want</p> <p><strong><code>diego@PC:/$</code></strong><code>k8s() { kubectl $1 $2 $3 --record=true;}</code></p> <p><st...
Diego Mendes
<p>I'm trying to use a directory config map as a mounted volume inside of my docker container running a spring boot application. I am passing some of the mounted paths to the things like the spring application.yaml, but it doesn't appear the mount is working as expected as it can't find the config. For example</p> <p>...
PDStat
<p>As explained in <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-directories" rel="nofollow noreferrer">Create ConfigMaps from Directories</a> and <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configm...
Diego Mendes
<p>I'm using config maps to inject env variables into my containers. Some of the variables are created by concatenating variables, for example:</p> <p>~/.env file</p> <pre><code>HELLO=hello WORLD=world HELLO_WORLD=${HELLO}_${WORLD} </code></pre> <p>I then create the config map</p> <p><code>kubectl create configmap ...
Eric Guan
<p>I can't find any documentation on interpolating environment variables, but I was able to get this to work by removing the interpolated variable from the configmap and listing it directly in the deployment. It also works if all variables are listed directly in the deployment. It looks like kubernetes doesn't apply in...
Grant David Bachman
<p>I am deploying sample springboot application using fabric8 maven deploy. The build fails with SSLHandshakeException.</p> <pre><code>F8: Cannot access cluster for detecting mode: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable t...
jack
<p>The following works on MacOS:</p> <p>The certificate to install is the one found on the browser URL bar;<br> On Firefox (at least) click the padlock <a href="https://i.stack.imgur.com/5H4i9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5H4i9.png" alt="padlock icon"></a> to the left of the URL,...
Ed Randall
<p>I am trying to write a CronJob for executing a shell script within a ConfigMap for Kafka.</p> <p>My intention is to reassign partitions at specific intervals of time.</p> <p>However, I am facing issues with it. I am very new to it. Any help would be appreciated.</p> <p>cron-job.yaml</p> <pre><code>apiVersion: ba...
amankedia
<p>You've set the ConfigMap to <code>name: {{ template "kafka.fullname" . }}-config</code> but in the job you are mounting <code>configmap-config</code>. Unless you installed the Helm chart using <code>configmap</code> as the name of the release, that Job will never start. </p> <p>One way to fix it would be to define ...
Stefan P.
<p>I'm new to Kubernetes and Rancher, but have a cluster setup and a workload deployed. I'm looking at setting up an ingress, but am confused by what my DNS should look like.</p> <p>I'll keep it simple: I have a domain (example.com) and I want to be able to configure the DNS so that it's routed through to the correct ...
Steadman
<p>You aren't dumb, man. This stuff gets complicated. Are you using AWS or GKE? Most methods of deploying kubernetes will deploy an internal DNS resolver by default for intra-cluster communication. These URLs are only useful inside the cluster. They take the form of <code>&lt;service-name&gt;.&lt;namespace&gt;.svc.clus...
Grant David Bachman
<p>Why am I getting an error when I try to change the <code>apiVersion</code> of a deployment via <code>kubectl edit deployment example</code> ? </p> <p>Do I have to delete and recreate the object?</p>
Chris Stryczynski
<p>You're getting this because there are only certain attributes of a resource that you may change once it's created. ApiVersion, Kind, and Name are some of the prime identifiers of a resource so they can't be changed without deleting/recreating them.</p>
Grant David Bachman
<p>Can we interact and troubleshoot containers inside kubernetes without command line access? Or reading logs will be sufficient for debugging? Is there any way for debugging the containers without command line (kubectl)?</p>
FNU
<p>Unfortunately the containers created <em>FROM Scratch</em> are not simple to debug, the best you can do is add logging and telemetry in the container so that you don't have to debug it. The other option is use minimal images like busybox.</p> <p>The K8s team has a <a href="https://github.com/verb/community/blob/473...
Diego Mendes
<p>I am following this <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">concept guide</a> on the kubernetes docs to connect to a service in a different namespace using the fully qualified domain name for the service.</p> <p><strong>service.yml</strong></p> <...
Clement
<p>This is by design to avoid cross-namespace exposure, In this <a href="https://github.com/kubernetes/kubernetes/issues/17088" rel="nofollow noreferrer">thread</a> is explained why this limitation on the ingress specification was intentional.</p> <p>That means, the <strong>Ingress can only expose services within the ...
Diego Mendes
<p>I would like to run Node-RED as a service on Kubernetes to be able to build a custom API using the HTTP IN nodes. The goal is to be able to push any number of different flows to an arbitrary container running Node-RED using the Node-RED API.</p> <p>I have tried running Node-RED as a service with 5 replicas and bui...
kturcios
<p>This is working as expected. If you are interacting with the Node-RED editor via the load balancer you are only editing the flow on that instance.</p> <p>If you have 5 instances of Node-RED and only one of them is running a flow with the HTTP endpoints defined then calls to that endpoint will only succeed 1 time in...
hardillb
<p>I am just curious to know how k8s master/scheduler will handle this.</p> <p>Lets consider I have a k8s master with 2 nodes. Assume that each node has 8GB RAM and each node running a pod which consumes 3GB RAM.</p> <pre><code>node A - 8GB - pod A - 3GB node B - 8GB - pod B - 3GB </code></pre> <p>Now I would ...
KitKarson
<p>Most of the Kubernetes components are split by responsibility and workload assignment is no different. We could define the workload assignment process as <strong><em>Scheduling</em></strong> and <strong><em>Execution</em></strong>.</p> <p>The <strong>Scheduler</strong> as the name suggests will be responsible for t...
Diego Mendes
<p>I have a backend pod running a quite migration script on startup (1 minute or more). How to avoid K8s thinks that the pods failed to start and tries to re-launch it? </p>
pditommaso
<p>I'm assuming you have a liveness probe set on your Pod. This is what k8s is looking at when it decides whether a pod needs restarted. You can fix this by setting the <code>initialDelaySeconds</code> attribute on your script to something beyond the length of time the migration script needs to run. <a href="https://ku...
Grant David Bachman
<p>I'm new to using Helm and I'm not sure which is the best approach when you have two deployments. I've created a chart for my application. It contains two deployments:</p> <ol> <li>app-nginx-phpfpm.yaml</li> <li>app-mysql.yaml</li> </ol> <p>Should I keep them in the same chart or should I create a sub-chart for app...
Agustin Castro
<p>You can have both, depending on how you want to structure your deployments.</p> <p>You should keep in mind the following</p> <h1>Considerations</h1> <h2>Single chart benefits</h2> <ul> <li>Easier to deploy: only deploy once, single diffing</li> <li>Single version, so rollback/upgrades happen on a single element<...
ssice
<p>I have the following questions regarding request/limit quota for ns:</p> <p>Considering the following namespace resource setup: - request: 1 core/1GiB - limit: 2 core/2GiB</p> <ol> <li><p>Does it mean a namespace is guaranteed to have 1/1GiB? How is it achieved physically on cluster nodes? Does it mean k8s...
Jan Lobau
<p>The <a href="https://kubernetes.io/docs/concepts/policy/resource-quotas/" rel="nofollow noreferrer">docs</a> clearly states the following:</p> <blockquote> <p>In the case where the total capacity of the cluster is less than the sum of the quotas of the namespaces, there may be contention for resources. This is ha...
Diego Mendes
<p>I want to use a local folder for a container with kubernetes on docker for windows. When I used hostPath in nginx.yaml, it works well. But I used persistentVolumeClaim instead of hostPath, the container could not mount the volume.</p> <p>pv.yaml</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name...
k_trader
<p>You can either try <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">hostPath</a> set direct in the POD:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: test-pd spec: containers: - image: k8s.gcr.io/test-webserver name: test-container volumeMount...
Diego Mendes
<p>seeing an odd behaviour with kubernetes-dashboard where the exec option is not taking me into a shell. Instead it shows me a snippet of the dashboard UI in it? Has anyone noticed this? I cannot see any errors in the logs for the same.</p> <p>I am using the following dashboard yaml: <a href="https://raw.githubuserco...
devops84uk
<p>It is a problem with the library <code>hterm</code> and Firefox that has been fixed in version 2 of the Dashboard (as it now uses <code>xterm</code>).</p> <p>You can read more in the <a href="https://github.com/kubernetes/dashboard/issues/3541" rel="nofollow noreferrer">github issue 3541</a>.</p> <p>If you are sti...
PhoneixS
<p>I have actually a spring boot application with a MQTT client into it that is subscribed to topic.</p> <p>I encounter a problem when i put 2 instances of my application ( 2 containers/pods ) because it creates 2 connections to the publisher ! The problem is that I record things in a database for each message, so I r...
Kévin
<p>You need to use a broker that supports Shared Subscriptions (this is feature added to MQTTv5 standard, but some brokers supported none standard versions at v3)</p> <p>Shared Subscriptions allow groups of clients to subscribe to the a topic (or wildcard topic) and any given message published to that topic will only b...
hardillb
<p>If I have 2 pods is there a way for them to talk to each other without any other resource created and used?</p> <p>The question goes for the both situations - if they are in the same namespace or in different ones.</p>
LIvanov
<p>Yes, they can!</p> <p>Assuming you don't have any network policies restricting the calls, it just need to know its DNS name, this is how it works:</p> <ul> <li>the cluster must have DNS enabled</li> <li>if the pods are manually create on the same namespace(not via deployment), you just need make a call to the podn...
Diego Mendes
<p>I am in the process of migrating an application from Windows server to Kubernetes running on cloud.I was able to launch the application successfully in Kubernetes. Next is restoration and there is a script provided to restore the data to the new instance, but that should be run when the instance of application is sh...
John
<p>A POD is meant to stay alive while the main process is running, when the main process shutdown, the pod will be terminated.</p> <p>What you want is <strong>not</strong> how to keep the POD alive, but how to refactor your application to work with Kubernetes properly.</p> <p>The restore phase you previously had in a...
Diego Mendes
<p>We want our Prometheus installation to scrape the metrics of both containers within a pod. One container exposes the metrics via HTTPS at port 443, whereas the other container exposes them via HTTP at port 8080. Both containers provide the metrics at the same path, namely <code>/metrics</code>.</p> <p>If we declare...
croeck
<p>I found a GIST snippet that takes the port from the container directly if it is named "metrics", instead of relying on a per-pod annotation. It also contains a comments to make this a regex for any port that starts with "metrics".</p> <p>Maybe you can extend it to also extract the schema from the port name, like "m...
ahus1
<p>We are using <code>Mosquitto</code> MQTT broker, an IoT server implementation and devices which connect to the Broker as an Client. Both device and IoT server will be publishing to the broker.</p> <p>The devices publish requests to the topic : <code>/req/&lt;device-id&gt;/&lt;server-id&gt;</code></p> <p>The devices ...
Siddharth Trikha
<p>The short answer to this is: You don't easily.</p> <p>The longer answer is:</p> <p>You will probably need to pick a different MQTT broker than mosquitto, mosquitto does not support clustering, so there is no (simple) way to run multiple instances that sessions and messages can be distributed across.</p> <p>You can s...
hardillb
<p>After some readings, it seems there is no sustainable solution for <strong>auto-scaling</strong> Redis on Kubernetes without adding a controller like <a href="https://github.com/adenda/maestro/wiki/Kubernetes-Redis-controller-for-autoscaling-a-Redis-cluster" rel="nofollow noreferrer">Maestro</a>. Unfortunatly the pr...
Loïc Guzzetta
<p>If you want to autoscale anything on Kubernetes, it requires some type of controller. For general autoscaling, the community is rallying around the <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaler</a>. By default, you configure i...
Grant David Bachman
<p>I'm looking for a command like "gcloud config get-value project" that retrieves a project's name, but for a pod (it can retrieve any pod name that is running). I know you can get multiple pods with "kubectl get pods", but I would just like one pod name as the result.</p> <p>I'm having to do this all the time: </p> ...
sjsc
<p>There are many ways, here are some examples of solutions:</p> <p><code>kubectl get pods -o name --no-headers=true </code></p> <p><code>kubectl get pods -o=name --all-namespaces | grep kube-proxy</code></p> <p><code>kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{&quot;\n&quot;}}{{end}...
Diego Mendes
<p>I installed kubectl and tried enable shell autocompletion for zsh. When I'm using <code>kubectl</code> autocompletion works fine. Howewer when I'm trying use autocompletion with alias <code>k</code> then shell return me</p> <pre><code>k g...(eval):1: command not found: __start_kubectl ...
Dawid Krok
<p>If you use Oh My Zsh, what fixed it for me was updating:</p> <pre><code>omz update ... lots of output source ~/.zshrc </code></pre>
Jerry
<p>While I was running kubectl command in my ubuntu 16.04 os which is a 32 bit machine, I was getting</p> <blockquote> <p>cannot execute binary file: Exec format error</p> </blockquote> <p>Can some one tell me whether Kubernetes works on 32 bit machine or not ?</p>
Mammu yedukondalu
<p>Currently there are no ready-made binaries for 32bit systems at: <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.7.md#downloads-for-v1710" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.7.md#downloads-for-v1710</a></p> <p>You can build kubernetes...
vascop
<p>If I want to save credential information in K8s and then retrieve it to use out of k8s, can I do it? and how?</p>
Ya He
<p>Yes you can, <em>but you probably shouldn't</em>.</p> <p>When you run <code>kubectl get secret</code> command, what it does behind the scenes is an api call to kubernetes api server.</p> <p>To access the secret outside the cluster you will need to:</p> <ul> <li>Have the Kubernetes api exposed to the client(if not in...
Diego Mendes
<p>My Kubernetes application uses an Ingress to proxy requests to different servers, according to the URL given: I want a fanout configuration. I want the URLs of the requests <strong>not to be rewritten</strong> when forwarded to the servers. How do I do that?</p> <p>I want all the <code>/api</code> URLs forwarded to...
Raedwald
<p>The Kubernetes ingress isn't rewriting your request URLs, the ingress controller is doing this (whatever you happen to be using). For instance, if your ingress controller is Nginx, you can control this behavior with <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">anno...
Grant David Bachman
<p>Need to deploy cluster to GCP and setup, helm, ingress and some other stuff without manually running gcloud command. Tried many ways google_container_cluster with and without certs and user/pass. I get two kind of results:</p> <p><code>Error: serviceaccounts is forbidden: User "system:anonymous" cannot create resou...
Aram
<p>I solved this issue by updating how Terraform connect to the Kubernetes cluster. As I change the backend to use "remote" (Terraform Cloud) it does not work anymore and I have the same kind of error message. It is because with "remote" backend Terraform doesn't use the local kubectl config.</p> <p>see for example : ...
Neoh59
<p>I have deployed <a href="https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html" rel="nofollow noreferrer">ECK</a> on my kubernetes cluster(all vagrant VMs). The cluster has following config.</p> <pre><code>NAME STATUS ROLES AGE VERSION kmaster1 Ready control-p...
bluelurker
<p>I hope this helps ... Here is how I set a &quot;LoadBalancer&quot; using nginx and forward traffic to HTTPS services:</p> <pre><code> kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME asd-master-1 R...
oz123
<p>We have hundreds of deployment and in the config we have imagePullPolicy set as “ifnotpresent” for most of them and for few it is set to “always” now I want to modify all deployment which has <strong>ifnotpresent</strong> to <strong>always</strong>.</p> <p>How can we achieve this with at a stroke?</p> <p>Ex:</p> ...
Nishanth
<p>Kubernetes doesn't natively offer mass update capabilities. For that you'd have to use other CLI tools. That being said, for modifying existing resources, you can also use the <code>kubectl patch</code> function.</p> <p>The script below isn't pretty, but will update all deployments in the namespace.</p> <pre><code...
Grant David Bachman
<p>Looking if the below scenario is possible or not -</p> <p>Lets say user(<code>user1</code>) have access only to namespaces <code>default</code> and <code>marketing</code>. </p> <p>When we perform <code>kubectl get ns</code> it should display both namespaces.</p> <p>No other namespaces should be displayed even if...
Avinash Reddy
<p>This isn't possible in Kubernetes. Namespaces are the resources providing the scoping mechanism to limit visibility into other resources. There's no meta-namespace that provides scoping rules for namespaces.</p>
Grant David Bachman
<p>When we run <code>helm install ./ --name release1 --namespace namespace1</code>, it creates the chart only if none of the deployments exist then it fails saying that the deployment or secret or any other objects already exist. </p> <p>I want the functionality to create Kubernetes deployment or objects as part of he...
Chandra
<p>In recent helm versions you can run <code>helm upgrade --install</code> which does an upgrade-or-install.</p> <p>Another alternative is you can use <code>helm template</code> to generate a template and pipe it to <code>kubectl apply -f -</code>. This way you can install or upgrade with the same command.</p>
Jonathan
<p>I have an Airflow 1.10.15 (a.k.a. Bridge Release) in my AWS Kubernetes cluster. It uses KubernetesExecutor.</p> <p>I have a Hello World KubernetesExecutor DAG which should print Hello World. When triggering the DAG, it creates a pod but it never prints the Hello World.</p> <p>Here are all the logs after the pod has ...
Felix Labayen
<p>You should check Task logs, not Kubernetes logs. Kubernetes logs keep information about &quot;atempting to run&quot; the task (and looks that it's all ok here).</p> <p>Now, when you log anything in the running tasks, it does not go to the k8S logs - it goes to task logs. By default, when you configure Airflow, the l...
Jarek Potiuk
<p>I am very new creating CD pipeline to grape image from Azure Container Registry(ACR) and push it into the Azure Kubernetes(AKS), In first part like in CI pipeline I am able to push my .netcore api image into the ACR, now my aim is to </p> <blockquote> <p>Create CD pipeline to grape that image and deploy it to Kub...
Saad Awan
<p>Creating the YAML file is critical for being able to redeploy and track what is happening. If you don't want to create YAML then you have limited options. You could execute the imperative command from Azure DevOps by using a kubectl task.</p> <pre><code>kubectl create deployment &lt;name&gt; --image=&lt;image&gt;.a...
Jamie
<p>I am using <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">kubernetes/client-go</a> to retrieve some pod logs. I am able to retrieve logs should the pod have one container as such</p> <pre class="lang-golang prettyprint-override"><code>req := client.CoreV1().Pods("namespace").GetLogs("my...
scniro
<p>If you take a look in <code>kubectl</code> code they just get all relevant containers in a pod and then iterate over them and gather logs container by container. So I don't think there's REST API endpoint that would do that for you.</p> <p>See here: <a href="https://github.com/kubernetes/kubectl/blob/19fd05792d8c80...
blami
<p>I have a multistage pipeline with the following</p> <p>Stage build:</p> <ol> <li>build docker image</li> <li>push image to ACR</li> <li>package helm chart</li> <li>push helm chart to ACR</li> </ol> <p>Stage deployment:</p> <ol> <li>helm upgrade</li> </ol> <p><strong>Push helm chart to AKS:</strong></p> <pre><code> t...
Michael
<p>The answer from @sshepel actually helped somewhat, you need to login to the registry before being able to pull. However, it is sufficient with a simple AzureCLI login.</p> <pre><code> - task: AzureCLI@2 displayName: Login to Azure Container Registry inputs: azureSubscription: &lt;Azure Resourc...
JMag
<p>I have a container that has a ping endpoint (returns pong) and I want to probe the ping endpoint and see if I get a pong back. If it was just to check 200 , I could have added a liveliness check in my pod like this -></p> <pre><code>livenessProbe: initialDelaySeconds: 2 periodSeconds: 5 httpGet: path: /pi...
Illusionist
<p>As the HTTP probe only checks the status code of the response, you need to use the exec probe to run a command on the container. Something like this, which requires <code>curl</code> being installed on the container:</p> <pre><code>livenessProbe: initialDelaySeconds: 2 periodSeconds: 5 exec: command: ...
doelleri
<p>airflow 1.10.10 <br /> minikube 1.22.0 <br /> amazon emr</p> <p>I am running airflow on kubernetes(minikube). Dags are synced from github. spark-submit on Amazon EMR as a CLI mode.</p> <p>In order to do that, I attach EMR pem key. So, I get pem key from AWS S3 while ExtraInitContainer is getting image awscli and m...
Yong Rhee
<p>Are you using KubernetesExecutor or CeleryExecutor?</p> <p>If the former, then you have to make sure the extra init container is added to the pod_template you are using (tasks in KubernetesExecutor) run as separate PODs.</p> <p>If the latter, you should make sure the extra init container is also added for workers, n...
Jarek Potiuk
<p>I have setup a Kubernetes cluster using kops on aws.</p> <p>It has 4 worker nodes and one master node.</p> <p>It has deployments for each microservice i.e. customer deployment has two pods</p> <p>I need to make calls to some API from these pods.</p> <p>Whenever I make request from these pods the source ip is by defa...
confusedWarrior
<p>I think the tool you want here is an egress IP. I don't know the specifics for AWS/kops, but an egress IP has worked for Azure Kubernetes Service for the same situation.</p>
Danny Staple
<p>I'm running SystemTap on CentOS Linux release 7.6.1810. The version of SystemTap is:</p> <pre class="lang-sh prettyprint-override"><code>$ stap -V Systemtap translator/driver (version 4.0/0.172/0.176, rpm 4.0-11.el7) Copyright (C) 2005-2018 Red Hat, Inc. and others This is free software; see the source for copying c...
visionken
<p><code>pid2task()</code> can return NULL</p> <p>Check for <code>pid2task(pid())</code> or <code>current_task()</code> returning NULL like that:</p> <pre><code>task = pid2task(pid()); if (task) { printf(&quot;task_ancestry:%s\n&quot;, task_ancestry(task, 1)); } else { printf(&quot;task_ancestry more available\n&qu...
Tino
<p>I am new to K8s and trying to create a Helm chart to setup my application.</p> <p>I want a frictionless experience for users setting up the application without much manual intervention.</p> <p>Creating the helm chart i was pleased with the provided templating functionallity but missing one essential thing: Creating ...
firstdorsal
<p>You could try <a href="https://github.com/bitnami-labs/sealed-secrets" rel="nofollow noreferrer">Sealed Secrets</a>. It stores secrets encrypted using assimetric keys, so they secrets can be only restored having the proper keys.</p>
Gonzalo Matheu
<p>I updated my k8 cluster to 1.18 recently. Afterwards I had to recreate a (previously functional) loadBalancer service. It seemed to come up properly but I was unable to access the external ip afterwards. Looking at the dump from <code>kubectl describe service</code> I don't see a field for &quot;loadbalancer ingress...
ethrbunny
<p>For a distant observer - this is likely due to metallb version conflict. Note that 1.17-&gt; 1.18 introduces some breaking changes.</p>
ethrbunny
<p>I configured an automatic build of my Angular 6 app and deployment in Kubernetes each time is push to my code repository (Google Cloud Repository).</p> <p>Dev environment variables are classically store in a environment.ts file like this:</p> <pre><code>export const environment = { production: false, api_key: ...
Manuel RODRIGUEZ
<p>Nevertheless what you do, your Angular app is a <em>client</em> application i.e. the user's browser downloads the source code of the app (a bunch of CSS/JS/HTML files, images etc.) and it executes it on the user's machine. So you can't hide anything like you do when implementing a <em>client/server</em> app. In clie...
Lachezar Balev
<p>I have a pod running on Google Cloud Kubernetes and I have a MongoDB cluster running on Atlas. The issue is quite simple:</p> <p><strong>If I allow IP from ANYWHERE on Atlas MongoDB, I can connect. If I add the IP of the pod (so not from ANYWHERE anymore), it doesn't work.</strong></p> <p>I also tried locally and...
Emixam23
<p>The IP exposed to Mongo Atlas should be Internet accessible IP (or called it, public IP). </p> <p>Normally it should be the net gateway IPs (or proxy server's IPs, if you go with proxy). </p> <p>One quick way to check the IP by running below command in pods</p> <pre><code>curl ifconfig.me </code></pre> <p>If you...
BMW
<p>I use minikube on windows 10 and try to generate Persistent Volume with minikube dashboard. Belows are my PV yaml file contents.</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: blog-pv labels: type: local spec: storageClassName: manual capacity: storage: 1Gi volumeMode: Files...
Joseph Hwang
<p>First, apply the resource one by one. So make sure this problem can be isolated to PV(PersistentVolume) or PVC (PersistentVolumeClaim)</p> <p>Second, please adjust the hostPath to others, <code>/mnt/data</code> normally is a mounted or NFS folder, maybe that's the issue, you can adjust to some other real path for ...
BMW
<p>I am trying to build a kubernetes master with kubelet and kube-api server running as a static pod.</p> <p>My unit for kubelet is:</p> <pre><code>[Unit] Description=Kubernetes Kubelet Documentation=https://github.com/GoogleCloudPlatform/kubernetes After=docker.service Requires=docker.service [Service] ExecStart=/u...
oz123
<p>As all too often, the problem is in detail ...</p> <p>The faulty line is:</p> <pre><code>- --cloud-config=/etc/kubernetes/cloud.conf </code></pre> <p>Without this file, which is missing, because I forgot to mount the proper volume, kube-apiserver will fail to start.</p> <p>This will show in the kubelet logs, but...
oz123
<p><strong>Context</strong></p> <p>I'm using <strong>GCP</strong>, more specifically <strong>GKE</strong> to deploy my app in container/pod. The app I'm trying to deploy is in node js (express js). This app connects to <strong>MongoDB Atlas</strong> <em>(free tier M0)</em>. </p> <p><strong>No issue when running the p...
iji
<p>If you think the network policy has been set properly with GCP firewall rules, let's work out it in kubernetes step by step.</p> <ol> <li>check if you can connect to mongodb Atlas from the containers themselves. </li> </ol> <pre><code>kubectl exec &lt;node_app_pod&gt; --command -- curl &lt;mongo_url&gt;:27017 </co...
BMW
<p>Can you help me? I want to deploy Ingres for nodeport. But I can't understand if this possible? </p> <p>I tried to find some information in Google but I got Ingress for load balancing or some difficult examples Ingress Ruby on rails and etc. </p>
noute
<p>I'll try to provide the simplest example that I can think of below. I will use the <code>nginxdemos/hello</code> docker image for my example. Locally this works as this:</p> <pre><code>$docker run -p 80:80 -d nginxdemos/hello ... $curl -I http://localhost HTTP/1.1 200 OK Server: nginx/1.13.8 Date: Tue, 08 Oct ...
Lachezar Balev
<p>We have deployed etcd of k8s using static pod, it's 3 of them. We want to upgrade pod to define some labels and readiness probe for them. I have searched but found no questions/article mentioned. So I'd like to know the best practice for upgrading static pod.</p> <p>For example, I found modifying yaml file directly...
xudifsd
<p>You need to recreate the pod if you want to define readiness probe for it, for labels an edit should suffice.</p> <p>Following error is thrown by Kubernetes if editing readinessProbe:</p> <pre><code># * spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*...
Mika Vatanen
<p>I have added mysql in requirements.yaml. Helm dependency downloads the mysql chart</p> <pre><code>helm dependency update Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "nginx" chart repository ...Successfully got an update from the "stable" chart repositor...
Komal Kadam
<p>You don't have to add it to the control version system, you just download them again if for some reason you have lost them (for example when you clone the repository). To do this, execute the command:</p> <p><code>helm dependency update</code></p> <p>The above command will download the dependencies you've defined ...
PhoneixS
<p>I'm setting up an InnoDB Cluster using <code>mysqlsh</code>. This is in Kubernetes, but I think this question applies more generally.</p> <p>When I use <code>cluster.configureInstance()</code> I see messages that includes:</p> <blockquote> <p>This instance reports its own address as node-2:3306</p> </blockquote> <p>...
Jerry
<p>Apparently this value has to be set at startup. The option for my setup was</p> <pre><code>--report-host=${HOSTNAME}.cluster </code></pre> <p>when starting the MySQL instances resolved the issue.</p> <p>Specifically for Kubernetes, an example is at <a href="https://github.com/adamelliotfields/kubernetes/blob/master/...
Jerry
<p>I'm creating a configuration to host some apps in a Kubernetes cluster on AWS. I have two different apps, with separate service/pod/selector but I want to expose them with a single ingress for the moment.</p> <p>So I created the following ingress controller</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingre...
Federico Paparoni
<p>If you have recently changed the version of your nginx-ingress controller then maybe the cause can be a recent change done to it. Now it uses regex rewrite rules and maybe your rewrite target is just always being rewritten to "/". I think the changes were introduced in version 0.22 in January.</p> <p>The new correc...
Yervand Aghababyan
<p><a href="https://www.docker.com/" rel="nofollow noreferrer">Docker</a> provides a way to run the container using <code>docker run</code></p> <p>Or just pull the container image using <code>docker pull</code></p> <p>Found a <a href="https://kubernetes.io/docs/reference/kubectl/docker-cli-to-kubectl/" rel="nofollow ...
mchawre
<p><code>crictl pull &lt;image name&gt;</code></p>
Metalstorm
<p>I'm setting up a Prometheus exporter for my ASP.NET Core 3.1 app.</p> <p>I've imported</p> <p><code>&lt;PackageReference Include=&quot;prometheus-net.AspNetCore&quot; Version=&quot;4.1.1&quot; /&gt;</code></p> <p>And this is what I have configured:</p> <pre><code>public void Configure(IApplicationBuilder app, IWebHo...
Joel
<p>I ended up doing like this:</p> <pre><code>public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { ... app.UseMetricServer(9102); app.UseRouting(); app.UseHttpMetrics(); ... } </code></pre> <p>And then for my Kubernetes <code>Deployment</code> I had to add both port 80 and 91...
Joel
<p>I have a Kubernetes cluster running in AWS. I used <code>kops</code> to setup and start the cluster. </p> <p>I defined a minimum and maximum number of nodes in the nodes instance group: </p> <pre><code>apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: 2017-07-03T15:37:59Z labels: k...
CPA
<p>Someone opened a <a href="https://github.com/kubernetes/kops/issues/341" rel="nofollow noreferrer">ticket for this on GitHub</a> and it suggests you have to install the <a href="https://github.com/kubernetes/kops/tree/master/addons/cluster-autoscaler" rel="nofollow noreferrer">autoscaler addon</a>. Check if it's alr...
kichik
<p>I am new to istio. Istio intercepts all traffic between two services through istio-proxy/envoy. Is it possible to configure istio so that it ignores certain type of traffic</p> <ul> <li>when serviceA makes an https call directly to serviceB on a certain port</li> <li>UDP traffic</li> </ul> <p>Thanks</p>
user674669
<p>As per Istio <a href="https://github.com/istio/istio/blob/master/install/kubernetes/helm/istio/templates/sidecar-injector-configmap.yaml" rel="nofollow noreferrer">sidecar injection configuration</a> you can exclude ports from Envoy &amp; iptables rules using the <code>includeInboundPorts</code> and <code>excludeInb...
Stefan P.
<p>I have a docker image for a Spring Boot app with the log file location as <code>--logging.config=/conf/logs/logback.xml</code> and the log file is as follows.</p> <p>I am able to get the logs as</p> <blockquote> <p>kubectl log POD_NAME</p> </blockquote> <p>But, unable to find the log file when I log in to the pod. I...
user1578872
<p>What you see from kubectl logs is console log from your service. Only console log can be seen like that and this is via docker logs support.</p>
manojlds
<p>I have a problem with Istio Request Routing directly behind the Istio Ingress Gateway: </p> <p><a href="https://i.stack.imgur.com/YBfhx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YBfhx.png" alt="request routing"></a></p> <p>I have simple node.js app (web-api) in 2 versions (v1, v2) with an ...
Harald Uebele
<p>You have to attach the web-api virtual service to the gateway and delete the virtualservice-ingress object.</p> <p>Here is how the web-api virtual service should look like:</p> <pre><code>apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: web-api spec: hosts: - "*" gateways: - ...
Stefan P.
<p>I have added the following command-line arguments to <code>kube-apiserver</code> to enable audit logging:</p> <pre><code>- --audit-log-path=/tmp/k8s-audit.log - --audit-policy-file=/etc/kubernetes/audit.yaml - --audit-log-maxage=1 - --audit-log-maxsize=100 - --audit-log-maxbackup=1 </code></pre> <p>The contents of...
Robin Green
<p>The request is actually only logged in the <code>ResponseComplete</code> stage, somewhat unexpectedly. Even though Kubernetes <em>could</em> theoretically log the request as soon as it receives it, it doesn't.</p> <p>So it's necessary to remove the <code>ResponseComplete</code> line from the <code>omitstages</code>...
Robin Green
<p>I am trying to implement CI/CD pipeline using Kubernetes and Jenkins. Now I am exploring about the CI part using Jenkins file, SVN repository with Docker Hub. After pushing the Docker image into registry docker hub , I need to deploy this into a Kubernetes cluster having 3 cluster master and 15 worker machine/node.<...
Mr.DevEng
<p>You can use <a href="https://helm.sh/" rel="nofollow noreferrer">Kubernetes Helm</a> to define what you want to spin up, in parameterisable modules called Helm charts. Many charts are available for common software like nginx and postgresql. This allows an "infrastructure as code" way of working - declaratively speci...
Robin Green
<p>I am quite confused how IPs and ports work in kubernetes.</p> <p>Here is my yaml for a very basic service:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: httpbin-pod labels: app.kubernetes.io/name: httpbin spec: containers: - name: httpbin-container image: kennethreitz/httpbin ports: ...
Mandroid
<p>At least part of the problem you have here is that the image you're using <code>kennethreitz/httpbin</code> listens on port 80 rather than 8080.</p> <p>If you change the value of <code>containerPort: 8080</code> in the pod definition to <code>containerPort: 80</code> that'll work fine in terms of getting the traffi...
Rory McCune
<p>I'm trying to enable 'auditing'. <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/audit/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/debug-application-cluster/audit/</a> mentions:</p> <blockquote> <p>You can pass a file with the policy to kube-apiserver using the --audit-polic...
Chris Stryczynski
<p>For a recent version of Kubernetes, add this to the <code>kind: ClusterConfiguration</code> section:</p> <pre><code> apiServer: extraArgs: audit-log-path: /tmp/k8s-audit.log audit-policy-file: /etc/kubernetes/audit.yaml audit-log-maxage: "1" audit-log-maxsize: "100" ...
Robin Green
<p>We are having issues when we run an import in our system. He have a pod with 6 replicas that calls a service that is backed by a 5-replica pod. Nevertheless, our metrics indicate that, under load, that only one of the 5 pods is getting the request. We are using a ClusterIP service to "route" the calls.</p> <p>We f...
JSBach
<p>I found out the answer. I deployed an app that would call an endpoint through the service and would get back the node that answered. I noticed that during a time frame around 30s, only the same node would answer, then it would switch to another node for another time frame and then back. It seems weird, but seems to ...
JSBach
<p>I noticed some of my clusters were reporting a CPUThrottlingHigh alert for metrics-server-nanny container (image: gke.gcr.io/addon-resizer:1.8.11-gke.0) in GKE. I couldn't see a way to configure this container to give it more CPU because it's automatically deployed as part of the metrics-server pod, and Google auto...
pgier
<p><a href="https://github.com/robusta-dev/alert-explanations/wiki/CPUThrottlingHigh-on-metrics-server-(Prometheus-alert)" rel="nofollow noreferrer">This is a known issue with GKE metrics-server.</a></p> <p>You can't fix the error on GKE as GKE controls the metric-server configuration and any changes you make are rever...
Natan Yellin