prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have 2 pods, one that is writing files to a persistent volume and the other one supposedly reads those files to make some calculations.</p> <p>The first pod writes the files successfully and when I display the content of the persistent volume using <code>print(os.listdir(persistent_volume_path))</code> I get all t...
<p>When two pods should access a shared Persistent Volume with <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">access mode</a> <code>ReadWriteOnce</code>, concurrently - then the two pods must be running on the <strong>same node</strong> since the volume ...
<p>I'm passing the following string through values.yaml:</p> <pre><code>urls: http://example.com http://example2.com http://example3.com </code></pre> <p>Is there a way to create a list from this, so i can then do something like:</p> <pre><code>{{ range $urls }} {{ . }} {{ end }} </code></pre> <p>The problem is I'm pas...
<p>Basically all you need is just add this line in your template <code>yaml</code>:</p> <pre><code>{{- $urls := splitList &quot; &quot; .Values.urls }} </code></pre> <p>It will import <code>urls</code> string from <code>values.yaml</code> <a href="http://masterminds.github.io/sprig/string_slice.html" rel="nofollow nore...
<p>I have redis DB setup running on my minikube cluster. I have shutdown my minikube and started after 3 days and I can see my redis pod is failing to come up with below error from pod log</p> <pre><code>Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix &lt;f...
<p>I am not an Redis expert but from what I can see:</p> <pre><code>kubectl describe pod red3-redis-master-0 ... Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix &lt;filename&gt; ... </code></pre> <p>Means that your appendonly.aof file was corrupted with inv...
<p>I wish to run the Spring batch application in Azure Kubernetes.</p> <p>At present, my on-premise VM has the below configuration</p> <ul> <li>CPU Speed: 2,593</li> <li>CPU Cores: 4</li> </ul> <p>My application uses multithreading(~15 threads)</p> <p>how do I define the CPU in AKS.</p> <pre><code>resources: limits: ...
<p>I'm afraid there is no easy answer to your question, while planning the right size of VM Node Pools for Kubernetes cluster to fit appropriately your workload requirements for resource consumption . This is a constant effort for cluster operators, and requires you to take into account many factors, let's mention few ...
<p>I am trying to connect my Kubernetes Cluster in Digital Ocean with a Managed Database.</p> <p>I need to add the <code>CA CERTIFICATE</code> that is a file with extension <code>cer</code>. Is this the right way to add this file/certificate to a secret?</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: sec...
<p><strong>How to create a secret from certificate</strong></p> <hr /> <p>The easiest and fastest way is to create a secret from command line:</p> <pre><code>kubectl create secret generic secret-db-ca --from-file=.tls.ca=digitalocean-db.cer </code></pre> <p>Please note that type of this secret is <code>generic</code>, ...
<p>I have installed a Kubernetes cluster using <a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">kind k8s</a> as it was easier to setup and run in my local VM. I also installed Docker separately. I then created a docker image for Spring boot application I built for printing messages to the stdout. It was t...
<p>It's absolutely normal that your local installed Docker doesn't have containers running in pod created by kind Kubernetes. Let me explain why.</p> <p>First, we need to figure out, why kind Kubernetes actually needs Docker. It needs it <strong>not</strong> for running containers inside pods. It needs Docker to <stron...
<p>I have an openjdk:8 image running on the Kubernetes cluster. I added memory HPA (Horizontal Pod Autoscaling) which scales up fine but since JVM doesn't release the memory back from the heap to the OS, pods do not scale down. Following is the hpa.yaml</p> <pre><code>apiVersion: autoscaling/v2beta2 kind: HorizontalPod...
<p>Scaling Java applications in Kubernetes is a bit tricky. The HPA looks at system memory only and as pointed out, the JVM generally do not release commited heap space (at least not immediately).</p> <p>There are two main approaches one could take to solve this</p> <h2>1. Tune JVM Parameters so that the commited heap ...
<p>I was trying to configure a new installation of Lens IDE to work with my remote cluster (on a remote server, on a VM), but encountered some errors and can't find a proper explanation for this case.</p> <p>Lens expects a config file, I gave it to it from my cluster having it changed from</p> <p><code>server: https://...
<p>The solution is quite obvious and easy.</p> <p>k3s has to add the new IP to the certificate. Since by default, it includes only localhost and the IP of the node it's running on, if you (like me) have some kind of machine in from of it(like an lb or a dedicated firewall), the IP of one has to be added manually.</p> <...
<p>I am merging my applications from <code>docker</code> to <code>kubernetes</code>.</p> <p>I am currently working with <code>minikube</code>.</p> <p>I am using traefik as my reverse proxy, and it was installed in kubernetes using the oficial <code>helm chart</code> available at <a href="https://github.com/traefik/trae...
<p>You would set annotations on your service:</p> <pre><code>apiVersion: v1 kind: Service metadata: annotations: traefik.ingress.kubernetes.io/service.sticky.cookie: &quot;true&quot; traefik.ingress.kubernetes.io/service.sticky.cookie.name: cookie traefik.ingress.kubernetes.io/service.sticky.cookie.secure...
<p>I'm pretty well versed in Docker, but I haven't got Minikube/K8s working yet. I first tried setting up artifactory-oss in helm but failed to connect to the LoadBalancer. Now I'm just trying the <a href="https://minikube.sigs.k8s.io/docs/start/" rel="nofollow noreferrer">basic hello-minikube NodePort setup as a sanit...
<p>I faced a similar issue that I was banging my head upon, <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer">this documentation</a> was quite helpful. In my case I was accessing a Jenkins build server running in a Kubernetes cluster...
<p>I have nginx ingress installed on my cluster. Here is the yaml</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-client annotations: kubernetes.io/ingress.class: nginx namespace: dev spec: rules: - host: example.com http: paths: - path: / path...
<p>This is because a path <code>/</code> with type <code>Prefix</code> will match <code>/</code> and everything after, including <code>/api</code>. So your first rule overshadows the second rule in some sense.</p> <hr /> <p>I don't know if it's an option for you, but it would be probably most elegant and idiomatic to u...
<p>I am running the command:</p> <pre><code>kubectl run testbox -it --rm --restart=Never --image=python:buster -- python3 </code></pre> <p>which will launch a python session and then I input <code>exit()</code> to quit the session. But the session hangs forever there. If I do <code>kubectl get po testbox</code> I can s...
<p>There is a similar issue posted on <code>kubectl</code> GtiHub page (<a href="https://github.com/kubernetes/kubectl/issues/1098" rel="nofollow noreferrer">run commands don't return when using kubectl 1.22.x #1098</a>), created 3 days ago. Currently awaiting triage.</p> <p>This is most probably a bug in <em>1.22</em>...
<p>I have a PowerShell script that I want to run on some Azure AKS nodes (running Windows) to deploy a security tool. There is no daemon set for this by the software vendor. How would I get it done?</p> <p>Thanks a million Abdel</p>
<p>Similar question has been asked <a href="https://techcommunity.microsoft.com/t5/azure-devops/run-a-powershell-script-on-azure-aks-nodes/m-p/2689781" rel="nofollow noreferrer">here</a>. User <a href="https://techcommunity.microsoft.com/t5/user/viewprofilepage/user-id/1138854" rel="nofollow noreferrer">philipwelz</a> ...
<p>I deployed an Azure AKS cluster via the following terraform statements into an existing vnet. It worked, the AKS cluster is created with an Azure load balancer and an public IP address assigned to it. I need a setup with an internal Azure load balancer only. How do I have to change the terraform code to only get an ...
<p>This is configured in the Kubernetes LoadBalancer service using annotations. Specifically you need to add <code>service.beta.kubernetes.io/azure-load-balancer-internal: &quot;true&quot;</code> to the spec of your <code>LoadBalancer</code> service.</p> <p>This is documented here <a href="https://learn.microsoft.com/e...
<p>I am trying to understand the retry behavior for liveness probe, its not clear from <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes" rel="nofollow noreferrer">documentation</a>.</p> <p>I will to illustrate with an example. Consider the f...
<p><code>periodSeconds</code> is how often it checks. If you mean retry after crossing the failure threshold it never will because the container is full restarted from scratch.</p>
<p><strong>The problem:</strong></p> <p><code>Websockets</code> and <code>Socket.io</code> allow for rich 2-way asynchronous notifications between client and webserver.</p> <p><code>Socket.io</code> between HTML/javascript client and ingress &quot;cookie&quot; routing creates a stateful association between a Pod in a D...
<p>There is no native way to reliably communicate between pods of different Deployments. It's kind of possible in case of StatefulSets where all pods have known and stable names.</p> <p>In your case, assuming I understand your requirements correctly, I would recommend using queue messaging software like <a href="https:...
<p>I am trying out to have a volume mount on Kubernetes.</p> <p>Currently I have a Docker image which I run like:</p> <pre><code>docker run --mount type=bind,source=&quot;$(pwd)&quot;&lt;host_dir&gt;,target=&lt;docker_dir&gt; container </code></pre> <p>To have this run on Google Kubernetes cluster, I have:</p> <ol> <li...
<p>You are on the right path here. In your Pod spec, the name of the volumeMount should match the name of the volumes. So in your case,</p> <pre><code>volumes: - name: pvc persistentVolumeClaim: claimName: pvc </code></pre> <p>volume name is <code>pvc</code>. So your volumeMount should be</p> <pre><c...
<p>lets say, we have two independent Kubernetes clusters <code>Cluster 1 &amp; Cluster 2 </code>, Each of them has two replicas of same application Pod. Like <code>Cluster 1 : Pod A &amp; Pod B</code> <code>Cluster 2 : Pod C &amp; Pod D</code> Application code in Pod A(client) wants to connect to any Pod running in clu...
<blockquote> <p>Since, UDP is a connectionless protocol, my concern is around the session Affinity based on ClientIP. Should setting the sessionAffinity as client IP solve my issue ?</p> </blockquote> <p><code>sessionAffinity</code> keeps each session based on sourceIP regardless of the protocols at the same cluster. B...
<p>I have a web application hosted in EKS and there is a matrix in place for CPU utilization for scaling the pods horizontally.</p> <p>If the current number of pods is 10, and I increase the load (increasing requests per minute) then the desired number of pods is dependent on how aggressively I am increasing the load, ...
<p>Went through documentation and some code, this looks impossible to force horizontal pod autoscaler (HPA) to scale down or up in exact numbers of pods since there's no flags/options for it.</p> <p><strong>The closest you can get</strong> is to set up <code>scaleDown</code> and <code>scaleUp</code> policies.</p> <p>Be...
<p>I was trying to add a poststart hook for my pod using curl, say sending a message to my slack channel in shell, the command looks like this</p> <pre class="lang-sh prettyprint-override"><code>curl -d &quot;text=Hi I am a bot that can post messages to any public channel.&quot; -d &quot;channel=C1234567&quot; -H &quot...
<p>it finally solved by replacing () with {} to use a env variable in command, it should be ${TOKEN}</p>
<p>I have attributes that include dashes in their names, which I don't have any issue while using them along with <code>index</code> i.e:</p> <pre><code>{{ toYaml index .Values.myService &quot;my-service-config&quot; | b64enc }} </code></pre> <p>However, if I want to use an <code>if or</code> for multiple evaluations, ...
<p>I had to use <code>index</code> for each attribute name having dashes within parentheses:</p> <pre><code>{{- if or .Values.serviceA.appyml .Values.serviceB.log4j2xml ( index .Values.serviceC &quot;some-service-configyml&quot;) ( index .Values.serviceD &quot;another-serviceyml&quot;) }} </code></pre>
<p>I'm using Spark 3.0.0 with Kubernetes master. I am using a cluster mode to rung the spark job. Please find the spark submit command as below</p> <pre><code>./spark-submit \ --master=k8s://https://api.k8s.my-domain.com \ --deploy-mode cluster \ --name sparkle \ --num-executors 2 \ --executor-cores 2 \ --executor-memo...
<p>Unfortunately, it appears that there is no way for the driver-scoped logs to be piped to the spark-submit scope. From the <a href="http://df_check%20=%20spark.sql(%22%22%22%20SELECT%20%20%20%20batch,%20%20%20count(1)%20as%20c%20FROM%20bronze%20GROUP%20BY%20batch%20ORDER%20BY%20c%20DESC%20%22%22%22)%20display(df_chec...
<p>While working with Kubernetes for some months now, I found a nice way to use one single existing domain name and expose the cluster-ip through a sub-domain but also most of the microservices through different sub-sub-domains using the ingress controller.</p> <p>My ingress example code:</p> <pre><code>kind: Ingress a...
<p>Your understanding is good, by default NGINX Ingress Controller only supports HTTP and HTTPs traffic configuration (Layer 7) so probably your SQL server is not working because of this.</p> <p>Your SQL service is operating using TCP connections so it is <a href="https://stackoverflow.com/questions/56798909/resolve-do...
<p>I searched on the net but couldn't find a single use case of having this empty key in config file. I tried to comment it and <code>kubectl</code> worked perfectly fine.</p> <p>so my question is, what on earth it is solving? :)</p>
<p>Interesting question. Looking at the source code here <a href="https://github.com/kubernetes/client-go/blob/d412730e5f0160f6dc0a83459c14b05df8ea56fb/tools/clientcmd/api/v1/types.go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go/blob/d412730e5f0160f6dc0a83459c14b05df8ea56fb/tools/clientcmd/api/v1/...
<p>I have created a deployment and I wanted to mount the host path to the container, and when I check the container I see only empty folder.</p> <p>Why am I getting this error? What can be the cause?</p> <p>EDIT: I am using Windows OS.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: myservicepod6 ...
<p>After a detailed search and hit and trial method - Found the way</p> <p>Only for minikube:-</p> <p>First we need to mount the host folder into the directory name:</p> <p><code>minikube mount src/:/var/www/html</code></p> <p>Then we need to define hostPath and mountPath as</p> <p><code>/var/www/html</code></p> <p>Bec...
<p>I have a web applicaton (e.g. <code>&quot;india&quot;</code>) that depends on postgres and redis (e.g. a typical Rails application).</p> <p>I have a <code>docker-compose.yml</code> file that composes the containers to start this application.</p> <pre><code>version: '3' services: redis-india: image: redis:5.0....
<h1>Independent components</h1> <p>Your three components should run as separate deployments on Kubernetes. You want these three components to be:</p> <ul> <li>Independently upgradable and deployable (e.g. you deploy a new version of Redis but not your app or database)</li> <li>Independently scalable - e.g. you might ge...
<p>I am using Kubernetes with Minikube on a Windows 10 Home machine to &quot;host&quot; a gRPC service. I am working on getting Istio working in the cluster and have been running into the same issue over and over and I cannot figure out why. The problem is that once everything is up and running, the Istio gateway uses ...
<p>Changing the port number to port 80 resolved my issue. The problem was that my gRPC service was not using HTTPS. Will return if I have trouble once I change the service to use HTTPS.</p>
<p>does anyone know if this is possible?</p> <p>All I can find in docs is reference to enabling docker experimental features, but not the kubernetes experimental features.</p> <p>I tried this, but still get error.</p> <pre><code>k alpha debug -it exchange-pricing-865d579659-s8x6d --image=busybox --target=exchange-prici...
<p>I had the same intent (as have others in <a href="https://github.com/docker/for-mac/issues/2382" rel="nofollow noreferrer">this feature request</a>). After several hours of trial and error, I finally found out a way to do so.</p> <p>Steps:</p> <ol> <li>Depending on which file you're trying to edit, you may need to f...
<p>How can I configure something so that the injected istio sidecar uses the recent kubernetes container lifecycle of sidecar? The sidecar lifecycle is discussed <a href="https://medium.com/@chan_seeker/sidecar-containers-improvement-in-kubernetes-1-18-b5eb66ee2b83" rel="nofollow noreferrer">here</a> and <a href="https...
<p>The mentioned Kubernetes sidecar proposal was withdrawn. So there is no support for that, neither in Istio 1.6 nor in more recent versions.</p> <p>See <a href="https://github.com/kubernetes/enhancements/issues/753" rel="nofollow noreferrer">https://github.com/kubernetes/enhancements/issues/753</a></p>
<p>I'm trying to install an nginx ingress controller into an Azure Kubernetes Service cluster using helm. I'm following <a href="https://learn.microsoft.com/en-us/azure/aks/ingress-static-ip" rel="nofollow noreferrer">this Microsoft guide</a>. It's failing when I use helm to try to install the ingress controller, becau...
<p>It seems like the issue is caused by the new ingress-nginx/ingress-nginx helm chart release. I have fixed it by using version 3.36.0 instead of the latest (4.0.1).</p> <pre><code>helm upgrade -i nginx-ingress ingress-nginx/ingress-nginx \ --version 3.36.0 \ ... </code></pre>
<p>I've made my cluster using minukube.</p> <p>as I know, Indexed-Job feature is added at kubernetes version <a href="https://sysdig.com/blog/kubernetes-1-21-whats-new/" rel="nofollow noreferrer">1.21</a>.</p> <p>but when I made my job, it looks like there is no $JOB_COMPLETION_INDEX environ variable.</p> <p>here is my...
<p>as of now(2021.08.29), the <strong>IndexedJob</strong> is an alpha feature, so I started minikube with feature-gates flag</p> <pre><code>minikube start --feature-gates=IndexedJob=true </code></pre> <p>and It works well</p>
<p>I want to connect Galera cluster from <code>haproxy</code> pod deployed in kubernetes.</p> <p>Docker file for the image.</p> <pre><code>FROM haproxy:2.3 COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg </code></pre> <p><code>haproxy.cfg</code> File</p> <pre><code>defaults log global mode tcp retries 1...
<p>Depends on :</p> <p><code>[Warning] Access denied for user 'haproxy'@'192.168.1.10' (using password NO)</code></p> <p>I think you have to set password for user : <code>haproxy</code>.</p>
<p>A container running behind a K8s service fails to make network requests with the error <code>x509: certificate signed by unknown authority</code>.</p> <p>The container is an API that serves incoming requests and makes external network requests before responding, it's running in a local K8s cluster managed by Docker ...
<p>I hope this helps someone else as there are many different discussions about this topic online.</p> <p>The fix seems to be that when doing a multi stage docker build and using e.g. <code>FROM golang:alpine3.14 AS build</code> along with <code>FROM scratch</code>, the root certificates are not copied into the image....
<p>I've been looking for documentation for a long time and still couldn't find any clear connection procedure. I came up with this code sample :</p> <pre><code>package aws import ( &quot;fmt&quot; &quot;net/http&quot; &quot;github.com/aws/aws-sdk-go/aws/session&quot; &quot;github.com/aws/aws-sdk-go/se...
<p>Have you had a look at the <a href="https://github.com/kubernetes/client-go/blob/master/examples/in-cluster-client-configuration/main.go" rel="nofollow noreferrer">client-go example</a> on how to authenticate in-cluster?</p> <p>Code that authenticate to the Kubernetes API typically start like this:</p> <pre><code> ...
<p>Is the host needed when connecting to a Postgres container behind a K8s service?</p> <p>I was able to connect via the sql driver using just the username, password and dbname. When using the postgres driver with GORM it fails without the host in the url.</p> <p>The issue is that the service IP address routing to the ...
<p>The idiomatic way to achieve this is to use the <code>service name</code> as <code>hostname</code> and the <code>port</code> the <code>service</code> is exposing.</p> <p>When in the same <code>namespace</code>, the <code>service name</code> alone is enough. I.E.</p> <pre class="lang-sh prettyprint-override"><code>my...
<p>I deployed the OpenVPN server in the K8S cluster and deployed the OpenVPN client on a host outside the cluster. However, when I use client access, I can only access the POD on the host where the OpenVPN server is located, but cannot access the POD on other hosts in the cluster. The network used by the cluster is Cal...
<p>When the server is deployed on hostnetwork, a forward rule is missing in the iptables field.</p>
<p>I want a deployment in kubernetes to have the permission to restart itself, from within the cluster.</p> <p>I know I can create a serviceaccount and bind it to the pod, but I'm missing the name of the most specific permission (i.e. not just allowing <code>'*'</code>) to allow for the command</p> <pre><code>kubectl r...
<p>I believe the following is the minimum permissions required to restart a deployment:</p> <pre><code>rules: - apiGroups: [&quot;apps&quot;, &quot;extensions&quot;] resources: [&quot;deployments&quot;] resourceNames: [$DEPLOYMENT] verbs: [&quot;get&quot;, &quot;patch&quot;] </code></pre>
<p>I have read in ingress-nginx documentation that the rewrite is being performed thanks to an annotation like this:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/rewrite-target: /$2 name: rewrite namespace: default spec: rules: - host: re...
<p>I managed to get the desired result with this configuration:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx cert-manager.io/cluster-issuer: letsencrypt nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot; nginx.ing...
<p>I'm new to running Prometheus and Graphana. I want to create an alert that fires when a Kubernetes pod is in a pending state for more than 15 minutes. The PromQL query I'm using is:</p> <blockquote> <p>kube_pod_status_phase{exported_namespace=&quot;mynamespace&quot;, phase=&quot;Pending&quot;} &gt; 0</p> </blockquot...
<pre><code>- alert: KubernetesPodNotHealthy expr: min_over_time(sum by (namespace, pod) (kube_pod_status_phase{phase=~&quot;Pending|Unknown|Failed&quot;})[15m:1m]) &gt; 0 for: 0m labels: severity: critical annotations: summary: Kubernetes Pod not healthy (instance {{ $labels.instance }}) description: &quot;Pod ha...
<p>There is only 1 version per object in k8s 1.20 as can be checked by command:</p> <pre><code>kubectl api-resources </code></pre> <p>Also, creating custom objects with different versions is not allowed. <code>AlreadyExists</code> is thrown on trying.</p> <p>In what use cases providing <code>--api-version</code> option...
<p>Command:</p> <pre class="lang-yaml prettyprint-override"><code>kubectl api-resources </code></pre> <p>Print the supported API resources on the server. You can read more about this command and allowed options <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#api-resources" rel="nofollow...
<p>I'm trying to build a self managed kubernetes cluster on AWS/EC2 using Ubuntu VM's running 18.04 (so not EKS). I've managed to get the Master built which is integrated with ELB/Classic LB (i couldnt get this working with NLB) to allow me to expose services via type=LoadBalancer before moving over to an ingress contr...
<p>sudo kubeadm reset</p> <p>sudo systemctl enable docker</p> <p>sudo systemctl enable kubelet</p> <p>sudo systemctl daemon-reload</p> <p>sudo systemctl restart docker</p> <p>sudo netstat -lnp | grep 1025</p> <p>sudo rm -rf /etc/kubernetes/kubelet.conf /etc/kubernetes/pki/ca.crt</p> <p>sudo kubeadm join ipaddress:64...
<p>I'm trying to install Redis on Kubernetes environment with <a href="https://github.com/bitnami/charts/tree/master/bitnami/redis" rel="nofollow noreferrer">Bitnami Redis HELM Chart</a>. I want to use a defined password rather than randomly generated one. But i'm getting error below when i want to connect to redis mas...
<p>You can achieve it in much simpler way i.e. by running:</p> <pre><code>$ helm install my-release \ --set auth.password=&quot;admin1234&quot; \ bitnami/redis </code></pre> <p>This will update your <code>&quot;my-release-redis&quot;</code> secret, so when you run:</p> <pre><code>$ kubectl get secrets my-release-...
<p>I am using Kubernetes v1.20.10 baremetal installation. It has one master node and 3 worker nodes. The application simply served HTTP requests.</p> <p>I am scaling the deployment based on the (HPA) Horizontal Pod Autoscaler and I noticed that the load is not getting evenly across pods. Only the first pod is getting 9...
<p>Based on the information provided I assume that you are using http-keepalive which is a persistent tcp connection. A kubernetes service distributes load for each (new) tcp connection. If you have persistent connections, only the additional connections will be distributed which is the effect that you observe.</p> <p>...
<p>I'm having some trouble getting the Nginx ingress controller working in my Minikube cluster. It's likely to be some faults in Ingress configuration but I cannot pick it out.</p> <p>First, I deployed a service and it worked well without ingress.</p> <pre><code>kind: Service apiVersion: v1 metadata: name: online l...
<p>Moving this out of comments so it will be visible.</p> <hr /> <p><strong>Ingress</strong></p> <p>Main issue was with <code>path</code> in ingress rule since application serves traffic on <code>online/userOnline</code>. If requests go to <code>online</code> then ingress returns <code>404</code>.</p> <p>Rewrite annota...
<p>I am using Kubernetes in Azure with Virtual Nodes this is a plugin that creates virtual nodes using Azure Container Instances.</p> <p>The instructions to set this up require creating a AKSNet/AKSSubnet which seems to automatically come along with A VMSS called something like. aks-control-xxx-vmss I followed the inst...
<blockquote> <p>Can I use Azure Container Instances without the VMSS?</p> </blockquote> <p>In an AKS cluster currently you <em><strong>cannot</strong></em> have virtual nodes without a <strong>node pool</strong> of type <code>VirtualMachineScaleSets</code> or <code>AvailabilitySet</code>. An AKS cluster has at least on...
<p>I am currently using the KubernetesPodOperator to run a Pod on a Kubernetes cluster. I am getting the below error:</p> <blockquote> <p>kubernetes.client.rest.ApiException: (403) Reason: Forbidden</p> <p>HTTP response headers: HTTPHeaderDict({'Audit-Id': '', 'Cache-Control': 'no-cache, private', 'Content-Type': 'appl...
<p>You can't really. You need to assign and create the roles when you deploy airflow, otherwise that would mean that you have huge security risk because deployed application would be able to give more permissions.</p> <p>This can be done in multiple ways &quot;automatically&quot; if your intention was to somewhat autom...
<p>I have a secretsProviderClass resource defined for my Azure Kubernetes Service deployment, which allows me to create secrets from Azure Key Vault. I'd like to use Kustomize with it in order to unify my deployments across multiple environments. Here is my manifest:</p> <pre><code>apiVersion: secrets-store.csi.x-k8s.i...
<p>Unfortunately - the value that you're trying to access is not another nested YAML array - the pipe symbol at the end of a line in YAML signifies that any indented text that follows should be interpreted as a multi-line scalar value</p> <p>With kustomize you'd probably need to replace whole <code>/spec/parameters/obj...
<p>I'm using <strong>AWS EKS 1.21 with Fargate (serverless)</strong>. I'm trying to run Fluentd as a daemonset however the daemonset is not running at all.</p> <p>All the other objects like role, rolebinding, serviceaccount, configmap are already in place in the cluster.</p> <pre><code>NAME DESIRED CU...
<p>As you figured, EKS/Fargate does not support Daemonsets (because there are no [real] nodes). Actually, you don't need to run FluentBit as a sidecar in every pod. EKS/Fargate supports a logging feature called Firelens that allows you to just configure where you want to log (destination) and Fargate will configure a &...
<p>I enabled Istio on GKE using istio-addon. According to the images the version of Istio is <code>1.6</code>. Deployment of the application, which contains <code>RequestAuthentication</code> resource gives the following error:</p> <pre><code> admission webhook &quot;pilot.validation.istio.io&quot; denied the request: ...
<p>I have posted community wiki answer for better visibility.</p> <p>As <a href="https://stackoverflow.com/users/9496448/katya-gorshkova">Katya Gorshkova</a> has mentioned in the comment:</p> <blockquote> <p>Finally, I turned off istio addon and installed the newest istio 1.11.1. It worked without any problems</p> </bl...
<p>In my helm chart, I have a few files that need credentials to be inputted For example</p> <pre><code>&lt;Resource name=&quot;jdbc/test&quot; auth=&quot;Container&quot; driverClassName=&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot; url=&quot;jdbc:sqlserver://{{ .Values.DB.host }}:{{ .Values....
<p>you can't pass variables from any template to <code>values.yaml</code> with helm. Just from <code>values.yaml</code> to the templates.</p> <p>The answer you are seeking was posted by <a href="https://stackoverflow.com/users/3061469/mehowthe">mehowthe</a> :</p> <p>deployment.yaml =</p> <pre><code> env: ...
<p>Why I'd want to have multiple replicas of my DB?</p> <ol> <li>Redundancy: I have &gt; 1 replicas of my app code. Why? In case one node fails, another can fill its place when run behind a load balancer.</li> <li>Load: A load balancer can distribute traffic to multiple instances of the app.</li> <li>A/B testing. I can...
<p>I have created this community wiki answer to summarize the topic and to make pertinent information more visible.</p> <p>As <a href="https://stackoverflow.com/users/4216641/turing85" title="14,085 reputation">Turing85</a> well mentioned in the comment:</p> <blockquote> <p>Do NOT share a pvc to multiple db instances. ...
<p>I have a cluster deployed with: <a href="https://bitnami.com/stack/prometheus-operator/helm" rel="nofollow noreferrer">https://bitnami.com/stack/prometheus-operator/helm</a> and <a href="https://github.com/prometheus-community/postgres_exporter" rel="nofollow noreferrer">https://github.com/prometheus-community/postg...
<p>Use <a href="https://sysdig.com/blog/kubernetes-monitoring-prometheus-operator-part3/" rel="nofollow noreferrer">ServiceMonitors</a> if using Prometheus Operator.</p> <p>Configure the following block under the values.yaml in the postgres-exporter helm chart.This allows Prometheus Operator to read and configure jobs ...
<p>Say you have 3 or more services that communicate with each other constantly, if they are deployed remotely to the same cluster all is good cause they can see each other.</p> <p>However, I was wondering how could I deploy one of those locally, using minikube for instance, in a way that they are still able to talk to ...
<p><strong>TL;DR Yes, it is possible but not recommended, it is difficult and comes with a security risk.</strong></p> <p><a href="https://stackoverflow.com/users/4185234/charlie" title="19,519 reputation">Charlie</a> wrote very well in the comment and is absolutely right:</p> <blockquote> <p>Your local service will no...
<p>I have a small Kubernetes on prem cluster (Rancher 2.3.6) consisting of three nodes. The deployments inside the cluster are provisioned dynamically by an external application and always have their replica count set to 1, because these are stateful applications and high availability is not needed.</p> <p>The applic...
<p>It depends on how the traffic gets into your cluster. But let's break it down a little bit:</p> <p>Generally, there are two strategies on how to handle source ip preservation:</p> <ul> <li>SNAT (packet IP)</li> <li>proxy/header (passing the original IP in an additional header)</li> </ul> <h4>1) SNAT</h4> <p>By defau...
<p>I want to schedule kubernetes cronjob in my local timezone (GMT+7), currently when I schedule cronjob in k8s I need to schedule in UTC but I want to schedule in my local timezone, As specify in <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">Kubernetes document</a>, th...
<p>UPDATE 2023: WARNING OLD SYNTAX. See @Thanawat's answer, the official syntax has changed from what is shown in this answer.</p> <hr /> <pre class="lang-yaml prettyprint-override"><code>spec: schedule: &quot;CRON_TZ=America/New_York */5 * * * *&quot; </code></pre> <pre class="lang-yaml prettyprint-override"><code>...
<p>I'm using <code>kubectl</code> to access the api server on my minikube cluster on ubuntu but when try to use <code>kubectl</code> command I got an error certificate expired:</p> <pre><code>/home/ayoub# kubectl get pods Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2...
<p>Posted community wiki for better visibility. Feel free to expand it.</p> <hr /> <p>There is similar issue opened on <a href="https://github.com/kubernetes/minikube/issues/10122" rel="nofollow noreferrer">minikube GitHub</a>.</p> <p>The temporary workaround is to remove some files in the <code>/var/lib/minikube/</cod...
<p>According to documentation (<a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a>) I can create cron job in k8s with specify timezone like: <code>&quot;CRON_TZ=UTC 0 23 * * *&quot;</code></p> <p>My depl...
<p>The <code>CRON_TZ=&lt;timezone&gt;</code> prefix won't be available yet, not until 1.22. The inclusion in the 1.21 release docs was an error.</p> <p>Originally, the change adding the syntax was <a href="https://github.com/kubernetes/website/pull/29455/files" rel="nofollow noreferrer">included for 1.22</a>, but it ap...
<p>Can someone help me to understand if service mesh itself is a type of ingress or if there is any difference between service mesh and ingress?</p>
<p>An &quot;Ingress&quot; is responsible for Routing Traffic into your Cluster (from the <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="noreferrer">Docs</a>: <em>An API object that manages external access to the services in a cluster, typically HTTP.</em>)</p> <p>On the other side, a Se...
<p>I have a Kubernetes Cluster on Azure and I need to connect it to an external tool, this tool needs the API server address and the Bearer token, I was able to get the url of the api, but the bearer token, I am not finding.</p> <p>Does anyone know how to generate this token?</p>
<p>Bearer Tokens are just normal Tokens from ServiceAccounts.</p> <blockquote> <p>Service account bearer tokens are perfectly valid to use outside the cluster and can be used to create identities for long standing jobs that wish to talk to the Kubernetes API.</p> </blockquote> <p>You should def. create a new ServiceAcc...
<p>I have a set of environment variables in my <code>deployment</code> using <code>EnvFrom</code> and <code>configMapRef</code>. The environment variables held in these configMaps were set by kustomize originally from json files.</p> <pre><code>spec.template.spec.containers[0]. envFrom: - secretRef: name: even...
<h2>Short answer:</h2> <p>You will need to define variables explicitly or change configmaps so they have <code>1 environment variable = 1 value</code> structure, this way you will be able to refer to them using <code>envFrom</code>. E.g.:</p> <pre><code>&quot;apiVersion&quot;: &quot;v1&quot;, &quot;data&quot;: { &q...
<p>In Kubernetes job, there is a spec for .spec.activeDeadlineSeconds. If you don't explicitly set it, what will be the default value? 600 secs?</p> <p>here is the example from k8s doc</p> <pre><code>apiVersion: batch/v1 kind: Job metadata: name: pi-with-timeout spec: backoffLimit: 5 activeDeadlineSeconds: 100 ...
<p>By default, a Job will run uninterrupted. If you don't set <code>activeDeadlineSeconds</code>, the job will not have active deadline limit. It means <code>activeDeadlineSeconds</code> doesn't have default value.</p> <p>By the way, there are several ways to terminate the job.(Of course, when a Job completes, no more ...
<p>In <code>Chart.yaml</code> I specified dependency:</p> <pre><code>dependencies: - name: redis version: 15.0.3 repository: https://charts.bitnami.com/bitnami </code></pre> <p>In <code>deployment.yaml</code> I specify service:</p> <pre><code>apiVersion: v1 kind: Service metadata: labels: app: redis ...
<p>Helm supports passing arguments to dependent sub-charts. You can override the architecture of your <code>redis</code> sub-chart by adding this to your <code>values.yaml</code> file.</p> <pre><code>redis: architecture: standalone </code></pre>
<p>My own app dockerized on my MacOS M1 Silicon host machine, fails with <code>standard_init_linux.go:190: exec user process caused &quot;exec format error&quot;</code> when launched on Kubernetes cluster, with runs on Linux server.</p> <p>I have my app with this Dockerfile:</p> <pre><code>FROM openjdk:11-jre-slim as j...
<p>The final solution was to build app for certain architecture, adding platform (<code>platform: linux/amd64</code>) to the compose file:</p> <pre><code>version: &quot;3.8&quot; services: myapp: platform: linux/amd64 build: context: . dockerfile: myapp/Dockerfile hostname: myapphost </code><...
<pre><code>apiVersion: apps/v1 kind: StatefulSet metadata: name: mysql namespace: cp1 spec: selector: matchLabels: app: mysql serviceName: mysql replicas: 1 template: metadata: labels: app: mysql spec: terminationGracePeriodSeconds: 10 containers: - name: ...
<p>Looks like the PVC was not satisfied with the needed PV because the storageClass didnt create a new PV and the existing PV didnt match the <code>Pending</code> PVC so they couldnt bound together. after changing the appropriate fields they bound together.</p> <p>Although it only uses a single replica a statefulSet is...
<p>I created a kubernetes cluster using <code>kubeadm</code>. Services are declared as <code>ClusterIP</code>. At the moment I'm trying to deploy my app as ingress of type <code>loadbalancer</code> with Metallb but I faced some problems. If I deploy my app as ingress some jv and css components are not found. There was ...
<p>If you look closer in the logs, you can find that the cause of your problem is that your app is requesting static content (example for <code>css/site.css</code> file) in the path <code>tasty.taco.com/css/site.css</code> and as Ingress Controller doesn't have definition for prefix <code>/css</code> in it's definitio...
<p>I am trying to run a Spring Batch application in kubernetes cluster. I am able to enforce resource limits to the main application pod by placing the following snippet in the deployment yaml:</p> <pre><code>resources: limits: cpu: 500m ephemeral-storage: 500Mi memory: 250Mi </code></pre> <p>These settin...
<p>Since the <code>DeployerPartitionHandler</code> is created using the <code>new</code> operator in the <code>partitionHandler</code> method, it is not aware of the values from the properties file. The <code>DeployerPartitionHandler</code> provides a setter for <code>deploymentProperties</code>. You should use this pa...
<p><code>kubectl top pod --all-namespaces | sort --reverse --key 4 --numeric | head -10</code> gives top pods in a cluster. How to get top memory consuming pods per node?</p>
<p>In Ubuntu, this is the command which works for me:</p> <p>Sort by MEMORY Usage:</p> <p><code>kubectl get po -A -owide | grep ${NODE_NAME} | awk '{print $1, $2}' | xargs -n2 kubectl top pod --no-headers -n $1 | sort --key 3 -nr | column -t</code></p> <p>Sort by CPU Usage:</p> <p><code>kubectl get po -A -owide | grep ...
<p>Im new to kubernetes. In the yaml file to create services, i define externalIPs value in order to access services from outside the cluster:</p> <pre><code>kind: Service apiVersion: v1 metadata: name: mytestservice spec: type: ClusterIP clusterIP: 10.96.1.113 externalIPs: - 172.16.80.117 ports: - na...
<p>Welcome to the community.</p> <p><strong>Short answer:</strong></p> <p>At this point the answer to your question is yes, for simple cases you may completely ignore ingress. It will be a good option when it's time to go to production.</p> <hr /> <p><strong>A bit more details:</strong></p> <p>Main point why you may ne...
<p>When deciding on update strategy for a kubernetes application, there is an option to use <code>Recreate</code> strategy.</p> <p>How would this be different from just uninstalling and installing the app?</p>
<p><code>Recreate</code> strategy will delete your Pods and then add new Pods - you will get short downtime, but on the other side you will not use much extra resources during upgrade.</p> <p>You typically want <code>RollingUpgrade</code> since that takes a few Pods at a time and you can deploy stateless applications w...
<p>How can I use <code>kubectl</code> to list all the installed operators in my cluster? For instance running:</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/reactive-tech/kubegres/v1.9/kubegres.yaml </code></pre> <p>installs the <strong>Kubegres</strong> (Postgres cluster provider) operator, but the...
<p>Unless you are using <a href="https://github.com/operator-framework/operator-lifecycle-manager" rel="noreferrer">OLM</a> to manage operator, there is no universal way to get rid of it.</p> <p>Some operator might be installed using <a href="https://helm.sh" rel="noreferrer">Helm</a>, then it's just matter of <code>he...
<p><em>*Cross-posted to <a href="https://github.com/rancher/k3d/discussions/691" rel="noreferrer">k3d github discussions</a>, to a thread in <a href="https://forums.rancher.com/t/k3s-traefik-dashboard-activation/17142/11?u=iseric" rel="noreferrer">Rancher forums</a>, and to <a href="https://community.traefik.io/t/expos...
<p>I found a solution and hopefully someone find a better one soon</p> <ol> <li>you need to control your k3s cluster from your pc and not to ssh into master node, so add <code>/etc/rancher/k3s/k3s.yaml</code> into your local <code>~/.kube/config</code> (in order to port forward in last step into your pc)</li> <li>now g...
<p>I have a <code>k3s</code> cluster that have system pods with <code>calico</code> policy applied:</p> <pre><code>kube-system pod/calico-node-xxxx kube-system pod/calico-kube-controllers-xxxxxx kube-system pod/metrics-server-xxxxx kube-system pod/local-path-provisioner-xxxxx kube-s...
<p>When you install <code>k3s</code> based on the instructions <a href="https://rancher.com/docs/k3s/latest/en/installation/install-options/" rel="nofollow noreferrer">here</a> it won't install Calico CNI by default. There is a need to install Calico CNI <a href="https://docs.projectcalico.org/getting-started/kubernete...
<p>I'm struggling to setup a kubernetes secret using GoDaddy certs in order to use it with the Ingress Nginx controller in a Kubernetes cluster.</p> <p>I know that GoDaddy isn't the go-to place for that but that's not on my hands...</p> <p>Here what I tried (mainly based on this <a href="https://rammusxu.github.io/2019...
<p><em>This is a Community Wiki answer, posted for better visibility, so feel free to edit it and add any additional details you consider important.</em></p> <p>As OP mentioned in comments, <strong>the issue was solved by adding a new line in the beginning of the file</strong>.</p> <blockquote> <p>&quot;The key wasn't ...
<p>i've found two similar posts here but one hasn't been answered and the other was about android. I have a spring boot project and I want to access GCP Storage files within my application.</p> <p>Locally everything works fine I can access my bucket and read as well as store files in my storage. But when i upload it to...
<p>Following <a href="https://stackoverflow.com/a/67526886/11604596">Averi Kitsch's answer</a> and using the same <a href="https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine-java11/springboot-helloworld" rel="nofollow noreferrer">springboot-helloworld</a> example, I was able to get it workin...
<p>Apache Airflow version: v2.1.1</p> <p>Kubernetes version (if you are using kubernetes) (use kubectl version):- Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;21&quot;, GitVersion:&quot;v1.21.2&quot;, GitCommit:&quot;092fbfbf53427de67cac1e9fa54aaa09a28371d7&quot;, GitTreeState:&quot;clean&quot;, BuildD...
<p>Here are kube cluster role resources. Create with <code>kubectl -n &lt;namespace&gt; apply -f &lt;filename.yaml&gt;</code></p> <pre class="lang-yaml prettyprint-override"><code># Role for spark-on-k8s-operator to create resources on cluster apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name:...
<p>I have installed Prometheus using <a href="https://prometheus-community.github.io/helm-charts" rel="nofollow noreferrer">prometheus community</a> on my EKS cluster.</p> <p>Everything is working as expected. However I want it to scrape data from other sources. How do I add new targets? Can't find a documentation for ...
<p>Prometheus has a <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config" rel="noreferrer">scraping configuration</a> that allows you to add target you want to scrape. This is the documentation (a good starting point).</p>
<p>I am learning Kubernetes, by following the course, <a href="https://www.udemy.com/course/kubernetes-microservices/" rel="nofollow noreferrer">https://www.udemy.com/course/kubernetes-microservices/</a></p> <p>When i try to build an image, using the file <a href="https://github.com/fleetman-ci-cd-demo/jenkins" rel="no...
<p>I think it's the container that has an issue with connecting to the Internet. I ran into the same problem with Jenkins running in Docker.</p> <p>I restarted Docker with <code>sudo service docker restart</code>, and solved my problem.</p> <p>Now if you're concerned with the depracated warning:</p> <pre><code>WARN: in...
<p>I'm trying to implement in Kubernetes Dask distributed with one scheduler and three workers. I have one pod (<code>frontend.yaml</code>) for the scheduler and three other pods (<code>replicas: 3 in worker.yaml</code>) for the workers. The problem is that the workers are trying to connect to the scheduler and get a t...
<p>Thank you <a href="https://stackoverflow.com/users/3888719/michael-delgado">Michael Delgado</a> . Posting your suggestion as an answer to help community members.</p> <p>You can check the <a href="https://github.com/dask/helm-chart/tree/main/dask" rel="nofollow noreferrer">dask</a> and <a href="https://github.com/das...
<p>Can you help me? I want to deploy Ingres for nodeport. But I can't understand if this possible? </p> <p>I tried to find some information in Google but I got Ingress for load balancing or some difficult examples Ingress Ruby on rails and etc. </p>
<p>Create deployment and service</p> <pre><code>kubectl create deploy test --image httpd kubectl expose deploy test --port 80 --target-port 80 </code></pre> <p>Check if the service is working</p> <pre><code>kubectl get svc </code></pre> <p>returns</p> <pre><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PO...
<p>We are using a self-hosted microk8s cluster (single-node for now) for our internal staging workloads. From time to time, the server becomes unresponsive and I can't even ssh into it. The only way out is a restart.</p> <p>I can see that before the server crashes, its memory usage goes to the limit and the CPU load sh...
<p>Since microk8s running on the host machine, then all resources of the host are allocated for it. That is why if you want to keep your cluster resources in borders, you have to manage them in one of the ways below:</p> <ol> <li>Setup <a href="https://kubernetes.io/docs/concepts/policy/limit-range/" rel="nofollow nore...
<p>I would like to change the default tcp keep alive value in a Kubernetes pod, what's the recommended approach?</p>
<p>You could do this via sysctls on the pod manifest in AKS/Kubernetes:</p> <pre><code>spec: securityContext: sysctls: - name: &quot;net.ipv4.tcp_keepalive_time&quot; value: &quot;45&quot; </code></pre> <p>Here is also further documentation:</p> <p><a href="https://kubernetes.io/docs/tasks/administer-cl...
<p>If my pod is exceeding the memory requested (but still under the limit) is more memory available at runtime on request or does the pod needs to restarts to allocate more memory?</p>
<p>Memory up to the limit is available to the pod (as long as the host has enough free) at all times. The &quot;request&quot; amount is used for scheduling, and the limit is used for actually restricting the pod to an amount. I would caution against setting too high of a gap between request and limit, as it can result ...
<p>I found that creating a yaml object description using <code>--dry-run=client</code> and providing <code>--command</code> only works when the provided arguments are in a very specific order.</p> <p>This works:</p> <pre><code>k run nginx --image=nginx --restart=Never --dry-run=client -o yaml --command -- env &gt; ngin...
<p>Everything after <code>--</code> is a positional argument (until the <code>&gt;</code> which is a shell metachar), not an option.</p>
<p>I have VPC A with CIDR <code>10.A.0.0/16</code> and VPC B with CIDR <code>10.B.0.0/16</code>. I have VPC A and B peered and updated the route tables and from a server in <code>10.B.0.0/16</code> can ping a server in <code>10.A.0.0/16</code> and vice versa.</p> <p>The applications on VPC A also use some IPs in the <...
<p>Calico creates an overlay network using the specified cluster CIDR (192.168.x.x) on top of VPC (A) CIDR, so pods/services in this k8s cluster can communicate. The overlay network routing information is neither expose nor usable for AWS route table. This is different from k8s cluster running in VPC (B) which uses VPC...
<p>I am setting up a <code>kind</code> cluster</p> <pre><code>Creating cluster &quot;kind&quot; ... ✓ Ensuring node image (kindest/node:v1.22.1) 🖼 ✓ Preparing nodes 📦 📦 ✓ Writing configuration 📜 ✓ Starting control-plane 🕹️ ✓ Installing CNI 🔌 ✓ Installing StorageClass 💾 ✓ Joining worker nodes 🚜 ✓...
<p>The problem you're seeing here isn't related to kind, instead it's the manifest you're trying to apply is using outdated API versions, which were removed in Kubernetes 1.22</p> <p>Specifically the manifest is using the v1beta1 version of the customresourcedefinition object and validatingadmissionwebhook object</p> <...
<p>I am a newbie to Kubernetes and trying to install Kubernetes locally on my Mac machine.</p> <p>I am following the below tutorial on Kubernetes website</p> <p><a href="https://minikube.sigs.k8s.io/docs/start/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/start/</a></p> <p>Now, I am at a step where it t...
<p>to access your application either use <code>minikube tunnel</code> and then access it by one of the endopoints of your servers IPs and and port.</p> <p>Another option would be to expose your application via a service of type NodePort and then use <code>minikube service $servicename</code></p> <p>Edit:</p> <p>just a ...
<p>I am started GKE cluster using Terraform (<a href="https://learn.hashicorp.com/terraform/kubernetes/provision-gke-cluster" rel="nofollow noreferrer">link</a>), Now I am trying to release the helm charts on the cluster, and tried for "Nginx Ingress" helm chart which is as follow:</p> <pre><code>resource "helm_releas...
<p>Here is an example with Helm3:</p> <p>Note:</p> <ul> <li><code>[cluster endpoint]</code> and <code>[ca certificate]</code> are outputs of the cluster that was created with Terraform</li> <li>You will need a <code>cluster.admin</code> and <code>iam.serviceAccountTokenCreator</code> roles on the service account</li> <...
<p>I am recently new to Kubernetes and Docker in general and am experiencing issues.</p> <p>I am running a single local Kubernetes cluster via Docker and am using skaffold to control the build up and teardown of objects within the cluster. When I run <code>skaffold dev</code> the build seems successful, yet when I atte...
<p>As it seems, you have made the ingress service of type <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a>, this will usually provision an external loadbalancer from your cloud provider of choice. That's also why It's still pending. Its w...
<p>Previously we only use <code>helm template</code> to generate the manifest and apply to the cluster, recently we start planning to use <code>helm install</code> to manage our deployment, but running into following problems:</p> <p>Our deployment is a simple backend api which contains &quot;Ingress&quot;, &quot;Servi...
<p>You are already doing it &quot;right&quot; way, just don't change <code>release-name</code>. That's key for Helm to identify resources. It seems that you previously used different name for release (<code>rel-123</code>) then you are using now (<code>rel-124</code>).</p> <p>To fix your immediate problem, you should b...
<p>I could not understand what the package can do, the offical doc show nothing about <code>unstructured</code>. What the package used for ? Is it used for converting map[string]interface{} to K8S Obj ?</p> <p><a href="https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" rel="nofollow noreferrer">https...
<p>As @kseniia-churiumova suggested it is used when you don't know the object type. Here is the use case to understand it better. Let us say your organisation has a policy that all Kubernetes object must have annotation &quot;owner&quot; with value pointing to email ID of a person or group. You have tasked with finding...
<p>Kubernetes doesn't allow RoleRef of RoleBinding to be updated.<br /> When I command like below, kubernetes shows error:&quot;cannot change roleRef&quot;</p> <pre><code>$ kubectl apply -f - &lt;&lt; EOF kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: test-crb subjects: - kind: User...
<p>roleRef is immutable,You need to delete and recreate the referenced role/clusterorle. Here is the related <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#clusterrolebinding-example" rel="nofollow noreferrer">documentation</a>.</p> <blockquote> <p>After you create a binding, you cannot change ...
<p>I found that creating a yaml object description using <code>--dry-run=client</code> and providing <code>--command</code> only works when the provided arguments are in a very specific order.</p> <p>This works:</p> <pre><code>k run nginx --image=nginx --restart=Never --dry-run=client -o yaml --command -- env &gt; ngin...
<blockquote> <p>Ideally both should work in my opinion.</p> </blockquote> <p>Unfortunately, the commands you presented are not the same. They will never work the same either. This is correct behaviour. <a href="https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean">Double dash</a> (<code>--</code>) ...
<p>I have made a HA Kubernetes cluster. FIrst I added a node and joined the other node as master role. I basically did the multi etcd set up. This worked fine for me. I did the fail over testing which also worked fine. Now the problem is once I am done working, I drained and deleted the other node and then I shut down...
<p>After reboot the server you need to do some step below:</p> <ol> <li><p>sudo -i</p> </li> <li><p>swapoff -a</p> </li> <li><p>exit</p> </li> <li><p>strace -eopenat kubectl version</p> </li> </ol>
<p>I have been trying to deploy a Kubernetes cluster in Digital Ocean. Everything seems to work except when I try to apply the tls certificates. I have been following these steps, but with <code>Nginx Ingress Controller</code> v1.0.0 and <code>cert-manager</code> v1.5.0.</p> <p>I have two urls, let's say <code>api.exam...
<p>As <a href="https://stackoverflow.com/users/2853555/agusgambina">agusgambina</a> has mentioned in the comment, problem is solved:</p> <blockquote> <p>I was able to make this work, first I need to get the load balancer id executing <code> k describe svc ingress-nginx-controller --namespace=ingress-nginx</code> and th...
<p>I was recently trying to create a docker container and connect it with my SQLDeveloper but I started facing some strange issues. I downloaded the docker image using below pull request:</p> <pre><code>docker pull store/oracle/database-enterprise:12.2.0.1-slim </code></pre> <p>then I started the container from my dock...
<p>There are two issues here:</p> <ol> <li>Oracle Database is not supported on ARM processors, only Intel. See here: <a href="https://github.com/oracle/docker-images/issues/1814" rel="nofollow noreferrer">https://github.com/oracle/docker-images/issues/1814</a></li> <li>Oracle Database Docker images are only supported w...
<p>I see a lot of heavy documentation online related to Kubernetes deployment but still can't find the definition of <code>0/0</code>.</p> <pre><code>&gt; $ k get deployment NAME READY UP-TO-DATE AVAILABLE AGE async-handler-redis-master ...
<p>It means replica of your deployment is 0. In other words you don't have any pods under this deployment so 0/0 means 0 out of 0 pod is ready.</p> <p>You can;</p> <pre><code>kubectl scale deployment &lt;deployment-name&gt; --replicas=1 </code></pre>
<p>In the past I've installed them using:</p> <pre><code>helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update helm install ingress-nginx-01 ingress-nginx/ingress-nginx </code></pre> <p>and could have multiple.</p> <p>Now I'm getting this error when I try to install another:</p> <pre>...
<p>You have to set the <strong>Class Name</strong> while installing the new Nginx ingress controller again.</p> <p>For example :</p> <pre><code>helm install stable/nginx-ingress --set controller.ingressClass=gce --namespace kube-system --set controller.replicaCount=2 --set rbac.create=false helm install stable/nginx-in...
<p>I am using this <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/multibases/README.md" rel="noreferrer">example</a>:</p> <pre><code>├── base │   ├── kustomization.yaml │   └── pod.yaml ├── dev │   └── kustomization.yaml ├── kustomization.yaml ├── production │   └── kustomization.yaml └── st...
<p>It took some time to realise what happens here. I'll explain step by step what happens and how it should work.</p> <h2>What happens</h2> <p>Firstly I re-created the same structure:</p> <pre><code>$ tree . ├── base │   ├── kustomization.yaml │   └── pod.yaml ├── dev │   └── kustomization.yaml ├── kustomization.yaml └...
<p>I am using <a href="https://www.npmjs.com/package/memory-cache" rel="nofollow noreferrer">https://www.npmjs.com/package/memory-cache</a> package for caching purpose. I've given time value to expire cached data but need to create route using express so it can be cleared forcefully in case of any issue. is there any w...
<p>You can use the <strong>Headless service</strong> in this case which will return IPs of PODs running behind the service.</p> <p><strong>Or else</strong></p> <p>you can use the command :</p> <p><code>kubectl get endpoints &lt;your-service&gt;</code> provides a list of <code>IPs</code> that you can use to route to eac...
<p>I have set up a custom docker image registry on Gitlab and AKS for some reason fails to pull the image from there.<br /> Error that is being thrown out is:</p> <pre><code>Failed to pull image &quot;{registry}/{image}:latest&quot;: rpc error: code = FailedPrecondition desc = failed to pull and unpack image &quot;{re...
<p>• You can try scaling up the registry to run on all nodes. Kubernetes controller tries to be smart and routes node requests internally, instead of sending traffic to the loadbalancer IP. The issue though that if there is no registry service on that node, the packets go nowhere. So, scale up or route through a non-...