prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I'm using <a href="https://keda.sh/" rel="nofollow noreferrer">KEDA</a> to scale my pods on EKS cluster. I want to have trigger enabled on both CPU and Memory based scalers in the ScaledObject so here is my code chunk:-</p> <pre><code>spec: scaleTargetRef: name: workload-processor cooldownPeriod: 120 minRe...
<p>Functionally it has got all the triggers when I do <code>kubectl get scaledobject -o yaml</code>. The problem is with the CRD itself as it is not able to display all the triggers on CLI. It is an existing bug and have been already reported here <a href="https://github.com/kedacore/keda/issues/1943" rel="nofollow nor...
<p>I am totally new to Go and the Kubernetes library k8s.io (<a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go</a>) and try to figure out how to get a specific secret.</p> <p>I have a kind of observer which watches changes of <code>Secrets</code>. I am i...
<p>as mentioned above, <code>secret</code> object resides in a namespace. They can only be referenced by pods in that same namespace.</p> <p><a href="https://stackoverflow.com/questions/46297949/sharing-secret-across-namespaces">Sharing secret across namespaces</a></p> <p>if you want to use the secret in multiple names...
<p>I have one running container which uses node:alpine as base image.I want to know version of this image.</p>
<p>You can check the <strong>Dockerfile</strong> of the container if handy.</p> <p>You can check the first line with <strong>FROM</strong> <code>node:&lt;version&gt;-alpine</code></p> <p>For example :</p> <pre><code>FROM node:12.18.1-alpine ENV NODE_ENV=production WORKDIR /app </code></pre> <p>You can also use the comm...
<p>I'm starting out in K8s and I'm not quite wrapping my head around deploying a StatefulSet with multiple replicas bound to a local disc using <code>PV</code>+<code>PVC</code>+<code>SC</code> vs. <code>volumeClaimTemplates</code> + <code>HostPath</code> scenarios. My goal is to deploy a MongoDB StatefulSet with 3 repl...
<p>Ok, after fiddling with it a bit more and testing a couple more of configurations I found out that the <code>PVC</code> to <code>PV</code> binding happens in a 1:1 manner, so once the <code>PV</code> has bound to a claim (either <code>PVC</code> or <code>volumeClaimTemplates</code>) no other claim can bind to it. So...
<p>After shifting from Docker to containerd as docker engine used by our kubernetes, we are not able to show the multiline logs in a proper way by our visualization app (Grafana) as some details prepended to the container/pod logs by the containerd itself (i.e. timestamp, stream &amp; log severity to be specific it is ...
<p>This is the workaround I followed to show the multiline log lines in Grafana by applying extra fluentbit filters and multiline parser.</p> <p>1- First I receive the stream by tail input which parse it by a multiline parser (multilineKubeParser).</p> <p>2- Then another filter will intercept the stream to do further p...
<p>I'm just trying to set the log level of Guacamole to DEBUG.. I've successfully set the logging level for <code>guacd</code> and tried multiple environment variables for the guacamole container but it's still not working.. I've found a <code>logging.properties</code> file in the Guacamole container at path: <code>/ho...
<p>I got in contact <a href="https://issues.apache.org/jira/browse/GUACAMOLE-1646" rel="nofollow noreferrer">with Guacamole support</a>.</p> <p>For the people they're experiencing the same issue because the people from Guacamole didn't documented this yet, you can use the environment variable <code>LOGBACK_LEVEL</code>...
<p>When I try to create a pod in kubernetes with my image in my Harbor registry,I got an ErrImagePull Error, which looks like that:</p> <pre><code>Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 10s default-scheduler Successf...
<blockquote> <p>I copied the ca.crt to /etc/docker/certs.d/my.harbor.com/</p> </blockquote> <p>This will make it work for the docker engine, which you've shown.</p> <blockquote> <p>along with my.harbor.cert and my.harbor.com.key</p> </blockquote> <p>I'd consider that a security violation and no longer trust the secret ...
<h1>Actual Issue:</h1> <p>Unable to start kubernetes API, due to which, unable to intite kube services like: kubectl version kubect get nodes</p> <pre><code>/home/ubuntu# kubectl version Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", Git...
<p>I spent a couple of hours on that.<br /> In my case, I was using Ubuntu 22.04 and Kubernetes 1.24.</p> <p>API was restarting all the time, I didn't find something in kubelet logs:</p> <pre><code>service kubelet status journalctl -xeu kubelet </code></pre> <p>I checked the API logs through:</p> <pre><code>/var/log/c...
<p>I've searched but nothing has helped me through.</p> <p>My Set.<br /> k8s - v1.20.2.<br /> calico - 3.16.6.<br /> pod-cidr = 10.214.0.0/16.<br /> service-cidr = 10.215.0.1/16.</p> <p>Installed by kubespray with this one <a href="https://kubernetes.io/ko/docs/setup/production-environment/tools/kubespray" rel="norefer...
<p>Experienced this issue when deploying an app to Kubernetes.</p> <blockquote> <p>Warning Unhealthy 10m (x3206 over 3d16h) kubelet Liveness probe failed: Get &quot;http://10.2.0.97:80/&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)</p> </blockquote> <p>I did an exec into the po...
<p>Is it possible to create resource:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: projectcalico.org/v3 kind: HostEndpoint </code></pre> <p>using calico operator? I want to get rid of <code>calicoctl</code>.</p>
<p>It is possible only with <code>calicoctl</code> to create a host endpoint resource.</p> <p>As mentioned in the <a href="https://projectcalico.docs.tigera.io/reference/host-endpoints/objects" rel="nofollow noreferrer">document</a>:</p> <blockquote> <p>For each host endpoint that you want Calico to secure, you’ll need...
<p><strong>NOTE</strong>: this is I think a bash question, not kubernetes or kubectl</p> <p>I can run the following:</p> <pre class="lang-bash prettyprint-override"><code>kubectl get pods -n myspace -w </code></pre> <p>which will &quot;watch&quot; and provide a stream of lines with e.g. pod name, ready count, status, r...
<p>You could convert each object into a single line json object with <code>jq</code>:</p> <pre><code>i=0; while read line; do i=$(($i+1)) echo &quot;$line&quot; &gt; &quot;$i.json&quot; done &lt; &lt;(kubectl get pods -w -o json | jq -rc '.') </code></pre>
<p>In <strong>command line</strong> we can use <code>kubectl apply --server-dry-run -f example-pod.yml</code> to make a trial run of <code>yml</code> file without persisting it. Can we do smth similar from <strong>Java</strong>, using <code>io.fabric8.kubernetes</code> (Java client for kubernetes) ?</p>
<p>DryRun has been implemented with version <code>5.2.0</code> according to this issue <a href="https://github.com/fabric8io/kubernetes-client/issues/2588" rel="nofollow noreferrer">https://github.com/fabric8io/kubernetes-client/issues/2588</a>.</p> <p>It can be used like this on many resources:</p> <pre class="lang-ja...
<p>I am creating a hyperledger fabric network using the following hyperledger fabric operator for kubernetes <a href="https://github.com/hyperledger-labs/hlf-operator" rel="nofollow noreferrer">https://github.com/hyperledger-labs/hlf-operator</a> I have my cluster configured in aws eks and it is currently running 3 nod...
<p>I encountered the same problem and I finally solved it. The problem is when you create your peer node right now (as of July 28, 2022), the version defaults to <code>2.3.0-v0.0.2</code> (you can find this <code> kubectl hlf peer create --help</code> and see the description next to the <code>--version</code> flag). Th...
<p>I am using Kubernetes version 1.24, I have created a secret for my service account manually, but when I run <code>kubectl get serviceaccounts</code>, it is showing that I do not have any secrets for that service account?</p>
<p>If you are on K8s version <strong>1.24</strong></p> <p>The <strong>serviceaccount</strong> won't create the <strong>secret</strong> automatically.</p> <p>You have to create it manually.</p> <pre><code>kubectl create sa &lt;serviceaccount-name&gt; </code></pre> <p><strong>Example</strong> :</p> <pre><code>apiVersion:...
<p>I am new to microk8s, it's a wonderful and easy approach to setup k8s, just one thing which is quite annoying which is to use <strong>microk8s</strong> everytime before the <strong>kubectl</strong> command, is there any way to use kubectl directly or make it a alias.</p> <p>For eg to run kubectl command, I've to use...
<p>Yeah, there is a way to create an alias for kubectl in microk8s, run this command</p> <p><code>sudo snap alias microk8s.kubectl kubectl</code></p> <p>and you will be able to use kubectl directly.</p>
<p>I am trying to set up a load test for an endpoint. This is what I have followed so far:</p> <h2><code>Dockerfile</code></h2> <pre><code>FROM python:3.8 # Add the external tasks directory into /tasks WORKDIR /src ADD requirements.txt . RUN pip install --no-cache-dir --upgrade locust==2.10.1 ADD run.sh . ADD load_t...
<p>Probably the environment variables set by k8s is colliding with locust’s (LOCUST_WEB_PORT specifically). Change your setup so that no containers are named ”locust”.</p> <p>See <a href="https://github.com/locustio/locust/issues/1226" rel="nofollow noreferrer">https://github.com/locustio/locust/issues/1226</a> for a s...
<p>I'm trying to set up a K3s cluster. When I had a single master and agent setup cert-manager had no issues. Now I'm trying a 2 master setup with embedded etcd. I opened TCP ports <code>6443</code> and <code>2379-2380</code> for both VMs and did the following:</p> <pre class="lang-none prettyprint-override"><code>VM1:...
<p>Try to specify the proper ingress class name in your Cluster Issuer, like this:</p> <pre><code>apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: info@example.org privateKeySecretRef: name: let...
<p>When I want to restart the kubernetes(<code>v1.21.2</code>) statefulset pod, the pod are stuck with terminating status, and the log shows like this:</p> <pre><code>error killing pod: failed to &quot;KillPodSandbox&quot; for &quot;8aafe99f-53c1-4bec-8cb8-abd09af1448f&quot; with KillPodSandboxError: &quot;rpc error: c...
<p>I think force deletion can be a workaround for this issue.</p> <p>In order to delete the affected pod that is in the terminating state, please refer to the <a href="https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/#delete-pods" rel="nofollow noreferrer">documentation</a>. In case the po...
<p>I have a cli app written in NodeJS [not by me].</p> <p>I want to deploy this on a k8s cluster like I have done many times with web servers.</p> <p>I have not deployed something like this before, so I am in a kind of a loss.</p> <p>I have worked with dockerized cli apps [like Terraform] before, and i know how to use ...
<p>Your edit is one solution, another one if you do not want or cannot change the Docker image is to <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/" rel="nofollow noreferrer">Define a Command for a Container</a> to loop infinitely, this would achieve the same as the...
<p>I am currently using the following to attempt to spread Kubernetes pods in a given deployment across all Kubernetes nodes evenly:</p> <pre class="lang-yaml prettyprint-override"><code> spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100...
<h2>Summary</h2> <p>TL;DR - The advantage of switching to <code>topologySpreadConstraints</code> is that you will be able to be more expressive about the <code>topology</code> or the <code>structure</code> of your underlying infrastructure for pod scheduling. Think of this is as a superset of what <code>affinity</code>...
<p>I'm following Les Jackson's <a href="https://www.youtube.com/watch?v=DgVjEo3OGBI" rel="nofollow noreferrer">tutorial</a> to microservices and got stuck at 05:30:00 while creating a deployment for a ms sql server. I've written the deployment file just as shown on the yt video:</p> <pre><code>apiVersion: apps/v1 kind:...
<p>I fixed it by manually pulling the image via <code>docker pull mcr.microsoft.com/mssql/server:2017-latest</code> and then deleting and re-applying the deployment.</p>
<p>I'm trying to run Keycloak 18.0.1 as a StatefulSet with the bitnami Helm chart on my Azure AKS Kubernetes cluster. Traefik 2.7 is the Ingress Controller and an external Postgres Database is used. Keycloak is in &quot;proxy&quot;-mode &quot;edge&quot; and doesn't need to handle SSL, because it's handled by traefik, c...
<p>Found the solution to enable production mode:</p> <pre><code> - name: KEYCLOAK_EXTRA_ARGS value: &quot;--auto-build&quot; </code></pre> <p>The error:</p> <pre><code>[org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled </code></pre> <p>...
<p>I am fairly new to Kubernetes, and I think I understand the basics of provisioning nodes and setting memory limits for pods. Here's the problem I have: my application can require dramatically different amounts of memory, depending on the input (and there is no fool-proof way to predict it). Some jobs require 50MB, s...
<p>Natively K8S supports horizontal autoscalling i.e. automatically deplying more replicas of a deployment basing on chosen metric like CPU usage, memory usage etc.: <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaling</a></p> <p>What ...
<p>In my kubernetes cluster, there are multiple deployments in a namespace. For a specific deployment, there is a need to not allow &quot;CrashLoopBackoff&quot; pods to exist. So basically, when any pod gets to this state, I would want it to be deleted and later a new pod to be created which is already handled by the R...
<p>Firstly, you should address the reason <em>why</em> the pod has entered the <code>CrashLoopBackOff</code> state rather than just delete it. If you do this, you'll potentially just recreate the problem again and you'll be deleting pods repeatedly. For example, if your pod is trying to access an external DB and that D...
<p>Using different tools (kubent for example) I see that I have deprecated API in my cluster. For example</p> <pre><code>Type: Ingress Name: kibana API: networking.k8s.io/v1beta1 </code></pre> <p>But when I open Ingress itself, I can see this:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress managedFiel...
<p>There will be no issue while upgrading your Kubernetes cluster to the latest version even if you have deprecated API version in the <code>managed field</code> in the ingress configuration. The reason why you still see versions <strong>“/v1beta1”</strong> in the UI is because there are different parts of GKE that re...
<p>I am trying to isolate my pods in namespace from other namespaces. I have tried to create a NetworkPolicy:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-from-other-namespaces spec: podSelector: matchLabels: ingress: - from:...
<p>In my case I have the same problem and the response in this link <a href="https://stackoverflow.com/a/56860217/7324872">https://stackoverflow.com/a/56860217/7324872</a> is great</p> <p>Please create 2 network policy:</p> <p><strong>deny-from-other-namespaces</strong></p> <pre><code>kind: NetworkPolicy apiVersion: ne...
<p>Fairly new to kubernetes, I have a question about setting <code>limits</code> and <code>requests</code> in regards to <code>CPU</code> and <code>Memory</code>. If I have a few applications in my cluster but none of these applications are in production how do I determine the correct way to set the <code>limits</code>...
<p>To determine request and limits, you can try the vertical pod autoscaler : <a href="https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler</a></p> <p>You have two main modes :</p> <ul> <li><c...
<p>I created disk in azure k8s cluster (4Gb standard HDD) I am using code PV</p> <p><a href="https://pastebin.com/HysrzFyB" rel="nofollow noreferrer">Pv file</a></p> <p>Then I am creating PVC:</p> <p><a href="https://pastebin.com/r7T4KZEv" rel="nofollow noreferrer">PVC yaml</a></p> <p>Attach my volume to Pod:</p> <p><a...
<blockquote> <p>...Volume capability not supported</p> </blockquote> <p>Try update your PV:</p> <pre><code>... accessModes: - ReadWriteOnce # &lt;-- ReadWriteMany is not supported by disk.csi.azure.com ... </code></pre> <p>ReadWriteMany is supported by file.csi.azure.com (Azure Files).</p>
<p>I have an JAVA application running in Kubernetes which listens to port 8080. When I connect JProfiler to JVM and run a few requests sequentially, everything works fine. But as soon as I fire some load using Jmeter, my application stops responding on Port 8080 and I get request timeout.</p> <p>When JProfiler is detac...
<p>From the feedback you have sent me by email, the overhead becomes noticeable when you switch on allocation recording. Just with CPU and probe recording you don't experience any problem.</p> <p>Allocation recording is an expensive operation that should only be used when you have a related problem. The added overhead ...
<p>I am running a 2-node K8s cluster on OVH Bare Metal Servers. I've set up <strong>MetalLB</strong> and <strong>Nginx-Ingress</strong>.The 2 servers both have public IPs and are not in the same network segment. I've used one of the IPs as the entrypoint for the LB. The deployments I created 3 nginx containers &amp; se...
<p>Based on the comments from zer0 answered, try:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-resource-3 annotations: nginx.ingress.kubernetes.io/rewrite-target: / # &lt;-- add spec: ingressClassName: nginx ... </code></pre> <p>Page with different font color should...
<p>I am trying to implement ingress for gRPC services. When i use single service it works fine but as soon as i integrate second service i am unable to call it.</p> <p>below is the code for this. My both services are exposed as NodePort.</p> <pre><code>#### Ingress #### apiVersion: networking.k8s.io/v1 kind: Ingress m...
<p>gRPC uses paths in the <a href="https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests" rel="nofollow noreferrer">style of <code>/the.service.Name/methodName</code></a>. So use the service name in the <code>path</code> to separate traffic. To send all <code>UserService</code> traffic to the <code>us...
<p>I have a Python process that I want to fire up every <em>n</em> minutes in a Kubernetes cronjob and read a number of messages (say 5) from a queue, and then process/convert some files and run analysis on results based on these queue messages. If the process is still running after <em>n</em> minutes, I don't want to ...
<p>Duplicate cronjobs seems to be the way to achieve what you are looking for. Produce 3 duplicates with single job at a time. You could template the job manifest and produce multiple as in the following example. The example is not in your problem context, but you can get the idea. <a href="http://kubernetes.io/docs/ta...
<p>While reading about ingress and ingress controller in k8s, it is documented that there is a load balancer in the ingress controller.</p> <p>From my understanding, The ingress controller only accepts external requests and forwards them to the target service (the load balancing between the pods actually happens here) ...
<p>You have the right mental model of the implementation of ingress, though it is not what is actually happening:</p> <pre><code>Ingress -&gt; Service -&gt; 1..n Endpoints (Pods) </code></pre> <p>In practice this can lead to problems, though: If you want to influence the actual load balancing and use additional informa...
<p>If I want to run multiple replicas of some container that requires a one off initialisation task, is there a standard or recommended practice?</p> <p>Possibilities:</p> <ul> <li>Use a StatefulSet even if it isn't necessary after initialisation, and have init containers which check to see if they are on the first p...
<p>We effectively ended up with a Job that does the initialization task and creates a secret that the Deployment replicas have mounted as a volume, blocking them until the Job has completed. We're using ArgoCD without sync waves. (There are complications with patching the Job name whenever its spec is updated because J...
<p>I am installing CNI using null_resource in terraform. Now if the CNI is already installed the terraform script fails with error: <code>exit status 254. Output: │ An error occurred (ResourceInUseException) when calling the CreateAddon │ operation: Addon already exists.</code> How can I make terraform continue with ex...
<p>you can handle the error base on the response. if the command response contains <code>Addon already exists</code> you can <code>exit 0</code> and return an error if something else, it can be <code>aws cli</code> permission or wrong command.</p> <pre><code>resource &quot;null_resource&quot; &quot;install-CNI&quot; { ...
<p>While provisioning a Kubernetes cluster using kubeadm, I get my nodes tagged as &quot;none&quot;.I would like to know if there is an option to add a Role name manually for the node.</p>
<p>You can label the node by <code>kubectl label node &lt;name&gt; key=value</code></p>
<p>I have a ASP.NET Core Worker Service which gets some information like thread count, batch size etc. from <code>appsettings.json</code>. These settings will only take affect on startup and cannot be change when the service is running. The application will be running in a kubernetes cluster.</p> <p>What is the best pr...
<p>In Kubernetes, the suggested way of having these type of configuration settings of non-confidential data is to use the configmap api</p> <p><a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/configmap/</a></p> <p>This giv...
<p>I am using Azure devops to deploy services to AKS. There are few instances that even though the pods weren't started(in crashed state) the pipeline still shows it as success. I want to make the task/pipeline to fail if the deployment aren't successfully rolled out. I tried to use</p> <pre><code>kubectl rollout statu...
<p>Based on the approach from @DevUtkarsh I am able to fail my pipeline when the pods are not in running state Thanks to <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/kubectl/cheatsheet/</a>. basically, I am doing two things. 1. Validat...
<p>Im on macOS and im using <code>minikube</code> with <code>hyperkit</code> driver: <code>minikube start --driver=hyperkit</code></p> <p>and everything seems ok...</p> <p>with <code>minikube status</code>:</p> <pre><code>minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configu...
<p>I had exactly same problem. I found out that my internet connection was slow, the timout to pull an image is <code>120</code> seconds, so kubectl <strong>could not</strong> pull the image in under <code>120</code> seconds.</p> <p>first use minikube to pull the image you need for example:</p> <pre><code>minikube im...
<p>First, the yaml file is right,because I can use them directley create a mysql cluster in kubernetes.<br /> but when I try to create a mysql cluster by kubernetes api for java, an error occured<br /> The commond in yaml file cannot be recognized by the process.<br /> The key component of the yaml file is as follows</...
<p>In your Java code, you are explicitly including double quotes in the string, <code>withCommand(&quot;bash&quot;, &quot;\&quot;-c\&quot;&quot;, ...)</code>. That's causing the container command to execute something similar to <code>bash '&quot;-c&quot;' ...</code> where the quotes are part of the argument. In turn,...
<p>I have a Kubernetes namespace with limited privileges which excludes the creation of <code>ClusterRole</code> and <code>ClusterRoleBinding</code>. I want to monitor the resource consumption and pod-related metrics on the namespace level.</p> <p>E.g., pod health and status, new pod creation, pod restarts, etc.</p> <p...
<p>It is possible to get namespace level entities from kube-state-metrics.</p> <ol> <li><p>Pull the helm chart for kube-state-metrics: <a href="https://bitnami.com/stack/kube-state-metrics/helm" rel="nofollow noreferrer">https://bitnami.com/stack/kube-state-metrics/helm</a></p> </li> <li><p>Edit the values.yaml file an...
<p>I have managed MariaDB with SSL enabled deployed in Azure, and i created a service type &quot;external&quot; named &quot;mysql&quot; within my k8s cluster.</p> <p>Then i created a secret like follwing :</p> <pre><code>kubectl create secret generic ca-cert --from-file=ca-cert=./BaltimoreCyberTrustRoot.crt.pem -n app ...
<p>So make sure that the DB exist on the Azure MariaDB server and the second thing is that path is further used by the daemon <code>tmp</code> so certs should not be mounted here, somewhere where the daemon can read.</p> <pre><code>wordpress 04:19:09.91 INFO ==&gt; Persisting WordPress installation /opt/bitnami/script...
<p>In EKS I am trying to use SecretProviderClass to provide secrets as environment variables to containers. I can see the secret mounted inside the container but no combination of key/names is allowing me to use it as an environment variable. Insode the container I can <code>cat /mnt/secrets-store/awscredentials</code>...
<p>I eventually got this sorted. I had followed the AWS documentation for installing the driver which included using a helm chart i.e.</p> <pre><code>helm install -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver </code></pre> <p>However, the documentation failed to point out that with ...
<p>I'm trying to follow the instructions at <a href="https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md" rel="noreferrer">https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md</a> to create a Kubernetes Dashboard token. Ho...
<p>If your version is lower than 1.24, please run the following command.</p> <pre><code>kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath=&quot;{.secrets[0].name}&quot;) -o go-template=&quot;{{.data.token | base64decode}}&quot; </code></pre> <p>This works in my c...
<blockquote> <p>error: resource mapping not found for name: &quot;ingress-srv&quot; namespace: &quot;&quot; from &quot;ingress-srv.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &quot;networking.k8s.io/v1beta1&quot; ensure CRDs are installed first</p> </blockquote> <p>I am new to Kubernetes, I was setti...
<p>The resource type specified in your manifest, <code>networking.k8s.io/v1beta1 Ingress</code>, was removed in Kubernetes v1.22 and replaced by <code>networking.k8s.io/v1 Ingress</code> (see the <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122" rel="noreferrer">deprecation guide<...
<p>I've created a secret okay by doing this...<code>kubectl create secret generic &lt;namespace&gt; &lt;secret-name&gt; --from-literal=value1=xxxx --from-literal=value2=xxxx --from-literal=value3=xxxx</code></p> <p>When I do a get command I get</p> <pre><code> apiVersion: v1 data: value1: xxxx value2: ...
<blockquote> <p>Is this ONLY possible if you add the secret from a file</p> </blockquote> <p>yes, this is used to compare the live manifest and manifest in the file. <strong>But we annotate the secret even if it's created without a manifest file.</strong></p> <blockquote> <p>The kubectl apply command writes the content...
<p>Since NFS has single point of failure issue. I am thinking to build a storage layer using S3 or Google Cloud Storage as PersistentVolumn in my local k8s cluster.</p> <p>After a lot of google search, I still cannot find an way. I have tried using s3 fuse to mount volume to local, and then create PV by specifying the ...
<p>S3 is not a file system and is not intended to be used in this way.</p> <p>I do not recommend to use S3 this way, because in my experience any FUSE-drivers very unstable and with I/O operations you will easily ruin you mounted disk and stuck in <a href="https://stackoverflow.com/questions/37476114/s3fs-throws-error-...
<p>I've just started learning about kubernetes and yaml files.</p> <p>Although kubernetes documentation provides lot's of examples.</p> <p>One thing I couldn't manage to find were how the different <strong>Kind</strong> (Deployment, Pod, Service, ConfigMap, Etc...) required a different yaml structure and keys.</p> <p>S...
<p><a href="https://kubernetes.io/docs/reference/kubernetes-api/" rel="nofollow noreferrer">It's documented on the Kubernetes website.</a> However it may be a bit cumbersome to learn it like this, and you may prefer to learn mostly by looking at examples and existing yaml files.</p> <p>Also, a good IDE that support Kub...
<p>With my team, we're currently building an API using FastAPI and we're really struggling to get good performances out of it once deployed to Kubernetes. We're using async calls as much as possible but overall sitting at ~8RPS / pod to stay under our SLA of P99 200ms.</p> <p>For resources, we assign the following:</p>...
<p>First, try to request at least 1 CPU for your API, because if there are no available CPUs on the node, the pod will only use the reserved amount of CPUs which is 600m, so if you have another application with requests cpu=400m for example, kubernetes will run both applications on the same cpu, with 60% of the time fo...
<p>I have a Neo4j database running on Kubernetes. I want to make scheduled backups for the database. I know that Neo4j provides <a href="https://neo4j.com/docs/operations-manual/current/backup-restore/" rel="nofollow noreferrer">a set of tools for backup and restore</a>. However, Kubernetes <a href="https://kubernetes....
<p>Generally, if it is not supported by the database, then it is a bad idea.</p> <p>Think of your database as being stored across:</p> <ol> <li>Database files on disk</li> <li>Page cache (in volatile memory)</li> <li>Write ahead transaction logs on disk</li> </ol> <p>A volume snapshot would not save enough information ...
<p>So we have a kubernetes cluster running some pods with celery workers. We are using python3.6 to run those workers and celery version is 3.1.2 (I know, really old, we are working on upgrading it). We have also setup some autoscaling mechanism to add more celery workers on the fly.</p> <p>The problem is the following...
<p>I wrote a <a href="https://blog.dy.engineering/hpa-for-celery-workers-6efd82444aee" rel="nofollow noreferrer">blog post</a> exactly on that topic - check it out.</p> <p>When Kubernetes decide to kill a pod, it first send SIGTERM signal, so your Application have time to gracefully shutdown, and after that if your App...
<p>I am running a 2-node K8s cluster on OVH Bare Metal Servers. I've set up <strong>MetalLB</strong> and <strong>Nginx-Ingress</strong>.The 2 servers both have public IPs and are not in the same network segment. I've used one of the IPs as the entrypoint for the LB. The deployments I created 3 nginx containers &amp; se...
<p>I believe the reason is that the <code>nginx</code> service you have deployed for &quot;blue&quot; and &quot;green&quot; deployments are not serving anything on the <code>/blue</code> and <code>/green</code> endpoints. You need to create these endpoints inside <code>nginx</code> so that they become valid. Your ingre...
<p>When k8s job keeps recreating pods within 10 seconds, what is the best way to get the related logs and find out the root cause? I tried to use</p> <pre><code>kubectl logs &lt;pod&gt; -n &lt;namespace&gt; </code></pre> <p>and always got <em><strong>Error from server (NotFound): pods &quot;XXXX&quot; not found</strong...
<p>If the pod &quot;restarting/crashloop&quot; then you can get logs from the <code>previous</code> run.</p> <pre><code>kubectl logs -n &lt;namespace&gt; &lt;pod&gt; --previous </code></pre> <p>This will show you the logs of the last run of the pod before it crashed. It is a handy feature in case you want to figure out...
<p>I am using Azure devops to deploy services to AKS. There are few instances that even though the pods weren't started(in crashed state) the pipeline still shows it as success. I want to make the task/pipeline to fail if the deployment aren't successfully rolled out. I tried to use</p> <pre><code>kubectl rollout statu...
<p>Your <code>kubectl</code> commands are getting applied successfully to the cluster which means the YAML's are getting updated in the kube cluster and so you will not see an error with apply or rollout commands in your Azure pipelines.</p> <p>It's your Kubernetes controller manager that is not able to apply the chang...
<p>Is there any way to set label on secret created by ServiceAccount? For now it is the only secret I'm not able to configure with label.</p> <pre><code>apiVersion: v1 kind: ServiceAccount metadata: name: forum-sa </code></pre> <p><a href="https://i.stack.imgur.com/qZY9D.png" rel="nofollow noreferrer"><img src="https...
<p>Please use the below configuration using the service account with kubectl,Follow the <a href="https://www.ibm.com/docs/en/cloud-paks/cp-management/2.0.0?topic=kubectl-using-service-account-tokens-connect-api-server#kube" rel="nofollow noreferrer">documentation</a><a href="https://www.ibm.com/docs/en/cloud-paks/cp-ma...
<p>In the following task I want to make ansible <strong>not</strong> to fail when <code>stderr</code> contains <code>the object has been modified</code> or <code>have a resource type</code>.</p> <pre><code>- name: List nodes delegate_to: localhost shell: kubectl get nodes run_once: true register: output_error ...
<p>Use a regex which includes both alternatives:</p> <pre class="lang-yaml prettyprint-override"><code>- name: List nodes delegate_to: localhost shell: kubectl get nodes run_once: true register: output_error failed_when: - output_error.stderr_lines | length &gt; 0 - output_error.stderr is not regex('t...
<p>With my team, we're currently building an API using FastAPI and we're really struggling to get good performances out of it once deployed to Kubernetes. We're using async calls as much as possible but overall sitting at ~8RPS / pod to stay under our SLA of P99 200ms.</p> <p>For resources, we assign the following:</p>...
<p><strike>It finally appeared that our performance issues were caused by the non-usage of <code>gunicorn</code> and only <code>uvicorn</code> (even though <a href="https://fastapi.tiangolo.com/id/deployment/docker/#replication-number-of-processes" rel="nofollow noreferrer">FastAPI's author recommends against this in h...
<p>I have new Civo cluster,I downloaded config</p> <pre><code> kubectl config --kubeconfig=civo-enroute-demo-kubeconfig </code></pre> <p>does not work</p> <pre><code>Modify kubeconfig files using subcommands like &quot;kubectl config set current-context my-context&quot; The loading order follows these rules: 1. I...
<p>You can use a kubeconfig file with kubectl as</p> <pre><code>kubectl --kubeconfig=config_file.yaml command </code></pre> <p>Example:</p> <pre><code>kubectl --kubeconfig=civo-enroute-demo-kubeconfig.yaml get nodes </code></pre> <p>OR You can export <code>KUBECONFIG</code> and use <code>kubectl</code> command</p>
<p>I created a k8s eks cluster and all of it's resources within terraform but ran into some issues and deleted the cluster through the aws UI. Now when I try to run terraform I'm getting this error <code>Error: Get &quot;http://localhost/api/v1/persistentvolumes/efs-jupyter-shared-v2&quot;: dial tcp 127.0.0.1:80: conne...
<p>You need to clean the terraform state:</p> <p>First step is listing all the resources in the state:</p> <pre class="lang-bash prettyprint-override"><code>terraform state list </code></pre> <p>Then you can delete the resources you deleted in AWS dashboard:</p> <pre class="lang-bash prettyprint-override"><code>terrafo...
<p>In our kubernetes cluster setup, we normally have 2 types of setups: <code>prod</code> and <code>dev</code>. The clusters have tags/labels as well as env variables to identify them as such.</p> <p>Some of our images are designed to dev but not prod and vice-versa (differences are in the custom binaries that are inst...
<p>Kubernetes provides a few ways to enforce your organizational policies, some are as follow:</p> <p><strong>using ImagePolicyWebhook:</strong></p> <p>You can use <code>ImagePolicyWebhook</code> to enforce your image usage policies by doing <code>ImageReview.</code> More info <a href="https://kubernetes.io/docs/refere...
<p>We have an AKS test cluster with <em>four</em> Windows worker nodes and a Deployment with a replica count of <em>two</em>. The corresponding Pod spec does not specify any resource requests and limits (thus, the resulting Pods are in the BestEffort QoS class).</p> <p>In order to conduct a performance test, we scaled ...
<p>I <em>believe</em> that the scheduler is aware of which Nodes already have the container images pulled down, and will give them preference to avoid the image pull (and thus faster start time)</p> <p>Short of digging up the source code as proof, I would guess one could create a separate Pod (for this purpose, I liter...
<p>I am running a GKE Cluster with the GCP Load Balancer as my Ingress Controller.</p> <p>However, I noticed that a specific request to the service hosted in this GKE Cluster was being rejected with and 502 error.</p> <p>I checked the GCP Loadbalancer logs and I was able to see a return with <code>statusDetails: &quot;...
<p>Can you verify the timer of your health check? If this is set to 1 second or lower than the health checks that were set to higher value, <code>failed_to_pick_backend</code> error will normally occur.</p> <p>I recommend you to change the timer to the default value 5 or higher and then test a new deployment. You can c...
<p>Has anyone deployed QUIC with a supported/official Kubernetes Ingress Controller? I have been using the NGINX ingress so far and support for QUIC seems to be NOT there at present.</p>
<p><a href="https://bunny.net/academy/cdn/what-is-http-3-quic-protocol/" rel="nofollow noreferrer">QUIC/HTTP3</a> is not yet available in the <code>Stable Nginx</code> and to be available in the Nginx ingress controller will defiantly take time.</p> <blockquote> <p>Product Management tells me that we hope to fully sup...
<p>minikube in mac os is not able to pull docker images from docker repository.</p> <p>Trying to run spark on k8s</p> <pre><code>spark-submit --master k8s://https://ip:port --deploy-mode cluster --name test-run-spark --conf spark.kubernetes.container.image=Docker-image --conf spark.kubernetes.driver.container.image=doc...
<p>Your <code>minikube</code> environment is isolated from your host, so if you already have the image on your host or you can pull it, it doesn't mean you can do the same thing in <code>minikube</code>.</p> <p>If you want to build the image in <code>minikube</code> context:</p> <pre class="lang-bash prettyprint-overri...
<p>There are two fields in k8s, requests, and limits. I want to know that whether GKE cost us on requests or limits.</p> <p>If request is 1Gi and limits is 2Gi Will I be costed for 1Gi or 2Gi?</p>
<p>There are two different modes of operation in Google Kubernetes Engine: Autopilot (easier to manage, but less flexible) and Standard. They're billed <a href="https://cloud.google.com/kubernetes-engine/pricing#google-kubernetes-engine-pricing" rel="nofollow noreferrer">differently</a>.</p> <p>In Standard mode, you're...
<p>I have a kubernetes pod configuration with a named volume and want to run it via <code>podman play kube</code> which fails for an unknown reason:</p> <p><code>podman play kube kubernetes.yml</code>:</p> <pre><code>Error: kubernetes.yml: Volume mount database-data-volume specified for container but not configured in ...
<p>Your <code>volume</code> is missing a name (this would fail on Kubernetes as well). The <code>volumes</code> section maps a volume name to some sort of volume definition; when you write:</p> <pre><code> volumes: - persistentVolumeClaim: claimName: database-data-volume </code></pre> <p>You have a volume ...
<p>I'm setting up an ingress for the application resides in the AKS. But ran into a problem on binding the certificate to the ingress.</p> <p>As you can see below, I am trying to reference <code>ingress-cert</code> from the KV and use it in the ingress through <code>SecretProviderClass</code></p> <pre class="lang-yaml ...
<p>As I couldn't find a way to integrate the Ingress with the Azure Key Vault, I've implemented a workaround with GitHub Actions to retrieve the certificate and add it to the AKS. Because most of them are bash commands, the workaround isn't exclusive to GitHub Actions.</p> <pre class="lang-yaml prettyprint-override"><c...
<p>kubernetes cannot pull a public image. Standard images like nginx are downloading successfully, but my pet project is not downloading. I'm using minikube for launch kubernetes-cluster</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment metadata: name: api-gateway-deploumnet ...
<p>I could not solve the problem in the ways I was suggested. However, it worked when <strong>I ran minikube with a different driver</strong></p> <pre><code>$ minikube start --driver=none </code></pre> <p><em><strong>--driver=none</strong></em> means that the cluster will run on your host instead of the standard <em><s...
<p>Should I deploy traefik 1.7.x as DaemonSet or as A deployment in GKE (Google K8S)?</p> <h3>Environment Description</h3> <p>Kubernetes clusters with node autoscaler in Google cloud, hosting several production clusters. Clusters can extend up to 90 nodes (minimum is 6 nodes), currently we have <code>traefik</code> pod...
<h2>Deploy Traefik using a Deployment or DaemonSet?</h2> <p>It is possible to use Traefik with a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment" rel="nofollow noreferrer">Deployment</a> or a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noref...
<p>I do have multiple persistent volumes which need to be shrinked to reduce the hosting costs. I already figured out that Kubernetes does not provide such an option. I also tried to clone or the restore the volumes from an snapshot to a new smaller volume - with the same result (<code>requested volume size XXX is less...
<p>Finally I achieved what needed with the following steps (still tricky and manual work):</p> <ul> <li>Stop running pod (otherwhise you could not use the volume in the next steps)</li> <li>Create the a new PVC with the desired capacity (ensure that the spec and label matches the exisitng PVC)</li> <li>Run this Job <a ...
<p>My cluster is running on-prem. Currently when I try to ping the external IP of service type LoadBalancer assigned to it from Metal LB. I get a reply from one of the VM's hosting the pods - <strong>Destination Host unreachable</strong>. Is this because the pods are on an internal kubernetes network(I am using calico)...
<p>The LoadbalancerIP or the External SVC IP will never be pingable.</p> <p>When you define a service of type LoadBalancer, you are saying I would like to Listen on TCP port 8080 for eg: on this SVC.</p> <p>And that is the only thing your External SVC IP will respond to.</p> <p>A ping would be UDP ICMP packets that do ...
<p>I've experienced a surprising behavior when playing around with Kubernetes and I wanted to know if there is any good explanation behind it.</p> <p>I've noticed that when two Kubernetes deployments are created with the same labels, and with the same <code>spec.selector</code>, the deployments still function correctly...
<p>When you create a K8S Deployment, K8S creates a ReplicaSet to manage the pods, then this ReplicaSet creates the pods based on the number of replicas provided or patched by the hpa. Addition to the provided labels and annotations you provide, the ReplicaSet add <code>ownerReferences</code> which contains its name and...
<p>I noticed that a new cluster role - &quot;eks:cloud-controller-manager&quot; appeared in our EKS cluster. we never created it.I tried to find origin/creation of this cluster role but not able to find it.</p> <p>any idea what does &quot;eks:cloud-controller-manager&quot; cluster role does in EKS cluster?</p> <p><cod...
<p>This role is created by AWS when you provision the cluster. This role is for the AWS <a href="https://kubernetes.io/docs/concepts/architecture/cloud-controller/" rel="nofollow noreferrer">cloud-controller-manager</a> to integrate AWS services (eg. CLB/NLB, EBS) with Kubernetes. You will also find other roles like ek...
<p>I am learning kubernetes and created first pod using below command</p> <pre><code>kubectl run helloworld --image=&lt;image-name&gt; --port=8080 </code></pre> <p>The Pod creation was successful. But since it is neither a ReplicationController or a Deloyment, how could I expose it as a service. Please advise.</p>
<p>Please refer to the documentation of <strong>kubernetes service concept</strong> <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/</a> At the end of the page, there also is an int...
<p>I am learning kubernetes and created first pod using below command</p> <pre><code>kubectl run helloworld --image=&lt;image-name&gt; --port=8080 </code></pre> <p>The Pod creation was successful. But since it is neither a ReplicationController or a Deloyment, how could I expose it as a service. Please advise.</p>
<p>You can create the service with the same set of selector and labels</p> <pre><code>apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app: helloworld ports: - protocol: TCP port: 80 targetPort: 9376 </code></pre> <p>so if selector matching it will route the traffic to P...
<p>We are using helm charts to deploy our charts in Openshift.</p> <p>This is our workflow:</p> <ul> <li>We create a new version of the helm and docker image at each sprint/ e.g 1.0.0 (saving them in a snapshot artifactory)</li> <li>During the sprint we build several times the helm chart and the docker image and push t...
<p>In addition to you functional tag (eg v1.0.0), add a second tag to your image with something unique, for example the git-sha commit tag coming from git used at build time.</p> <p>The functionnal tag is a &quot;floating&quot; tag, it will move from one image to the other but the &quot;git-sha&quot; tag will be unique...
<p>Error : Failed to pull image &quot;busybox&quot;: rpc error: code = Unknown desc = Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: <a href="https://www.docker.com/increase-rate-limit" rel="nofollow noreferrer">https://www...
<p><strong>1 .</strong> On November 20, 2020, rate limits anonymous and free authenticated use of Docker Hub went into effect. Anonymous and Free Docker Hub users are limited to 100 and 200 container image pull requests per six hours. You can read <a href="https://docs.docker.com/docker-hub/download-rate-limit/" rel="n...
<p>What are the packages inside Kubernetes ConstraintTemplate policy definition? and can we create our own packages using rego? I have a use case wherein I want to disallow the use of a <strong>stable</strong> image tag for any deployments. I have seen the Github repository of OPA gatekeeper samples and I see they have...
<blockquote> <p>Packages group the rules defined in one or more modules into a particular namespace. Because rules are namespaced they can be safely shared across.</p> </blockquote> <p>You can try this <strong>ConstraintTemplate</strong>, also set it as per requirement to disable <strong>stable</strong> image</p> <pre>...
<p>I am working on building a project using Node.js which will require me to have an application that can deploy to Kubernetes. The service I am working on will take some Kubernetes manifests, add some ENV variables into them, and then would deploy those resources.</p> <p>I have some code that can create and destroy a ...
<p>Management of deployments is handled by the <a href="https://kubernetes-client.github.io/javascript/classes/appsv1api.appsv1api-1.html" rel="nofollow noreferrer">AppsV1Api</a> class:</p> <pre><code>const k8s = require('@kubernetes/client-node'); const kc = new k8s.KubeConfig(); kc.loadFromDefault(); const k8sApi =...
<p>I made a Kafka and zookeeper as a statefulset and exposed Kafka to the outside of the cluster. However, whenever I try to delete the Kafka statefulset and re-create one, the data seemed to be gone? (when I tried to consume all the message using <code>kafkacat</code>, the old messages seemed to be gone) even if it is...
<p>Kubernetes default prevent deleting <code>PersistentVolumeClaims</code> and bounded <code>PersistentVolume</code> objects when you scaling <code>StatefulSet</code> down or deleting them.</p> <p>Retaining <code>PersistentVolumeClaims</code> is the default behavior, but you can configure the <code>StatefulSet</code> t...
<p>I'm trying to create a new <strong>Kubernetes Service Connection</strong> for <strong>Azure DevOps</strong>, but when I try to create it I get the error:</p> <blockquote> <p>You don’t appear to have an active Azure subscription</p> </blockquote> <p>I've tried a few ways to fix the issue but it's not working.</p>
<p><strong>Here's how I solved it</strong>:</p> <p>I simply went to <strong>Azure DevOps</strong> &gt; <strong>Project</strong> &gt; <strong>Project settings</strong></p> <p><a href="https://i.stack.imgur.com/4EkFj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4EkFj.png" alt="enter image descriptio...
<p>I have installed loki and grafana via helm charts to my cloud hosted k8s cluster. How do I send the loki metrics to grafana cloud? I know I should edit the promtail config file but how do I locate and view/edit helm chart files?</p> <p>My installation procedure for loki+grafana are:</p> <pre><code>helm upgrade --ins...
<p>I'm not an expert in Loki but I downloaded the default values.yaml that Chart uses and there seems an option to mention the Promtail configuration which should help you (shown below) and looking at the commands above, it seems Helm would have used default values to install the chart, you can still modify them in 2 w...
<p>I'm trying to create an EKS cluster with terraform and configure it thorugh kubectl and istio basic following this guides:</p> <p><a href="https://rtfm.co.ua/en/aws-elastic-kubernetes-service-running-alb-ingress-controller/" rel="nofollow noreferrer">alb-ingress-controller</a></p> <p><a href="https://rtfm.co.ua/en/i...
<p>I managed to make ALB working with following</p> <pre><code>EKS - 1.22 aws-load-balancer-controller - v2.4.1 istioctl - 1.14.2 </code></pre> <p>First I modified istio-ingressgateway service type from load balancer to node port.</p> <pre><code>istioctl install --set profile=default --set values.gateways.istio-ingres...
<p>I want to run Python code inside a pod. The pod is created by airflow that I don't control.</p> <p>I want to somehow get the name of the pod I'm running in.</p> <p>How can it be done?</p>
<p>You can tell kuberenetes to mount an env variable for you:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: dapi-test-pod spec: containers: - name: test-container image: gcr.io/google_containers/busybox command: [ &quot;/bin/sh&quot;, &quot;-c&quot;, &quot;env&quot; ] env: - ...
<p>All.</p> <p>I have questions about the purpose of root directory for containerd, docker, kubeadm. I've been trying to change the root directory from default to specific directory.</p> <p>As far as I known, there are 3 types of root directory like below.</p> <ul> <li>docker : --data-root /var/lib/docker</li> <li>cont...
<p>These are the implementation specific paths for these runtimes. With docker all your containers, images and their related information is stored in /var/lib/docker, same is the case for containerd.io which stores all its container related objects in /var/lib/containerd</p>
<p>I am deploying a monitoring stack from the <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer"><code>kube-prometheus-stack</code></a> helm chart and I am trying to configure alertmanager so that it has my custom configuration for alerting in ...
<p>The alertmanager requires certain non-default arguments to overwrite the default as it appears it fails in silence. Wrong configuration leads to the pod not applying the configuration (<a href="https://github.com/prometheus-community/helm-charts/issues/1998" rel="nofollow noreferrer">https://github.com/prometheus-co...
<p>I created PV as follows:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: foo-pv spec: storageClassName: &quot;my-storage&quot; claimRef: name: foo-pvc namespace: foo </code></pre> <p>Why we need to give storageClassName in PV? When Storage class creates PV, why to give storageClass...
<p>According to Kubernetes Official documentation:</p> <p><strong>Why we need to give storageClassName in PV?</strong></p> <blockquote> <p>Each <em>StorageClass</em> contains the fields <em>provisioner, parameters, and reclaimPolicy</em>, which are used when a PersistentVolume belonging to the class needs to be dynamic...
<p>I want to implement a conditional template for Deployment resources through helm which can be enabled or disabled as per the environment. Something like the below which in not working. Or can we achieve the same through a different method.</p> <pre><code>resources: enabled: true requests: cpu: 100m ...
<p>you can add condition in the deployment template</p> <pre><code>{{- if .Values.resources_limit.enabled }} resources: {{- toYaml .Values.resources_limit.resources | nindent 12 }} {{- end }} </code></pre> <p>and the value file should be like this</p> <pre><code>resources_limit: enabled: true resources: ...
<p>I want to implement a conditional template for Deployment resources through helm which can be enabled or disabled as per the environment. Something like the below which in not working. Or can we achieve the same through a different method.</p> <pre><code>resources: enabled: true requests: cpu: 100m ...
<p>You can also check directly on <strong>resource</strong> value without adding the <strong>If</strong> <strong>condition</strong> or introducing a new variable in <code>values.yaml</code></p> <pre><code>resources: {{- toYaml .Values.resources | nindent 12 }} </code></pre> <p><strong>values.yaml</strong> if values a...
<p>I have a k8s cluster with three masters, two workers, and an external haproxy and use flannel as a cni. The coredns have problems, and their status is running, but they don't become ready.</p> <p>Coredns log</p> <p><img src="https://i.stack.imgur.com/lFNGV.png" alt="1" /></p> <p>I get the logs of this pod, and I get...
<h3>Lets see your CoreDNS works at all?</h3> <ul> <li>You can crete a simple pod and go inside and from there, curl Services via <code>IP:PORT</code> &amp; <code>Service-name:PORT</code> <pre class="lang-bash prettyprint-override"><code>kubectl run -it --rm test-nginx-svc --image=nginx -- bash </code></pre> </li> </ul...
<p>GCP allows the Kubernetes service account to impersonate the IAM service account by adding an IAM policy binding between the two service accounts. This binding allows the Kubernetes service account to act as the IAM service account.</p> <pre><code>gcloud iam service-accounts add-iam-policy-binding GSA_NAME@GSA_PROJE...
<p><code>service_account_id</code> is the fully-qualified name of the service account to apply the policy to.</p> <p><code>projects/PROJECT_ID/serviceAccounts/SERVICE_ACCOUNT_EMAIL</code></p>
<p>We are using the Go <a href="https://pkg.go.dev/helm.sh/helm/v3/pkg/action" rel="nofollow noreferrer">helm.sh/helm/v3/pkg/action</a> package to install Helm charts. We are able to pass installation values to Helm chart <code>Run</code> functions via <code>map[string]interface{}</code>, as in <a href="https://stackov...
<p>One straightforward thing to do could be to reuse the <a href="https://pkg.go.dev/helm.sh/helm/v3@v3.9.3/pkg/cli/values" rel="nofollow noreferrer">helm.sh/helm/v3/pkg/cli/values</a> package. This has the logic to handle the <code>-f</code> option (and also <code>--set</code> and its variants) and return a unified <...
<p>I can't find where the kubelet logs are located for Docker Desktop (Windows). There's a similar question <a href="https://stackoverflow.com/questions/34113476/where-are-the-kubernetes-kubelet-logs-located">here</a>, but the answers all refer to linux/kind installs of kubernetes.</p>
<p><em>I get that this is an old question, but it does seem to get some traffic, has no accepted answer and is the only of this kind on SO - here is my take on this problem and a solution:</em></p> <h2>The process</h2> <p>As already pointed out by @acid_fuji, everything is running inside a VM we need to access, to get ...
<p>How can I add a default value to shutdownDelay to 50 seconds in my template</p> <pre><code> lifecycle: preStop: {{ toYaml .Values.lifecycleHooks.preStop | indent 14 }} {{- else if gt (int .Values.shutdownDelay) 0 }} preStop: exec: ...
<p>Ordinarily I'd recommend the <a href="https://docs.helm.sh/docs/chart_template_guide/function_list/#default" rel="nofollow noreferrer"><code>default</code></a> function</p> <pre class="lang-none prettyprint-override"><code>... (gt (.Values.shutdownDelay | default 50) 0) ... </code></pre> <p>The problem here is that ...
<p>I'm new to k8 and i'm trying to figure out how to deploy my first docker image on minikube.</p> <p>My k8.yaml file is:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: my-deployment namespace: default spec: replicas: 1 selector: matchLabels: app: my-app template: metadata...
<p>There is an issue in the service selector as well, so first, we need to fix this service selector and it should match with with deployment label</p> <pre><code> replicas: 1 selector: matchLabels: app: my-app </code></pre> <p>and the service should refer to this <code>selector</code></p> <p>the selector ...
<p>In Kubernetes secrets I can only retrieve creation timestamp</p> <pre><code>metadata: creationTimestamp: </code></pre> <p>However I don't find a way to check modified/updated timestamp</p> <p>Is this a lacking feature or I am not able to find it ?</p>
<p>Indeed, while Kubernetes metadata usually includes creationTimestamp, there would not be anything tracking previous or last edition timestamp. For deployments, you could track changes using their replicasets. Or querying etcd directly, you may find about previous revisions for any object, that were not yet removed b...
<p>When I went through some of the tutorials online, it showed that only the worker nodes have the container runtime. But from my understanding, it seems master nodes also run some pods such as <a href="https://stackoverflow.com/questions/58481709/why-kubelet-is-running-on-kubernetes-master-node#:%7E:text=The%20reason%...
<p><code>Master</code> nodes have <code>CRI</code> too, verify it using: <code>kubectl get nodes -o wide</code>.</p> <p>When a Kubernetes cluster is first set up, a <code>Taint</code> is set on the master node. This automatically prevents any pods from being scheduled on this node. But, it's definitely possible to run ...
<p>I have created an image of my app using docker and when I run the docker image on my local machine it runs successfully, but the same image is erroring out when running using kubernetes. The error is: <code>exec /docker-entrypoint.sh: exec format error</code> Upon surfing the net for possible solutions I found the s...
<p>Try something like in you <strong>Dockerfile</strong></p> <pre><code>FROM --platform=linux/amd64 node:18-alpine as builder </code></pre> <p>Build the image and run it on K8s.</p> <p>it could be due to the building image on Mac or Arm and your K8s cluster is not supporting that architecture.</p>
<p>I installed the <a href="https://github.com/prometheus-operator/kube-prometheus" rel="nofollow noreferrer">kube-prometheus-0.9.0</a>, and want to deploy a sample application on which to test the Prometheus metrics autoscaling, with the following resource manifest file: (hpa-prome-demo.yaml)</p> <pre class="lang-yaml...
<p><strong>ENV</strong>:</p> <ol> <li>helm install all Prometheus charts from <code>prometheus-community https://prometheus-community.github.io/helm-chart</code></li> <li>k8s cluster enabled by docker for mac</li> </ol> <p><strong>Solution</strong>:<br /> I met the same problem, from Prometheus UI, i found it had <c...
<p>I am running my <strong>minikube as docker image.</strong> I am trying to expose my service to outside world using Nodeport.</p> <p>This is my yaml file.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: docker-hello-world labels: app: docker-hello-world spec: selector: matchLabels: ...
<p>You don't need an external IP when using NodePort, you can use <code>minikube ip</code> to get the minikube node address, and then connect to the respective <code>nodePort</code>:</p> <pre><code>$ kubectl svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE docker-hello-world-s...