prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I've a custom operator that listens to changes in a CRD I've defined in a Kubernetes cluster.</p> <p>Whenever something changed in the defined custom resource, the custom operator would reconcile and idempotently create a secret (that would be owned by the custom resource).</p> <hr /> <p><strong>What I expect is for...
<p>This would require more info on how your controller is set up. For example what is the sync period you have set. This could be due to default sync period set which reconciles all the objects at given interval of time.</p> <blockquote> <p>SyncPeriod determines the minimum frequency at which watched resources are reco...
<p>I would like to write a small programm similar to <code>kubectl explain</code>.</p> <p>I use the python client.</p> <p>With <code>kubectl explain pods -v=8</code> I see which APIs get called.</p> <p>The URL is <code>/openapi/v2</code></p> <p>I tried this:</p> <pre><code>from kubernetes import client, config # Confi...
<p>You're already getting the data, it's just that some error occurs while processing it :) To turn off post-processing, you need to pass the _preload_content=False argument to call_api<br /> Then the code will look something like this:</p> <pre><code>import json from kubernetes import client, config # Configs can be ...
<p>I understand that, in Cloud scenarios, a LoadBalancer resource refers to and provisions an external layer 4 load balancer. There is some proprietary integration by which the cluster configures this load balancing. OK.</p> <p>On-prem we have no such integration so we create our own load balancer outside of the cluste...
<p>As pointed out in the comments a kubernetes service of type LoadBalancer can not be used by default with on-prem setups. You can use <a href="https://metallb.universe.tf/" rel="nofollow noreferrer">metallb</a> to setup a service of that type in an on prem environment.</p> <blockquote> <p>Kubernetes does not offer an...
<p>Trying to keep track of memory usage for a pod in k8s. Does the metric kubernetes.pod.memory.usage counts cached/buffer size? If yes, which metric should I use to keep track of actual memory usage</p>
<ol> <li>Does the metric kubernetes.pod.memory.usage counts cached/buffer size? The answer is <strong>Yes</strong>.</li> </ol> <p><a href="https://i.stack.imgur.com/VHTHE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VHTHE.png" alt="enter image description here" /></a></p> <ol start="2"> <li>Which ...
<p>I am trying to start up a couple of containers locally using k8s but container creation is stopped cause of <strong>ImagePullBackOff</strong>, <strong>ErrImagePull</strong>. The yaml is fine, tested it on another workstation. And i can pull images using regular docker. But it fails in k8s/minikube environment</p> <p...
<p>Based on the comments, my suggestion is to use the docker driver, since Docker has been installed in the system and is the <a href="https://minikube.sigs.k8s.io/docs/drivers/" rel="nofollow noreferrer">preferred stable driver</a>.</p> <pre class="lang-sh prettyprint-override"><code>minikube start --driver=docker </c...
<p>I have a pod that I can see on GKE. But if I try to delete them, I got the error:</p> <pre><code>kubectl delete pod my-pod --namespace=kube-system --context=cluster-1 </code></pre> <blockquote> <p>Error from server (NotFound): pods &quot;my-pod&quot; not found</p> </blockquote> <p>However, if I try to patch it, the...
<pre><code>kubectl patch deployment my-pod --namespace kube-system -p &quot;{\&quot;spec\&quot;:{\&quot;template\&quot;:{\&quot;metadata\&quot;:{\&quot;annotations\&quot;:{\&quot;secrets-update\&quot;:\&quot;`date +'%s'`\&quot;}}}}}&quot; --context=cluster-1 </code></pre> <p>You are patching the <strong>deployment</str...
<p>I have a war file that I deployed with Tomcat.<br /> I have a Dockerfile and at the end I build a kubernetes pod.</p> <p>The problem is that if my property files from my app do exist in the path: <code>/usr/local/tomcat/webapps/myapp/WEB-INF/classes/config/</code> and not in path <code>/usr/local/tomcat/webapps/myap...
<p>As <a href="https://stackoverflow.com/a/2161583/6309">mentioned here</a>:</p> <blockquote> <p><code>foo.properties</code> is supposed to be placed in one of the roots which are covered by the default classpath of a webapp, e.g. webapp's <code>/WEB-INF/lib</code> and /WEB-INF/classes, server's /lib, or JDK/JRE's /lib...
<p>I am trying to patch a secret using kubectl</p> <pre><code>kubectl patch secret operator-secrets --namespace kube-system --context=cluster1 --patch &quot;'{\&quot;data\&quot;: {\&quot;FOOBAR\&quot;: \&quot;$FOOBAR\&quot;}}'&quot; </code></pre> <p>But I receive the error</p> <blockquote> <p>Error from server (BadRequ...
<blockquote> <p>If I run the command using echo, it seems to be a valid JSON</p> </blockquote> <p>In fact, it does not. Look carefully at the first character of the output:</p> <pre><code>'{&quot;data&quot;: {&quot;FOOBAR&quot;: &quot;value that I want&quot;}}' </code></pre> <p>Your &quot;JSON&quot; string starts with ...
<p>I have a container with a dotnet core application running in Azure Kubernetes Service. No memory limits were specified in Pod specs.</p> <p>The question is why GC.GetTotalMemory(false) shows approx. 3 Gb of memory used while AKS Insights shows 9.5 GB for this Pod container?</p> <p><a href="https://i.stack.imgur.com/...
<p>As I understand <code>GC.GetTotalMemory(false)</code> returns the size of managed objects in bytes but the entire working memory set is much larger because memory is allocated in pages and because of managed heap fragmentation and because GC is not performed.</p>
<p>I have some images on my local docker instance, one of which is named <code>door_controls</code>:</p> <pre><code>&gt;docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE door_controls latest d22f58cdc9c1 3 hours ago 1.12GB [...] </code></pre> <p>This imag...
<p>Minikube comes with its own docker daemon and not able to find images by default, the below works in my local env, i noticed the first step is already done and looks like the the image is still being pulled, step-2 might solve the problem below.</p> <ol> <li>Set the environment variables with eval $(minikube docker-...
<p>On my PC I have multiple network interfaces:</p> <ol> <li><code>lo 127.0.0.1</code> - loopback interface</li> <li><code>enp2s0 192.168.1.244</code> - main interface</li> <li><code>lo:40 192.168.40.1</code> - a virtual loopback device</li> <li>others are irrelevant</li> </ol> <p>I am running apache on both the main...
<p>k3s by default binds to first public system interface.<br /> To overwrite this behavior you need to provide <code>--node-ip=&lt;listen-ip&gt;</code> parameter to the server process.</p> <p>Since there is no configuration (neither internal nor exteral) that allows to set that parameter, the only way of setting it is ...
<p>I have Windows 11 Home (which does not allow Hyper-V, only Pro edition does). Installed WSL2 and Docker Desktop.</p> <p>Installed Minikube using Chocolatey but it refused to start. Searching on SO, I found this advice in several posts, but it failed to work.</p> <pre><code>PS C:\WINDOWS\system32&gt; docker system pr...
<p>I thought of trying to have <em>Docker Desktop</em> already running <strong>before</strong> I start minikube.</p> <p>From the Windows Start menu, I ran <em>Docker Desktop in Administrator mode</em>.</p> <p>Now I ran the command again to remove old stuff,</p> <pre><code>PS C:\WINDOWS\system32&gt; minikube delete * Re...
<p>I've been reading about the Kubernetes imagePullPolicy attribute when set to 'always', and it seems like something has changed:</p> <p>Up through <a href="https://v1-21.docs.kubernetes.io/docs/concepts/containers/images/" rel="nofollow noreferrer">version 1.21 of the documentation</a>, it said the following:</p> <p>...
<p>I think this change tends to save network bandwidth rather than changing the behaviour. In <code>1.21</code> or earlier versions, k8s is Always trying to pull the image all over again without checking some image layers exists on the node or not. In the new version, k8s will check the image layers and if they exist, ...
<p>I am using the opentelemetry-ruby otlp exporter for auto instrumentation: <a href="https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp" rel="nofollow noreferrer">https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlp</a></p> <p>The otel collector was installed as a daem...
<p>The problem is with this setting:</p> <pre><code>OTEL_EXPORTER_OTLP_ENDPOINT=http://0.0.0.0:4318 </code></pre> <p>Imagine your pod as a stripped out host itself. Localhost or 0.0.0.0 of your pod, and you don't have a collector deployed in your pod.</p> <p>You need to use the address from your collector. I've checked...
<p>I am trying to deploy a keycloak server with a postgres database attached using the <a href="https://artifacthub.io/packages/helm/bitnami/keycloak" rel="nofollow noreferrer">bitnami helm chart</a> configured as follows with flux.</p> <pre><code>apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: ...
<p>My first guess is that the resource limits might be too restrictive. At least memory should be more.</p> <pre class="lang-yaml prettyprint-override"><code>resources: limits: memory: 256Mi cpu: 250m requests: memory: 256Mi cpu: 250m </code></pre>
<p>I'm attempting to mount a filepath into my datadog agent container, which is being provisioned into a kubernetes cluster via <a href="https://artifacthub.io/packages/helm/datadog/datadog" rel="nofollow noreferrer">Datadog Helm Chart.</a></p> <p>I'm using <code>agents.volumes</code> value to pass in. which the docs d...
<p>I see that value is only used to declare the volumes on the DaemonSet pod definition, not to mount them.</p> <p><code>agents.volumes</code> is for defining custom volumes on the agent but this is used on the DaemonSet definition, specifically on <code>spec.template.spec.volumes</code> <a href="https://github.com/Dat...
<p>I have an openshift namespace (<code>SomeNamespace</code>), in that namespace I have several pods.</p> <p>I have a route associated with that namespace (<code>SomeRoute</code>).</p> <p>In one of pods I have my spring application. It has REST controllers.</p> <p>I want to send message to that REST controller, how can...
<p><strong>Routes</strong> are an <strong>OpenShift-specific</strong> way of exposing a Service outside the cluster. But, if you are developing an app that will be deployed onto <strong>OpenShift and Kubernetes</strong>, then you should use <strong>Kubernetes Ingress</strong> objects.</p> <p>Using Ingress means that yo...
<p>I am new to Kubernetes and have been stuck at one point.</p> <p>Lets say, I have multiple pods and I have some tasks running. Suddenly when pods stops due to whatever reason, I save the state of the task in some database (terminated but not completed) by catching SIGTERM signal or using terminationGracePeriod. So as...
<p>Store the state of the task in a database, and when the pod terminates, you update the state to 'terminated'. Then when pods start up again, query for tasks that have been 'terminated' and need to be continued. Grab a random ID for one of these tasks, and perform an UPDATE transaction to update the status to 'runnin...
<p>I would like to use <code>kubectl</code> to print out all key-value pairs in my Secrets. I cannot figure out how to do this in one line with the <code>-o --jsonpath</code> flag or by piping into <code>jq</code>. I could certainly make a script to do this but I feel there must be a better way, given that the kubernet...
<p>I read this question as asking for how to decode <em>all secrets</em> in one go. I built on the accepted answer to produce a one-liner to do this:</p> <pre><code>kubectl get secrets -o json | jq '.items[] | {name: .metadata.name,data: .data|map_values(@base64d)}' </code></pre> <p>This has the added benefit of listi...
<p>I am trying to create a Keycloak deployment having its configuration imported from a local file located at <code>./import/realm.json</code>.</p> <p>Folder structure:</p> <ul> <li><code>keycloak-deploy.yml</code></li> <li><code>import/realm.json</code></li> </ul> <p>However, when applying the deployment I get this er...
<p>I followed what was said in the comments (thanks @Andrew Skorkin). It worked like this:</p> <ul> <li>deployment &amp; service:</li> </ul> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: keycloak-deployment name: keycloak-deployment spec: replicas: 1 select...
<p>I have deployed a pod in kubernetes cluster that run a python script.</p> <p>The problem is i want to force the k8s to stop the container after the script complete his job and not to re-create another pod.</p> <p>To be aware that i have tried to use kind:job but it doesn't fulfill my need.</p> <p>I tried two types o...
<p>I have posted community wiki answer to summarise the topic.</p> <p>User <a href="https://stackoverflow.com/users/213269/jonas" title="108,324 reputation">Jonas</a> has posted great suggestions:</p> <blockquote> <p>A kind <code>Job</code> does exactly this. Use <code>Job</code> and your problem is solved.</p> </block...
<p>I am trying to access a simple minikube cluster from the browser, but I keep getting the following: <code>❗ Because you are using a Docker driver on windows, the terminal needs to be open to run it.</code></p> <p>I've created an external service for the cluster with the port number of 30384, and I'm running minikub...
<p>You can get this working by using kubectl's port forwarding capability. For example, if you are running <code>hello-node</code> service:</p> <p><code>kubectl port-forward svc/hello-node 27017:27017</code></p> <p>This would expose the service on <code>localhost:27017</code></p> <p>You can also mention your pod instea...
<p>I have a Spring batch 2.1.x application deployed on Azure Kubernetes. Base image is Ubuntu 18.04. I see that the process is getting killed at times.</p> <p><strong>Process flow:</strong></p> <ol> <li>kubectl command line command to start the bash script</li> <li>bash script to start the spring batch</li> <li>spring ...
<p>It's perfectly normal in a Kubernetes environment that pods are shutdown sometimes and that replacement pods are scheduled on another worker node. This happens all the time due to node maintenance or to balance the workload. You can read more about this in the <a href="https://kubernetes.io/docs/concepts/workloads/p...
<p>I need to service gitlab, nexus and jupyterhub based on URL using one open port using k8s ingress.</p> <p>If the path is written as &quot;/&quot; when create ingress, it works normally, but if you write &quot;/nexus&quot; like this, a problem occurs during the redirection process.</p> <p>Have any of you solved the s...
<p>That's a problem with nexus itself. Your ingress works as intended, and you cannot do more from this side.</p> <p>The problem here is that nexus webpage, i.e. index.html, requests resources in such a way that it's looking at the wrong place. You can see this by opening the network tab and inspecting the request URL ...
<p>I am trying to create a GitHub actions self-host runner in GKE. For the I created the Docker with Ubuntu base image and downloaded the GitHub runner code.</p> <pre class="lang-sh prettyprint-override"><code>curl -o actions-runner-linux-x64-2.288.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.288....
<p>As I mentioned earlier I am using Istio, After whitelisting the below URL in Istio. My issue got resolved and I am able to create a runner in the Kubernetes cluster.</p> <p>api.github.com</p> <p>raw.githubusercontent.com</p> <p>oauth2.googleapis.com</p>
<p>I'm trying to understand how traffic can be routed to a pod that has begun shutdown process.</p> <p>In Spring Boot docs it is mentioned that</p> <blockquote> <p>Once the pre-stop hook has completed, SIGTERM will be sent to the container and graceful shutdown will begin, allowing any remaining in-flight requests to c...
<p>It happens in the following order:</p> <ol> <li>Count down for termination grace period starts</li> <li>Pre stop hook starts executing</li> <li>Pre stop hooks finished</li> <li>SIGTERM is issued to the container, Spring Boot starts shutting down (possible waiting if graceful shutdown is configured)</li> </ol> <p>If ...
<p>Good afternoon, colleagues. Please tell me. I set up the k8s+vault integration according to the instructions: <a href="https://www.hashicorp.com/blog/injecting-vault-secrets-into-kubernetes-pods-via-a-sidecar" rel="nofollow noreferrer">https://www.hashicorp.com/blog/injecting-vault-secrets-into-kubernetes-pods-via-a...
<p>It's possible what needs to be done:</p> <pre><code>helm install vault hashicorp/vault \ --set &quot;injector.externalVaultAddr=http://external-vault:8200&quot; --set &quot;authPath=auth/kubernetesnew&quot; vault auth enable -path kubernetesnew kubernetes .. vault write auth/kubernetesnew/role/k8s-name-role \ ...
<p>When logged into gitlab using the oauth2 provider keycloak and trying to log out, Gitlab redirects to the sign_in page, but doesn't end out session on Keycloak, so we are logged in again.</p> <p>These are the environment variables used in gitlab kubernetes deployment:</p> <pre><code>- name: OAUTH2_GENERIC_APP_ID v...
<p>To be perfectly clear: the expectation is that you should be signed out of GitLabn, not necessarily keycloak altogether. This is happening correctly since you see the sign-in page after signing out. For example, if you sign into GitLab using Google and sign out of GitLab, you should only be signed out of GitLab, not...
<p>I am recording and monitoring SLOs (server-side request duration) of Kubernetes Pods via Prometheus using a <a href="https://godoc.org/github.com/prometheus/client_golang/prometheus#HistogramVec" rel="nofollow noreferrer">HistogramVec</a> within a Golang HTTP server. Every request’s duration is timed and persisted a...
<p>The solution is to use <a href="https://docs.victoriametrics.com/MetricsQL.html#last_over_time" rel="nofollow noreferrer">last_over_time()</a> function. For example, the following query returns the last values seen during the last hour per each histogram bucket:</p> <pre><code>last_over_time(http_request_duration_mi...
<p>I want to update my pod because there is a new image uploaded to docker registry with <code>latest</code> tag.</p> <p>I am currently doing this:</p> <pre><code>kubectl delete -f deployment.yaml kubectl apply -f deployment.yaml </code></pre> <p>If I do:</p> <pre><code>kubectl apply -f deployment.yaml </code></pre> <p...
<p>You can just delete the POD once and restart the POD so it will change the image and pull new version from docker registry.</p> <p>However, make sure <code>imagePullPolicy</code> set to <strong>always</strong> in your <code>deployment.yaml</code></p> <p>Or else you need to update one minor field into <code>deploymen...
<p>I've been trying to run few services in AWS EKS Cluster. I followed the ingress-nginx guide to get https with AWS ACM certificate</p> <blockquote> <p><a href="https://kubernetes.github.io/ingress-nginx/deploy/#aws" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#aws</a></p> </blockquote> <p>Used ...
<p>You seems to be missing</p> <pre><code>nginx.org/websocket-services </code></pre> <p>annotation</p> <p>It's value should be a value of kubernetes service name. See <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-annotations/" rel="nofollow norefer...
<p>How can I check if some namespace is missing quota?</p> <p>I expected the <code>absent()</code> function to return 1 when something doesn't exist and 0 when something exists. So I tried to do the next query:</p> <pre class="lang-yaml prettyprint-override"><code>absent(kube_namespace_labels) * on(namespace) group(kub...
<p>You can use a different query instead to have all namespaces where <code>resourcequota</code> is missing:</p> <pre><code>count by (namespace)(kube_namespace_labels) unless sum by (namespace)(kube_resourcequota) </code></pre>
<p>I am doing an exercise from KodeKoud which provide the CKAD certification training.</p> <p>The exercise has a <code>my-kube-config.yml</code> file located under <code>root/</code>. The file content is below:</p> <p>(I ommited some unrelated parts)</p> <pre><code>apiVersion: v1 kind: Config clusters: - name: product...
<p>Your initial idea was correct. You would need to change the context to <code>research</code> which can be done using</p> <blockquote> <p>kubectl config use-context research</p> </blockquote> <p>But the command would not be applied to the correct config in this instance. You can see the difference by checking the cur...
<p>When I run the command</p> <pre><code>kubectl create -f .k8s/deployment.yaml --context=cluster-1 </code></pre> <p>I get the error</p> <blockquote> <p>error: error validating &quot;.k8s/deployment.yaml&quot;: error validating data: ValidationError(Deployment.spec.template.spec.containers[0]): unknown field &quot;volu...
<p><code>...unknown field &quot;volumes&quot; in io.k8s.api.core.v1.Container</code></p> <p>Your <code>volumes</code> section is placed wrongly. Try:</p> <pre><code>apiVersion: apps/v1 kind: Deployment spec: ... template: ... spec: containers: - name: ... ... volumes: &lt;-- shoul...
<p>I just want to check my understanding of a microservice architecture.</p> <p>I have 5 different apps that I'm building and running in their own Dockerfile. Each docker file first builds that app before pulling the Apache httpd image and moving the built files over to its server.</p> <p>This means that all 5 apps hav...
<p>Yes it is normal, each microservice should have its own web server, so that they run in isolation and can be scaled individually.</p>
<p>I have successfully installed <code>external-dns</code> in my Kubernetes cluster following the official steps on <a href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md" rel="nofollow noreferrer">github</a>, it creates a Route53 record and I am able to access it correctly. I instal...
<p>The answer is no, you don't need to deploy it more than once. If you don't specify a namespace in the args section of your external-dns deployment using <code>--namespace=</code>, it works for all of the namespaces in the cluster. <a href="https://i.stack.imgur.com/imchR.png" rel="nofollow noreferrer"><img src="http...
<p>I want to deploy Application Load Balancer for Traefik running in Kubernetes. So, I tried the following:</p> <pre><code>kind: Service apiVersion: v1 metadata: name: traefik-application-elb namespace: kube-system annotations: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: &quot;tcp&quot; ...
<p>From the docs: <a href="https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html</a></p> <blockquote> <p>When you create a Kubernetes Service of type LoadBalancer, the AWS cloud provider load b...
<p>I am trying to map a configMap in JSON format to my docker image in Kubernetes I am using config npm package to fetch the configurations.</p> <p>The idea is that I will have a file development.json in /config directory from there the config package will pick it up. This all works in localhost. The name of the config...
<p>Usually, when the configmap cannot be mounted, the pod will not even start. So the fact that it started, shows that its mounted.</p> <p>In any case, your volumeMounts looks problematic.</p> <pre><code>volumeMounts: - name: config-volume mountPath: /config/development.json </code></pre> <p>This lead to the full...
<p>I'm trying to find some sort of signal from a cluster indicating that there has been some sort of change with a Kubernetes cluster. I'm looking for any change that could cause issues with software running on that cluster such as Kubernetes version change, infra/distro/layout change, etc.</p> <p>The only signal that...
<p>From a pure Kubernetes perspective, I think the best you can do is monitor Node events (such as drain, reboot, etc) and then check to see of the version of the node has actually changed. You may also be able to watch Node resources and check to see if the version has changed as well.</p> <p>For GKE specifically, yo...
<p>I am using docker to run my java war application and when I run the container I got this exception <strong>java.net.BindException: Address already in use</strong> .</p> <p>The container expose port 8085 (8080-&gt;8085/tcp) I executed this command to run the docker container :</p> <blockquote> <p>docker run -p 8080:8...
<p>The <code>ps</code> shows <em>two</em> java processes, possibly running Tomcat.</p> <p>Since they would be running with the same parameters, including ports, it seems expected the second process fails with</p> <pre><code>java.net.BindException: Address already in use </code></pre> <p>Make sure to <code>docker stop</...
<p>I have a strange case. Context:</p> <p>At the very first, the client was using our domain for their store, the URL was something like <code>somestore.eu.mycompany.com</code></p> <p>Then, the client upgraded to a custom domain, other clients did this without any problem.</p> <p>We deleted the whole namespace with the...
<ol> <li>make sure you have the correct configmaps, secrets or other configuration in your cluster (E.g. where SSL certs are stored). The desired config must be present, the deprecated must be dumped.</li> <li>perform a rollout restart on your deployment. ( E.g. if <code>nginx-ingress</code> is the name of the deployme...
<p>My nginx-ingress-controller is in the <code>ingress-nginx</code> namespace and I've set the large-client-header-buffers to <code>4 16k</code>, <code>4 32k</code> etc.</p> <pre><code>kind: ConfigMap apiVersion: v1 metadata: name: nginx-configuration namespace: ingress-nginx data: proxy-buffer-size: "16k" l...
<p>There is <a href="https://github.com/kubernetes/ingress-nginx/issues/319" rel="nofollow noreferrer">dedicated topic on github</a> about the problem. You can find there possible solutions. This problem should be completely removed based on <a href="https://github.com/helm/charts/issues/20901" rel="nofollow noreferrer...
<p>aws-load-balancer-scheme: internal does not create an NLB, no error, it just never creates the NLB</p> <p>If I use the deprecated service.beta.kubernetes.io/aws-load-balancer-internal: &quot;true&quot;, it works fine.</p> <p>However, the annotation documentation says to use scheme instead.</p> <p>Here is my full cod...
<p>You need to use load balancer type <code>external</code> along with <code>internal</code> scheme as shown below:</p> <pre><code>service.beta.kubernetes.io/aws-load-balancer-type: external service.beta.kubernetes.io/aws-load-balancer-scheme: internal </code></pre> <p>For details, please refer to <a href="https://kube...
<p>In the Kubernetes docs, in the <a href="https://kubernetes.io/docs/concepts/configuration/overview/#using-labels" rel="nofollow noreferrer">Using Labels</a> section it says:</p> <blockquote> <p>A Service can be made to span multiple Deployments by omitting release-specific labels from its selector. When you need to ...
<p>A service points to a set of endpoints (pods) determined by its label selector.</p> <p>Let's take an example of a service that has the label selector</p> <pre class="lang-yaml prettyprint-override"><code>app: api version: v1 </code></pre> <p>It will point to all pods that have these two labels (may have more).</p> <...
<p>I'm trying to find some sort of signal from a cluster indicating that there has been some sort of change with a Kubernetes cluster. I'm looking for any change that could cause issues with software running on that cluster such as Kubernetes version change, infra/distro/layout change, etc.</p> <p>The only signal that...
<p>In addition to watching Node events (see the complete list of events <a href="https://github.com/kubernetes/kubernetes/blob/7380fc735aca591325ae1fabf8dab194b40367de/pkg/kubelet/events/event.go#L50" rel="nofollow noreferrer">here</a>), you can use Kubernetes' <strong>Node Problem Detector</strong> for monitoring and ...
<p>I want to monitor disk usages of persistent volumes in the cluster. I am using <a href="https://github.com/coreos/kube-prometheus" rel="noreferrer">CoreOS Kube Prometheus</a>. A dashboard is trying to query with a metric called <strong>kubelet_volume_stats_capacity_bytes</strong> which is not available anymore with...
<p>Per-PVC disk space usage in percentage can be determined with the following query:</p> <pre><code>100 * sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim) / sum(kubelet_volume_stats_capacity_bytes) by (persistentvolumeclaim) </code></pre> <p>The <code>kubelet_volume_stats_used_bytes</code> metric show...
<p>I have roughly 20 cronjobs in Kubernetes that handle various tasks at specific time intervals. Currently there's a fair bit of overlap causing usage of resources to spike, opposed to the usage graph being more flat.</p> <p>Below is a rough example of one of my cronjobs:</p> <pre class="lang-yaml prettyprint-override...
<p><strong>Posting my comment as the answer for better visibility.</strong></p> <p>As far as I understood, all your jobs are configured separately, you can set specific schedule for each of them, e.g. for job 1 that starts at 12:00 with next run at 12:20 it can set up like this:</p> <pre><code>spec: schedule: &quot;0...
<p>I have a Helm Chart that looks like this:</p> <pre><code>apiVersion: v1 name: my-app version: 1.0-123.4b3k32 </code></pre> <p>I am trying to use helm template (or lint, it doesn't matter, they both throw the same error). With helm2 this wasn't a problem, but with helm3, it is complaining that</p> <pre><code>Error: v...
<p>The <a href="https://docs.helm.sh/docs/topics/charts/#charts-and-versioning" rel="nofollow noreferrer">Chart.yaml <code>version:</code> field</a> is specified to be a <a href="https://semver.org" rel="nofollow noreferrer">semantic version</a>; quoting the Helm documentation, &quot;non-SemVer names are explicitly dis...
<p>If a Deployment uses ReplicaSets to scale Pods up and down, and StatefulSets don't have ReplicaSets...</p> <p>So, how does it manage to scale Pods up and down? I mean, what resource is responsible? What requests does a StatefulSet make in order to scale?</p>
<p>In short StatefulSet Controller handles statefulset replicas.</p> <p>A StatefulSet is a Kubernetes API object for managing stateful application workloads. StatefulSets handle the deployment and scaling of sets of Kubernetes pods, providing guarantees about their uniqueness and ordering.</p> <p>Similar to deployments...
<p>hope you are doing fine,</p> <p>i got that error :error:</p> <p><code>error converting YAML to JSON: yaml: line 33: found character that cannot start any token</code></p> <p>while trying to deploy this cronjob on my k8s cluster, can you please check and let me know if you have any clues about the reason of having t...
<p>The problem could be from your indentation method, Try using spaces and not tabs for your indentation. Use 2 spaces for each indentation. Hope this helps.</p>
<p>I need to service gitlab, nexus and jupyterhub based on URL using one open port using k8s ingress.</p> <p>If the path is written as &quot;/&quot; when create ingress, it works normally, but if you write &quot;/nexus&quot; like this, a problem occurs during the redirection process.</p> <p>Have any of you solved the s...
<p>I solve this problem by myself</p> <ol> <li>I edited my pc hosts file</li> </ol> <pre><code>172.30.1.87 nexus.k8s.io 172.30.1.87 gitlab.k8s.io </code></pre> <ol start="2"> <li>I edited each Ingress in same service namespace</li> </ol> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annota...
<p>I have few consumers which updates their local cache on reading a message from the kinesis queue. But this leads to inconsistency as message is only processed by only one among all the replicas and any information retrieved from other replicas gives us invalid cache.</p> <p>How can i make sure i clear the cache amon...
<p>The library that you're using assigns consumers to shards, so any message that you put on the stream will only go to one consumer.</p> <p>The best solution would be to send your invalidation message out-of-band, using another Kinesis stream (or alternative such as SNS). This would add complexity to your listener, a...
<p>I'm very new to Istio and not a Kubernete's expert, though I have used the latter. I respectfully ask for your understanding and a bit more details than you might normally include.</p> <p>For simplicity, say I have two services, both Java/SpringBoot. Service A listens to requests from the outside world, Service B li...
<p>If the scalable service is returning <code>503</code>, it makes sense to add a virtual service just like the blog example for <code>serviceB</code> and make <code>serviceA</code> connect to <code>virtualServiceB</code> which will do the retries to <code>ServiceB</code></p> <p>Now, for this to work (from within the c...
<p>suddently, this error message started appearing when starting minikube:</p> <pre><code>* Creating docker container (CPUs=2, Memory=4000MB) .../ E0124 18:28:01.039963 8724 kic.go:267] icacls failed applying permissions - err - [%!s(&lt;nil&gt;)], output - [file elaborato: C:\Users\user\.minikube\machines\minikube\...
<p>Sounds like it is a known issue (and will be fixed in 1.26.0): <a href="https://github.com/kubernetes/minikube/issues/13868" rel="nofollow noreferrer">https://github.com/kubernetes/minikube/issues/13868</a></p>
<p>I have one service with 10 pods inside of my cluster and it sends multiple requests to the master node for more than an hour. I put an annotation in my ingress resource and modified it with some annotation, the first annotation I used is only to change the load balancer method to ewma load balancing.</p> <pre><code>...
<p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p> <p><strong>Root cause:</strong></p> <p>The nodes should receive equal requests from clients (load balancing) and at the same time saving machine resources.</p> <p>Due to this, need to find the best solution between ann...
<p>My application runs over a Kubernetes cluster of 3 nodes and uses Kafka to stream data. I am trying to check my system's ability to recover from node failure, so I deliberately fail one of the nodes for 1 minute.</p> <p>Around 50% of the times, I experience data loss of a single data record after the node failure. I...
<p>Yes, if the broker hosting the single replica goes down, then you can expect an unclean topic. If you have unclean leader election disabled, however, you shouldn't lose data that's already been persisted to the broker.</p> <p>To modify existing topics, you must use <code>kafka-reassign-partitions</code> tool, not an...
<p>I have the following values.yaml</p> <pre><code>ingresses: - name: public class: &quot;nginx&quot; annotations: nginx.ingress.kubernetes.io/proxy-body-size: 122m nginx.ingress.kubernetes.io/proxy-connect-timeout: &quot;7&quot; nginx.ingress.kubernetes.io/proxy-read-timeout: &quot;60&quot;...
<p>You need to break the two separate ingress configurations up in the Helm values somehow. Right now they're in a single map object under <code>ingress:</code>, so <code>.Values.ingress.name</code> for example only has one value rather than being something you can iterate over.</p> <p>A YAML list here makes sense:</p...
<p>I'm trying to migrate from docker-maven-plugin to kubernetes-maven-plugin for an test-setup for local development and jenkins-builds. The point of the setup is to eliminate differences between the local development and the jenkins-server. Since docker built the image, the image is stored in the local repository and ...
<p>If you don't want to use any docker repo (public or private), you can use what is called <a href="https://kubernetes.io/docs/concepts/containers/images/#pre-pulled-images" rel="nofollow noreferrer">Pre-pulled-images</a>. This is a bit annoying as you need to make sure all the kubernetes nodes have the images there a...
<p>I deployed a cluster (on premise) as proof of concept, using this command:</p> <p><code>sudo kubeadm init --upload-certs --pod-network-cidr=x.x.x.x/16 --control-plane-endpoint=x.x.x.x.nip.io</code></p> <p>Now, i need to change the endpoint from <code>x.x.x.x.nip.io</code> to <code>somename.example.com</code>. How ca...
<p>Posting an answer as a community wiki out of comments, feel free to edit and expand.</p> <hr /> <p>Based on the documentation and <a href="https://stackoverflow.com/questions/65505137/how-to-convert-a-kubernetes-non-ha-control-plane-into-an-ha-control-plane/65565377#65565377">very good answer</a> (which is about swi...
<p>By default, when we raise a request from a Pod to another pod, Kubernetes is trying to append <code>.namespace.svc.cluster.local</code> to the domain we gave and try to resolve.</p> <p>But in our case, we are already using a fully qualified URL to raise the request (<a href="http://service-name.namespace.svc.cluster...
<p>Lowering the <code>ndots</code> will fix the issue</p> <blockquote> <p>ndots: sets a threshold for the number of dots which must appear in a name before an initial absolute query will be made. The default for n is 1, meaning that if there are any dots in a name, the name will be tried first as an absolute name befor...
<p>I know we can edit the pvc and change to RWX but there is a cache in this, I'm trying to do in GKE, so for my pvc with RWO the storage class is standard, but if edit to RWX i need to change the storage class also to NFS.</p> <p>Is it possible to achieve this without losing data inside PVC ?</p>
<p>Your existing pvc is using the standard storage class which doesn’t allow RWX . So it’s not possible. It means even if you change it in PVC config it’s not going to work.</p> <p>Workaround to the above is take the backup of existing pv data. Create a new pvc with RWX mode for NFS pv and mount that to the application...
<p>Is there a way to determine programatically if a pod is in crashloopbackoff? I tried the following</p> <pre><code>pods,err := client.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{}) if err != nil { return err } for _, item := range pods.Items { log.Printf(&quot;found pod %v with state %v ...
<p>To clarify I am posting a community wiki answer.</p> <blockquote> <p>It's hiding in <a href="https://pkg.go.dev/k8s.io/api/core/v1#ContainerStateWaiting" rel="nofollow noreferrer"><code>ContainerStateWaiting.Reason</code></a>:</p> </blockquote> <pre><code>kubectl get po -o jsonpath='{.items[*].status.containerStatu...
<p>I plan to use Helm for deploying purposes. I have three applications/pods p1,p2,p3 and each of these has 2 enivronments dev, prod and in each environment there is a configmap.yml and deployment.yml.</p> <p>I plan on using helm, however how can I structure these. Do I need three helm charts?, one per application or i...
<p>You can use the single helm chart to manage all the deployment and config map.</p> <p>Create the <strong>tpl</strong> for deployment and service so this single tpl (template) will use to generate the multiple deployment YAML configs.</p> <p>So you will get the 3 YAML deployment file as output while you will be manag...
<p>I have make my deployment work with istio ingressgateway before. I am not aware of any changes made in istio or k8s side.</p> <p>When I tried to deploy, I see an error in replicaset side that's why it cannot create new pod.</p> <blockquote> <p>Error creating: Internal error occurred: failed calling webhook &quot;nam...
<p>In my case this was related to firewall. More info can be found <a href="https://istio.io/latest/docs/setup/platform-setup/gke/" rel="nofollow noreferrer">here</a>.</p> <p>The gist of it is that on GKE at least you need to open another port 15017 in addition to 10250 and 443. This is to allow communication from your...
<p>I'm studying how to make a chat service with gRPC. I notice that most of the examples store all the subscriber's connections into a List data structure. When the chatroom got a new message, the server will loop through that List and send new messages.</p> <p>Stores subscribers in <a href="https://github.com/Raaaaaaa...
<p>Here are a couple of aspects that I'm thinking:</p> <ul> <li>Any chat system has some limits in terms of chatroom size. How many subscribers do you want to support? If you want to support tens (or even hundreds) of subscribers, I believe it works well with an in-memory list of subscribers, since it's much faster tha...
<p>We are working on a Java Spring Boot application, that needs access to a database, the password is stored on the <code>application.properties</code> file.</p> <p>Our main issue is that the passwords might be viewable when uploaded to GitLab/GitHub.</p> <p>I found that we can use Jasypt to encrypt the data, but from ...
<p>Do not store passwords in <code>application.properties</code> as you mention is insecure but also you may have a different version of your application (dev, staging, prod) which will use different databases and different passwords.</p> <p>What you can do in this case is maintain the password empty in source files an...
<p>The following questions are about an on-prem K3S setup.</p> <p>1] How does HTTP/S traffic reach an ingress controller in say K3S?</p> <p>When I hit any of my nodes on HTTPS port 443 I get the traefik ingress controller. This must be &quot;magic&quot; though because:</p> <ul> <li>There is no process on the host liste...
<ol> <li>Port-forwarding is responsible for traffic getting mapped to traefik ingress controller by hitting on port 443 and NodePort is generally in between this range 30000-32767 only.</li> </ol> <p>Refer this <a href="https://doc.traefik.io/traefik/user-guides/crd-acme/#port-forwarding" rel="nofollow noreferrer">docu...
<p>I am trying to send mail using sendgrid api and cronjob in k8s , I tried my python code in cloud function and it is running as expected however when I used my code to create GCR image and deploy it in a k8s cronjob i got an <code>urllib.error.URLError: &lt;urlopen error [Errno 104] Connection reset by peer&gt; </cod...
<p>To communicate from/to sendgrid , you need to add dns confs so that sendgrid api will be recognized , you need to open port (pod level) , I abandoned the sendgrid and I used the company's smtp server.</p>
<p>I am currently working on a side project with Go. I'm trying to get the information about the pods running on the cluster.</p> <p>I can reach the pods according to the namespace value, but in order to reach the working pods with the metadata.labels.applicationGroup value in the service.yaml file, I need to obtain th...
<p>Just use LabelSelector instead of FieldSelector</p> <pre><code>listOptions := meta.ListOptions{ LabelSelector: &quot;applicationGroup=alpha&quot;, } </code></pre> <p>UPD: If you want to use it for pods you should set applicationGroup on pod template</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: ...
<p>I have a pod/deployment initially with one replica. <strong>The code in the pod contains a variable/counter of type int</strong>. Initially equals one, and then when I scale the deployment. I want the second pod replica to set that variable/counter to two only in the second replica (while the value remains one in ...
<p>You can use the stateful sets if no issue with it, as it manages the sequence so.</p> <p>You can use the name of POD as an environment so this, as stateful set will scale up it, will have a name as a variable for <strong>int</strong> you might need to parse or slice it as per need.</p> <pre><code>env: - name: MY_P...
<p>First time Kubernetes user here.</p> <p>I deployed a service using <code>kubectl -n my_namespace apply -f new_service.yaml</code></p> <p>It failed, with the pod showing <code>Warning -Back-off restarting failed container</code></p> <p>I am now trying to delete the failed objects and redeploy a fixed version. However...
<p>Posting this as Community wiki for better visibility. Feel free to expand it.</p> <hr /> <p><strong>In a Kubernetes cluster</strong>:</p> <ul> <li>if you delete Pods, but they are recreated again<br /> <code>there is a Kubernetes Deployment / StatefulSet / DaemonSet / job that recreates them</code><br /> <strong>del...
<p>I have a GKE cluster running with several persistent disks for storage. To set up a staging environment, I created a second cluster inside the same project. Now I want to use the data from the persistent disks of the production cluster in the staging cluster.</p> <p>I already created persistent disks for the staging...
<p>You can use the open source tool <a href="https://velero.io/" rel="nofollow noreferrer">Velero</a> which is designed to migrate Kubernetes cluster resources.</p> <p>Follow these steps to migrate a persistent disk within GKE clusters:</p> <ol> <li>Create a GCS bucket:</li> </ol> <pre><code>BUCKET=&lt;your_bucket_name...
<p>I know I can use <code>kubectl wait</code> to check if a pod is <code>Ready</code> but is there an easy way to check whether the pod is gone or in <code>Terminating</code> state? I'm running some tests and I only want to continue when the pod (or the namespace for that matter) is completely gone.</p> <p>Also a timeo...
<p>It's actually part of the wait command.</p> <pre><code>kubectl wait --for=delete pod/busybox1 --timeout=60s </code></pre> <p>You can check with <code>kubectl wait --help</code> to see this example and some more. For example</p> <blockquote> <p>--for='': The condition to wait on: [delete|condition=condition- name|js...
<p>Hi I am trying to add built-in OpenShift(v4.8) prometheus data source to a local grafana server. I have given basic auth with username and password and as of now I have enabled skip tls verify also. Still I'm getting this error</p> <p><a href="https://i.stack.imgur.com/xvKu8.png" rel="nofollow noreferrer"><img src="...
<p>You cannot authenticate to the OpenShift prometheus instance using basic authentication. You need to authenticate using a bearer token, e.g. one obtained from <code>oc whoami -t</code>:</p> <pre><code>curl -H &quot;Authorization: Bearer $(oc whoami -t)&quot; -k https://prometheus-k8s-openshift-monitoring.apps.xxxx.x...
<p>I'm very new to k8s and the related stuff, so this may be a stupid question: How to change the pod name?</p> <p>I am aware the pod name seems set in the helm file, in my values.yaml, I have this:</p> <pre><code>... hosts: - host: staging.application.com paths: ... - fullName: application ...
<p><code>...the pod name still remains the same</code></p> <p>The code snippet in your question likely the helm values for Ingress. In this case not related to Deployment of Pod.</p> <p>Look into your helm template that define the Deployment spec for the pod, search for the <code>name</code> and see which helm value wa...
<p>I did docker system prune to delete unused images but deleted everything is there way to undo this? is there any ways to fix this out?</p>
<p>Hello, sorry for my answer but its a nope...</p> <p>When you use the prune command you are prompted to know if you are sure or not, sadly this is a last warning before the drama :D</p> <p>Hope you still got the dockerfile to rebuild your own images, if they came from internet, just go back from where you get them :D...
<p>My understanding is that the <code>AGE</code> shown for a pod when using <code>kubectl get pod</code>, shows the time that the pod has been running since the last restart. So, for the pod shown below, my understanding is that it intially restarted 14 times, but hasn't restarted in the last 17 hours. Is this correct,...
<p>Hope you're enjoying your Kubernetes journey !</p> <p>In fact, the AGE Headers when using kubectl get pod shows you for how long your <strong>pod</strong> has been created and it's running. But do not confuse POD and container:</p> <p>The header &quot;RESTARTS&quot; is actually linked to the parameters &gt; '.status...
<p>I got a K8S+DinD issue:</p> <ul> <li>launch Kubernetes cluster</li> <li>start a main docker image and a DinD image inside this cluster</li> <li>when running a job requesting GPU, got error <code>could not select device driver &quot;nvidia&quot; with capabilities: [[gpu]]</code></li> </ul> <p>Full error</p> <pre><cod...
<p>I got it working myself.</p> <p>Referring to</p> <ul> <li><a href="https://github.com/NVIDIA/nvidia-docker/issues/375" rel="nofollow noreferrer">https://github.com/NVIDIA/nvidia-docker/issues/375</a></li> <li><a href="https://github.com/Henderake/dind-nvidia-docker" rel="nofollow noreferrer">https://github.com/Hende...
<p>I installed aws-load-balancer-controller on new EKS cluster (version v1.21.5-eks-bc4871b).</p> <p>I installed by this guide <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/deploy/installation/" rel="noreferrer">https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/deploy/in...
<p>In case it might help others - I also had the original issue using fargate profile and worker-node for core-dns. The solution for me I found in another place was just adding</p> <pre><code>node_security_group_additional_rules = { ingress_allow_access_from_control_plane = { type = &quot...
<p>The env</p> <blockquote> <p>Ansible 2.9.6 (python3)</p> </blockquote> <p>Tried to run a simple playbook</p> <pre><code>- hosts: master gather_facts: no become: yes tasks: - name: create name space k8s: name: testing api_version: v1 kind: Namespace state: present <...
<p>I am a bit late to the party but since I faced this today and don't see an accepted answer, I am posting what worked for me.</p> <p>Since you are running the tasks on remote servers, you must have <code>openshift</code>, <code>pyyaml</code> and <code>kubernetes</code> installed on the remote machines for this to wor...
<p>I'm trying to setup a gitlab kubernetes agent and runner for my in-cluster CICD pipeline. My gitlab.ci is something on the line of:</p> <pre><code>stages: - deploy deploy-new-images: stage: deploy image: name: alpine/helm:3.7.1 entrypoint: [&quot;&quot;] script: - helm list --all-namespaces ta...
<p><strong>In short:</strong> In your gitlab-runner values file, add the setting <code>service_account = &quot;gitlab&quot;</code> under <code>[runners.kubernetes]</code>.</p> <p><strong>Explanation:</strong> The actual pod that executes the job is not the gitlab-runner pod, nor the gitlab agent pod. Gitlab runner kube...
<p>I want to deploy keycloak with below custom configuration, before starting it.</p> <ul> <li>new realm</li> <li>role</li> <li>client</li> <li>an admin user under the new realm</li> </ul> <p>I am using below deployment file to create keycloak pod</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: ke...
<p>When you are setting up Keycloak on kubernetes, you only need to import the new realm (realm.json) and the corresponding clients (client.json) only during the first run. So a <strong>Job</strong> needs created instead of adding it to the deployment.</p> <p>Once the Job is run, the json will be imported to the Keyclo...
<p>I'm using zerolog in golang, which outputs json formatted log, the app is running on k8s, and has cri-o format as following. <a href="https://i.stack.imgur.com/M1qMe.png" rel="nofollow noreferrer">actual log screenshot on Grafana loki</a></p> <p>My question is, since there's some non-json text prepended to my json l...
<p>after some head scratching, problem solved.</p> <p>As I'm directly using the promtail setup from here <a href="https://raw.githubusercontent.com/grafana/loki/master/tools/promtail.sh" rel="nofollow noreferrer">https://raw.githubusercontent.com/grafana/loki/master/tools/promtail.sh</a></p> <p>And within this setup, t...
<p>I am having the following issue. I am new to GCP/Cloud, I have created a cluster in GKE and deployed our application there, installed nginx as a POD in the cluster, our company has a authorized SSL certificate which i have uploaded in Certificates in GCP.</p> <p>In the DNS Service, i have created an A record which m...
<p>I was able to fix this problem by adding an extra argument to the ingress-nginx-controller deployment.</p> <p>For context: my TLS secret was at the default namespace and was named <code>letsencrypt-secret-prod</code>, so I wanted to add this as the default SSL certificate for the Nginx controller.</p> <p>My first so...
<p>I am playing around with the Horizontal Pod Autoscaler in Kubernetes. I've set the HPA to start up new instances once the average CPU Utilization passes 35%. However this does not seem to work as expected. The HPA triggers a rescale even though the CPU Utilization is far below the defined target utilization. As seen...
<p>Scaling is based on % of <code>requests</code> not <code>limits</code>. I think we should change this answer as the examples in the accepted answer show:</p> <pre><code> limits: cpu: 1000m </code></pre> <p>But the <code>targetCPUUtilizationPercentage</code> is based on <code>requests</code> like:</p> <pre><code>r...
<p>I have a Deployment like this:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment spec: template: volumeMounts: - mountPath: /home name: john-webos-vol subPath: home - mountPath: /pkg name: john-vol readOnly: true subPa...
<p>You can use JSON patch <a href="http://jsonpatch.com/" rel="nofollow noreferrer">http://jsonpatch.com/</a></p> <h4>Remove specific volume mount</h4> <pre><code>kubectl patch deployment &lt;NAME&gt; --type json -p='[{&quot;op&quot;: &quot;remove&quot;, &quot;path&quot;: &quot;/spec/template/spec/containers/0/volumeMo...
<p>I have deployed an Event Hub triggered Azure Function written in Java on AKS. The function should scale out using KEDA. The function is correctly triggerd and working but it's not scaling out when the load increases. I have added sleep calls to the function implementation to make sure it's not burning through the ev...
<p>Was able to find a solution to the problem.</p> <p>Event Hub triggered Azure Functions deployed on AKS show the same scaling characteristics as Azure Functions on App Service show:</p> <p>You only get one consumer per partition to allow for ordering per partition. This characteristic overrules maxReplicaCount in the...
<p>On an EKS cluster, I want to transition from the existing NodeGroup (say NG1) to a fresh NG2 (with spot instances). NG1 will remain as fall-back.</p> <p>Do I really need to play with Node Affinity in my deployments and make them &quot;prefer&quot; NG2, and then rollout-restart?</p> <p>Or is it enough to set the desi...
<p>Node affinity sounds better choice to me</p>
<p>I have 2 kubernetes cluster</p> <p>cluster 2 - exposed loadblancer nginx with regional IP <code>IP_PRIVATE</code></p> <pre><code>service 1 - website `/website` service 2 - blog `blog` service 3 - api `api` </code></pre> <p>cluster 1 - exposed loadblancer gce with global IP <code>IP_PUBLIC</code></p> <p>I want to imp...
<p>i am not sure which ingress you are running in the background however you can change the config using the annotation.</p> <p>You can enable passing the headers on <strong>Nginx</strong> using this annotation so it will forward all the custom headers and domain details.</p> <pre><code>enable-underscores-in-headers: t...
<p>Today I found the host kubernetes(v1.21.3) folder <code>io.containerd.snapshotter.v1.overlayfs</code> takes too much spaces:</p> <pre><code>[root@k8smasterone kubernetes.io~nfs]# pwd /var/lib/kubelet/pods/8aafe99f-53c1-4bec-8cb8-abd09af1448f/volumes/kubernetes.io~nfs [root@k8smasterone kubernetes.io~nfs]# duc ls -Fg...
<p>The directory <code>/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs</code> is where the various container and image layers are persisted by containerd. These layers are downloaded based on the containers running on the node. If we start running out of space, the kubelet has the ability to garbage collecte...
<p>I have a local k3d cluster in stalled on Mac (Big Sur 12) that I am attempting to install calico (their default manifest <a href="https://k3d.io/v5.3.0/usage/advanced/calico/" rel="nofollow noreferrer">https://k3d.io/v5.3.0/usage/advanced/calico/</a>). In the logs for the calico-kube-controller pod, I get this:</p>...
<p>double check your container resources configuration for errors. Try to increase the values.</p> <pre><code> resources: limits: cpu: '1' memory: 500m requests: cpu: 50m memory: 100m </code></pre> <p>Mine started working when removed resources section comple...
<p>I am wondering if it is possible to configure the “public access source allowlist” from CDK. I can see and manage this in the console under the networking tab, but can’t find anything in <a href="https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.Cluster.html" rel="nofollow noreferrer">the CDK docs</a> ...
<p>In general EKS has two relevant security groups:</p> <ol> <li><p>The one used by nodes, which AWS calls &quot;cluster security group&quot;. It's setup automatically by EKS. You shouldn't need to mess with it unless you want (a) more restrictive rules the defaults (b) open your nodes to maintenance taks (e.g.: ssh ac...
<p>I run this Job:</p> <pre><code>kubectl apply -f - &lt;&lt;EOF apiVersion: batch/v1 kind: Job metadata: name: sample spec: template: spec: containers: - command: - /bin/bash - -c - | env echo &quot;MY_VAR : ${MY_VAR}&quot; sleep 800000 ...
<p>The reason this happens is because your shell expands the variable <code>${MY_VAR}</code> before it's ever sent to the kubernetes. You can disable parameter expansion inside of a heredoc by quoting the terminator:</p> <pre><code>kubectl apply -f - &lt;&lt;'EOF' </code></pre> <p>Adding these quotes should resolve you...
<p>how to using crictl to get the dangling images? The server was not install docker right now. is it possible to using crictl to get the dangling images? I have tried to using this command:</p> <pre><code>crictl images </code></pre> <p>but could not recognized which images could be remove.</p>
<p>It is not possible to get the dangling images using crictl.Safest and easiest way to clean up dangling images is by using <a href="https://stackoverflow.com/questions/45142528/what-is-a-dangling-image-and-what-is-an-unused-image">docker</a>.</p> <p>You can use the <code>$ docker image prune</code> command which allo...
<p><strong>Is there a way to extend the kustomize image transformer to recognise more keys as image specifiers?</strong> Like the <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/transformerconfigs/README.md#name-reference-transformer" rel="nofollow noreferrer"><code>nameReference</code> trans...
<p>Just after writing this up I finally stumbled on the answer: Kustomize does support <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/transformerconfigs/images/README.md" rel="noreferrer">image transformer configs</a>.</p> <p>The correct way to express the above would be a <code>image_transf...
<p>I have setup MinIO with Kubernetes (K3s) in one node.</p> <p>Command <code>kubectl logs mypod-0 -n minio</code> returns the following:</p> <ul> <li><p>API: <a href="http://10.42.0.14:9000" rel="nofollow noreferrer">http://10.42.0.14:9000</a> <a href="http://127.0.0.1:9000" rel="nofollow noreferrer">http://127.0.0.1...
<p>Yes, an Ingress would allow you to expose MinIO to clients outside your clusters SDN.</p> <p>You probably have a Service object already (if not, you need one, Ingress points to Service, which resolves to Pods).</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: minio spec: rules: - h...
<p>I have a configmap that looks like this:</p> <pre><code>apiVersion: v1 data: nginx.conf: &quot;events {worker_connections 1024; . . . }&quot; kind: ConfigMap metadata: name: nginx-cfg namespace: nginx </code></pre> <p>I want to add a new line of text to the begining of nginx.conf:</p> <pre><code>apiVersion: v...
<p>The error is because you're trying to go into file block. If you remove the braces:</p> <p><code>-p '{&quot;data&quot;:{&quot;nginx.conf&quot;:{&quot;load_module /usr/lib/nginx/modules/ngx_http_vhost_traffic_status_module.so&quot;}}}'</code></p> <p>to:</p> <p><code>-p '{&quot;data&quot;:{&quot;nginx.conf&quot;:&quot...
<p>I have a few external CRDs with old <code>apiVersion</code> applied in the cluster, and operators based on those CRDs deployed.</p> <p>As said in <a href="https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/" rel="nofollow noreferrer">official docs</a> about Kubernetes API and Feature Removals ...
<p>The custom resources will still be served after you upgrade</p> <p>Suppose we define a resource called <code>mykind</code></p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: mykinds.grp.example.com spec: group: grp.example...
<p>I want Ingress to redirect a specific subdomain to one backend and all others to other backend. Basically, I want to define a rule something like the following:</p> <blockquote> <p>If subdomain is <code>foo.bar.com</code> then go to <code>s1</code>, for all other subdomains go to <code>s2</code></p> </blockquote>...
<p>This is now possible in <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#hostname-wildcards" rel="noreferrer">Kubernetes</a>:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: ingress.kubernetes.io/ssl-redirect: &quot;false&quot; kubernetes.io/ingre...
<p>We need to disable the automount of service account from our existing deployments in AKS cluster. There are 2 ways to do by adding the property &quot;automountserviceaccount : false&quot; in either in the service account manifest or pod template.</p> <p>We are using separate service account specified in our applicat...
<p>Disable auto-mount of default service account:</p> <pre><code>apiVersion: v1 kind: ServiceAccount metadata: name: default automountServiceAccountToken: false </code></pre> <p><a href="https://gist.github.com/pjbgf/0a8c8a1459e5a2eb20e9d0852ba8c4be" rel="nofollow noreferrer">https://gist.github.com/pjbgf/0a8c8a1459e...