Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I'm trying to deploy a HA Keycloak cluster (2 nodes) on Kubernetes (GKE). So far the cluster nodes (pods) are failing to discover each other in all the cases as of what I deduced from the logs. Where the pods initiate and the service is up but they fail to see other nodes.</p> <p>Components</p> <ul> <li>PostgreSQL D...
nour
<h3>For Keycloak 17 and newer</h3> <p>By default, those versions use DNS_PING as the discovery mechanism for JGroups (the underlying cluster mechanism) but you still need to activate it.</p> <p>You'll need:</p> <ul> <li>a <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="...
motobói
<p>I'm trying to install Kibana with a plugin via the <code>initContainers</code> functionality and it doesn't seem to create the pod with the plugin in it.</p> <p>The pod gets created and Kibana works perfectly, but the plugin is not installed using the yaml below.</p> <p><a href="https://www.elastic.co/guide/en/cloud...
Ovi
<p>Got Kibana working with plugins by using a custom container image</p> <p>dockerfile</p> <pre><code>FROM docker.elastic.co/kibana/kibana:7.11.2 RUN /usr/share/kibana/bin/kibana-plugin install https://github.com/fbaligand/kibana-enhanced-table/releases/download/v1.11.2/enhanced-table-1.11.2_7.11.2.zip RUN /usr/share/k...
Ovi
<p>I am learning StackExchange.Redis, and Kubernetes, so I made a simple .net core app that reads a key/value from a Redis master+2slaves deployed on kubernetes. (so, everything, Redis and my app, run inside containers)</p> <p>To connect to redis I use the syntax suggested in the doc: </p> <pre><code>ConnectionMultip...
Anton M
<p>SE.Redis has a <code>CommandFlags</code> parameter that is optional on every command. There are some useful and relevant options here:</p> <ul> <li><code>DemandPrimary</code></li> <li><code>PreferPrimary</code></li> <li><code>DemandReplica</code></li> <li><code>PreferReplica</code></li> </ul> <p>The default behaviou...
Marc Gravell
<p><strong>UPDATE:</strong></p> <p>With @Tanktalus 's answer, I realized that it was the left most <code>kubectl</code> command is buffered. </p> <pre class="lang-sh prettyprint-override"><code># will hang forever, because RHS pipe is broken, and LHS pipe need to send # the output to the pipe to realize the broken p...
Psyduck
<p>I suspect it's because <code>kubectl</code> hasn't exited that the shell doesn't continue on. If you look at the <code>ps</code> output, you'll notice that <code>grep -m1 ...</code> does actually exit, and doesn't exist anymore, but the rest of the pipe still exists.</p> <p>So I suspect you'll need to invert this. ...
Tanktalus
<p>I have a Ansible <code>group_vars</code> directory with the following file within it:</p> <pre><code>$ cat inventory/group_vars/env1 ... ... ldap_config: !vault | $ANSIBLE_VAULT;1.1;AES256 31636161623166323039356163363432336566356165633232643932623133643764343134613064 6563346430393264...
slm
<p>We can use an Ansible adhoc command to retrieve the variable of interest, <code>ldap_config</code>. To start we're going to use this adhoc to retrieve the Ansible encrypted vault string:</p> <pre><code>$ ansible -i "localhost," all \ -m debug \ -a 'msg="{{ ldap_c...
slm
<p>I'm deploying a simple app in Kubernetes (on AKS) which is sat behind an Ingress using Nginx, deployed using the Nginx helm chart. I have a problem that for some reason Nginx doesn't seem to be passing on the full URL to the backend service. </p> <p>For example, my Ingress is setup with the URL of <a href="http://a...
Sam Cogan
<p>So I found the answer to this. It seems that as of Nginx v0.22.0 you are required to use capture groups to capture any substrings in the request URI. Prior to 0.22.0 using just <code>nginx.ingress.kubernetes.io/rewrite-target: /</code> worked for any substring. Now it does not. I needed to ammend my ingress to use ...
Sam Cogan
<p>I have noticed that when I create and mount a config map that contains some text files, the container will see those files as symlinks to <code>../data/myfile.txt</code> .</p> <p>For example, if my config map is named tc-configs and contains 2 xml files named stripe1.xml and stripe2.xml, if I mount this config map ...
Anthony Dahanne
<p>I think this solution is satisfactory : specifying exact file path in mountPath, will get rid of the symlinks to <code>..data and ..2018_06_04_19_31_41.860238952</code></p> <p>So if I apply such a manifest : </p> <pre><code>apiVersion: v1 kind: Pod metadata: name: my-lamp-site spec: containers: - name: ...
Anthony Dahanne
<p>There are a set of proxy environment variables (http_proxy, HTTP_PROXY, https_proxy, HTTPS_PROXY, no_proxy, NO_PROXY) in my OpenShift pods that I did not explicitly include and I do not want them there.</p> <p>For example</p> <pre><code>$ oc run netshoot -it --image docker-registry.default.svc:5000/default/netshoo...
Everett Toews
<p>We finally figured this out. We had <code>openshift_http_proxy</code>, <code>openshift_https_proxy</code>, and <code>openshift_no_proxy</code> set in our installer inventory variables as per <a href="https://docs.openshift.com/container-platform/3.9/install_config/install/advanced_install.html#advanced-install-confi...
Everett Toews
<p>In some cases, we have Services that get no response when trying to access them. Eg Chrome shows ERR_EMPTY_RESPONSE, and occasionally we get other errors as well, like 408, which I'm fairly sure is returned from the ELB, not our application itself.</p> <p>After a long involved investigation, including ssh'ing into...
Ben
<p>After much investigation, we were fighting a number of issues: * Our application didn't always behave the way we were expecting. Always check that first. * In our Kubernetes Service manifest, we had set the <code>externalTrafficPolicy: Local</code>, which probably should work, but was causing us problems. (This w...
Ben
<p>I'm getting the following warning when trying to run the <code>aws</code> client with the <code>aws-iam-authenticator</code> for kubernetes:</p> <pre><code>Warning: aws-iam-authenticator is not installed properly or is not in your path. </code></pre> <p>However, the <code>aws-iam-authenticator</code> is clearly in...
Gavin Miller
<p>Turns out the issue is because I used the <code>~</code> in my <code>PATH</code>. I found <a href="https://github.com/kubernetes-sigs/aws-iam-authenticator/issues/136#issuecomment-417417212" rel="nofollow noreferrer">this issue and comment</a> that pointed me in the correct direction. Updating my <code>PATH</code> t...
Gavin Miller
<p>I am trying to use named arguments for the method because it has quite a lot of arguments. I am using java-client for Kubernetes API. However, I get <code>Cannot resolve symbol</code> compile error. I am writing the code in Intellij IDEA, could it be some plugins problem?</p> <p>Here is the code:</p> <pre><code> ...
Cassie
<p>Scala 2.12 <a href="https://github.com/scala/scala/pull/4735" rel="nofollow noreferrer">supports named parameters for Java if they are available</a>, but <a href="https://docs.oracle.com/javase/tutorial/reflect/member/methodparameterreflection.html" rel="nofollow noreferrer">by default Java is compiled without stori...
Alexey Romanov
<p>I'd like to get the list of kubernetes pods for a service that are "Running" and fully "Ready".</p> <p>And by fully ready, I mean shows a full "READY" count in k9s, so if there are 4 conditions for the pod to run, I see "READY" with "4/4" listed in k9s.</p> <p>How can I do this?</p>
Brad Parks
<p>For a particular service, <code>my-service</code>, this only shows pods that are fully ready</p> <pre><code>$ kubectl get pods --selector=app=my-service -o json | select_ready_pods.py </code></pre> <p>Similar idea for all pods</p> <pre><code>$ kubectl get pods --all-namespaces -o json | select_ready_pods.py </c...
Brad Parks
<p>I am attempting to build a pod in kubernetes that has files mounted to the pod from my local system, in a similar way to mounting volumes in <code>docker-compose</code> files</p> <p>I have tried the following, in an attempt to mount the local folder <code>./test</code> and files to the pod under the <code>/blah/</c...
Colonel Mustard
<p>If you just want to pass a file or directory to a Pod for the purpose of reading configuration values (which I assume from your choice of volume mount <code>config-volume</code>) and has no need to update the file/directory, then you can just put the file(s) in a ConfigMap like below:</p> <pre><code>apiVersion: v1 ...
Lukman
<p>I have a use case in which I need to run <code>kubectl</code> command in <code>crontab</code>. I am getting empty response from all <code>kubectl</code> commands</p> <p>I have tried this</p> <pre><code>#!/bin/sh /usr/bin/kubectl get po &gt;&gt; /cron.txt </code></pre> <p>Help will be appreciated!</p>
Ali Mehdi
<p>I don't know why you're not getting any output, but I think I know why it's not telling you why it's not getting output.</p> <p>Your command line is only going to get stdout, and drop stderr on the floor. It's likely that stderr will tell you why it's not working.</p> <p>Try changing the command line to:</p> <pre><c...
David M. Karr
<p>Below are the setup details: keda installed, prometheus deployed, through application using below scaled object template for hpa:</p> <pre><code>keda: triggers: - metadata: metricName: container_memory_usage query: avg(floor((container_memory_usage_bytes{pod=~&quot;pythonb-.*&quot;,container=~&...
sush
<p>We just solved this one after a lot of off-and-on hunting. Turns out KEDA has an option called <code>metricType</code> that you can specify under <code>triggers</code>. TLDR you need to set that to <code>&quot;Value&quot;</code>.</p> <p>To understand why you need to dive into how HPA works in Kubernetes. When you de...
Jack Senechal
<p>I'm using Kubernates for production environment (I'm new for these kinds of configuration), This is an example for one of my depolyment files(with changes):</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: myProd labels: app: thisIsMyProd spec: replicas: 3 selector: matchLabels: ...
Amr Adel
<ol> <li><p>If the image tag is the same in both <code>apply</code> and <code>set image</code> then only the <code>apply</code> action re-deploy the Deployment (in which case you do not need the <code>set image</code> command). If they refer to different image tags then yes, the deployment will be run twice.</p></li> <...
Lukman
<p>I've set up my Kubernetes cluster, and as part of that set up have set up an ingress rule to forward traffic to a web server.</p> <pre><code>--- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: alpha-ingress annotations: kubernetes.io/ingress.class: nginx certmanager.k8s.io/cluster-issuer: l...
Stuart Grimshaw
<p>So, this all boiled down to the php-fpm service not having any endpoints, because I'd misconfigured the service selector!</p> <p>Some of the more eagle eyed readers might have spotted that my config began life as a conversion from a docker-compose config file (my dev environment), and I've built on it from there.</...
Stuart Grimshaw
<p>Update:<br /> A colleague who works for Microsoft said:</p> <blockquote> <p>Changelog entry for this behaviour change is here: <a href="https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/docs-ref-conceptual/release-notes-azure-cli.md#aks-3" rel="nofollow noreferrer">https://github.com/MicrosoftDocs/azure-do...
Jeremy Thompson
<p>For Reference: I got the same and following your <a href="https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/docs-ref-conceptual/release-notes-azure-cli.md#aks-3" rel="nofollow noreferrer">link</a> I found that this worked.</p> <pre><code>az aks show -g aks -n cluster --query identityProfile.kubeletidentity...
Preet Sangha
<p>I have deployed spark applications in cluster-mode in kubernetes. The spark application pod is getting restarted almost every hour. The driver log has this message before restart:</p> <pre><code>20/07/11 13:34:02 ERROR TaskSchedulerImpl: Lost executor 1 on x.x.x.x: The executor with id 1 was deleted by a user or the...
Sprasad
<p>I did a quick research on running Spark on Kubernetes, and it seems that Spark by design will terminate executor pod when they finished running Spark applications. Quoted from the official Spark website:</p> <blockquote> <p>When the application completes, the executor pods terminate and are cleaned up, but the drive...
Lukman
<p>I'm not sure how to access the Pod which is running behind a Service.</p> <p>I have Docker CE installed and running. With this, I have the Docker 'Kubernetes' running.</p> <p>I created a Pod file and then <code>kubectl created</code> it ... and then used port-forwarding to test that it's working and it was. Tick!</p...
Pure.Krome
<p>@vailyangapov basically answered this via comments in the OP - this answer is in two parts.</p> <ol> <li><p><strong>I didn't <code>apply</code> my changes in my manifest</strong>. I made some changes to my services yaml file but didn't push these changes up. As such I needed to do <code>kubectl apply -f myPod.yaml<...
Pure.Krome
<p>It is clear from the documentation that whenever pods are in Pending state because there is no node that has enough free resources to respect the pods resource request - the cluster autoscaler will create another node within 30 seconds of the pod creation (for reasonably sized clusters).</p> <p>However, consider the...
Alechko
<p>It's important to recognise the distinction here between the CPU <code>request</code> in a PodSpec, and the amount of cpu a process is trying to use. Kubernetes provisioning and cluster autoscaling is based purely on the <code>request</code> in the PodSpec. Actual use is irrelevant for those decisions.</p> <p>In the...
Mike Bryant
<p>I've recently setup a cron process that will make an internal request inside my K8 instance call my service internally. I'm now faced with the task of securing that endpoint. The simplest solution might be to pass a secret via the Authorization header but that doesn't seem safe or the proper way.</p> <p>What are som...
pilotguy
<p>Since any traffics from outside will go through an ingress in order to reach your HTTP service, you can add a routing to an error page component if the traffics reach the API paths meant for your internal cron usage, which calls the API via the service and not going through the ingress.</p> <p>For example:</p> <pre>...
Lukman
<p>I see there are many Github pages for gradle kubernetes plugin like <br> <a href="https://github.com/bmuschko/gradle-kubernetes-plugin" rel="nofollow noreferrer">https://github.com/bmuschko/gradle-kubernetes-plugin</a> <br> <a href="https://github.com/kolleroot/gradle-kubernetes-plugin" rel="nofollow noreferrer">htt...
Anurag_BEHS
<p>Since I also faced a lack of plugins that deal with Kubernetes I started working on a Gradle plugin to make deploying resources to a Kubernetes cluster easier: <a href="https://github.com/kuberig-io/kuberig" rel="nofollow noreferrer">https://github.com/kuberig-io/kuberig</a>.</p> <p>In the user manual you will find ...
Tom Eyckmans
<p>We have an applications that requires secrets ONLY during the runtime or creation of the pod. Once the Pod is up and started the secrets are no longer needed.</p> <p>I've tried to load secrets from environment variables then unset them via a script however if you exec into the container the secret is available on e...
Jay
<p>You can't unmount a Secret while the Pod is running. (The design is any updates to the secret will be reflected immediately)</p> <p>However, what you could do is use an initContainer, which mounts the secret. That initContainer and your main container also both mount an emptyDir volume, which is ephemeral. Init coul...
Mike Bryant
<p>I know there are multiple different solutions to do what I am looking for, but I am looking for a/the proper way to perform some requests in parallel. I am new to Go but it feels cumbersome what I am doing at the moment.</p> <p><strong>Use case:</strong></p> <p>I need to query 4 different REST endpoints (kubernete...
kentor
<p>Your code has 2 race conditions, and likely will never correctly report an error.</p> <p>You need to wait for the goroutines to complete before you can read the values they operate on, which is easily done with a <code>sync.WaitGroup</code> like so:</p> <pre><code>var nodeMetricsList *v1beta1.NodeMetricsList var p...
JimB
<p>Cert-manager various versions ( 15 and 16 ) installed on both k3s version v1.18.8+k3s1 and docker-desktop version v1.16.6-beta.0 using the following command:</p> <pre class="lang-sh prettyprint-override"><code>helm install cert-manager \ --namespace cert-manager jetstack/cert-manager \ --version v0.16.1 \ --set inst...
sph1982
<p>Not 100% if it'll resolve your issue but I did come across this thread - <a href="https://github.com/jetstack/cert-manager/issues/1163" rel="nofollow noreferrer">https://github.com/jetstack/cert-manager/issues/1163</a>. They show <code>helm</code> being invoked like this and purporting it worked.</p> <pre><code>$ he...
slm
<p>I have a pod that needs to clean up an external reference when it is terminated. (I can do this with a a curl command.)</p> <p>I looked into <a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" rel="nofollow noreferrer">container lifecycle events</a> and they seem just ...
Vaccano
<p>I should have looked a bit longer.</p> <p>The <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#writing-a-deployment-spec" rel="nofollow noreferrer">Writing a Deployment Spec</a> section of the deployment documentation says:</p> <blockquote> <p>The .spec.template is a Pod template. It ha...
Vaccano
<p>I have tried using the Patch Class to scale the Deployments but unable to do so. Please let me know how to do it. i have researched a lot but no proper docs on it/Example to achieve.</p> <pre><code>public static async Task&lt;V1Scale&gt; Scale([FromBody] ReplicaRequest request) { try { ...
shwetha L
<p>The <code>JsonPatchDocument&lt;T&gt;</code> you are using generates Json Patch, but you are specifying ApplyPatch.</p> <p>Edit as of 2022-04-19:<br /> The <a href="https://github.com/kubernetes-client/csharp" rel="nofollow noreferrer">kubernetes-client/csharp</a> library changed the serializer to <code>System.Text....
Paciv
<p>I am new to Kubernetes. I am trying to implement zoneminder on Kubernetes. I noticed from google I found quantumobject which is implementing zoneminder on docker, but the resources of implementing it on Kubernetes are really less. I tried implementing it on Kubernetes but somehow it doesn't show the video stream and...
Cheow Jing Wei
<p>I was just quickly researching this myself. Should run fine - it can even run multiple pods with shared storage per <a href="https://zoneminder.readthedocs.io/en/stable/installationguide/multiserver.html" rel="nofollow noreferrer">https://zoneminder.readthedocs.io/en/stable/installationguide/multiserver.html</a></p>...
Morgan Christiansson
<p>I'm trying to install Kubernetes on my Ubuntu server/desktop version 18.04.1. But, when I want to add kubernetes to the apt repository using the following command:</p> <pre><code>sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-bionic main" </code></pre> <p>I get the following error:</p> <pre><c...
Jordy van Eijk
<p>At the moment (nov. 2018) there is no bionic folder. You can see the supported distributions here: </p> <p><a href="https://packages.cloud.google.com/apt/dists" rel="noreferrer">https://packages.cloud.google.com/apt/dists</a></p> <p>The last kubernetes version there is: kubernetes-yakkety</p> <p>This should still...
Patrick Cornelissen
<p>I'm using Apache Ignite .Net v2.7. While resolving another issue (<a href="https://stackoverflow.com/questions/55388489/how-to-use-tcpdiscoverykubernetesipfinder-in-apache-ignite-net/55392149">How to use TcpDiscoveryKubernetesIpFinder in Apache Ignite .Net</a>) I've added a sprint configuration file where the Kubern...
Alex Avrutin
<p>It looks like you have different versions of <code>spring-core</code> and <code>spring-beans</code> in your Java classpath for some reason. There's no reason for them to not match exactly. I think it should print full classpath somewhere, you can look it up.</p> <p>In 2.7 Apache Ignite ships differing version of Sp...
alamar
<p>I want to deploy a service with three replicas, each having a readiness probe. One pod will start working (sending data at a port on which readiness is tested) only when the other two pods also spin up. All the three pods need to spin up, register their IP in an internal service, and then they will be discoverable.<...
Aviral Srivastava
<p>If you are using StatefulSet, use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#parallel-pod-management" rel="nofollow noreferrer">parallel pod management</a> to allow Kubernetes to create the replicas in parallel without waiting for previous pods to be ready.</p> <p>Set <code>.spec...
Lukman
<p>I am trying to upgrade the nodes in my Kubernetes cluster. When I go to do that, I get a notification saying:</p> <blockquote> <p>PDB istio-ingressgateway in namespace istio-system allows 0 pod disruptions</p> </blockquote> <p>PDB is Pod Disruption Budget. Basically, istio is saying that it can't loose that pod an...
Vaccano
<p>Turns out that if you did not install Istio using the Istio Kubernetes Operator, you cannot use the option I tried.</p> <p>Once I uninstalled Istio and reinstalled it using the Operator, then I was able to get it to work.</p> <p>Though I did not use the Patch operation, I just did a <code>kubectl apply -f istio-oper...
Vaccano
<p>I have a YAML file defining multiple Kubernetes resources of various types (separated with <code>---</code> according to the YAML spec):</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: # ... spec: # ... --- apiVersion: rbac.author...
Tomas Aschan
<p>I was finally able to make it work! Here's how:</p> <pre class="lang-golang prettyprint-override"><code>import ( &quot;k8s.io/client-go/kubernetes/scheme&quot; &quot;sigs.k8s.io/controller-runtime/pkg/client&quot; apiextensionsv1 &quot;k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1&quot; a...
Tomas Aschan
<p>I have a deployment (starterservice) that deploys a single pod with a persistent volume claim. This works. However restart fails:</p> <pre><code>kubectl rollout restart deploy starterservice </code></pre> <p>The new pod is started before the old one has terminated and it cannot attach the volume (Multi-Attach error ...
David Tinker
<p>You need to set deployment strategy = recreate.</p> <pre><code>spec: strategy: type: Recreate </code></pre> <p>The difference between the <code>Recreate</code> strategy compared to <code>RollingUpdate</code> (default) is that <code>Recreate</code> will terminate the old pod before creating new one while <code>...
Lukman
<p>I am currently in the process to set up <a href="https://sentry.io/" rel="nofollow noreferrer">sentry.io</a> but i am having problems in setting it up in openshift 3.11</p> <p>I got pods running for <code>sentry</code> itself, <code>postgresql</code>, <code>redis</code> and <code>memcache</code> but according to the...
HFinch
<p>Pods (even in the same namespace) are not able to talk <strong>directly</strong> to each other by default. You need to create a <code>Service</code> in order to allow a pod to receive connections from another pod. In general, one pod connects to another pod via the latter's service, as I illustrated below:</p> <p><a...
Lukman
<p>I have the following <code>RoleBinding</code> (it was deployed by Helm:</p> <pre><code>apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: annotations: meta.helm.sh/release-name: environment-namespaces meta.helm.sh/release-namespace: namespace-metadata creationTimestamp: &quot;2021-04-23...
Vaccano
<p><strong>Case Matters!!!!</strong></p> <p>Once I changed the user to be <code>sa-devk8s@mydomain.com</code> (instead of <code>SA-DevK8s@mydomain.com</code>), it all started working correctly!</p>
Vaccano
<p>I am reading the README file for <a href="https://github.com/prometheus-operator/kube-prometheus#prerequisites" rel="nofollow noreferrer">kube-prometheus</a> and is confused by the following passage:</p> <blockquote> <p>This stack provides resource metrics by deploying the Prometheus Adapter. This adapter is an Exte...
mark
<p>I think the documentation you need is under enabling aggregation.</p> <p><a href="https://kubernetes.io/docs/tasks/extend-kubernetes/configure-aggregation-layer/#enable-kubernetes-apiserver-flags" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/extend-kubernetes/configure-aggregation-layer/#enable-kuberne...
Colwin
<p>I want to capture <code>subdomain</code> and rewrite URL with <code>/subdomain</code>, For example <code>bhautik.bhau.tk</code> rewrite to <code>bhau.tk/bhautik</code>.</p> <p>I also <a href="https://github.com/google/re2/wiki/Syntax" rel="nofollow noreferrer">https://github.com/google/re2/wiki/Syntax</a> tried grou...
Bhautik Chudasama
<p>I believe you want a redirect instead of rewrite. Here is the <code>server-snippet</code> you need:</p> <pre><code>nginx.ingress.kubernetes.io/server-snippet: | if ($host ~ ^(?&lt;subdom&gt;\w+)\.(?&lt;basedom&gt;bhau\.tk)$) { return 302 https://$basedom/$subdom/ ; } </code></pre> <p>If you really want a rew...
Lukman
<p>I'll describe what is my target then show what I had done to achieve it... my goal is to:</p> <ul> <li>create a configmap that holds a path for properties file</li> <li>create a deployment, that has a volume mounting the file from the path configured in configmap</li> </ul> <p>What I had done:</p> <p>ConfigMap:</p> ...
zbeedatm
<p>Put the content of the <code>my.properties</code> file directly inside the ConfigMap:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: my-configmap data: my_properties_file_name: | This is the content of the file. It supports multiple lines but do take care of the indentation. </code></pre> ...
Lukman
<p>I'm wondering about the best practices for architecting my Kubernetes clusters. For 1 environment (e.g. production), what organisation should I have in my clusters?</p> <p>Examples: 1 cluster per technology stack, 1 cluster per exposure area (internet, private...), 1 cluster with everything ... ?</p> <p>Thanks for y...
Xire
<p>I'm not a Kubernetes expert, so I'll give you some generic guidance to help until someone who knows more weighs in.</p> <ul> <li>By technology stack - no. That wouldn't provide any value I can think of.</li> <li>By 'exposure' - yes. If one cluster is compromised the damage will hopefully be limited to that cluster...
Adrian K
<p>I have set the Kubernetes cronJob to prevent concurrent runs <a href="https://stackoverflow.com/a/62892617/2096986">like here</a> using <code>parallelism: 1</code>, <code>concurrencyPolicy: Forbid</code>, and <code>parallelism: 1</code>. However, when I try to create a cronJob manually I am allowed to do that.</p> <...
Felipe
<p>The <code>concurrencyPolicy: Forbidden</code> spec only prevents concurrent pod creations and executions of <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy" rel="nofollow noreferrer">the same <code>CronJob</code></a>. It does not apply across separate CronJobs even th...
Lukman
<p>I have few questions regarding how a random string part in kubernetes podname is decided .</p> <p>how is pod-template-hash decided ?? ( i understand that it is a random string generated by deployment controller). But exactly what are the inputs which the deployment controller considers before generating this random ...
Mahesh Suranagi
<p>10 characters? That is only the alphanumeric suffix of the replica set name. Pods under a replica set will have additional suffixes of a dash plus 5 characters long alphanumeric string.</p> <p>The name structure of a Pod will be different depending on the controller type:</p> <ul> <li>StatefulSet: StatefulSet name +...
Lukman
<p>When I add morethan 50 Paths in the Ingress file - getting below error from Google Cloud Platform.</p> <p><strong>"Error during sync: UpdateURLMap: googleapi: Error 413: Value for field 'resource.pathMatchers[0].pathRules' is too large: maximum size 50 element(s); actual size 51., fieldSizeTooLarge"</strong></p> <...
Asarudeen A
<p>This is hard limitation of the URLMap resource, <a href="https://cloud.google.com/load-balancing/docs/quotas" rel="nofollow noreferrer">which cannot be increased</a>.</p> <blockquote> <p>URL maps</p> <p>Host rules per URL map - 50 - This limit cannot be increased.</p> </blockquote> <p>Here's a feature reque...
Eduard Wirch
<p>in Kube, i have one pod with two containers * container 1: nginx reverse proxy * container 2: myapp</p> <p>for testing purpose, i also has a docker compose file, include the two services * service 1 nginx reverse proxy * service 2: myapp</p> <p>the issue is, in docker, the nginx upstream host is in the format of ...
user5358058
<p>I came across this question because we have the same issue.</p> <p>I noticed the other answers suggested splitting nginx and the app-server into 2 different Services / Pods. Whilst that is certainly a solution, I rather like a self-contained Pod with both nginx and the app-server together. It works well for us, esp...
Tom
<p>We are using Spark &amp; Cassandra in an application which is deployed on bare metal/VM. To connect Spark to Cassandra, we are using following properties in order to enable SSL :</p> <pre><code>spark.cassandra.connection.ssl.keyStore.password spark.cassandra.connection.ssl.keyStore.type spark.cassandra.connection.ss...
Pushpendra
<p>Yes, these properties will continue to work when you run your job on Kubernetes. The only thing that you need to take into account is that all properties with name ending with <code>.path</code> need to point to the actual files with trust &amp; key stores. On Kubernetes, you need to take care of exposing them as ...
Alex Ott
<p>I can start an &quot;interactive pod&quot; using:</p> <pre class="lang-sh prettyprint-override"><code>$ kubectl run my-shell --rm -i --tty --image ubuntu -- bash </code></pre> <p>How can I add a <a href="https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/" rel="nofollow noreferrer">customized hos...
malthe
<p>Add <code>--overrides='{ &quot;spec&quot;: { &quot;hostAliases&quot;: [ { &quot;ip&quot;: &quot;8.8.8.8&quot;, &quot;hostnames&quot;: [ &quot;dns.google&quot; ] } ] } }'</code> to the <code>kubectl run</code> command:</p> <pre><code>kubectl run my-shell --rm -i --tty --image ubuntu --overrides='{ &quot;spec&quot;: {...
Lukman
<p>We have a <code>PVC</code> that is written to by many <code>k8s</code> <code>cronjobs</code>. We'd like to periodically copy this data locally. Ordinarily one would use <code>kubectl cp</code> to do such tasks, but since there's no actively running pod with the <code>PVC</code> mounted, this is not possible.</p> <p>...
colm.anseo
<p>May I propose to use NFS instead of PVC?</p> <p>If you do not have an NFS server, you can run one inside k8s cluster using this image @ <a href="https://hub.docker.com/r/itsthenetwork/nfs-server-alpine" rel="nofollow noreferrer">https://hub.docker.com/r/itsthenetwork/nfs-server-alpine</a>. The in-cluster NFS server ...
Lukman
<p>The official <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html#cluster-mode" rel="nofollow noreferrer">spark documentation</a> only has information on the <code>spark-submit</code> method for deploying code to a spark cluster. It mentions we must prefix the address from kubernetes api server w...
alex
<p>It's better not to use <code>setMaster</code> in the code, but instead specify it when running the code via spark-submit, something like this (see <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html#submitting-applications-to-kubernetes" rel="nofollow noreferrer">documentation for details</a>):<...
Alex Ott
<p>I've got problem forwarding jmx from kubernetes pod to localhost. Everything works fine when port is forwarded to the same port:</p> <pre><code>kubectl port-forward ... 9010:9010 OR kubectl port-forward ... 9010 </code></pre> <p>However, when I try to forward to a different local port,</p> <pre><code>kubectl port...
user2186425
<p>This is an RMI issue. The problem is that the RMI stub delivered to the JMX client is created for 9010 and so it fails when attempting to connect at 9011. There's a couple of decent solutions outlined <a href="https://stackoverflow.com/questions/15093376/jconsole-over-ssh-local-port-forwarding">here</a>. Another opt...
Nicholas
<p>Is their a way to create a ClusterRole using ClusterRolebinding that can provide permissions to create ClusterRoles/ClusterRolebindings and also add a condition somehow it can be limited to one namespace and cannot create resources in other namespaces?</p> <p>Since, ClusterRole and ClusterRolebinding are not namespa...
3br10ee032
<p>From what I understand this is what you want to achieve:</p> <ol> <li>You have a cluster admin access</li> <li>You want to use this cluster admin access to create namespace admin(s)</li> <li>You want these namespace admins to be able to grant access to other subject (e.g. users, groups or service accounts) to resour...
Lukman
<p>I have recently started working with Kubernetes and Docker and still new with how it all works. I have made a ps1 script to run all the steps I need to do to build image and execute image on Kubernetes. </p> <p>What I see is all steps work fine on ISE (except this one: "kubectl exec -it test-runner pwsh"). For this...
Pramod Yadav
<p><strong>The PowerShell <em>ISE</em> doesn't support <em>interactive</em> console applications</strong>, which notably means that you cannot start other <em>shells</em> from it.</p> <p>The ISE tries to anticipate that problem by refusing to start well-known shells. For instance, trying to start <code>cmd.exe</code> f...
mklement0
<p>Our organisation runs Databricks on Azure that is used by data scientists &amp; analysts primarily for Notebooks in order to do ad-hoc analysis and exploration.</p> <p>We also run Kubernetes clusters for non spark-requiring ETL workflows.</p> <p>We would like to use Delta Lakes as our storage layer where both Databr...
Roman
<p>You can <em>usually</em> can write into the Delta table using <a href="https://delta.io/" rel="nofollow noreferrer">Delta connector for Spark</a>. Just start a Spark job with <a href="https://docs.delta.io/latest/quick-start.html#set-up-apache-spark-with-delta-lake" rel="nofollow noreferrer">necessary packages and ...
Alex Ott
<p>I am using Apache Ignite .Net v2.7 in a Kubernetes environment. I use TcpDiscoverySharedFsIpFinder as a node discovery mechanism in the cluster.</p> <p>I noticed a strange behaviour in a running cluster. The cluster starts up successfully and works fine for a couple of hours. Then, a node goes offline and then ever...
Alex Avrutin
<p>Nodes segmentation usually mean there are long pauses: either GC pauses, I/O pauses or network pauses.</p> <p>You can try increasing <code>failureDetectionTimeout</code>, see if the problem goes away. Or, you can try getting rid of pauses.</p>
alamar
<p>As we know, by default HTTP 1.1 uses persistent connections which is a long-lived connection. For any service in <a href="https://kubernetes.io/" rel="nofollow noreferrer">Kubernetes</a>, for example, clusterIP mode, it is L4 based load balancer.</p> <p>Suppose I have a service which is running a web server, this se...
Joe
<p>This webpage perfectly address your question: <a href="https://learnk8s.io/kubernetes-long-lived-connections" rel="nofollow noreferrer">https://learnk8s.io/kubernetes-long-lived-connections</a></p> <p>In the spirit of StackOverflow, let me summarize the webpage here:</p> <ol> <li><p>TLDR: Kubernetes doesn't load bal...
Lukman
<p>Suppose that I have a <strong>Deployment</strong> which loads the env variables from a <strong>ConfigMap</strong>:</p> <pre><code>spec.template.spec.containers[].envFrom.configMapRef </code></pre> <p>Now suppose that I change the data inside the ConfigMap.</p> <p><strong>When exactly are the Pod env variables update...
collimarco
<p>After some testing (with v1.20) I see that env variables in Pod template are updated immediately (it's just a reference to external values).</p> <p>However the container does not see the new env variables... You need at least to restart it (or otherwise delete and recreate the pod).</p>
collimarco
<p>I need to setup a RabbitMQ cluster with queue mirroring enabled on all queues in Kubernetes. The RabbitMQ plugin for kubernetes peer discovery only provides a clustering mechanism based on peer discovery , as the plugin name indicates. But how do I enable queue mirroring and achieve HA , so that if pods a restarted...
consult-kk
<p>Add a definitions.json file into your ConfigMap and ensure that your pods mount the file (in /etc/rabbitmq). In that file, specify all exchanges/queues, and have a policy defined for mirroring that would be applied to those exchanges/queues.</p> <p>It may be easier to manually set this up and export the definitions...
rifferte
<p>Sometimes, I want to explore all deployments/daemonsets which mount specific configmap/secret.</p> <p>Is there any way can achieve this by <code>kubectl</code>?</p>
Stephen Chen
<p>You need to have <code>jq</code> to do such a complex queries. Here you go:</p> <pre><code>kubectl get -o json deploy,daemonset | jq '[.items[] | . as $parent | .spec.template.spec.volumes[]? | select(.configMap != null) | {kind:$parent.kind, name:$parent.metadata.name, configMap:.configMap.name}]' </code></pre> <p>...
Lukman
<p>I was testing Skaffod and It is a great tool for microservices development. But I do not find any tutorial on how to use it with Java. Is there any support to Maven builds?</p>
Victor
<p>Skaffold now supports JIB out of the box which will be more efficient than multistage Dockerfile building! Check out the <a href="https://github.com/GoogleContainerTools/skaffold/tree/master/examples/jib" rel="nofollow noreferrer">JIB Maven example</a> in Skaffold.</p>
Balint Pato
<p>Some of our services in our K8s (EKS) envirnment use config files to drive functionality so we don't have to redeploy the whole image each time. Using <code>kubectl cp</code> command allows us to copy new config files to the pod. So the command <code>kubectl cp settings.json myapi-76dc75f47c-lkvdm:/app/settings.js...
Timothy Shenton
<p>Store the config file inside a ConfigMap and mount the ConfigMap to Deployment's pod template. When the file needs updating, either:</p> <ol> <li>Re-create the ConfigMap (kubectl delete then kubectl create --from-file)</li> <li>Or use the &quot;dry-run kubectl create piped into kubectl replace&quot; technique from <...
Lukman
<p>I have just terminated a AWS K8S node, and now.</p> <p>K8S recreated a new one, and installed new pods. Everything seems good so far.</p> <p>But when I do:</p> <pre><code>kubectl get po -A </code></pre> <p>I get: </p> <pre><code>kube-system cluster-autoscaler-648b4df947-42hxv ...
Juliatzin
<p>It looks like your nodes/master is running low on storage? I see only 1GB for ephemeral storage available. </p> <p>You should free up some space on the node and master. It should get rid of your problem.</p>
Colwin
<p>Just downloaded Lens 5.25. Windows 10, Docker Desktop 4/v20.10.8, Kubernetes v1.21.4.</p> <p>I run <code>Docker Desktop</code>, wait until <code>Kubernetes</code> is ready and then open <code>Lens</code>.</p> <p>It shows <code>docker-desktop</code> as being disconnected<a href="https://i.stack.imgur.com/8osMS.jpg" r...
Joe
<p>Click the cluster to open its information panel, then select the connect (chainlink) icon in the toolbar.</p> <p><a href="https://i.stack.imgur.com/VeJEc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VeJEc.png" alt="enter image description here" /></a></p> <p>You can then click the cluster's ico...
AKX
<p>Currently I have an OKD/openshift template which exposes port 1883 on a specific container:</p> <pre><code>ports: - name: 1883-tcp port: 1883 containerPort: 1883 protocol: TCP hostPort: ${MQTT-PORT} </code></pre> <p>Is it possible to have an if/else clause depending on parameters. For example:</p> <p...
Bob Claerhout
<p>You can't do this kind of conditional processing at the template level. </p> <p>But, to achieve your desired outcome, you can do one of 2 things.</p> <p><strong>Option 1</strong> Pass all the parameters required for the condition to process at the template level, like <code>MQTT-PORT</code>and map the correct port...
Badri
<p>We deployed Gridgain cluster in Google Kubernetes cluster and it working properly with persistence enable. We need to auto scale enable. At scale up no any errors, but at the scale down given &quot;Partition loss&quot;. We need to recover this loss partitions using control.sh script. But it is not possible at every ...
Nuwan Sameera
<p>Usually you should have backup factor sufficient to offset lost nodes (such as, if you have backups=2, you can lose at most 2 nodes at the same time).</p> <p>Coupled with baselineAutoAdjust set to reasonable value it should provide scale down feature.</p> <p>Scale down with data loss and persistence enabled will ind...
alamar
<p>We are getting warnings in our production logs for .Net Core Web API services that are running in Kubernetes.</p> <blockquote> <p>Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.&quot;,&quot;@l&quot;:&quot;Warning...
Michael Freidgeim
<p>After analysis how our applications are using protected data(authentication cookies, CSRF tokens etc) our team decided , that “Protected data will be unavailable when container is destroyed.&quot; is just a warning and would have no customer impact, so we ignore it.</p> <p>But <a href="https://www.howtogeek.com/6931...
Michael Freidgeim
<p>I am trying to run the tutorial at <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive/</a> locally on by ubuntu 18 machine. </p> <pre><code>$ minikube...
alok
<p>Ok so I was able to find the answer myself.</p> <p>~/.kube/config was present before so I removed it first.</p> <p>Next, when I ran the commands again, a config file was created again and that mentions the port as 8443.</p> <p>So, need to make sure there is no old ~/.kube/config file present before starting minik...
alok
<p>We are running Grafana on EKS Kubernetes v1.21 as a Helm deployment behind a Traefik reverse proxy.</p> <p>Grafana version: <code>v9.0.3</code></p> <p>Recently, Grafana has been posting this same log message every minute without fail:</p> <pre><code>2022-08-24 15:52:47 logger=context traceID=00000000000000000000000...
Tom Burton
<p>The Grafana Live feature is real-time messaging that uses websockets. It is used in Grafana for notifying on events like someone else is editing the same dashboard as you. It can also be used for streaming data directly to Grafana. <a href="https://grafana.com/docs/grafana/latest/setup-grafana/set-up-grafana-live/" ...
Daniel Lee
<p>I have a demo golang program to list Pods without a particular label. I want to modify it so it also can add a label to each pod.</p> <p>(I'm using the AWS hosted Kubernetes service, EKS so there's some boilerplate code specific to EKS )</p> <pre class="lang-golang prettyprint-override"><code>package main import ...
Tom
<p>I'm hoping there is a more elegant way, but until I learn about it, I managed to add a label to a Pod using <code>Patch</code>. Here is my demo code (again it has some EKS boilerplate stuff you may be able to ignore): </p> <pre class="lang-golang prettyprint-override"><code>package main import ( "fmt" "enc...
Tom
<p>I'm using the Azure AKS addon for HTTP application routing as described <a href="https://learn.microsoft.com/en-us/azure/aks/http-application-routing" rel="noreferrer">here</a>. I deployed it using Terraform and it generally works:</p> <pre><code>resource &quot;kubernetes_ingress&quot; &quot;ingress&quot; { metada...
silent
<p>The following will rewrite the path so that requests for <code>/sample/suffix</code> will be rewritten as <code>/suffix</code>:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: sample-ingress annotations: kubernetes.io/ingress.class: addon-http-application-routing nginx.ingre...
laktak
<p>I've created a label with:</p> <p><code>kubectl label pods &lt;pod id&gt; color=green</code></p> <p>but removing it using:</p> <p><code>kubectl label pods bar -color</code></p> <p>gives:</p> <p><code>unknown shorthand flag: 'c' in -color</code></p> <p>Any suggestions?</p>
Snowcrash
<p>The dash goes at the end of the label name to remove it, per <code>kubectl help label</code>:</p> <pre><code># Update pod 'foo' by removing a label named 'bar' if it exists. # Does not require the --overwrite flag. kubectl label pods foo bar- </code></pre> <p>So try <code>kubectl label pods bar color-</code>.</p>
kevingessner
<p>I have a cluster in GKE and it is working, everything seems to be working. If I forward the ports I am able to see that the containers are working.</p> <p>I am not able to setup a domain I own from namecheap.</p> <p>These are the steps I followed</p> <ol> <li>In Namecheap I setup a custom dns for the domain</li> </o...
agusgambina
<p>GKE should have created a cloud load balancer for your ingress service. Depending on your config, the LB can be internal or external. You can get your LB information by looking at the services:</p> <pre><code>kubectl get svc -n ingress-nginx </code></pre> <p>Create a CNAME record in your DNS (namecheap) with the LB ...
Faheem
<p>Does Kubernetes support connection draining?</p> <p>For example, my deployment rolls out a new version of my web app container. In connection draining mode Kubernetes should spin up a new container from the new image and route all new traffic coming to my service to this new instance. The old instance should remai...
Andriy Kopachevskyy
<p>Kubernetes <strong>does</strong> support connection draining, but how it happens is controlled by the Pods, and is called <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods" rel="noreferrer">graceful termination</a>.</p> <h2>Graceful Termination</h2> <p>Let's take an example of a ...
Kekoa
<p>How do I automatically restart Kubernetes pods and pods associated with deployments when their configmap is changed/updated?</p> <hr> <p>I know there's been talk about the ability to automatically restart pods when a config maps changes but to my knowledge this is not yet available in Kubernetes 1.2. </p> <p>So w...
Johan
<p>The current best solution to this problem (referenced deep in <a href="https://github.com/kubernetes/kubernetes/issues/22368" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/22368</a> linked in the sibling answer) is to use Deployments, and consider your ConfigMaps to be immutable.</p> <p>When you ...
Symmetric
<p>I'm deploying a Spring Boot app in minikube that connects to a database running on the host. Following the 12 factor app recommendations I use environment variables for the necessary configuration:</p> <pre><code>SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver SPRING_DATASOURCE_PASSWORD=... SPRING_DATASO...
Dean Schulze
<p>Following Ansil's comment above I used <code>configmap</code> and <code>secret</code> to pass the configuration like this:</p> <pre><code>kubectl create secret generic springdatasourcepassword --from-literal=SPRING_DATASOURCE_PASSWORD=postgres kubectl create secret generic springdatasourceusername --from-literal=SP...
Dean Schulze
<p>I have a powershell script, that take my variable and deliver it to the my helm upgrade command</p> <pre><code>param ( [Parameter(Mandatory = $false)] $HELM_SET ) helm upgrade --install myrelease -n dev my_service.tgz $HELM_SET </code></pre> <p>My HELM_SET var contains:<br /> <code>--set config.vali=...
Сергей Нешитов
<p><strong>If you're passing <code>$HELM_SET</code> as a <em>single string</em> encoding <em>multiple arguments</em>, you cannot pass it as-is to a command</strong>.</p> <p>Instead, you'll need to parse this string into an <em>array</em> of <em>individual</em> arguments.</p> <p>In the <strong><em>simplest</em> case</s...
mklement0
<p>I'm working on a python script for update the configmaps programmatically.</p> <p>Example script at shown as below. </p> <pre><code>import requests headers = {"Content-Type": "application/json-patch+json"} configData = { "apiVersion": "v1", "kind": "ConfigMap", "data": { "test2.load": "testimtest" }, "metadat...
ColossusMark1
<p>I suggest you use a Kubernetes client library, instead of making the raw HTTP calls yourself. Then you don't need to figure out the low-level connection stuff, as the library will abstract that away for you.</p> <p>I've been using <a href="https://github.com/kelproject/pykube" rel="nofollow noreferrer">Pykube</a>, ...
Symmetric
<p>I have a two node k8s cluster working. I added another node to the cluster and the <code>sudo kubeadm join ...</code> command reported that the node had joined the cluster. The new node is stuck in the NotReady state:</p> <pre><code>kubectl get nodes NAME STATUS ROLES AGE VERSION msi-ubuntu...
Dean Schulze
<p>For anyone else running into this problem, I was finally able to solve this by doing</p> <pre><code>kubectl delete -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml </code></pre> <p>followed by</p> <pre><code>kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml </code></pre> <p>There mus...
Dean Schulze
<p>When I run Kubernetes commands, Powershell is wanting me to use the path to the kubectl.exe instead of just using the command kubectl.</p> <p>I'm told using an Alias would work but I'm not sure how to do that in this case with Powershell and my attempts have come up fruitless.</p> <p>This is what I tried:</p> <p><a ...
burntcookie
<p>Place the following in your <a href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Profiles" rel="nofollow noreferrer"><code>$PROFILE</code></a> file (open it for editing with, e.g., <code>notepad $PROFILE</code>; if it doesn't exist, create it with <code>New-Item -Force $...
mklement0
<p>I have two services running in kubernetes with url say <code>https://service1.abc.cloud.com</code> and <code>https://service2.abc.cloud.com</code>. I have routes defined in Ingress of both the services, for example my swagger path is <code>https://service1.abc.cloud.com/docs</code> and in ingress I have defined /doc...
iAviator
<p>I am putting my best guess here:</p> <blockquote> <p>You are trying to route <code>mynamespace.abc.cloud.com/service1/docs</code> to <code>service1:8082/docs</code>. You are having difficulty to convert the external path <code>/service1/docs</code> to the internal path <code>/docs</code> of service1</p> </blockquote...
Lukman
<p>Can anybody point me to the workflow that I can direct traffic to my domain through Ingress on EKS?</p> <p>I have this:</p> <pre><code>--- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: hello-world labels: app: hello-world annotations: kubernetes.io/ingress.class: nginx ingress.kubernete...
enerudfwqenq
<p>You need to wire up something like <a href="https://github.com/kubernetes-incubator/external-dns" rel="nofollow noreferrer">https://github.com/kubernetes-incubator/external-dns</a> to automatically point DNS names to your cluster's published services' IPs.</p>
AKX
<p>Created an Ingress for my react application hosted in nginx docker container.</p> <p>Ingress config</p> <pre><code>apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: my-ingress labels: helm.sh/chart: home-service app.kubernetes.io/name: home-service app.kubernetes.io/instance: xrayed...
Buba Conteh
<p>Your resources are rendered with the root path <code>/static</code>. That’s a separate HTTP request and will get default backend since it does not satisfy your <code>/pmr</code> path rule. You should use relative paths inside the web app for the reverse proxy to work correctly. For example drop the <code>/</code> ro...
Faheem
<p>I have two Kubernetes clusters in datacenters and I'm looking to create a third in public cloud. Both of my clusters use Azure AD for authentication by way of OIDC. I start my API server with the following: </p> <pre><code>--oidc-issuer-url=https://sts.windows.net/TENAND_ID/ --oidc-client-id=spn:CLIENT_ID --oidc-us...
Daniel Watrous
<p>This is now supported! Check out <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/oidc" rel="nofollow noreferrer">the documentation</a> on how to configure an external OIDC provider.</p>
crb
<p>Could someone help me please and point me what configuration should I be doing for my use-case?</p> <p>I'm building a development k8s cluster and one of the steps is to generate security files (private keys) that are generated in a number of pods during deployment (let's say for a simple setup I have 6 pods that eac...
Sniady
<p>You can create a NFS and have the pods use NFS volume. Here is the manifest file to create such in-cluster NFS server (make sure you modify STORAGE_CLASS and the other variables below):</p> <pre><code>export NFS_NAME=&quot;nfs-share&quot; export NFS_SIZE=&quot;10Gi&quot; export NFS_IMAGE=&quot;itsthenetwork/nfs-serv...
Lukman
<p>I have deployed an application on Kubernetes and exposed with Istio service mesh. There is 2 components in the application, UI and API. I am trying to setup canary based setup to enable AB testing. So, for these 2 components, there is 2 versions (v1 and v2) has deployed, so (min) 4 pods are running.</p> <p>Assume, v...
Ashish Kumar
<p>Have you tried using <code>sourceLabels</code> based <a href="https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPMatchRequest" rel="nofollow noreferrer">routing</a>? For example:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.istio.io/v1alpha3 kind: VirtualSer...
Faheem
<ul> <li>I need to see the logs of all the pods in a deployment with N worker pods</li> <li>When I do <code>kubectl logs deployment/name --tail=0 --follow</code> the command syntax makes me assume that it will tail all pods in the deployment</li> <li>However when I go to process I don't see any output as expected until...
Trevor Boyd Smith
<h3>only one pod seems to be the answer.</h3> <ul> <li>i went here <a href="https://stackoverflow.com/questions/33069736/how-do-i-get-logs-from-all-pods-of-a-kubernetes-replication-controller#comment124606499_56258727">How do I get logs from all pods of a Kubernetes replication controller?</a> and it seems that the com...
Trevor Boyd Smith
<p>We are finding that our Kubernetes cluster tends to have hot-spots where certain nodes get far more instances of our apps than other nodes.</p> <p>In this case, we are deploying lots of instances of Apache Airflow, and some nodes have 3x more web or scheduler components than others.</p> <p>Is it possible to use anti...
John Humphreys
<p>Try adding this to the Deployment/StatefulSet <code>.spec.template</code>:</p> <pre><code> affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: ...
Lukman
<p>I have two services in kubernetes sharing the same namespace.</p> <p>I am trying to connect to <code>service B</code> from inside a pod that is associated with <code>service A</code>.</p> <p>I exec into the pod that is associated with <code>service A</code> then try to send <code>curl</code> request to <code>service...
bakadevops
<p>Here are some debugging tips:</p> <ol> <li>If running on multiple nodes, please make sure nodes can talk to each other.</li> <li>Check if <code>coredns</code> pod on <code>master</code> is running and is healthy. See logs for any issues.</li> <li>Run a test pod in the cluster and see if you can resolve internet doma...
Faheem
<p>I configured kubernetes cluster with one master and one node, the machines that run master and node aren't in the same network. For networking I installed calico and all the pods are running. For testing the cluster I used <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-containe...
Dorin
<p>I had this issue too. Don't know if you're on Azure, but I am, and I solved this by deleting the tunnelfront pod and letting Kubernetes restart it:</p> <pre><code>kubectl -n kube-system delete po -l component=tunnel </code></pre> <p>which is a solution I got from <a href="https://github.com/Azure/AKS/issues/232#i...
Lee Richardson
<p>I'm trying to set up an Ingress rule for a service (Kibana) running in my microk8s cluster but I'm having some problems.</p> <p>The first rule set up is</p> <pre><code>Name: web-ingress Namespace: default Address: 127.0.0.1 Default backend: default-http-backend:80 (&lt;error: endpoints &...
lovrodoe
<p>Add the following annotation to the <code>kibana</code> ingress so that nginx-ingress interprets the <code>/kibana(/|$)(.*)</code> path using regex:</p> <pre><code> nginx.ingress.kubernetes.io/use-regex: &quot;true&quot; </code></pre> <p>Additional detail: To let kibana know that it runs on <code>/kibana</code> path...
Lukman
<p>I'm creating a plain vanilla AKS cluster with an ACR container registry and deploying a dummy service, something I've done a number of times before and should work but it's not - the service deploys without errors, I see the pod and the service are alive, the ports seem to match - but I fail to reach the app running...
Vroomfundel
<p>You have the wrong label applied. Service is looking for <code>app: dummyapp-prep</code> while the pod and deployment have <code>run: dummyapp-prep</code>. Notice <code>run</code> vs <code>app</code> label names.</p> <p>You can also check if the service is bound by checking the endpoint object the API server creates...
Faheem
<p>How can I schedule a Kubernetes <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/" rel="nofollow noreferrer">cron job</a> to run at a specific time and just once?</p> <p>(Or alternatively, a Kubernetes job which is not scheduled to run right away, but delayed for some amount of time – wha...
malthe
<p>You can always put specific minute, hour, day, month in the schedule cron expression, for example 12:15am on 25th of December:</p> <pre><code>apiVersion: batch/v1 kind: CronJob metadata: name: hello spec: schedule: &quot;15 0 25 12 *&quot; jobTemplate: spec: template: spec: containe...
Lukman
<p>I have a scaler service that was working fine, until my recent kubernetes version upgrade. Now I keep getting the following error. (some info redacted)</p> <p><code>Error from server (Forbidden): deployments.extensions "redacted" is forbidden: User "system:serviceaccount:namesspace:saname" cannot get resource "depl...
ravi kiran mahankali
<p>scale is a subresource, not a verb. Include "deployments/scale" in the resources list. </p>
Jordan Liggitt
<p>If I perform the following command it looks in &quot;https://github.com/grafana/&quot; instead of the one I specified - &quot;https://grafana.github.io/helm-charts&quot;</p> <p>Here is what I run and the results:</p> <pre><code>helm3 upgrade --install grafana grafana --dry-run --repo https://grafana.github.io/helm-c...
ErnieAndBert
<p>I executed your Helm command but with <code>--debug</code> flag to get this error:</p> <pre><code>helm upgrade --install grafana grafana --dry-run --repo https://grafana.github.io/helm-charts --wait --debug history.go:56: [debug] getting history for release grafana Release &quot;grafana&quot; does not exist. Install...
Lukman
<p>I am using helm/k8s to deploy a third party (<a href="https://prisma.io" rel="nofollow noreferrer">prisma</a>) container. The container expects a environment variable in the shape of yaml similar to </p> <pre><code>port: 4466 managementApiSecret: $PRISMA_SECRET databases: ...
BBS
<p>From the envvar doc: <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.12/#envvar-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.12/#envvar-v1-core</a></p> <blockquote> <p>Variable references $(VAR_NAME) are expanded using the previous d...
Jordan Liggitt
<p>I am trying to install Operator Lifecycle Manager (OLM) — a tool to help manage the Operators running on your cluster — from the <a href="https://operatorhub.io/operator/gitlab-runner-operator" rel="nofollow noreferrer">official documentation</a>, but I keep getting the error below. What could possibly be wrong?</p>...
Frederico23
<p><strong>Using PowerShell <em>on Windows</em></strong>, <strong>you must explicitly ensure that the stdout lines emitted by <code>curl.exe</code> are separated with Unix-format LF-only newlines, <code>\n</code>, <em>when PowerShell passes them on to <code>bash</code></em></strong>, given that <code>bash</code>, like ...
mklement0
<p>I am running kubectl version 1.7</p> <p>I am trying to add an init container to my deployment via <code>kubectl patch</code> but no matter how I try it it simply returns "not patched". </p> <p><code>kubectl patch deployment my-deployment --patch "$(cat ./init-patch.yaml)"</code> <strong>deployment "my-deployment" ...
Aliisa Roe
<p>Kubectl is not idempotent. If the element to be patched already contains the patch, kubectl patch fails. </p> <p>The solution can be read in Natim's comment, but it took me a while to realise that was indeed my problem.</p>
Gonfva
<p>I have a React app that I want to pull data from a springboot endpoint on load. If I run it locally (via intellij and webstorm) it loads and I see my page render. It looks like this:</p> <p><a href="https://i.stack.imgur.com/b9NQq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b9NQq.png" alt="ent...
Damisco
<p>Your browser won't be able to resolve <code>http://bootdemo:8080/</code> because <code>bootdemo</code> is only resolvable by pods running inside the same namespace.</p> <p>You see, even if you run Kubernetes cluster on your local machine via Docker Desktop, the cluster and your local machine are effectively isolated...
Lukman
<p>Hello I try to have a Pod with 2 container, one a c++ app, one a mysql database. I used to have the mysql deployed in its own service, but i got latency issue. So i want to try multi-container pod.</p> <p>But i've been struggling to connect my app with the mysql through localhost. It says..</p> <blockquote> <p>C...
Hana Alaydrus
<p>Your MySQL client is configured to use a socket and not talk over the network stack, cf. the <a href="https://dev.mysql.com/doc/refman/5.5/en/connecting.html" rel="nofollow noreferrer">MySQL documentation</a>:</p> <blockquote> <p>On Unix, MySQL programs treat the host name localhost specially, in a way that is ...
Christoffer Soop
<p>I created ingress resource but it is not working. Please note - I have not deployed the ingress controller using gke default ( is this mandatory to deploy ingress controller in managed gke )</p> <h1>I have created two nginx deployment and nodeport service respectively here is kubectl get all</h1> <pre><code>NAME ...
Kiran Patil
<p>I am assuming your applications are listening to <code>/</code> and not <code>/app1</code> or <code>/app2</code> paths. That would explain why the single backend is working. There <a href="https://github.com/kubernetes/ingress-gce/issues/109" rel="nofollow noreferrer">seems</a> to be a limitation in <code>gce-ingres...
Faheem
<p>I have deployed on prod 10+ java/js microservices in GKE, all is good, none use external volumes, its a simple process in pipeline of generating new image, pushing to container registry and when upgrading the app to new version, just deploy new deployment with the new image and pods using rolling update are upgraded...
potatopotato
<p>I would probably generate an image with the compiled code, and possibly a post-dump image, then rely on Kubernetes to restart pods in your Deployment or StatefulSet in a sensible way. If necessary (and web-based), use Readiness checks to gate what pods will be receiving requests.</p> <p>As an aside, the projected co...
Vatine