prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have managed to install Prometheus and it's adapter and I want to use one of the pod metrics for autoscaling</p> <pre><code> kubectl get --raw &quot;/apis/custom.metrics.k8s.io/v1beta1&quot; | jq . |grep &quot;pods/http_request&quot;. &quot;name&quot;: &quot;pods/http_request_duration_milliseconds_sum&quot;,...
<p>1st deploy metrics server, it should be up and running.</p> <pre class="lang-sh prettyprint-override"><code>$ kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml </code></pre> <p>Then in a few sec. metrics server deployed. check HPA it should resolved.</p> <pr...
<p>I am using traefik ingress controller in Kubernetes. It is configured to redirect all request to https and terminate tls connection before passing the request to backend service.</p> <p>Is it possible to only enable http for one particular ingress config but https for other ingresses ? Any example would be helpful.<...
<p>You can create the one ingress with the config like</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress annotation: kubernetes.io/ingress.class: &quot;traefik&quot; ingress.kubernetes.io/force-ssl-redirect: &quot;false&quot; ingress.kubernetes.io/ssl-redirect: &quot;false&quot; traefik.ingress.ku...
<p>I am a new DevOps Engineer.</p> <p>I was checking out our DEV AKS cluster at work and noticed that Fluentd is using a crazy amount of memory and isn't releasing it back, example below:</p> <pre><code>fluentd-dev-95qmh 13m 1719Mi fluentd-dev-fhd4w 9m ...
<p>Regarding the question about restarting the fluentd pods:</p> <p>If you have permissions to delete pods in the namespace where fluentd is deployed, you can simply delete the pods to restart fluentd</p> <pre><code>kubectl delete pod fluentd-xxxxx </code></pre> <p>Since the daemonset definition is still there the Kube...
<p>We recently started upgrading our EKS clusters from 1.18 version to 1.19. One change that we did was to change our HPA manifest files to have apiVersion as autoscaling/v2beta2. I can see all three api versions are available in my cluster</p> <pre><code>kubectl api-versions | grep autoscaling autoscaling/v1 autoscali...
<p>This command show which versions are supported by your cluster</p> <pre><code>kubectl api-versions | grep autoscaling autoscaling/v1 autoscaling/v2beta1 autoscaling/v2beta2 </code></pre> <p>however, we mainly focus on which ApiVersion is getting stored in etcd database.</p> <p>Based on my understanding, there could ...
<p>One of my namespace is in <code>Terminating</code> state. While there are many posts that explain how to forcefully delete such namespaces. The ultimate result is that everything in your namespace will be gone. Which is not what you might want especially if that termination was a result of mistake or bug (or may cau...
<blockquote> <p>Is there a way to cancel namespace termination in kubernetes?</p> </blockquote> <p>As far as I know, unfortunately not. Termination is a one-way process. Note how <a href="https://unofficial-kubernetes.readthedocs.io/en/latest/concepts/abstractions/pod-termination/#:%7E:text=Kubernetes%20marks%20the%20P...
<p>What is the preferred Kubernetes storageClass for a PersistentVolume used by a Postgresql database? Which factors should go into consideration choosing the storageClass when I have the choice between S3 (Minio), NFS and HostPath?</p>
<p>When you choose a storage option for Postgresql in Kubernetes, you should take into account the following:</p> <ol> <li><p><strong>NFS / Minio</strong> is not the preferred storage for databases, if your application is latency-sensitive. A common use case is a download folder or a logging/backup folder.<br /> But it...
<p>I'm trying to access my ETCD database from a K8s controller, but getting rpc error/EOF when trying to open ETCD client.</p> <p>My setup:</p> <ul> <li>ETCD service is deployed in my K8s cluster and included in my Istio service mesh (its DNS record: <code>my-etcd-cluster.my-etcd-namespace.svc.cluster.local</code>)</li...
<p>Turned out to be version mismatch - my ETCD db is v3.5.2 and the clientv3 library that I used was v3.5.0. As seen in ETCD changelog (<a href="https://github.com/etcd-io/etcd/blob/main/CHANGELOG/CHANGELOG-3.5.md" rel="nofollow noreferrer">https://github.com/etcd-io/etcd/blob/main/CHANGELOG/CHANGELOG-3.5.md</a>):</p> ...
<p>I'm runnning a cluster in Kubernetes with minikube and VirtualBox.</p> <p>This is my headless service</p> <pre><code>apiVersion: v1 kind: Service metadata: labels: service: test name: test-group-ping spec: clusterIP: None ports: - port: 4444 name: ping protocol: TCP targetPort: 4444...
<p>Your Service selector <code>service: test</code> does not match with the Pod label <code>app: test</code>.</p>
<p>I have several <a href="https://stackoverflow.com/questions/58167618/exception-has-occurred-mongodarterror-mongodart-error-invalid-scheme-in-uri?rq=1">pages</a> that I found with similar question and most answer tell us to white list our IP. However I have allowed access from anywhere <code>0.0.0.0/0</code> in the a...
<p>I was able to solve it using this to start <code>minikube</code>:</p> <p><code>minikube start --driver=docker</code></p> <p>It seems there's some dns resolution issue with the underlying oracle's virtualbox driver(Maybe some configuration and setup issue as well)</p>
<p>I am working on deploying a certain pod to GKE but I am having an unhealthy state for my backend services.</p> <p>The deployment went through via <code>helm install process</code> but the ingress reports a certain warning error that says <code>Some backend services are in UNHEALTHY state</code>. I have tried to acce...
<p>Without more details it is hard to determine the exact cause.</p> <p>As first point I want to mention, that your error message is <code>Some backend services are in UNHEALTHY state</code>, <strong>not</strong> <code>All backend services are in UNHEALTHY state</code>. It indicates that only <strong>a few of your back...
<p>I'm exploring K8S possibilities and I'm wonder is there any way to create deployments for two or more apps in single deployment so it is transactional - when something is wrong after deployment all apps are rollbacked. Also I want to mention that <strong>I'm not saying about pod with multiple containers</strong> bec...
<blockquote> <p>Is it possible to have single deployment that can produce 2+ kind of pods?</p> </blockquote> <p>No. A Deployment creates only one kind of Pod. You can update a Deployment's contents, and it will incrementally replace existing Pods with new ones that match the updated Pod spec.</p> <p>Nothing stops you...
<p>I would like to know if it's possible to override a value in environment.ts files (angular) with a Kubernetes manifest?</p> <p>I do it for application.properties (spring) but looks like it's not working the same way with Angular.</p> <p>here's what I do for Spring :</p> <pre><code>spec: containers: ...
<p>I faced the same issue you described. A good way I found to solve it, was creating an environment-service-loader where I do a merge between the properties from an env.json file and the properties defined in the environment.ts.</p> <p>Let me describe each step.</p> <p><strong>ANGULAR</strong></p> <p><strong>1. Create...
<p>I am new to k8s and need some help, plz.</p> <p>I want to make a change in a pod's deployment configuration and change readOnlyRootFilesystem to false.</p> <p>This is what I am trying to do, but it doesn't seem to work. Plz suggest what's wrong:</p> <pre class="lang-sh prettyprint-override"><code>kubectl patch deplo...
<p>Your JSON is invalid. You need to make sure you are providing valid JSON and it should be in the correct structure as defined by the k8s API as well. You can use <a href="https://jsonlint.com" rel="nofollow noreferrer">jsonlint.com</a>.</p> <pre class="lang-json prettyprint-override"><code>{ &quot;spec&quot;: { ...
<p>I'm trying to set up a OKE Cluster on OCI, deploy a Ghost container in it for blogging, then expose it to the internet. I've successfully done it with a load balancer service in my YAML and my blog is visible to the internet:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: blog annotations: servi...
<p>OKE now supports OCI Network Load Balancers (NLB). The documentation is available at: <a href="https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingloadbalancer.htm" rel="nofollow noreferrer">https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingloadbalancer.htm</a>.</p>
<p>In one of my deployment files, I want to set an environment variable. The variable is <code>KUBE_VERSION</code> and values must be fetched from a ConfigMap.</p> <pre><code> kube_1_21: 1.21.10_1550 </code></pre> <p>This is part of ConfigMap where I want to set <code>1.21.10_1550</code> to <code>KUBE_VERSION</code>, ...
<p>As far as I know it is unfortunately not possible to use the regular expression as you would like. Additionally, you have information about the regular expression that validates the entered data:</p> <blockquote> <p>regex used for validation is '[-._a-zA-Z0-9]+')</p> </blockquote> <p>It follows that you have to ente...
<p>I want to allow traffic to look like the following:</p> <p>external client https request (e.g. <a href="https://my-app-out-side-cluster.com" rel="nofollow noreferrer">https://my-app-out-side-cluster.com</a>) -&gt; inside the cluster (terminate tls) and change to http (e.g. <a href="http://my-app-out-side-cluster.com...
<p>i am not sure how your setup and K8s cluster is set,</p> <p>is it a <strong>private</strong> cluster or <strong>public</strong> cluster, how the request is getting outside of POD running any service of Node or Java that calling HTTP service?</p> <blockquote> <p>external client https request (e.g. <a href="https://my...
<p>I have a <code>Laravel</code> backend API and an <code>Angular</code> frontend. I deploy them with <code>Kubernetes ⎈</code> on <strong>Minikube</strong>.</p> <pre><code>NAME READY STATUS RESTARTS AGE pod/backend-deployment-bd4f98697-c2scp 1/1 Running 1 (22m ag...
<p>The mistake I made was using the <code>Kubernetes</code> annotations for the Frontend Ingress. What I had to do was create a Backend Ingress as well, that used the annotations:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: &quot;nginx&quot; ...
<p>I have a k8 setup that looks like this</p> <p><code>ingress -&gt; headless service (k8 service with clusterIp: none) -&gt; statefulsets ( 2pods)</code></p> <p>Fqdn looks like this:</p> <pre><code>nslookup my-service Server: 100.4.0.10 Address: 100.4.0.10#53 Name: my-service.my-namespace.svc.cluster...
<p>Original answer didn't clarify how OP fixed the issue, the problem was in <code>serviceName</code> property under statefulset implementation.</p>
<p>I want to start minikube to learn Kubernetes but am having trouble because of error <code>RSRC_INSUFFICIENT_CORES</code>. My mac has 2 CPU cores and minikube docs say that 2 cores are required. Here a the machine specs from &quot;About this Mac&quot;:</p> <ul> <li>MacBook Pro (15-inch, Late 2008)</li> <li>Processor ...
<p>I ran into these errors on an M1 Mac because my podman (4.0.2) did not have the VM configured with enough capacity. <a href="https://itnext.io/goodbye-docker-desktop-hello-minikube-3649f2a1c469" rel="noreferrer">Abhinav Sonkar</a> figured out how to fix this. This builds on his trail blazing.</p> <p>First you may ...
<p>I have an Elasticsearch cluster (6.3) running on Kubernetes (GKE) with the following manifest file:</p> <pre class="lang-yaml prettyprint-override"><code>--- # Source: elasticsearch/templates/manifests.yaml apiVersion: v1 kind: ConfigMap metadata: name: elasticsearch-configmap labels: app.kubernetes.io/name:...
<p>Did you try checking which <strong>types</strong> of both <strong>Nodes</strong> are?</p> <p>There are <strong>Master</strong> nodes and <strong>data</strong> nodes, at a time only one master gets elected while the other just stay in the background if the first master node goes down new <strong>Node</strong> gets el...
<p>I've made a deployment in GKE with a readiness probe. My container is coming up but it seems the readiness probe is having some difficulty. When I try to describe the pod I see that there are many probe warnings but it's not clear what the warning is.</p> <pre><code>Events: Type Reason Age ...
<p>Regarding the error in the logs <em><strong>“DeprecationWarning: The legacy HTTP parser is deprecated.”</strong></em>, it is due to the legacy HTTP parser being deprecated with the pending <em><strong>End-of-Life of Node.js 10.x</strong></em>. It will now warn on use, but otherwise continue to function and may be re...
<p>I'm trying to introduce a small change to an existing project without unit tests and decided I'd try to learn enough about nodejs and jest to include tests with my change. However, I cannot get mocks to work like I'd expect in, say, python. The project uses the &quot;kubernetes-client&quot; library from godaddy and ...
<p>I had to change a few things to get this working:</p> <ul> <li><code>jest.doMock()</code> instead of <code>jest.mock()</code></li> <li>use of <code>let app</code> inside the <code>describe</code> block instead of <code>const app</code> at module-scope</li> <li>a <code>beforeEach()</code> which calls <code>jest.reset...
<p>I'm using <strong>google Composer version</strong> <strong>1.18.0</strong> which is having <strong>Airflow version 2.2.3</strong> and the worker node count is set to 4 with a Disk Size of 100 GB and machine type <strong>n1-standard-2</strong> and</p> <pre><code>Web server machine type=composer-n1-webserver-2 (2 vCPU...
<p>Check your <strong>resource quota</strong></p> <pre><code>apiVersion: v1 kind: ResourceQuota metadata: name: compute-resources spec: hard: requests.ephemeral-storage: 2Gi limits.ephemeral-storage: 4Gi </code></pre> <p>There could be chances if <strong>resource quota</strong> is set and POD <code>exceede...
<p>I have a k8s cluster with one master node (node one) and three worker nodes(node two, three, and four). Is there any way to change node two to the master node and change node one to the worker node? In other words, switch the role of node one and node two.</p> <p>Thanks</p>
<p><code>Is there any way to change node two to the master node and change node one to the worker node?</code></p> <p>K8s control plane (aka master) is make up of <code>kubectl get componentstatuses</code>. This is not like <code>docker node promote/demote</code>. In your case, you need to delete node 2 from the cluste...
<p>I am using K8S</p> <p>I want to calculate a string that that is a result of <code>kubectl exec -it ... -c </code></p> <p>after the <code>-c</code> option there is a string.</p> <p>How can I pass a string with double quotes inside.</p> <p>The following example doesn't work properly.</p> <pre><code>x=&quot;$(kubectl e...
<ul> <li>when only a command needs to be executed on a pod , <code>-it</code> option is not required as it stands for attaching an interactive teminal</li> <li>when mysql is itself an executable command , no need to use <code>/bin/sh -c</code></li> <li>no need to encapsulate whole command in <code>&quot; &quot;</code><...
<p>I am trying to add a zip file to our configmap due to the amount of files exceeding the 1mb limit. I deploy our charts with helm and was looking into binaryData but cannot get it to work properly. I wanted to see if anyone had any suggestions on how I could integrate this with helm so when the job is finished it del...
<p><code>binaryData</code> exepcts a <em>map</em> but you are passing a <em>string</em> to it.<br /> When debugging the template we can see</p> <pre class="lang-text prettyprint-override"><code>Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: error validating &quot;&quot;: error val...
<p>I have read some tutorials of how to mount a volume in container and run the script on host/node directly. These are the examples given.</p> <p><strong>DeamonSet pod spec</strong></p> <pre><code> hostPID: true nodeSelector: cloud.google.com/gke-local-ssd: &quot;true&quot; volumes: - na...
<p>Lets start from the namepaces to understand this in detail :</p> <p>Namespaces in container helps to isolate resources among the process. Namespaces controls the resources from the kernal and allocate to the process. This provides a great isolation among different containers that may run in a system.</p> <p>Having ...
<p>I can ssh into a jumphost from where I can accesss k8 cluster. there is a particular pod which has a UI exposed on port 4040, how can I view that on my local browser ?</p> <p>What I have figured out so far, by executing the below command</p> <pre><code>kubectl port-forward podName 4040:4040 </code></pre> <p>I can no...
<p>Had to be done in two steps</p> <p>1st run <code>kubectl port-forward podName 4040:4040</code> from jumpbox</p> <p>2nd run <code>ssh -L 4040:localhost:4040 -i some_key.pem user@jumpbox-server</code> from the local machine</p> <p>access <code>http://localhost:4040</code> using browser</p>
<p><strong>Background</strong></p> <p>We have a need for messages to be processed in the order they were published. This is necessary to make sure all updates related to a particular entity are applied in order. Example: User updated their address 2 times in quick succession (could be on the UI OR a burst of messages f...
<p>One solution might be for each instance to bind a &quot;control&quot; queue to a fanout exchange; then, during startup, each instance could publish a control message to that exchange to tell the other instances to stop and restart its listener containers.</p> <p>You might need to add a random delay between each cont...
<p>I am having .net a self-hosted application, basically, it runs for 12 hours. The entire functionality is working as expected in my local machine.</p> <p>Reference: <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-3.1&amp;tabs=visual-studio" rel="nofollow norefe...
<p>Personally I have found that deploying my background services as ASP.NET Core applications works well, because we can:</p> <ol> <li>Deploy /health endpoints using <a href="https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-6.0" rel="nofollow noreferrer">Healthchecks</a></li> ...
<p>I have a 3-node ubuntu microk8s installation and it seems to be working ok. All 3 nodes are management nodes.</p> <p>On only one of the nodes, I get an error message and associated delay whenever I use a <strong>kubectl</strong> command. It looks like this:</p> <pre class="lang-sh prettyprint-override"><code>$ tim...
<p>Here's a good <a href="https://jonnylangefeld.com/blog/the-kubernetes-discovery-cache-blessing-and-curse" rel="noreferrer">write-up</a> about the issue. For some cases <code>rm -rf ~/.kube/cache</code> will remove the issue.</p>
<p>I am running <code>Kafka Streams 3.1.0</code> on <code>AWS OCP</code> cluster, and I am facing this error during restart of the pod:</p> <pre><code>10:33:18,529 [INFO ] Loaded Kafka Streams properties {topology.optimization=all, processing.guarantee=at_least_once, bootstrap.servers=PLAINTEXT://app-kafka-headless.app...
<p>As suggested, the fix I found was to set a <code>subPath</code> below the mountPath:</p> <p>Here is the relevant part of helm template used:</p> <pre><code>spec: containers: - name: app-processor volumeMounts: - name: data mountPath: {{ dir .Values.streams.state_dir | default &quot;/var/data/&quot;...
<p>I am taking a helm chart class and the 1st lab creates a pod, service and ingress. I am relatively new to k8s and I am running on minikube. The pod and service get created without issue; however the ingress.yaml file gives the following error:</p> <p><strong>unable to recognize &quot;ingress.yaml&quot;: no matches...
<p>Ingress spec <code>apiVersion: extensions/v1beta1</code> has deprecated. You can update it to <code>apiVersion: networking.k8s.io/v1</code></p> <p>Second question:</p> <pre><code>kind: Ingress metadata: name: guestbook-ingress spec: rules: - host: frontend.minikube.local http: paths: - path: / ...
<p>I have below go code that print my kubernetes deployment metadata,</p> <pre class="lang-golang prettyprint-override"><code>package test import ( &quot;context&quot; &quot;fmt&quot; &quot;os&quot; &quot;testing&quot; v1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot; &quot;k8s.io/client-go/...
<p>I was able to make it work by</p> <pre><code>appIngress, err := clientset.NetworkingV1().Ingresses(namespace).Get(context.TODO(), &quot;helloworldspringbootssl-ap145385&quot;, v1.GetOptions{}) fmt.Println(appIngress) </code></pre>
<p>TL/DR:</p> <ol> <li>I don't know if I'm using the asynchronous programming features of C# and Blazor correctly.</li> <li>Even though things technically work, I'd like some guidance if I'm doing things correctly.</li> <li>Also, I'm having issues trying to get my &quot;loading spinner&quot; to work. What am I doing wr...
<p>I can spot a few issues. Always avoid <code>async void</code>.</p> <pre class="lang-cs prettyprint-override"><code>async Task GetNodesAsync() { spin = true; //Task.Delay(1500).Wait(); -- .Wait() blocks the UI await Task.Delay(1500); //await InvokeAsync(GetNodes); -- this won't run on another Th...
<p>I'm fairly new to Kubernetes and I have played around with it for a few days now to get a feeling for it. Trying out to set up an Nginx Ingress controller on the google-cloud platform following <a href="https://cloud.google.com/community/tutorials/nginx-ingress-gke" rel="nofollow noreferrer">this guide</a>, I was ab...
<p>If you notice the tutorial inside the ingress configuration <code>path: &quot;/hello&quot;</code></p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-resource annotations: kubernetes.io/ingress.class: &quot;nginx&quot; nginx.ingress.kubernetes.io/ssl-redirect: &quot;fals...
<p>I'm working through <a href="https://rads.stackoverflow.com/amzn/click/com/1617293725" rel="nofollow noreferrer" rel="nofollow noreferrer">Kubernetes in Action</a> (copyright 2018), and at least one of the examples is out-of-date with respect to current versions of <code>kubectl</code>.</p> <p>Currently I'm stuck in...
<p>in short , you can use following commands to create pods and deployments (imperative way) using following commands which are similar to the commands mentioned in that book :</p> <ul> <li>To create a pod named <code>kubia</code> with image <code>Dave/kubia</code></li> </ul> <pre><code> kubectl run kubia --image=Dave/...
<p>I'm coming from the PHP/Python/JS environment where it's a standard to run multiple instances of web application as separate processes and asynchronous tasks like queue processing as separate scripts.</p> <p><strong>eg. in the k8s environment, there would be</strong></p> <ul> <li>N instances of <strong>web server on...
<blockquote> <p>What I need is to deploy separate parts of application (like 1 queue listener only) per pod in the cloud yet keep the monolith code architecture.</p> </blockquote> <p>I agree with <a href="https://stackoverflow.com/a/71598155/2446208">@jacky-neo's answer</a> in terms of the appropriate architecture/best...
<p>Hello I'am new on K8S and react typescript app, I'am trying to deploy my react application with typescript, i have an error in Kubernetes deployment</p> <pre><code>Liveness probe failed: HTTP probe failed with statuscode: 404 </code></pre> <p>where should I put the well-known routes /.well-known/live and /.well-know...
<blockquote> <p>where should I put the well-known routes /.well-known/live and /.well-known/ready ? and what should I write for it ?</p> </blockquote> <p>No need for it if you are serving index from your container with Nginx/Apache it will work in that case you need to update the K8s YAML config and update <code>HTTP p...
<p>I have 2 nodes that I'm running development pods on. I'd like to be able to echo only the node that a pod is running on based on the name.</p> <p>I can use <code>kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:spec.nodeName -n my-namespace</code> to pull back all the names and nodes for all pods in that n...
<p>Option-1: Using <code>custom-columns</code></p> <pre><code>kubectl get pod mypod -o custom-columns=&quot;:.spec.nodeName&quot; --no-headers </code></pre> <p>Option-2: Using <code>jsonpath</code></p> <pre><code>kubectl get pod mypod -o jsonpath='{.spec.nodeName}' </code></pre>
<p>We are getting logs that calls to k8s are being made, despite our cluster being private, as well as being behind the gcp firewall with a rule that blocks all ingress except IAP IPs (and ICMP). What am I missing?</p> <pre><code>&quot;protoPayload&quot;:{ &quot;@type&quot;:&quot;type.googleapis.com/google.cloud.aud...
<p>The private clusters have a control plane private endpoint and a control plane public endpoint and you can choose to disable the control plane public endpoint, this is the highest level of restricted access. So you can manage the cluster with the private endpoint internal IP address with tools like kubectl and any ...
<p>I'm trying to create Kubernetes job with the following requirements:</p> <ol> <li>Only one pod can be created for each job at most</li> <li>If the pod failed - the job will fail</li> <li>Max run time of the pod will be 1 hour</li> <li>If the job finished successfully - delete the job</li> </ol> <p>I tried the follow...
<ul> <li>Only one pod can be created for each job at most</li> </ul> <p>The requested parallelism (.spec.parallelism) can be set to any non-negative value. If it is unspecified, it defaults to 1. If it is specified as 0, then the Job is effectively paused until it is increased.</p> <blockquote> <p>For Cronjobs could be...
<p>What are the differences between</p> <pre><code>kubectl expose deployment myservice --type=NodePort --port=80 --target-port=80 </code></pre> <p>and</p> <pre><code>kubectl create service nodeport myservice --tcp=80:80 </code></pre> <p>?</p>
<pre><code>kubectl create service nodeport myservice --tcp=80:80 </code></pre> <p>it's just create the service with servicename as labels/selector.</p> <pre><code>kubectl expose deployment myservice --type=NodePort --port=80 --target-port=80 </code></pre> <p>it creates the service based on <code>labels/selector</code> ...
<p>My SpringBoot application is scheduled to run at 1 UTC each day for some data collection and put that in the database. We are using Kubernetes and we have two pods accessing the same database. The database is at some other location for which we have a connection string which is the same in both pods.</p> <p>The prob...
<p>I know this is old, but for anybody else, look into <a href="https://github.com/lukas-krecan/ShedLock" rel="nofollow noreferrer">ShedLock</a>. It handles locking across distributed nodes and is pretty easy to implement.</p>
<p>We have a single node kubernetes environment hosted on an on prem server and we are attempting to host jitsi on it as a single pod. Jitsi web, jicofo, jvb and the prosody will be in on one pod rather than having separate pods for each (<a href="https://github.com/DushmanthaBandaranayake/jitsi-kubernetes-scalable-ser...
<p>Managed to fix it. Posting this for anyone who comes across the same issue.</p> <p>first off the UDP port 10000 does not work in kubernetes as you can only expose ports between 30000 to 32768. Having said that you need to pick a port within that range and use it for the JVB_PORT configuration in the JVB container.</...
<p>I want to intercept the helm YAML and customize it using a Python script, and then install it. I have been doing something like <code>helm template | python3 script... | kubectl apply -f -</code> but of course this doesn't create a helm release in my cluster, so I lose out on <code>helm rollback</code> etc.</p> <p>I...
<p>Isn't that what post-renderers are for?</p> <p>See <a href="https://helm.sh/docs/topics/advanced/#post-rendering" rel="nofollow noreferrer">https://helm.sh/docs/topics/advanced/#post-rendering</a></p> <blockquote> <p>A post-renderer can be any executable that accepts rendered Kubernetes manifests on STDIN and return...
<p>I am using Kubernetes with Helm 3.</p> <p>It is ran on CentOS Linux 7 (Core).</p> <p>K8S (check by running: kubectl version):</p> <p>git version (kubernetes): v1.21.6, go version: go1.16.9.</p> <p>helm version: v3.3.4</p> <p>helm version (git) go1.14.9.</p> <p>I need to create a Job that is running after a Pod is cr...
<p>As per your configuration, it looks like you need to set <code>post-install</code> <a href="https://helm.sh/docs/topics/charts_hooks/#the-available-hooks" rel="nofollow noreferrer">hook</a> precisely for Job as it should execute after all resources are loaded into Kubernetes. On executing <code>pre-install</code> ...
<p>In k8s, I deploy an app running with clusterIP(port:5270). Then I want to set up an ingress-nginx to forward the request to this app. here is the configure:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: k8s-ingress annotations: nginx.ingress.kubernetes.io/rewrite-target: / spe...
<p>I think you might have some mis-understanding between the nginx ingress's <code>rewrite-target</code> annotation and your NestJS application's <code>redirection</code>.</p> <p>With the following annotation:</p> <pre><code>nginx.ingress.kubernetes.io/rewrite-target: / </code></pre> <p>your request path <code>/core/ap...
<p>The Python API is available to read objects from a cluster. By cloning we can say:</p> <ol> <li>Get a copy of an existing Kubernetes object using <code>kubectl get</code></li> <li>Change the properties of the object</li> <li>Apply the new object</li> </ol> <p>Until recently, the option to <a href="https://medium.c...
<p>Just use <code>to_dict()</code> which is now offered by Kubernetes Client objects. Note that it creates a partly deep copy. So to be safe:</p> <pre><code>copied_obj = copy.deepcopy(obj.to_dict()) </code></pre> <p>Dicts can be passed to <code>create*</code> and <code>patch*</code> methods.</p> <p>For convenience, you...
<p>Using Terraform I spin up the following resources for my primary using a unique service account for this cluster:</p> <pre><code>resource &quot;google_container_cluster&quot; &quot;primary&quot; { name = var.gke_cluster_name location = var.region # We can't create a cluster with no node pool defined, bu...
<p>Not sure if you intended to use <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning" rel="nofollow noreferrer">Node auto-provisioning (NAP)</a> (which I highly recommend you use unless it does not meet your needs), but the <code>cluster_autoscaling</code> argument for <code>google_...
<p>I want to display pod details in the following format using promql/Prometheus.</p> <p><a href="https://i.stack.imgur.com/AGPBm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AGPBm.png" alt="Image1" /></a></p> <p>Furthermore, I want to display CPU and memory utilization of application/component in below fo...
<h3>Per-pod CPU usage in percentage (the query doesn't return CPU usage for pods without CPU limits)</h3> <pre><code>100 * max( rate(container_cpu_usage_seconds_total[5m]) / on (container, pod) kube_pod_container_resource_limits{resource=&quot;cpu&quot;} ) by (pod) </code></pre> <p>The <code>kube_pod_container_...
<p><code>rke --debug up --config cluster.yml</code></p> <p>fails with health checks on etcd hosts with error:</p> <blockquote> <p>DEBU[0281] [etcd] failed to check health for etcd host [x.x.x.x]: failed to get /health for host [x.x.x.x]: Get &quot;https://x.x.x.x:2379/health&quot;: remote error: tls: bad certificate</p...
<p><code>rke util get-state-file</code> helped me to reconstruct bad cluster.rkestate file and I was able to successfully <code>rke up</code> and add new master node to fix whole situation.</p>
<p>What happened: We're on AKS with RBAC enabled. Executing any kubectl/helm command that connects to the k8s cluster, I have to reauthenticate. Output:</p> <p><code>To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXX to authenticate.</code> This succeeds but then wh...
<p>I recommend using <a href="https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli" rel="nofollow noreferrer"><code>az login</code></a> An auth token is cached locally on your environment and should give you access to your Kubernetes cluster.</p> <p>Then follow the Microsoft <a href="https://learn.microso...
<p>I recently deployed Minio stand-alone on a K0s pod. I can successfully use mc on my laptop to authenticate and create a bucket on my pod’s ip:9000.</p> <p>But when I try to access the web console and login I get a POST error to ip:9000 and I am unable to login.</p> <p>Would anyone know what’s causing this?</p>
<p>I've just started a minio container to verify this and it fact there are two ports you need to publish which are <code>9000</code> and <code>9001</code>.</p> <p>You can reach the admin console on port <code>9001</code> and the API on port <code>9000</code>, hence your <code>mc</code> command which targets port <code...
<p>I have a avi Kubernetes ingress and want to redirect / to /ui . Is it possible to do on Ingress routing rules.</p> <p>poc.xxx.com/ --&gt; How to redirect it to poc.xxx.com/ui</p> <p>poc.xxx.com/ui --&gt; ui-service</p> <p>poc.xxx.com/backend --&gt; backend-service</p> <p>My ingress Yaml</p> <pre><code>apiVersion: ne...
<p>What if you do something like this, any request at <code>/</code> will get moved to <code>ui</code> service</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: poc-ingress spec: rules: - host: poc.xxx.com http: paths: - path: / pathType: Prefix ...
<h1>Context</h1> <p>Say we have <code>d.yaml</code> in which a deployment, whose strategy is <code>RollingUpdate</code>, is defined.</p> <p>We first create a deployment:</p> <pre class="lang-sh prettyprint-override"><code>kubectl apply -f d.yaml </code></pre> <p>After some time, we modify <code>d.yaml</code> and re-app...
<blockquote> <blockquote> <p>Is it possible to kill R_old without waiting for rolling out R_new to complete?By &quot;kill&quot;, I mean completely stopping a replicaset; it should never restart. (So kubectl delete replicaset didn't help.)</p> </blockquote> </blockquote> <ol> <li>Make Changes to deployment</li> <li>Scal...
<p>I'm trying to deploy a simple .NET App in local kubernetes cluster (Kind) for testing purposes. When a deployment is applied, a pod doesn't start with an error. But the image is built well as a container works well if started locally in Docker.</p> <pre><code>NAME READY STATUS RESTAR...
<p>The reason was when a volume was mounted to <code>/app</code> it wiped out all the container's <code>/app</code> content.</p> <p>I fixed the issue by editing the following deployment's part:</p> <pre><code>volumeMounts: - name: appsettings-volume mountPath: /app/appSettings.json subPath: ...
<p>I have a namespace where new short-lived pods (&lt; 1 minute) are created constantly by Apache Airflow. I want that all those new pods are annotated with <code>aws.amazon.com/cloudwatch-agent-ignore: true</code> automatically so that no CloudWatch metrics (container insights) are created for those pods.</p> <p>I kno...
<p>To clarify I am posting community Wiki answer.</p> <p>You had to use <a href="https://github.com/aws/amazon-cloudwatch-agent/blob/dd1be96164c2cd6226a33c8cf7ce10a7f29547cf/plugins/processors/k8sdecorator/stores/podstore.go#L31" rel="nofollow noreferrer"><code>aws.amazon.com/cloudwatch-agent-ignore: true</code></a> an...
<p>Our GKE Autopilot cluster was recently upgraded to version 1.21.6-gke.1503, which apparently causes the <code>cluster-autoscaler.kubernetes.io/safe-to-evict=false</code> annotation to be banned.</p> <p>I totally get this for deployments, as Google doesn't want a deployment preventing scale-down, but for jobs I'd arg...
<p>At this point the only thing left is to ask to bring back this feature on <a href="https://issuetracker.google.com" rel="nofollow noreferrer">IssueTracker</a> - raise a new feature reqest and hope for the best.</p> <p>Link to this thread also as it contains quite a lot of troubleshooting and may be useful.</p>
<p><a href="https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/" rel="nofollow noreferrer">Since Kubernetes 1.20</a>, Docker support is deprecated and will be totally removed from 1.24. We use GKE to manage Kubernetes so the upgrade will be done automatically.</p> <p>As far as I've read, developers ...
<p><strong>Solved</strong> by putting this in our configuration:</p> <pre><code>- name: &quot;TESTCONTAINERS_HOST_OVERRIDE&quot; valueFrom: fieldRef: fieldPath: status.hostIP </code></pre> <p>Following <a href="https://www.testcontainers.org/features/configuration/" rel="nofollow noreferrer">this doc</a>:</...
<p>We have a 2 node K3S cluster with one master and one worker node and would like &quot;reasonable availability&quot; in that, if one or the other nodes goes down the cluster still works i.e. ingress reaches the services and pods which we have replicated across both nodes. We have an external load balancer (F5) which ...
<p>Your goals seems can be achievable with a few K8S internal features (not specific to Traffic):</p> <ol> <li><p>Assure you have 1 replica of <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress Controller's Pod</a> on each Node =&gt; use <a href="htt...
<p>I have a running pod that was created with the following <code>pod-definition.yaml</code>:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Pod metadata: name: microservice-one-pod-name labels: app: microservice-one-app-label type: front-end spec: containers: ...
<p>The problem is that you are trying to access your service at the <code>port</code> parameter which is the internal port at which the service will be exposed, even when using <code>NodePort</code> type.</p> <p>The parameter you were searching is called <code>nodePort</code>, which can optionally be specified together...
<p>it's possible to synchronize repo github for dags with an azure storage account?<br /> I want that evey time i put the dags in github repository it appears on azure file share.</p>
<p><em><strong>Airflow will not create the shared filesystem if you specify a Git repository. Instead, it will clone the DAG files to each of the nodes, and sync them periodically with the remote repository.</strong></em></p> <p>You can refer this <a href="https://docs.bitnami.com/azure-templates/infrastructure/apache-...
<p>I have a running pod and I use <code>kubectl attach -ti mypod</code> to give him input.</p> <p>But then, I would like to &quot;deattach&quot; from my pod and return back to my terminal without terminating my pod. How can I do that?</p>
<p>You can kill the <code>kubectl attach -it ..</code> process without killing the pod:</p> <pre><code>host$ kubectl attach -it podname pod$ do something in pod </code></pre> <p>Open the other terminal and find your <code>kubectl attach</code> command and then kill it, something like:</p> <pre><code>host$ ps x | grep &...
<p>We have created a few month ago controller which runs great using kubebuilder.</p> <p>Few weeks ago we added a “listener” to a secret which when the secret is changing (secret properties) The <strong>reconcile</strong> should be invoked, the problem is that it is <strong>sometimes working</strong> and <strong>someti...
<p>Most likely the issue is that the <code>WithEventFIlter</code> applies to all watched objects by the controller. The generation is auto-incremented for CRDs, but this doesn't hold for all resource types.</p> <p>From the GenerationChangedPredicate docs:</p> <pre><code>// Caveats: // // * The assumption that the Gener...
<p>Is there any way to configure promtail to send logs to loki via https-ingress?</p> <p><code>promtail</code> ---&gt; <code>https-ingress</code> ---&gt; <code>loki</code></p> <p>I used this helm chart <a href="https://github.com/grafana/helm-charts/tree/main/charts/promtail" rel="nofollow noreferrer">promtail</a> and ...
<p>After I played some time, I understood I need to remove port and specify <code>https</code> for the loki URL. Should be like below</p> <pre><code>https://gateway.loki.monitoring.example.com/loki/api/v1/push </code></pre>
<p>I am setting up External-DNS with Terraform. <a href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/azure.md" rel="nofollow noreferrer">Per the documentation</a>, I have to manually create an <code>azure.json</code> file and mount it as a secret volume. The directions also state:</p> <bl...
<p>This is the Terraform version of using the <code>--from-file</code> flag with kubectl.</p> <p>Basically, you'll add the name of the file and its contents per the structure of the <code>data</code> block below.</p> <pre><code>resource &quot;kubernetes_secret&quot; &quot;azure_config_file&quot; { metadata { name...
<p>We have a default deny-all-egress policy for all pods and we have an egress-internet policy like below</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-external-egress-internet spec: podSelector: matchLabels: egress: internet policyTypes: - Egress egress: ...
<p>Thats tricky because <code>matchLabels</code> does not take multiple key&amp;value pairs and <code>matchExpressions</code> will be ANDed. There are two possible ways (workarounds):</p> <ol> <li><p>Create another networkpolicy (along with existingone) where <code>matchLabels</code> contains <code>foo:bar</code>.</p> ...
<p>We have created our own custom resource a.k.a CRD and we need to add support for rolling update, as K8s is supporting it for deployments etc we want to reuse such logic, is there any lib which we can use (maybe partially) which we can use to support it? Or maybe learn and follow the logic as we don't want to re-inve...
<p>Posted community wiki answer to summarise the problem.</p> <p><a href="https://stackoverflow.com/users/13906951/clark-mccauley" title="1,093 reputation">Clark McCauley</a> well suggested:</p> <blockquote> <p>You're probably looking for the logic contained <a href="https://github.com/kubernetes/kubernetes/blob/master...
<p>I am using the Nginx annotations in Helm like so:</p> <pre><code>ingress: annotations: nginx.ingress.kubernetes.io/rewrite-target: /$2 hosts: - host: &quot;example.com&quot; paths: - path: /api(/?)(.*) </code></pre> <p>When visiting <code>example.com/api/</code>, my URL is rewritten as expe...
<p>I think you are searching for regex alternatives?</p> <pre><code>ingress: annotations: nginx.ingress.kubernetes.io/rewrite-target: /$2 hosts: - host: &quot;example.com&quot; paths: - path: /api(/|$)(.*) </code></pre> <p>Either after <code>/api</code> there's another <code>/</code> with what...
<p>I have a K8s cluster with multiple different services deployed and would like to use a single <code>Ingress</code> to route each incoming request to the appropriate service via a unique hostname <code>DNS</code>.</p> <p>Currently, I've only been able to resolve a request when using the root path i.e. <code>service-1...
<p>Not sure which K8s and ingress controller you are using, but in the later K8s you can specify the <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types" rel="nofollow noreferrer"><code>pathType</code></a> which takes care of path wildcards more nicely.</p> <p>You would have something l...
<p>One of our containers is using ephemeral storage but we don't know why. The app running in the container shouldn't be writing anything to the disk.</p> <p>We set the storage limit to 20MB but it's still being evicted. We could increase the limit but this seems like a bandaid fix.</p> <p>We're not sure what or where ...
<p>Adding details to the topic.</p> <blockquote> <p>Pods use ephemeral local storage for scratch space, caching, and logs. <strong>Pods can be evicted due to other pods filling the local storage, after which new pods are not admitted until sufficient storage has been reclaimed.</strong></p> </blockquote> <p>The kubelet...
<p>Yesterday, I stopped a Helm upgrade when it was running on a release pipeline in Azure DevOps and the followings deployments failed.</p> <p>I tried to see the chart that has failed with the aim of delete it but the chart of the microservice (&quot;auth&quot;) doesn't appear. I used the command «helm list -n [namespa...
<p>This error can happen for few reasons, but it most commonly occurs when there is an interruption during the upgrade/install process as you already mentioned.</p> <p>To fix this one may need to, <strong>first rollback to another version, then reinstall</strong> or helm upgrade again.</p> <p><em>Try below command to ...
<p>I am trying to use a constant in skaffold, and to access it in skaffold profile:</p> <p>example <code>export SOME_IP=199.99.99.99 &amp;&amp; skaffold run -p dev</code></p> <p>skaffold.yaml</p> <pre><code>... deploy: helm: flags: global: - &quot;--debug&quot; releases: - name: *** cha...
<p>Basically found a solution which I truly don't like, but it works:</p> <p>in <strong>dev</strong> profile: <strong>values.dev.yaml</strong> I added a placeholder</p> <pre><code> _anchors_: - &amp;_IPAddr_01 &quot;&lt;IPAddr_01_TAG&gt;&quot; # will be replaced with SOME_IP </code></pre> <p>The <strong>&lt;IPAddr...
<p>Using the helm <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/#using-the-tpl-function" rel="nofollow noreferrer">function tpl</a> or other similar functions, how do you pass in a <a href="https://helm.sh/docs/chart_template_guide/variables/" rel="nofollow noreferrer">file specific variable</a> and the <a...
<p>Helm is using a slightly modified version of sprig functions. Most things from sprig are available.</p> <p>You can use one of the <a href="http://masterminds.github.io/sprig/dicts.html" rel="nofollow noreferrer">dict functions</a> to set the value or create a new dict that you pass as context.</p> <pre><code>{{ $_ :...
<p>Im trying to parse a yaml file and update only one property, the problem is that the type is <code>RAW</code> and when I update one field it update the whole object,</p> <p>what I want is to <strong>update only</strong> <code>NatIPNames</code> from <code>test1</code> to <code>test2</code>, but <strong>without changi...
<p>I am not well aware of the gardener properties. But what you can do is create a struct for the <code>InfrastructureConfig</code> like below</p> <pre class="lang-golang prettyprint-override"><code>type InfraConfig struct { APIVersion string `json:&quot;apiVersion&quot;` Kind string `json:&quot;kind&quot...
<p>I am a newbie on Ops and need to update through Lens the HPA configuration like:</p> <p>From:</p> <pre><code> minReplicas: 6 maxReplicas: 10 </code></pre> <p>To:</p> <pre><code> minReplicas: 4 maxReplicas: 16 </code></pre> <p>My doubt is if the PODs will be recreated or not once we have 8 instances running.</p...
<blockquote> <p>In Kubernetes, a HorizontalPodAutoscaler automatically updates a workload resource (such as a Deployment or StatefulSet), with the aim of automatically scaling the workload to match demand.</p> </blockquote> <p>The HorizontalPodAutoscaler is implemented as a Kubernetes API <code>resource</code> and a <c...
<p>I started using <a href="https://k8slens.dev/" rel="noreferrer">Lens</a> and noticed that it gives you some warnings when the pods inside the nodes have limits higher than the actual capacity. <a href="https://i.stack.imgur.com/Txase.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Txase.png" alt="A graphic...
<p>you can use a kubectl plugin to list/sort pods with cpu limits:</p> <pre><code>kubectl resource-capacity --sort cpu.limit --util --pods </code></pre> <p><a href="https://github.com/robscott/kube-capacity" rel="noreferrer">https://github.com/robscott/kube-capacity</a></p>
<p>I am trying to build out my Custom Resource project in Kubebuilder but it seems like I am missing my controller gen whenever I build it out. I keep getting the error:</p> <pre><code>/Users/*****/Kubernetes/postgres-writer-operator/bin/controller-gen object:headerFile=&quot;hack/boilerplate.go.txt&quot; paths=&quot;....
<p>Not a perfect solution, this should work with the latest go version but it doesn't, so I had to downgrade the go version to 1.17 and then it worked</p> <p>Summarizing what I learned from this article on downgrading your go version. <a href="https://blog.notmyhostna.me/posts/downgrade-go-installed-with-homebrew/" rel...
<p>I'm trying to deploy an app to AKS cluster. Everytime I push changes to my branch, I want AKS to redeploy pods and make use of the most recent tag (which I have versioned with $(Build.BuildId))</p> <p>The problem is right now I have to manually retrieve this build version and enter it into deployment.yaml and then r...
<p>Replace tokens task can solve your problem. I use it most of the time.</p> <ol> <li>For the deployment yaml, change the image like this.</li> </ol> <blockquote> <pre><code>image: my_registry.azurecr.io/serving/mission_model_api:#{Build.BuildId}# </code></pre> </blockquote> <ol start="2"> <li>Before the <strong>task:...
<p>Is there a possibility to configure all the unbound configurations listed <a href="https://linux.die.net/man/5/unbound.conf" rel="nofollow noreferrer">here</a> similarly in kubernetes coredns 'Corefile' configuration like this. Only few options are listed <a href="https://kubernetes.io/docs/tasks/administer-cluster/...
<p><code>CoreDNS</code> supports some requested features via <a href="https://coredns.io/plugins/" rel="nofollow noreferrer"><code>plugins</code></a>:</p> <ul> <li><code>do-ip6</code> - CoreDNS works with ipv6 by default (if cluster is dual-stack)</li> <li><code>verbosity</code> - <a href="https://coredns.io/plugins/lo...
<p>We have a setup with Traefik as the Ingress Controller / CRD and ArgoCD. We installed ArgoCD into <a href="https://github.com/jonashackt/tekton-argocd-eks" rel="noreferrer">our EKS setup</a> as described in <a href="https://argo-cd.readthedocs.io/en/stable/getting_started/" rel="noreferrer">the Argo getting stared g...
<h2><strong>0. Why a declarative ArgoCD setup with Kustomize is a great way to configure custom parameters</strong></h2> <p>There are multiple options on how to configure ArgoCD. A great way is to use a declarative approach, which should be the default Kubernetes-style. Skimming the ArgoCD docs there's a <a href="https...
<p>What type of edits will change a ReplicaSet and StatefulSet AGE(CreationTimeStamp)?</p> <p>I'm asking this because I noticed that</p> <ol> <li>If I change a Deployment image, a new ReplicaSet will be created.</li> <li>The old ReplicaSet continues to exist with DESIRED set to 0.</li> <li>If I change back to the previ...
<blockquote> <p>AGE(CreationTimeStamp)</p> </blockquote> <p>A resource's <code>CreationTimeStamp</code> (and thereby its age) is set when a resource is <strong>created</strong>. E.g. to change it, you must <em>delete</em> the resource and create it again.</p>
<p>I want to expose a pod app to port 80, for that i have installed Metallb and configured a load balancer like this:</p> <p>metallb-config.yaml</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: namespace: metallb-system name: config data: config: | address-pools: - name: default protocol: lay...
<p>the same thing happened to me but it did not start because it collided with a docker swarm port, just run</p> <p><code>docker swarm leave -f </code></p> <p>and try again</p>
<p>I have a GKE Cluster current scaled upto multiple nodes, the scale up happened during high load due to a DDOS attack on our services , but now the cluster is unable to scale down due to redis-master and redis-slave, this is ending up costing alot of overhead costs that has become an issue for us now.</p> <p>The auto...
<p>Redis master or slave mostly save the data in to memory for backup and restore purpose it takes snapshot every min or second based on config.</p> <p>You can checkout the deployment config or configmap if any snapshot option running or not. In Redis terms known as the <strong>AOF</strong> and <strong>RDB</strong> bac...
<p>I'm using minikube locally. The following is the <code>.tf</code> file I use to create my kubernetes cluster:</p> <pre><code>provider &quot;kubernetes&quot; { config_path = &quot;~/.kube/config&quot; } resource &quot;kubernetes_namespace&quot; &quot;tfs&quot; { metadata { name = &quot;tfs&quot; # terraform-...
<p>The <code>kubernetes_ingress</code> resource generate an ingress with an <code>apiVersion</code> which is not supported by your kubernetes cluster. You have to use <code>[kubernetes_ingress_v1][1]</code> resource which looks similar to <code>kubernetes_ingress</code> resource with some diferences. For your example, ...
<p>I'am trying to learn kubernetes and ingress. I have misunderstood something ?</p> <p>I using proxmox with 3vm</p> <pre><code> kubectl get nodes NAME STATUS ROLES AGE VERSION k8sm Ready control-plane,master 127d v1.22.4 k8sn1 Ready &lt;none&gt; 127d v1.22....
<p>In Ingress you have used the path <code>/frontend</code> but you are not hitting it while</p> <p>Also, use the <code>Node Port</code> with <code>Node IP</code> you are using internal service IP.</p> <p>Something like :</p> <pre><code>curl http://192.168.1.39:32412/frontend </code></pre>
<p>Nginx can be configured to support the HAProxy proxy protocol for inbound traffic: <a href="http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_protocol" rel="nofollow noreferrer">http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_protocol</a></p> <p>However, using <code>proxy_protocol...
<blockquote> <p>Is it possible to configure nginx to treat the PROXY line as optional?</p> </blockquote> <p>No.</p> <p>You can use a listener with proxy protocol and one without but it's currently not possible to use both in one listener.</p>
<p>I am running three Ubuntu VMs using VMware workstation and I have been able to succesfully deploy a 3 node Kubernetes cluster using k3sup along with k3s.</p> <p>I am now trying to stand up AWX using the AWX operator but when I check the logs in the AWX pods I see the recurring messages.</p> <p>I am not sure what I a...
<p>By default, database upgrades are not applied when upgrading the AWX image.</p> <p>You must therefore manually connect to your AWX Web pod and run the following command:</p> <pre><code>awx-manage migrate --noinput </code></pre> <p>This should unblock the application startup.</p> <p>Source: <a href="https://github.co...
<p>I am using k3d to run local kubernetes</p> <p>I have created a cluster using k3d.</p> <p>Now I want to mount a local directory as a persistent volume.</p> <p>How can i do this while using k3d.</p> <p>I know in minikube</p> <pre><code>$ minikube start --mount-string=&quot;$HOME/go/src/github.com/nginx:/data&quot; --m...
<p>According to the answers to <a href="https://github.com/k3d-io/k3d/issues/566" rel="nofollow noreferrer">this Github question</a> the feature you're looking for is not available yet.</p> <p>Here is some idea from this link:</p> <blockquote> <p>The simplest I guess would be to have a pretty generic mount containing a...
<p>I am new to Kubernetes and I am trying to setup a Java-app locally in minikube. And I want it to be able to connect to locally hosted Postgres DB, connection URL looks like <code>jdbc:postgresql://localhost:5432/my_db</code>, not inside k8s. That sounds like something simple but I just can't find a solution. Could y...
<p>Seems, I found the solution. <code>host.minikube.internal</code> is exactly the alias we can use in this case. In my example just referring DB URI to <code>jdbc:postgresql://host.minikube.internal:5432/my_db</code> solved the problem.</p> <p>More info <a href="https://minikube.sigs.k8s.io/docs/handbook/host-access/"...
<p>Hello I am new to kubernetes and i need some help.</p> <p>I want use kubernetes ingress path for my 2 different nuxt project.</p> <p>First / path working well but my</p> <p>second /v1 path not get resources like .css and .js</p> <p>My first deployment and service yaml file:</p> <pre><code>apiVersion: apps/v1 kind: D...
<p>To clarify I am posting a community wiki answer.</p> <p>The problem here was resolved by switching the project path.</p> <p>See more about ingress paths <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types" rel="nofollow noreferrer">here</a>.</p>
<p>I'm trying to run a remote build execution with <a href="https://github.com/bazelbuild/bazel-buildfarm" rel="nofollow noreferrer">bazel buildfarm</a> memory workers on our k8s cluster.</p> <p>I've set up the server pods, worker pods, and redis clusters, as buildfarm's architecture requires it, along with k8s service...
<p>You need to use the shard worker config from here: <a href="https://github.com/bazelbuild/bazel-buildfarm/blob/main/examples/shard-worker.config.example" rel="nofollow noreferrer">https://github.com/bazelbuild/bazel-buildfarm/blob/main/examples/shard-worker.config.example</a> You will also need a running redis insta...
<p>I have generated logs for my pods using <code>kubectl logs 'pod name</code>. But I want to persist these logs in a volume (some kind of persistent storage), because container logs will get wiped out if the pods go down. Is there a way to do this? Do I have to write some sort of a script? I have read many answers but...
<p>I know this is an old question, but I've just had the same problem and I've spent some time to figure out the solution, so I'd like to share a more detailed solution.</p> <p>Like Aayush Mall said, you'll need the <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="noreferrer">PersistentVol...
<p>I have an openshift namespace (<code>SomeNamespace</code>), in that namespace I have several pods.</p> <p>I have a route associated with that namespace (<code>SomeRoute</code>).</p> <p>In one of pods I have my spring application. It has REST controllers.</p> <p>I want to send message to that REST controller, how can...
<p>You don't need to specify the pod in the route.</p> <p>The chain goes like this:</p> <ul> <li><code>Route</code> exposes a given port of a <code>Service</code></li> <li><code>Service</code> selects some pod to route the traffic to by its <code>.spec.selector</code> field</li> </ul> <p>You need to check your <code>Se...
<p>Attempting to deploy autoscaling to my cluster, but the target shows &quot;unknown&quot;, I have tried different metrics servers to no avail. I followed [this githhub issue](https&quot;//github.com/kubernetes/minikube/issues4456/) even thought I'm using Kubeadm not minikube and it did not change the problem.</p> <p>...
<p>Syntaxerror on line 6 of this yaml. It needs to be <code>- --kubelet-insecure-tls</code> and not <code>- --kubectl-insecure-tls</code></p> <pre><code>spec: containers: - args: - --cert-dir=/tmp - --secure-port=4443 - --kubectl-insecure-tls - --kubelet-preferred-address-types=InternalIP - --ku...
<p>I have a use case where I want to check which pods are covered by a network policy, right now my focus is only k8s generated network policies.</p> <p>What's the easiest way to do this? I know we can go through each network policy and from there filter out pods but a network policy can have multiple ways in which one...
<p>Using the <strong>podSelector</strong> field you can check all the pods that are covered by a Network Policy. Using the label mentioned in podSelector you can retrieve the list of pods which are using the NetworkPolicy.</p> <p>Each NetworkPolicy includes a <strong>podSelector</strong> which selects the grouping of p...
<p>I have an application that gets deployed from a docker image to a Kubernetes pod. Inside of my docker image I run the following command</p> <pre><code>FROM openjdk:17.0.1-slim USER root WORKDIR /opt/app ARG JAR_FILE ARG INFO_APP_BUILD RUN apt-get update RUN apt-get install -y sshpass RUN apt-get install -y openss...
<blockquote> <p>When the application gets deployed, out of my control, the user gets set to a non root user.</p> </blockquote> <p>Inside the container, the user running <code>java -jar /opt/app/app.jar</code> is root, because of <code>USER root</code>.</p> <p>Outside the container, on the host, a deployed application i...
<p>Forum,</p> <p>I am currently looking into Azure Synapse as an option for migrating our on-prem data architecture. I am excited by the functionality it offers - SQL Pools, Spark Pools, and the accompanying notebooks. I get that Synapse can function as a all in one data platform, where my data scientists and data anal...
<p>Unfortunately you can't integrate Azure Synapse Analytics with Kubernetes Services.</p> <p>While Synapse SQL helps perform SQL queries, Apache Spark executes batch/stream processing on Big Data. SQL Pool is used to work with data stored in Dedicated SQL Pool while Spark SQL can be integrated with existing data prepa...
<p>I have a .NetCore C# project which performs an HTTP POST. The project is set up in Kubernetes and I've noticed the logs below:</p> <pre><code>Heartbeat took longer than &quot;00:00:01&quot; at &quot;02/22/2020 15:43:45 +00:00&quot;. warn: Microsoft.AspNetCore.Server.Kestrel[22] Heartbeat took longer than &quot...
<p>This is a resource issue, as @andy pointed out in his response.</p> <p>According to OP, the solution to this problem is to either increase the server's CPU capacity (vertically) or the number of instances of your app (horizontally).</p>