prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I'm trying to install <strong>Datadog</strong> agent for a <strong>Kubernetes</strong> cluster using <strong>Helm</strong>.</p> <p>This is the <strong>helm command</strong> I'm using for it:</p> <pre><code>helm repo add datadog https://helm.datadoghq.com helm repo update helm upgrade --install datadog datadog/data...
<p><strong>Here's how I solved it</strong>:</p> <p>The issue had to do with the <strong>Datadog Destination Site</strong>. The Destination site for my metrics, traces, and logs is supposed to be <code>datadoghq.eu</code>. This is set using the variable <code>DD_SITE</code>, and it defaults to <code>datadoghq.com</code>...
<p>I have installed Rancher Desktop. It is working perfectly except for the inability for nerdctl and k3s to download docker images from hub.docker.com from behind my corporate firewall.</p> <p>Question 1: After downloading Rancher Desktop, how do I set my corporate proxy credentials such that Kubernetes (with Rancher...
<p>I am using mac. In mac. machine, add proxy details to /etc/conf.d/docker file.</p> <pre><code>#rdctl shell #sudo su - #vi /etc/conf.d/docker NO_PROXY=&quot;localhost,127.0.0.1&quot; HTTPS_PROXY=&quot;http://HOST:PORT&quot; HTTP_PROXY=&quot;http://HOST:PORT&quot; export HTTP_PROXY export HTTPS_PROXY expo...
<p>I have the following code:</p> <pre><code> kubectl get job &lt;JOB-NAME&gt; -o json | jq 'del(.spec.selector)' | jq 'del(.spec.template.metadata.labels)' | kubectl replace --force -f - </code></pre> <p>That replaces an existing Kubernetes job with itself. Is it possible to do this with the Python Kubernetes API?</p>...
<p>The kubectl replace command has a <strong>--force</strong> option which actually does not use the replace, i.e., PUT, API endpoint. It <strong>forcibly deletes</strong> (DELETE) and then <strong>recreates</strong>, (POST) the resource using the provided spec.</p> <p>According to the <a href="https://github.com/kuber...
<p>I have a azure function app in powershell, dedicated to kubernetes functions.</p> <p>There are multiple functions but on each of them, the first thing we do is something like this.</p> <pre><code> az login --service-principal -u $usr -p $pwd --tenant $tenant $config = $HOME + &quot;/.kube/$tenant&quot;; az acc...
<p>You should be able to just use kubectl's global <code>--context</code> parameter (and <code>--kubeconfig</code> if needed), example:</p> <pre class="lang-bash prettyprint-override"><code>az aks get-credentials -n $cluster -g $rg kubectl get pod -n $tenant --context $cluster </code></pre> <p>In case you have two diff...
<p>i have a question to ask you about kubernates. I need to configure a Horizontal Load Balancer on a service with Kubernates. Specifically in my yaml file I used the following kind: HorizontalPodAutoscaler; the problem arises on the logic of uploading files to the volume: in a nutshell, when a pod is released, the dat...
<p>it's not good idea to store data in Dockerimage however still what you can do is,</p> <ul> <li>Copy data to docker image</li> <li>Inside the Kubernetes POD create the PVC volume</li> <li>Attach POD to PVC and use the volume mount</li> <li>Use the <strong>init container</strong> to copy data from the docker path to t...
<p>I need help with setting up TLS termination (using ingress-nginx) for two services in different backends. Basically, the idea is to go with:</p> <pre><code>https://some.url.here/serviceOne/ -&gt; http://hostOne/ https://some.url.here/serviceTwo/ -&gt; http://hostTwo/someServiceNameHere/ </code></pre> <p>I tried doin...
<p>here is a quick example of how it should be done ,also make sure that your second service responds to the port that you specified (8180)</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/rewrite-target: /$2 name: rewrite namespace: default spec...
<p>I have a very big issue. We have a large number of deployments for a component which up until now were using the RollingUpdate deployment strategy type.</p> <pre><code>spec: strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate </code></pre> <p>Now a new design decision...
<p>Latest update from this <a href="https://github.com/gimlet-io/onechart/issues/35" rel="nofollow noreferrer">issue</a> works</p> <pre><code> strategy: rollingUpdate: null type: Recreate </code></pre>
<p>I have a new install of K8s master and node both on ubuntu-18. The master is using weave for CNI and all pods are running:</p> <pre><code>$ sudo kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-6d4b75cb6d-29qg5 ...
<p>[ERROR CRI]: container runtime is not running: output: E0724 16:32:41.120653 10509 remote_runtime.go:925] &quot;Status from runtime service failed&quot; err=&quot;rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService&quot;..............</p> <p>rm /etc/containerd/config.toml... syst...
<p>I am trying to create PostgreSQL pods on k8s. after the pod deploy when I use kubectl get pods I see out</p> <pre><code>NAME READY STATUS RESTARTS AGE pgadmin 1/1 Running 5 9m postgres 1/1 Running 5 8m...
<p>To answer why you are seeing two different outputs, you have to understand how a container runs in Kubernetes.</p> <p>In docker, a container can run and then terminate, but then stay stopped unless you tell docker you want that container to automatically restart using the <code>--restart yes</code> switch</p> <p>In ...
<p>I currently am doing something like this</p> <pre><code>watch, err := s.clientset.CoreV1().Pods(&quot;&quot;).Watch(context.TODO(), metav1.ListOptions{ FieldSelector: fmt.Sprintf(&quot;spec.myfoo=%s&quot;, s.foo), }) for event := range watch.ResultChan() { ....... } </code></pre> <p>I am curious if I have s...
<p>Watch internally establishes a long poll connection with the API server. After establishing a connection, the API server will send a batch of initial events and any subsequent changes. Once a timeout has occurred, the connection will be dropped.</p> <p>Since your scenario involves two go routines, we cannot guarante...
<p>I am trying to deploy elasticsearch and kibana to kubernetes using <a href="https://github.com/elastic/helm-charts" rel="nofollow noreferrer">this chart</a> and getting this error inside the kibana container, therefore ingress returns 503 error and container is never ready.</p> <p>Error:</p> <pre><code>[2022-11-08T1...
<p>Figured it out. It was a complete pain in the ass. I hope these tips will help others:</p> <ol> <li><code>xpack.security.http.ssl.enabled</code> should be set to false. I can't find another way around it, but if you do i'd be glad to hear any advices. As i see it, you don't need security for http layer since kibana ...
<p>I create some pods with containers for which I set <code>ephemeral-storage</code> request and limit, like: (here <code>10GB</code>)</p> <p><a href="https://i.stack.imgur.com/87ew4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/87ew4.png" alt="enter image description here" /></a></p> <p>Unfortunat...
<p>Pods use ephemeral local storage for scratch space, caching, and for logs. The kubelet can provide scratch space to Pods using local ephemeral storage to mount emptyDir volumes into containers.</p> <p>Depending on your Kubernetes platform, <strong>You may not be able to easily determine where these files are being w...
<p>I have AKS with kubernetes version 1.23. I want to activate podsecurity on cluster level by setting it via AdmissionConfiguration as explained here:</p> <p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-admission-controller/" rel="nofollow noreferrer">https://kubernetes.io/docs/t...
<p>This is because the administration configuration is not a file to be applied inside the Kubernetes cluster.</p> <blockquote> <p>It's a <strong>static</strong> file that must be given to the API-server.</p> </blockquote> <p>If your Kubernetes cluster is managed by a clouder and you don't have access to the api-server...
<p>I need to write a <code>golang</code> application with the help of <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">client-go</a> which will listen/watch a particular namespace for any of these events:</p> <ul> <li>A new pod has been created</li> <li>A pod has been deleted</li> <li>A new c...
<p>You can create a clientset from parsing the kubeconfig file and then use this clientset to create a sharedInformerfactory for your particular namespace. Get a informer for your pods and add Event Handler functions. Implement those functions according to your requirement. You can check for container updates between o...
<p>I have 2 services deployed in Kubernetes</p> <ol> <li>Application A (asp.net core 5 gRPC service)</li> <li>Application B (asp.net core 5 api)</li> </ol> <p>Application B is accessible via ingress-nginx-controller over https from out side of my cluster.</p> <p>Application A is expose via Service and only accessible i...
<p>For HTTPS communication, you can setup certificate with &quot;dotnet dev-certs https&quot;. Each pod will need setup self-signed certificate on port 443, for development purpose, but not recommended.</p> <p>However, GRPC actually can be use with HTTP based, with service mesh support for http2/grpc for service-to-ser...
<p>This is how I'm trying to create a secret for my kubernetes mongodb, which gets deployed using the <a href="https://github.com/bitnami/charts/blob/main/bitnami/mongodb/values.yaml" rel="nofollow noreferrer">bitnami mongodb helm chart</a>:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: mongodb-secret ...
<p>Should be something like:</p> <pre><code>auth: usernames: [&quot;bob&quot;, &quot;alice&quot;] passwords: [&quot;bobpass&quot;, &quot;alicepass&quot;] databases: [&quot;bobdb&quot;, &quot;alicedb&quot;] </code></pre> <p>If you want to pass those on the cli --set flag instead, you should be able to use curly br...
<p>I am attempting to build a simple app with FastAPI and React. I have been advised by our engineering dept, that I should Dockerize it as one app instead of a front and back end...</p> <p>I have the app functioning as I need without any issues, my current directory structure is.</p> <pre class="lang-bash prettyprint-...
<p>Following up on Vinalti's answer. I would also recommend using one Dockerfile for the backend, one for the frontend and a docker-compose.yml file to link them together. Given the following project structure, this is what worked for me.</p> <p>Project running fastapi (backend) on port 8000 and reactjs (frontend) on p...
<p>I am experimenting in a small lab created with AutomatedLab that contains Windows Server 2022 machines running ActiveDirectory and SQLServer along with CentOS 8.5 machines running a Kubernetes cluster. My test application is a .Net 6 console application that simply connect to a SQLServer database running in the the ...
<p>This may not be Auth reated.</p> <p>If you are deploying to a linux container you need to make sure you don't deploy System.Data.SqlClient as this is a Windows only library. It will just blow up your container (as you are experiencing) when it first loads the library.</p> <p>I found that if I added Microsoft.Data.S...
<p>Hi I have added secret in my hashi corp vault in the below path</p> <p>cep-kv/dev/sqlpassword</p> <p>I am trying to access secret in my manifest as below</p> <pre><code>spec: serviceAccountName: default containers: # List - name: cep-container image: myinage:latest env: ...
<p>As you are getting 403 permission you need to Configure Kubernetes authentication, you can configure authentication from the following step:</p> <ol> <li>Enable the Kubernetes auth method:</li> </ol> <blockquote> <p><code>vault enable auth kubernetes</code></p> </blockquote> <ol start="2"> <li>Configure the Kubernet...
<p>We have a kubernetes cluster, where a reconcile is triggered in response to a custom event. Implemented in Golang using the following format:</p> <pre><code>type reconciler struct {} func (reconciler) Reconcile(ctx context.Context, o reconcile.Request) (reconcile.Result, error) { // Implement business logic of ...
<p>I think a better approach would be to use concurrent reconciles allowing other requests to be handled while a single reconcile request is slow to handle. This way the reconcile request queue won't be blocked, and idle go routines are fairly cheap so it should not affect your performance all that much.</p> <p>Check o...
<p>I read a lot about best practices applying DataBase Migrations for Kubernetes Apps. Actually there are three common solutions:</p> <ol> <li><strong>Separate CI/CD stage for DB Migrations</strong> (usually we run it before deploy new App version but in some cases we can deploy first, it doesn't matter for current que...
<p>I started investigating this issue too, and it looks like all manuals, tutorials and practices are meant to be forward-only. Should you ever need to rollback a database migration, you face with the limitations of Helm rollback. There is an open issue in Helm (<a href="https://github.com/helm/helm/issues/5825" rel="n...
<p>I am new to <code>golang</code> and I have the following requirement:</p> <ol> <li>I have a deployment running with the image <code>nginx:latest</code></li> <li>Then manually someone update this image to something else (eg: <code>nginx:1.22</code>)</li> <li>I need to get the old image version and the new image versi...
<p>When an image is updated in the deployments, the pods restart with new image containers and there's no trace of the old pod spec remains. You should watch the deployments instead of the pods and check the image between old deployment and new deployment object. Here's a sample of how you can modify your <code>onUpdat...
<p>Kubernetes version: V1.22.2</p> <p>Cloud Provider Vsphere version 6.7</p> <p>Architecture:</p> <ul> <li>3 Masters</li> <li>15 Workers</li> </ul> <p>What happened: One of the pods for some &quot;unknown&quot; reason went down, and when we try to lift him up, it couldn't attach the existing PVC. This only happened to ...
<p>A longer term solution is referring to 2 facts:</p> <ol> <li><p>You're using <code>ReadWriteOnce</code> <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">access mode</a> where the volume can be mounted as read-write by a single node.</p> </li> <li><p>Pod...
<p>I have a private GKE cluster with no public endpoint. I have confirmed that I can authenticate and run <code>kubectl</code> commands against the cluster with my principal account. I am deploying Terraform from the same VM I tested the <code>kubectl</code> commands against and have added that IP address to the cluste...
<p><strong>Kubectl config view</strong></p> <p>Displays merged kubeconfig settings or a specified kubeconfig file.</p> <p><strong>Synopsis</strong></p> <p>Displays merged kubeconfig settings or a specified kubeconfig file.</p> <p>You can use –output jsonpath={…} to extract specific values using a jsonpath expression.</...
<p>I'm building a CLI application that would allow me to run an arbitrary command in my shell against any kube cluster in my kubeconfig that matches a given regex. I want to use the official <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">client-go</a> package to accomplish this, but for som...
<p>You can override the current context via <code>NewNonInteractiveDeferredLoadingClientConfig</code> method from <code>clientcmd</code> package.</p> <pre class="lang-golang prettyprint-override"><code>package main import ( &quot;context&quot; &quot;flag&quot; &quot;fmt&quot; &quot;k8s.io/client-go/res...
<p>Had an issue recently using the <code>terraform-aws-eks</code> module where we wanted to create the <code>aws-auth</code> config map and set the <code>mapRoles</code> and <code>mapAccounts</code> fields in the module but manage the <code>mapUsers</code> elsewhere.</p> <p><code>kubernetes_config_map_v1_data</code> se...
<p>terraform-aws-eks module version <code>17</code></p> <p>within the terraform module <code>aws-auth.tf</code>:</p> <pre><code>resource &quot;kubernetes_config_map&quot; &quot;aws_auth&quot; { count = var.create_eks &amp;&amp; var.manage_aws_auth ? 1 : 0 metadata { name = &quot;aws-auth&quot; namespa...
<p>I have Apache Nifi working in Kubernetes. I have deployed it with yaml file. I have several Python scripts I would like to call on Apache Nifi.</p> <p>I used this yaml file to deploy Apache Nifi:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: test-nifi namespace: test-namespace labels: ...
<p>To inject scripts as config map you should:</p> <ol> <li>Create kubernetes ConfigMap and paste python script you want to have</li> </ol> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: ConfigMap metadata: name: pyhton-scripts-cofigmap data: python_script_1.py: | import foo from bar ...
<p>I am creating</p> <ul> <li>A pod every two minutes using cron-job</li> <li>It has custom python image that reads the data from redis</li> </ul> <p>The problem is, it keeps on creating pods every two minutes irrespective of others terminated or not, I am trying to terminate the pod, if I get a response like &quot;Emp...
<p>You can do something like</p> <pre><code>kubectl wait --for=condition=complete job/jobname </code></pre> <p>and you can also set a timeout:</p> <pre><code>kubectl wait --for=condition=complete --timeout=10s job/jobname </code></pre> <p>Example python script that will be checking the redis</p> <pre><code>#!/usr/bin/e...
<p>I installed mongodb as a replicaset with 3 replicas on my k8s cluster using the bitnami helm chart.</p> <p>So I get these pods:</p> <pre><code>mongodb-0.mongodb-headless.mongodb.svc.cluster.local:27017 mongodb-1.mongodb-headless.mongodb.svc.cluster.local:27017 mongodb-2.mongodb-headless.mongodb.svc.cluster.local:270...
<p> Just have recreated your setup. Everything works fine</p> <pre><code>$ k create ns mongo-test namespace/mongo-test created $ k -n mongo-test create -f mongo-svc-sts.yaml statefulset.apps/mongo created service/mongo-headless created </code></pre> <p>result</p> <pre><code>$ k -n mongo-test get all NAME READ...
<p>I deployed kubernetes cluster in <code>minikube</code> which has one master node and one worker node. When I tried to see the kube-proxy with:</p> <pre><code>kubectl get pods -n kube-system </code></pre> <p>two kube-proxies apear</p> <pre><code>kube-proxy-6jxgq kube-proxy-sq58d </code></pre> <p>Acc...
<p>kube-proxy runs on every node, when you use</p> <pre><code>kubectl get po -n kube-system -o wide </code></pre> <p>you will see the node the pods are running on</p>
<p>I am having some issues with a Kubernetes CronJob running two containers inside of a GKE cluster.</p> <p>One of the two containers is actually executing the job that must be done by the CronJob.</p> <p>This works perfectly fine. It is started when it is supposed to be started, does the job and then terminates. All f...
<p>No, strictly speaking there is no way to make Kubernetes stop a sidecar container automatically once a &quot;main&quot; container is done.</p> <p>The closest &quot;kubernetes-native&quot; solution I can think of is setting CronJob <code>concurrencyPolicy</code> to <code>Replace</code> (see <a href="https://kubernete...
<p>My docker-compose creates 3 containers - django, celery and rabbitmq. When i run the following commands -&gt; docker-compose build and docker-compose up, the containers run successfully.</p> <p>However I am having issues with deploying the image. The image generated has an image ID of 24d7638e2aff. For whatever reas...
<p>The Compose <code>command:</code> overrides the Dockerfile <code>CMD</code>. <code>docker run</code> doesn't look at the <code>docker-compose.yml</code> file at all, and <code>docker run</code> with no particular command runs the image's <code>CMD</code>. You haven't declared anything for that, which is why the co...
<p>Has anyone ben able to install Kubernetes using <a href="https://kops.sigs.k8s.io" rel="nofollow noreferrer">kOps</a> on bare metal/ local virtual machine running Ubuntu.</p>
<p>From one of Kops maintainer</p> <blockquote> <p>As kOps maintainer, I can at least say that there is no active project to support bare-metal anymore. And the code we once had going in that direction was obsolete and removed.</p> </blockquote> <p>Source: <a href="https://github.com/kubernetes/enhancements/issues/360"...
<p>I am writing this question to share the solution we found in our company. We migrated Solr over a docker only solution to a kubernetes solution.</p> <p>On kubernetes the environment ended up with slowness. At least for me the solution was atypical.</p> <p><strong>Environment:</strong></p> <ul> <li>solr(8.2.0) with j...
<p>After one week of frustrated adjustments this is the simple solution we found:</p> <p>Solr JVM had 25 GB. We decreased the value to 10GB.</p> <p>This is the command to start solr with the new values:</p> <p>/opt/solr/bin/solr start -f -force -a '-Xms10g -Xmx10g' -p 8983</p> <p>If someone can explain what happened th...
<p>We're using <code>sasl_tls</code> mechanism with bitnami/kafka helm chart. We're using Let's Encrypt and cert-manager for issuing the certificate. Created a secret out of the Let's Encrypt generated certificate and passed the secret to the <code>existingSecrets</code> parameter in the helm chart. Now when I'm using ...
<p>There could be multiple causes. I'll try to list what needs to be true for this to work:</p> <ol> <li>Your node.js KafkaJS client should have a certificate store that is able to verify the CA that signed the Let's Encrypt certificate. node.js has a built-in list of certificates, and you can add to it. I have not che...
<p>I am new to <code>golang</code> and I am trying to list the nodes in my <code>minikube</code> cluster with the <code>client-go</code>. And I encounter the following issue:</p> <blockquote> <p>nodeList.Items undefined (type *invalid type has no field or method Items)compilerMissingFieldOrMethod</p> </blockquote> <p>A...
<p>It looks like the clientset is not created from your kubeconfig. I would suggest you to create the clientset in the following way. I have used out of cluster config here to create the clientset. You can also create it using <a href="https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-confi...
<p>I am writing a script that receives a Kubernetes context name as an input and outputs the different elements of the cluster -&gt;</p> <pre><code>class GKE: def __init__(self, context): s = context.split(&quot;_&quot;) self.provider: str = s[0] self.project: str = s[1] self.data_ce...
<p>You need to differentiate between the correct name of the cluster and the naming schema of a resource.</p> <p>When I run <code>kubectl config get-contexts</code> on the clusters Aks, Eks, and Gke I get the following results:</p> <pre><code>NAME AUTHINFO gke_project-1234_...
<p>We have OPA installed in our Kubernetes cluster. Not Gatekeeper. The &quot;original&quot; OPA...</p> <p><strong>I don't understand how I can look at what OPA is receiving as input request from the API-server ?</strong><br /> =&gt; If I knew exactly what the payload looks like then writing the Rego would be simple.</...
<p>You have two options:</p> <ul> <li><p>Run the OPA server with debug level logging:</p> <p><code>opa run --server --log-level debug ...</code></p> <p>This is obviously very noisy, so beware.</p> </li> <li><p>Run the server with <a href="https://www.openpolicyagent.org/docs/latest/management-decision-logs/" rel="nofol...
<p>I have been reading a lot of posts about this but according to them I should have my bases covered so I am not sure what is going on.</p> <p>I am using Minikube, Docker, Helm, and a local Docker registry on a Mac. After I install with Helm I see the following error.</p> <pre><code>Failed to pull image &quot;127.0.0...
<p>You can enable registry addon in minikube:</p> <p><code>minikube addons enable registry</code></p> <p>Also you can enable alias for registry:</p> <p><code>minikube addons enable registry-aliases # test.com, test.org, example.com, example.org</code></p> <p>Docs: <a href="https://github.com/kubernetes/minikube/blob/ma...
<p>The problem is that I need to modify the StorageClassName but it's not possible because there was a blank StorageClassName assigned.</p> <p>This PVC is bound to a PV, so, if I delete the PVC to create a new one with the StorageClassName, the data that is in my AWS will be deleted?</p>
<p>You can recreate an existing PVC reusing the same PV with no data losses by using <a href="https://kubernetes.io/blog/2021/12/15/kubernetes-1-23-prevent-persistentvolume-leaks-when-deleting-out-of-order/" rel="nofollow noreferrer">reclaim policy</a>.</p> <p>In case of Delete, the PV is deleted automatically when the...
<p>I'm trying to customize the <code>jenkins/jenkins:latest</code> image in order to install Docker so I'm able to run docker within the jenkins pipeline but when I run the following code using the following files, the pods, jenkins-jenkins, terminate with &quot;Error&quot; without outputing any meaningfully logs.</p> ...
<p>I don't see any issue in the logs you shared. You may try to install Jenkins using helm chart and not operator.</p> <p>I summarized how to do that in <a href="https://www.rokpoto.com/jenkins-docker-in-docker-agent/" rel="nofollow noreferrer">Jenkins Docker in Docker Agent</a> post. You may read about using Docker in...
<p>I have a secret in my kubernetes cluster which contains a kubeconfig of another Cluster. I want to be able to connect to that cluster in my Go code.</p> <p>I only found ways to create a client via a kubeconfig FILE but not with a kubeconfig string.</p> <p>This is my code so far:</p> <pre><code> // Read secret ...
<p>There are several ways for this purpose, for example:</p> <pre class="lang-golang prettyprint-override"><code>content := `a kubeconfig string` tmpfile, err := os.CreateTemp(&quot;&quot;, &quot;kubeconfig&quot;) if err != nil { ... } defer os.Remove(tmpfile.Name()) if err := os.WriteFile(tmpfile.Name(), []byte(co...
<p>I try to deploy nginx deployment to see if my cluster working properly on basic k8s installed on VPS (kubeadm, ubuntu 22.04, kubernetes 1.24, containerd runtime)</p> <p>I successfully deployed metallb via helm on this VPS and assigned public IP of VPS to the using CRD: apiVersion: metallb.io/v1beta1 kind: IPAddressP...
<p>I'm facing the same issue.</p> <p>Kubernetes cluster is deployed with Kubespray over 3 master and 5 worker nodes. MetalLB is deployed with Helm, IPAddressPool and L2Advertisement are configured. And I'm also deploying simple nginx pod and a service to check of MetalLB is working.</p> <p>MetalLB assigns first IP from...
<p>In dnsutils pod exec <code>ping stackoverflow.com</code></p> <pre><code>/ # ping stackoverflow.com ping: bad address 'stackoverflow.com' </code></pre> <p>The <code>/etc/resolve.conf</code> file looks fine from inside the pod</p> <pre><code>/ # cat /etc/resolv.conf nameserver 10.96.0.10 search weika.svc.cluster.loca...
<p><em>This might only apply to you if there was trouble during either your initial installation of <code>microk8s</code> or enablement of the <code>dns</code> addon</em>, but it might still be worth a shot. I've invested so much gd time in this I couldn't live with myself if I didn't at least share to help that one p...
<p>I have a <a href="https://konghq.com/" rel="nofollow noreferrer">Kong</a> deployment.</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment metadata: name: local-test-kong labels: app: local-test-kong spec: replicas: 1 selector: matchLabels: app: local-test-...
<p>Your readiness probes are failing on the local pod on port <code>8100</code>. It looks like you have a firewall(s) rule preventing internal pod and/or pod to pod communication.</p> <p>As per the <a href="https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s#2-deploying-microk8s" rel="nofollow norefer...
<p>For the <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">kube-prometheus-stack</a> we added more and more dashboards config to <code>/grafana/dashboards</code> folder to have more and more provisioned dashboards.</p> <p>And then in one day...
<p>As we can get information from <a href="https://helm.sh/docs/topics/advanced/#storage-backends" rel="nofollow noreferrer">doc</a>, the purpose of auto generated secret is for recording release information. In k8s <a href="https://kubernetes.io/docs/concepts/configuration/secret/#restriction-data-size" rel="nofollow ...
<p>Developed a nextjs app and have deployed it to a kubernetes (AKS) cluster. The docker file looks pretty much identical to the sample nextjs docker files (see <a href="https://github.com/vercel/next.js/blob/v12.3.2/examples/with-docker/Dockerfile" rel="nofollow noreferrer">here</a>).</p> <p>The pod manifest is nothin...
<p>Ok, seems like running operations and the final command as nextjs USER as specified in the Dockerfile is the bit that's causing issues in kubernetes. Removing those and running as default, root user fixes the issues.</p>
<p>How can I run kubectl apply commands from go via client-go? e.g.: I'm having a file called crds.yaml and I want to run it via client-go</p> <p>I can't find any examples about how to do so can someone please help?</p>
<p>You need to decode your .yaml file</p> <p><a href="https://github.com/kubernetes/client-go/issues/216" rel="nofollow noreferrer">Here</a> it's the complete answer (with code example)</p>
<p>In K8s i'm practising the example <em>6.1. A pod with two containers sharing the same volume: fortune-pod.yaml</em> from the book <strong>kubernetes in Action</strong>. In volumes concept where my pod contain 2 containers, one of the containers is not running, Please guide me where i'm doing wrong. to run the pod su...
<p>Your <em>Pod</em> named <code>vol-1</code> has two <em>containers</em>:</p> <ul> <li>One named <code>fortune-cont</code></li> <li>One named <code>web-server</code></li> </ul> <p>If you run <code>kubectl logs vol-1</code>, Kubernetes doesn't know which container you're asking about, so it has to pick one, and tells y...
<p>I tried creating just a simple Service account in Kubernetes by running the command on my AWS EC2 cli <code>kubectl create serviceaccount jenkins --dry-run=client -o yaml &gt; jenkins-sa.yaml</code> and I have my <code>kube/config</code> file on my <code>/home/ec2-user</code>.</p> <p>I applied the new config jenkins...
<p>You have to create the token secret manually. Here is a YAML example:</p> <pre><code>apiVersion: v1 kind: Secret type: kubernetes.io/service-account-token metadata: name: jenkins-sa-token namespace: default annotations: kubernetes.io/service-account.name: &quot;jenkins&quot; </code></pre> <p>This will crea...
<p>I am trying to enable ingress in minkube. When I run <code>minikube addons enable ingress</code> it hangs for a while then I get the following error message:</p> <pre><code>❌ Exiting due to MK_ADDON_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1...
<p>Bit late, but I hope someone find this useful, this happens becouse minikube could not pull the image(ingress-nginx-controller) in time, the way to know is:</p> <pre><code>kubectl get pod -n ingress-nginx </code></pre> <p>If the ingress-nginx-controller-xxxx (xxxx is the identifier of the pod) has a status of ImageP...
<p>I am getting this error from filebeat:</p> <blockquote> <p>Failed to connect to backoff(elasticsearch(<a href="https://elk.example.com:9200" rel="noreferrer">https://elk.example.com:9200</a>)): Get <a href="https://elk.example.com:9200" rel="noreferrer">https://elk.example.com:9200</a>: x509: certificate signed b...
<p>The reason is either an old default operating system truststore that does not feature your very much valid and well-known trusted CA chains or the Elasticsearch certificate is self-signed or signed by a private CA.</p> <p>You can choose from a number of solutions:</p> <ol> <li><p>Run your filebeat in an environment ...
<p>I am trying to get the cluster utilization values (CPU Utilization, Memory, File System, Network transfer, pod count) in a go program. Do we have api's to get the cluster data directly from k8s or openshift which can be called from a go program ? Or can we get the individual node data and add it up to get the total ...
<p>The Kubernetes <a href="https://kubernetes.io/docs/tasks/debug/debug-cluster/resource-metrics-pipeline" rel="nofollow noreferrer">metrics server</a> offers all of this information via the <a href="https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/ap...
<p>I've got a spring-boot application deployed in kubernetes, with actuator on port <code>8081</code>. The main application is working on port <code>8080</code>. When I describe the instance, the checks are failing:</p> <pre><code>$ kubectl describe pod app-844d96f469-8vkbn ... Warning Unhealthy 29s (x4 over 48s) ...
<p>I suppose that your application takes too long to become ready before it fails due to liveness probe. Spring boot / Java applications do heavy initialization on startup and when CPU is limited, it is slow and takes a long time.</p> <p>Here is a good explanation: <a href="https://faun.pub/java-application-optimizatio...
<p>For regular pods (in running state), we can check the <strong>actual</strong> resource utilisation (runtime) using <code>kubectl top pod &lt;pod_name&gt;</code> command. However, for the job pods (execution is already complete), any way we can fetch how much resources were consumed by those pods?</p> <p>Getting this...
<p>There is no command that can show a job resource utilisation. The only option is using an external tool like the prometheus or make a sidecar container with logging resources usage.</p>
<p>I installed GitLab runner via <a href="https://docs.gitlab.com/runner/install/kubernetes.html" rel="nofollow noreferrer">HelmChart</a> on my <code>Kubernetes</code> cluster</p> <p>While installing via helm I used config <code>values.yaml</code></p> <p>But my Runner stucks every time at <code>docker login</code> comm...
<p>I bypassed <code>docker login</code> with importing <code>$HOME/.docker/config.json</code> file which stores <code>auth token</code> from my host machine to Gitlab Ci</p> <pre><code> before_script: - mkdir -p $HOME/.docker - echo $DOCKER_AUTH_CONFIG &gt; $HOME/.docker/config.json </code></pre> <p><code>$DO...
<p>I want to know when the pod goes under termination and how much time it takes for termination</p> <p>from which stage pod go under termination</p> <p>I have a cluster in gke and so I want to know the details about pod termination in gke</p>
<p>The default grace period is 30 seconds if that is what you are looking for.</p> <p><a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination</a></p>
<p>Hi I have question about golang micro service via kubernetes container. Example I have 2 deploy of code name A and B.</p> <ol> <li>A have 1 pod do a sent request to create document in B service.</li> <li>B have autoscaling config between 1 - 5 pod waiting for request from A and process to create a document in many c...
<p>When pods are terminated (due to scale down), they receive a term signal and are deregistered from the load balancer. The problem in your case might be, that running processes are terminated imediatelly and connections get closed. You can try to circumvent the problem with a preStop lifecycle hook for your container...
<p>I am new to K8S so please be gentle. I have a test hello world Flask app and I would like to deploy it on EKS. I am using the AWS load Balancer Controller Addon using the link below. At the end when I check the deployment it shows up without any issues as the link describes. <a href="https://docs.aws.amazon.com/e...
<p>Finally got it working. When I realized that the ALB was not created automatically I researched and found the solution. I had to remove the ingress.class value from the annotations as well as remove the host. So now my ingress looks like the following. After deleting the old ingress and reapplying this one, I wa...
<p>Hi I have question about golang micro service via kubernetes container. Example I have 2 deploy of code name A and B.</p> <ol> <li>A have 1 pod do a sent request to create document in B service.</li> <li>B have autoscaling config between 1 - 5 pod waiting for request from A and process to create a document in many c...
<p>Make sure your service B can do a graceful shutdown.</p> <p>On scale down, or delete, the pod will first receive a TERM signal. Then, after a grace period, it will send a KILL if needed.</p> <p>Your service should respect TERM and stop all internal processes (goroutines in your case) and then terminate. If you manag...
<p>I'm currently setting up a Kubernetes cluster with windows nodes. I accidentally created a local image in the default namespace.</p> <p>As shown by <code>ctr image ls</code>, my image is in the <strong>default namespace</strong>:</p> <pre><code>REF TYPE ...
<p>As @ P Ekambaram suggested, the <code>podman save</code> and <code>podman load</code> commands let you share images across multiple servers and systems when they aren't available locally or remotely.</p> <p>You can use <a href="https://www.redhat.com/sysadmin/share-container-image-podman-save#:%7E:text=The%20%60podm...
<p>Could anyone offer advice on how to configure promtail correctly to parse the json output from my logs? I haven't been able to figure out why promtail is not identifying the json properties and showing them in Grafana.</p> <p>my logback appender, in logback.xml:</p> <pre><code>&lt;appender name=&quot;json&quot; ...
<p>Assuming you correctly copied in your <code>promtail.yaml</code>, there is a formatting error: <code>-docker: {}</code> should be <code>- docker: {}</code></p> <pre><code>--- scrape_configs: - job_name: parse-logs pipeline_stages: - docker: {} - json: expressions: subscription...
<p>I have a Flask web application running as a Docker image that is deployed to a Kubernetes pod running on GKE. There are a few environment variables necessary for the application which are included in the docker-compose.yaml like so:</p> <pre class="lang-yaml prettyprint-override"><code>... services: my-app: bu...
<p>Kompose can translate docker compose files to kubernetes resources:</p> <p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/translate-compose-kubernetes/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/translate-compose-kubernetes/</a></p>
<p>This is my <code>auth-depl.yaml</code> file:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: auth-depl spec: replicas: 1 selector: matchLabels: app: auth template: metadata: labels: app: auth spec: containers: - name: auth image: tes...
<p>I had a similar issue, and this was how I resolved it. I went to my Docker Desktop app (Mac) and did a clean-up of all the docker images. I basically deleted all the images which also include mongo image.</p> <p><a href="https://i.stack.imgur.com/rSmrZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.c...
<p>I wanted to know that does Knative on EKS supports the node autoscaler if yes do we need to set up cluster autoscaler or Knative itself scale the nodes?</p> <p>I tried autoscaling the nodes by increasing the pods but did not work my question is that does Knative automatically scales nodes or do we have to set up any...
<p><strong>Knative</strong> supports only two types of auto-scaling</p> <ul> <li><strong>KPA</strong> - Knative Pod Autoscaler</li> <li><strong>HPA</strong> - Horizontal Pod Autoscaler</li> </ul> <p>So for Node auto scaling <strong>Cluster Auto scaler</strong> will be required to be installed into EKS.</p> <p>Ref : <a ...
<p>I can see GKE, AKS, EKS all are having nodepool concepts inbuilt but Kubernetes itself doesn't provide that support. What could be the reason behind this?</p> <p>We usually need different Node types for different requirements such as below-</p> <p>Some pods require either CPU or Memory intensive and optimized nodes....
<p>Node Pools are cloud-provider specific technologies/groupings.</p> <p>Kubernetes is intended to be deployed on various infrastructures, including on-prem/bare metal. Node Pools would not mean anything in this case.</p> <p>Node Pools generally are a way to provide Kubernetes with a group of identically configured nod...
<p>I deployed a pod and service of a Flask API in Kubernetes.</p> <p>When I run the Nifi processor InvoqueHTTP that calls the API, I have the error :</p> <pre><code>File &quot;/opt/app-root/lib64/python3.8/site-packages/psycopg2/__init__.py&quot; </code></pre> <p><code>psycopg2.OperationalError: SCRAM authentication re...
<p>For psycopg2.OperationalError: SCRAM authentication requires libpq version 10 or above follow the below work arounds:</p> <p><strong>Solution :1</strong></p> <p>Download libpq.dll from <a href="https://www.exefiles.com/en/dll/libpq-dll/" rel="nofollow noreferrer">https://www.exefiles.com/en/dll/libpq-dll/</a> then ...
<p>I'm trying to get off the ground with Spark and Kubernetes but I'm facing difficulties. I used the helm chart here:</p> <p><a href="https://github.com/bitnami/charts/tree/main/bitnami/spark" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/main/bitnami/spark</a></p> <p>I have 3 workers and they all r...
<p>Your <code>people.json</code> file needs to be accessible to your driver + executor pods. This can be achieved in multiple ways:</p> <ul> <li>having some kind of network/cloud drive that each pod can access</li> <li>mounting volumes on your pods, and then uploading the data to those volumes using <code>--files</code...
<p>I'm trying to generate some env variables when I'm deploying my code with Kubernets. What I'm trying to do is to generate a ConfigMap to get my variables, but it's not working. I'm using azure pipelines to do my build and publish steps.</p> <p>Dockerfile:</p> <pre><code>FROM node:14-alpine WORKDIR /usr/src/app COP...
<p>If you are using GitHub actions, the first thing is to add a step in your image build process to include dynamic variables</p> <pre><code> - name: Create variables id: vars run: | branch=${GITHUB_REF##*/} echo &quot;API_URL=API_${branch^^}&quot; &gt;&gt; $GITHUB_ENV echo &quot;APP_ENV=APP_...
<p>I have a cron that's I'm testing for another project that is supposed to delete a namespace called &quot;test&quot; every minute.</p> <p>I have set up a ServiceAccount, ClusterRole, and RoleBinding as shown below:</p> <pre><code>apiVersion: v1 kind: ServiceAccount metadata: name: test --- apiVersion: rbac.authoriz...
<p>You have to use ClusterRoleBinding instead of RoleBinding. RoleBinding only allows access to resources in the namespace of the service account while ClusterRoleBinding allows cluster-wide access.</p>
<p>I want to create a cluster inside a VNET, so that later I can create a connection to the on-premise resources. I have following problem:</p> <p><code>│ Error: Unsupported argument │ │ on main.tf line 130, in resource &quot;azurerm_kubernetes_cluster&quot; &quot;aks&quot;: │ 130: user_assigned_identity_id = az...
<p>That argument does not seem to be a part of the identity block. The argument that can be used inside of the identity block is <code>identity_ids</code> [1]:</p> <pre><code>resource &quot;azurerm_kubernetes_cluster&quot; &quot;aks&quot; { name = var.cluster_name kubernetes_version = var.kubernetes...
<p>I am new to k8s and trying to setup prometheus monitoring for k8s. I used "helm install" to setup prometheus. Now:</p> <ol> <li>two pods are still in pending state: <ul> <li>prometheus-server</li> <li>prometheus-alertmanager</li> </ul></li> <li>I manually created persistent volume for both Can anyone help me wit...
<p>If you are in EKS, your node need to have the next permission</p> <pre><code>arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy </code></pre> <p>and the <strong>Amazon EBS CSI Driver</strong> Add-on</p>
<p>Assuming I have the following <code>skaffold.yaml</code></p> <pre><code>apiVersion: skaffold/v2beta12 kind: Config metadata: name: myapp build: local: push: true artifacts: - image: pkaramol/my-image docker: dockerfile: Dockerfile deploy: helm: releases: - name: myapp chartP...
<p>You can instruct Skaffold to build the image locally by using the <code>local</code> build mode in the <code>build</code> section of the skaffold.yaml file, like this:</p> <pre><code>apiVersion: skaffold/v2beta12 kind: Config metadata: name: myapp build: local: push: false artifacts: - image: pkaramol/my...
<p>Is there a way to restart a kubernetes deployment using go-client .I have no idea how to achieve this ,help me!</p>
<p>If you run <code>kubectl rollout restart deployment/my-deploy -v=10</code> you see that kubectl actually sends a PATCH request to the APIServer and sets the <code>.spec.template.metadata.annotations</code> with something like this:</p> <pre class="lang-yaml prettyprint-override"><code>kubectl.kubernetes.io/restarted...
<p>I am new to Docker. From what I understood both Docker and Kubernetes manage multiple containers.</p> <p>Kubernetes is more a large-scale container management with an abstraction layer compared to Docker. Isn't it possible to duplicate this scenario of abstraction in Docker? If so, then why do we say that it is pure...
<p><strong>Docker</strong> is a <strong>container runtime tool</strong> first; Kubernetes cannot be compared to Docker. The PODs are scheduled or managed by the orchestration platform known as Kubernetes.</p> <p>You may compare <strong>Kubernetes</strong> with <strong>Docker swarm</strong> in several ways.</p> <p>Kuber...
<p>We have an application running on EKS 1.21 and we are in the process of upgrading to EKS 1.22 since 1.21 will reach end of support in Feb 2023. I am trying to figure out a kubectl command or something similar that can query the entire cluster for any v1beta1 API versions that are deprecated and replaced by GA v1 as ...
<p>The below command would return the namespace, name, apiVersion, and all the resources in your cluster. You can pipe this with grep to filter wherever you want.</p> <pre><code>kubectl api-resources --no-headers |while read type ignore; do kubectl get $type -A -o go-template='{{range $index,$pod := .items}}{{(or .me...
<p>so I am currently connected to a contabo hosted kubernetes cluster. On there I have running kafka and opensearch/opensearch dashboards deployements. I am trying to run logstash so that I can get the data from a kafka topic to opensearch, <a href="https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearc...
<p>I figured it out. I think that it was expecting an ssl certificate and that is why it was refusing the connection. The way that I &quot;fixed&quot; this (because I don't need the ssl certification for this project for now) is that I changed the logstash configuration in this way.</p> <pre><code> logstash.conf: | ...
<p>We are trying to get the logs of pods after multiple restarts but we dont want to use any external solution like efk.</p> <p>i tried below config but its not working. does the below cmd run on the pod or it will run on node level</p> <pre><code>lifecycle: preStop: exec: command: [&quot;/bin/sh&quot;, &quo...
<blockquote> <p>i tried below config but its not working. does the below cmd run on the pod or it will run on node level</p> </blockquote> <p>it will run on the POD level, not on <strong>Node</strong> level</p> <p>You can use the <strong>Hostpath</strong> in POD configuration</p> <pre><code>apiVersion: v1 kind: Pod met...
<p>I am very new to the Kubernetes and Docker, and I am following the tutorials in the Kubernetes documentation.</p> <p>I got the below output after running the <code>minikube start</code> command.</p> <p><a href="https://i.stack.imgur.com/TnDmq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TnDmq.p...
<p>p/s means &quot;per second&quot;</p> <p>That line is your machine pulling the relevant docker image(s) to start minikube.</p>
<p>I'm trying to create an assignment for students to do that contains the following :</p> <ol> <li>A docker image with issues that have to be scanned and remedied. (using an opensource scanner in kubernetes)</li> <li>(Maybe) A sample attack scenario that can exploit those vulnerabilities.</li> </ol> <p>The problem ari...
<p>Looks like you are looking for the <strong>Container security hardening</strong> and Kubernetes security options maybe.</p> <p>You can use some tools like</p> <ul> <li><a href="https://github.com/controlplaneio/kubesec" rel="nofollow noreferrer">kubesec</a> - Security risk analysis for Kubernetes resources</li> <li>...
<p>There is a lot of sources that clarify how to connect into the cluster. But when searching for information about how to connect from inside the cluster to outside the search results are polluted with the opposite information.</p> <p>I want to connect my custom service that is running inside the cluster to my keycloa...
<blockquote> <p>There is no option of running keycloak inside the cluster.</p> </blockquote> <p>Not sure may you have checked or not, you can run the <strong>keycloak</strong> on the Kubernetes.</p> <p>You can refer my Github repo to get YAML files and deployment keycloak on Kubernetes : <a href="https://github.com/har...
<p>I am on Kubernetes v1.22.13. When i was trying to delete a namespace that's stuck in status <code>terminating</code>, i deleted api-service <code>v1.networking.k8s.io</code> by mistake with:</p> <pre><code>kubectl delete apiservices.apiregistration.k8s.io v1.networking.k8s.io </code></pre> <p>And now i don't have cr...
<p>You can recreate it via the following:</p> <pre><code>cat &lt;&lt;EOF | kubectl apply -f - apiVersion: apiregistration.k8s.io/v1 kind: APIService metadata: labels: kube-aggregator.kubernetes.io/automanaged: onstart name: v1.networking.k8s.io spec: group: networking.k8s.io groupPriorityMinimum: 17200 ve...
<p>I was wondering if it is possible to include a configmap with its own values.yml file with a helm chart repository that I am not managing locally. This way, I can uninstall the resource with the name of the chart.</p> <p>Example:</p> <p>I am using New Relics Helm chart repository and installing the helm charts using...
<p>What you could do is use Kustomize. Let me show you with an example that I use for my Prometheus installation.</p> <p>I'm using the kube-prometheus-stack helm chart, but add some more custom resources like a SecretProviderClass.</p> <p>kustomization.yaml:</p> <pre class="lang-yaml prettyprint-override"><code>apiVers...
<p>I have 2 k8s application running in a single cluster. When it communicate with service name, it takes 12 seconds to transfer 1 GB data. When communicate with nodeport time is 8sec. Why the service name is slow?</p> <p>Why the nodeport give faster? Actually the service name should be faster right?</p>
<p>It is expected to be faster when using the <code>NodePort</code> since the request does not rely on the <a href="https://kubernetes.io/docs/concepts/overview/components/#kube-proxy" rel="nofollow noreferrer">kube-proxy</a> to forward the traffic to the target.</p> <p>It also depends on the way the kube-proxy is conf...
<p>Currently we have a set of microservice hosted on kubernetes cluster. We are setting hpa values based on rough estimates. I am planning to monitor horizontal pod autoscaling behavior using grafana to ensure we are not over/under allocating the resources like CPU/memory and come up with possible cost optimization rec...
<p><strong>tl;dr</strong></p> <ol> <li>Monitor resource consumption of each pod.</li> <li>Monitor pod restarts and number of replicas.</li> <li>Use a load test.</li> </ol> <p><strong>Memory</strong></p> <p>As a starting point, you could monitor CPU- and memory-consumption of each pod. For example you can do something l...
<p>Im trying to listen to secret change using the operator sdk The problem is that im not getting the reconcile event when I apply the secret with the labels that I define in the operator</p> <p>I did the following</p> <pre><code>mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: ...
<p>It looks like you are using the cache.Options.SelectorsByObject field to specify the labels that should trigger a reconcile event. However, this field is used to specify the labels that should be used to select objects from the cache, not the labels that should trigger a reconcile event.</p> <p>To specify the labels...
<p>I'm deploying ELK on k8s but getting error on <code>Filebeat</code></p> <p><code>kubectl describe pod filebeat-filebeat-rpjbg -n elk</code> ///</p> <p><strong>Error:</strong></p> <pre><code>Warning Unhealthy 8s (x5 over 48s) kubelet Readiness probe failed: logstash: logstash:5044... connection... ...
<p>Filebeat is trying to resolve &quot;logstash&quot;, but you don't have a service with that name. You have &quot;logstash-logstash&quot;. Try to change filebeat config (line 49 and 116 in filebeat values.yaml) or change the name of your logstash service accordingly.</p>
<p>I was wondering if it is possible to include a configmap with its own values.yml file with a helm chart repository that I am not managing locally. This way, I can uninstall the resource with the name of the chart.</p> <p>Example:</p> <p>I am using New Relics Helm chart repository and installing the helm charts using...
<p>Using only Helm without any 3rd party tools like kustomize there are two solutions:</p> <ol> <li><p>Depend on the configurability of the Chart you are using as described by @Akshay in the other answer</p> </li> <li><p>Declare the Chart you are looking to add a ConfigMap to as a <a href="https://helm.sh/docs/helm/hel...
<p>I'm installing jupyterhub on k8s using <a href="https://z2jh.jupyter.org/en/stable/jupyterhub/installation.html#install-jupyterhub" rel="nofollow noreferrer">helm</a>.</p> <pre><code>helm upgrade --cleanup-on-fail --install jupyterhub jupyterhub-2.0.0/jupyterhub/ --namespace my-NS --create-namespace --version=2.0.0 ...
<p>Disable the pre-pull hook:</p> <p><a href="https://z2jh.jupyter.org/en/latest/administrator/optimization.html#pulling-images-before-users-arrive" rel="nofollow noreferrer">https://z2jh.jupyter.org/en/latest/administrator/optimization.html#pulling-images-before-users-arrive</a></p> <p>prePuller: hook: enabled: false<...
<p>If I use -XX:MaxRAMPercentage for Java running in a container, and in the K8S definition I provide request and limit values for the container's memory, what will happen?</p> <p>For example, if the request is 1GB and the limit 2GB, what will be the initial value for the JVM's max memory?</p>
<p>The memory limit applies to the cgroup. So assuming you are using a JVM version 10+, where +UseContainerSupport is enabled by default, your JVMs max memory will be the configured percentage of the limit, i.e. if -XX:MaxRAMPercentage has a value of 100 then your max memory will be 2GB.</p> <p>Memory request is only u...
<p>i've got a kubernetes node, control-plane, which is untainted for deploying pods to. i've got a docker image <code>sdmay23-42.ece.iastate.edu:5000/canvas-lti-frontend:v2</code>.</p> <p>i'm signed into docker cli. the daemon.json is set with insecure registry and i can verify with <code>docker info</code> :</p> <pre>...
<p>the solution was to configure containerd to accept insecure registries. i had thought kubernetes was using docker. you can do <code>kubectl get nodes -o wide</code> to see information about container runtime.</p> <p>steps for configuring containrd here: <a href="https://stackoverflow.com/questions/72419513/how-to-pu...
<p>My GKE cluster is displaying &quot;Scale down blocked by pod&quot; note, and clicking it then going to the Logs Explorer it shows a filtered view with log entries for the pods that had the incident: <code>no.scale.down.node.pod.not.enough.pdb</code> . But that's really strange since the pods on the log entries havin...
<p><code>no.scale.down.node.pod.not.enough.pdb</code> is not complaining about the lack of a PDB. It is complaining that, if the pod is scaled down, it will be <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-autoscaler-visibility#noscaledown-node-level-reasons" rel="nofollow noreferrer"><em>in v...
<p>In have a situation where the node has <code>4GB memory</code> and actual memory usage looks as below:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Pod</th> <th>Memory Requested</th> <th>Memory Limit</th> <th>Memory Used</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>2.0 GiB</td> <td...
<p>In your example, pod 1 will get evicted. The Pod that is not using more memory than it requested will not get evicted.</p> <p>This is mentioned in the Kubernetes documentation you link to:</p> <blockquote> <p>The kubelet uses the following parameters to determine the pod eviction order:</p> <ol> <li>Whether the pod...
<p>I'm testing a trigger i set on my k8s cluster. What it does it that detects if a pod is evicted. So to test I ran</p> <p><code>kubectl drain &lt;NODENAME&gt; --ignore-daemonsets --force</code></p> <p>but the evicted pods are just automatically deleted instead of staying in cluster. Can you guys help me on how can I ...
<p>First, to answer the title question: &quot;How to evict pods in kubernetes?&quot; There are a number of additional ways to trigger pod eviction, but two easy ones:</p> <h3>API Based Eviction</h3> <p>There is an API you can use to <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#create-ev...
<p>The application that me and my team working on use Ruby on Rails hosted in Openshift pod. We use delayed_job to handle background process, and for delayed_job logging, the application write the log into <code>log/delayed_job.log</code> file. However, if a new pod for the application is created, the pod will create a...
<p>In case it might help anyone:</p> <p>We're ended up muting the DelayedJobs ActiveRecord related logs playing around <a href="https://github.com/collectiveidea/delayed_job/issues/477#issuecomment-800341818" rel="nofollow noreferrer">this delayed_job repo post</a> to also ensure that if an error occurs, we get the pre...
<p>I'm managing Kubernetes + nginx.</p> <p>I'd like to install dynamic modules on nginx that are provided by Nginx Ingress Controller. Those dynamic modules are not offered by Nginx Ingress Controller official configmap (<a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/" rel=...
<h1>TL;DR</h1> <p>Extend the official image with the dynamic modules, and update the <code>helm_release</code> <code>terraform</code> resource to <code>set</code> the <code>controller.image.registry</code>, <code>controller.image.image</code>, <code>controller.image.tag</code>, <code>controller.image.digest</code>, and...
<p>we are doing case study with control-m to monitor Kubernetes job. On successful completions of job, control -m is able to recognize the job completed. however when it fails, it never recognize the failure it shows job is still running,i suspect job never gets completed in kubernetes.</p> <p>Here as job, pod status a...
<blockquote> <p>My question, is there way to kubernetes job complete with failure? or is it default behavior of kubernetes?</p> </blockquote> <p>You can manage it from the code mostly, if there is any error gracefully shutdown or pass the proper exit code.</p> <p><strong>Kubernetes</strong> have two status only <strong...
<p>I'm unable to find any references other than this link that confirms that the failure has to be consecutive. <a href="https://github.com/kubernetes/website/issues/37414" rel="nofollow noreferrer">https://github.com/kubernetes/website/issues/37414</a></p> <p>Background: Our Java application is getting restarted every...
<p>Liveness check is created when Kubernetes creates pod and is recreated each time that Pod is restarted. In your configuration you have set initialDelaySeconds: 20 so after creating a pod, Kubernetes will wait 20 seconds, then it will call liveness probe 3 times (as default value failureThreshold: 3). After 3 fails, ...
<p>I had this happen to me a couple of times:</p> <p>I change something in /etc/kubernetes/manifests/kube-apiserver.yaml and check for the API server process. I see that Docker container exited with error code 1. I check the logs of the container and all there is is a single line with:</p> <pre><code>Shutting down, got...
<p>I had a similar issue with pods of my kube-system randomly being terminated, preventing the cluster from starting.</p> <p>I found the solution here : <a href="https://discuss.kubernetes.io/t/why-does-etcd-fail-with-debian-bullseye-kernel/19696" rel="nofollow noreferrer">https://discuss.kubernetes.io/t/why-does-etcd-...
<p><em>SOS</em> I'm trying to deploy ELK stack on my Kubernetes**a</p> <p>ElasticSearch, Metricbeat, Filebeat and Kibana running on Kubernetes, but in Kibana there is <code>no Filebeat index logs</code> Kibana accessable: <strong>URL</strong><a href="http://logging.halykmart.online/" rel="nofollow noreferrer"> here</a>...
<p>Try to use FluentD as log transportation <code>fluentd.yaml</code></p> <pre><code>apiVersion: v1 kind: ServiceAccount metadata: name: fluentd namespace: elk labels: app: fluentd --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: fluentd labels: app: fluentd rules: - apiG...