prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>Based on <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">this guide</a>.</p> <p>I have created this ingress:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/enable-rewrite-log: &quot;true&quot; n...
<p>This is a community wiki answer based on the info from the comments and posted for better visibility. Feel free to expand it.</p> <p>As already pointed out in the comments, the path matching <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#use-regex" rel="nofollow noref...
<p>The service is external-ip is and is unable to bind with a external port. I have run the command to try to find the port.</p> <blockquote> <p>minikube service mongodb-express-service</p> </blockquote> <p>There is no error shown on the terminal. But the browser says that it is unable to connect to that url.</p> <p><...
<p>Posting this answer to give more reference on 2 topics:</p> <ul> <li>Kubernetes Service not able to get External IP</li> <li>Issue that was present in this question</li> </ul> <hr /> <h3>Kubernetes Service not able to get External IP</h3> <p><code>Service</code> of type <code>LoadBalancer</code>:</p> <blockquote> <p...
<p>In a multi-container pod:</p> <p>step-1: Deploy first container Postgres Database and create a schema</p> <p>step-2: Wait until the Postgres pod came up</p> <p>step-3: then start deploying second container keycloak</p> <p>I have written below deployment file to run :</p> <pre><code>apiVersion: apps/v1 kind: Deployme...
<p>you forget to add the</p> <pre><code>- name: DB_VENDOR value: POSTGRES </code></pre> <p>in the deployment YAML file due to that keycloak by default using the H2 database mode.</p> <p>YAML ref file : <a href="https://github.com/harsh4870/Keycloack-postgres-kubernetes-deployment/blob/main/keycload-deployment.yaml" r...
<p>I am modifying the code in my project, and deploying it in kubernetes pod, the pod are deployed successfully, but the latest changes which I have made in my code are not being reflected after deployment, any idea for it?</p>
<p>When you change the code inside your application which will be build into your container, you have to do the following:</p> <ol> <li>Rebuild your image with the latest changes (e.g. via <code>docker build ...</code>)</li> <li>Push the image to your registry (e.g. via <code>docker push ...</code>)</li> <li>Update you...
<p>I'm trying to limit my filebeat daemonset to collect logs only from certain namespaces.</p> <p>According to the <a href="https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover.html#_kubernetes" rel="nofollow noreferrer">official autodiscovery documentation</a>, I can define <code>namespace...
<p>After some reading it looks that you can achieve your goal with <a href="https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover-hints.html#configuration-autodiscover-hints" rel="nofollow noreferrer">Hints based autodiscover</a>:</p> <p>The hints system looks for hints in Kubernetes Pod ann...
<p>I am using below command to export default values of chart helm-zabbix to file $HOME/zabbix_values.yaml, as i am trying to install zabbix on kubernetes cluster.</p> <pre><code>helm show values cetic/zabbix &gt; $HOME/zabbix_values.yaml </code></pre> <p>But, i am getting below error:</p> <p>Error: unknown command &qu...
<p>You should use <em><strong>inspect</strong></em> instead of <em><strong>show</strong></em> command as helm version 2 use <em><strong>inspect</strong></em> instead of <em><strong>show</strong></em>.</p> <p>Try using</p> <pre><code>helm inspect values cetic/zabbix </code></pre>
<p>I am working in a setup where I have an Argo CD portal to view the Kubernetes deployments etc. But do not have access to a kubeconfig file (hence cannot use kubectl).</p> <p>I can see the logs for the pods in the web UI, but is there a way to export the logs as a text file?</p>
<p>ArgoCD's logging interface in &gt;2.0 includes a Download button.</p> <p>For earlier versions, open your browser's dev tools to the Network tab. Click the Logs tag in the ArgoCD interface. Find the network request to the <code>logs</code> endpoint and open the URL in a new tab. From there you can download the logs a...
<p>For instance, I have a bare-metal cluster with 3 nodes ich with some instance exposing the port 105. In order to expose it on external Ip address I can define a service of type NodePort with &quot;externalIPs&quot; and it seems to work well. In the documentation it says to use a load balancer but I didn't get well w...
<blockquote> <p>Can somebody explain whay I have to use external (MetalLB, HAProxy etc) Load Balancer with Bare-metal kubernetes cluster?</p> </blockquote> <p>You don't have to use it, it's up to you to choose if you would like to use NodePort or LoadBalancer.</p> <hr /> <p>Let's start with the difference between NodeP...
<p>I have two deployments, one for backend and one for frontend and two services for them. Frontend Service is set as a LoadBalancer and it is exposed as expected(using minikube tunnel). Backend service shouldnt be exposed outside of the cluster, therefore I didnt set any type of service(default is ClusterIP which is a...
<p>Since this doesn't have an section answer yet, might as well make it easier for others to find it in the future. The person who asked the question answered it themselves here in the comments of the question.</p> <p>Essentially what's happening here is, that React doesn't execute on the frontend pod, but in the brows...
<p>I have a few different containerized web apps running on Azure Container Instance (ACI). I recently noticed that some of these containers just restart with no apparent reason once in a month or so. Since the restarts are on different apps/containers each time, I have no reason to suspect that the apps are crashing.<...
<p>Same here</p> <p>I've contacted MS support and got the response that <strong>per design</strong> ACI maintenance can restart the hosts so <strong>it can't be expected to run ACI for weeks uninterrupted</strong></p> <p>Recommendation is to</p> <ul> <li>adapt your app to be resilient (so you don't care about restarts)...
<p>I have a frontend application running in a Kubernetes cluster in AWS. It communicates with a Postgres RDS instance running in the same VPC. The RDS and the k8s worker nodes are both attached to the same private subnets.</p> <p>The RDS security group allows all access from the Kubernetes nodes (EC2 instances) to the ...
<p>You forgot to mention how did you provision your kubernetes cluster.</p> <ol> <li>Either you use EKS service. In that case, the pod IP address is really a secondary IP address of your EC2 instance (worker node). At least if you use default AWS CNI plugin All that should be needed in that case is really to allow EC2 ...
<p>I am deploying my application in kubernetes using helm chart with 2 sub-charts <code>app</code> and <code>test</code>.</p> <p>I have the pod of <code>app</code> chart properly running. But <code>test</code> pod will be running only if it can properly authenticate to <code>app</code> container.</p> <p>That means, i h...
<p>Trying to answer your question:</p> <blockquote> <p>But still the same problem of container not having the code to set env by reading from the shared volume, will be there.</p> </blockquote> <p>Let's try to read this env from other container. Here Is what I have come up with.</p> <p>First you need to know what comma...
<p>Two years ago while I took CKA exam, I already have this question. At that time I only could do was to see k8s.io official documentation. Now just curious on generating pv / pvc / storageClass via pure kubectl cli. What I look for is similar to the similar logic as deployment, for example:</p> <pre><code>$ kubectl c...
<p>There is no kubectl command to create a resource like PV, PVC, and storage class.</p> <blockquote> <p>From certificate points of view, you have go over <a href="https://kubernetes.io/" rel="nofollow noreferrer">k8.io</a> and look for the PV, PVC, and storage class under the task link.</p> </blockquote> <blockquote> ...
<p>Everytime I try to access a NodePort on my machine, it says &quot;Error Connection Refused.&quot; I don't understand since the examples I read online imply that I can run Docker Desktop on my laptop, connect to the cluster, and access services via their nodeport.</p> <p>My machine:</p> <ul> <li>Windows 10</li> <li>D...
<p>Kubernetes run locally, still runs on its internal network.</p> <blockquote> <p>curl.exe <a href="http://192.168.65.4:30007" rel="nofollow noreferrer">http://192.168.65.4:30007</a></p> </blockquote> <p>Here you use an IP address that is internal Kubernetes network. You must expose your Kubernetes service so that it ...
<p>I'm trying to figure out ways to automate k8s deployments in an EKS cluster. I'm trying to set up namespaces for each specific environment. One for dev, one for staging, and one for production. My production namespace is in a separate region and also in a separate cluster (dev &amp; staging are in one cluster). I'm ...
<p>Hi <a href="https://stackoverflow.com/users/12145078/dave-michaels">Dave Michaels</a>, I assume there are two questions in your post above:</p> <ol> <li><p>If we use a dedicated namespace in the same cluster (dev &amp; staging setup), can we use a dedicated load balancer for each of these namespaces? Is this good pr...
<p>I am trying to configure an nginx ingress for a GKE cluster and define a path on a configured subdomain. It seems that even if I am able to successfully ping the host, and the domain binding is done correctly, I keep getting a 404 back whenever I try to access the configured path.</p> <p>My goal is to be able to hav...
<p>As indicated in the question comments and in the question itself, very well documented by @vladzam, two are the reasons of the problem.</p> <p>On one hand, the nginx ingress controller available through the Helm <code>stable</code> channel seems to be <a href="https://github.com/helm/charts/tree/master/stable/nginx-...
<p>How can I setup a single gateway in Istio 1.9 and multiple VirtualServices (each one in a different namespace). I can't set one gateway to each virtualservice because browsers leverage HTTP/2 <a href="https://httpwg.org/specs/rfc7540.html#reuse" rel="nofollow noreferrer">connection reuse</a> to produce 404 errors.</...
<p>To answer your question, <code>because gateway and virtualservice can't be in different namespaces</code>, actually they can be in a different namespaces.</p> <p>If it´s not in the same namespace as virtual service you just have to specify that namespace in your virtual service <code>spec.gateways</code>.</p> <p>Che...
<p>The doc <a href="https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html</a> provides details of creating a cron job.</p> <p>To start a scheduled task that executes a build every 10 mins I use the...
<p>You are trying to override the image <code>CMD</code>/<code>ARG</code> with the <code>161/my-app</code> command (which seems not to be valid).</p> <p>You should use:</p> <pre><code>oc run run-build --image=myimage --schedule='*/10 * * * *' \ --restart=OnFailure \ --command -- &lt;YOUR COMMAND HERE&gt; </code></pre> ...
<p>We have two different pods in Kubernetes for our Laravel app, </p> <ul> <li>one running apache serving on port 80, (CMD /usr/sbin/apache2ctl -D FOREGROUND)</li> <li>and another running worker (Laravel Horizon) (CMD php /var/www/artisan horizon)</li> </ul> <p>The issue is when I check the horizon dashboard, it says...
<p>Double check your <code>APP_ENV</code> matches one of the environments in the horizon.php config. Otherwise horizon will not start any queue workers.</p> <p>By default only <code>local</code> and <code>production</code> environments are provided:</p> <p><a href="https://laravel.com/docs/8.x/horizon#environments" rel...
<p>I am trying to add argocd ingress resources on my Azure Kubernetes Service (AKS)cluster. I follow this guide <a href="https://argoproj.github.io/argo-cd/operator-manual/ingress/#kubernetesingress-nginx" rel="nofollow noreferrer">https://argoproj.github.io/argo-cd/operator-manual/ingress/#kubernetesingress-nginx</a><...
<p>Please find below example ingress for <strong>1.19</strong> Kubernetes version</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: minimal-ingress annotations: nginx.ingress.kubernetes.io/rewrite-target: / spec: rules: - http: paths: - path: /testpath pathTyp...
<p>I have two ingress controller one with default class <code>nginx</code> in <code>default</code> namespace, while the second ingress controller has a <code>nginx class: nginx-devices</code>.</p> <p>Cert-manager is already installed using Helm.</p> <p>I managed to get TLS certificate from Lets Encrypt for the first co...
<p>your second cluster issuer namespace is : <strong>ingress-nginx-devices</strong> ideally it should be in the <strong>default</strong> namespace as your ingress is in the <strong>default</strong> namespace.</p> <p>Keep these three in same namespace :</p> <ol> <li>Ingress</li> <li>Clusterissuer</li> <li>Service</li> <...
<p>I am using docker/K8s to deploy some pods.</p> <p>Now, I need to limit total CPU that worker can use for running container (not limit CPU for each Container).</p> <p>For example: we have 24 cores Linux Server. But I want to only use 20 cores for docker runtime.</p> <p>Could we do that?</p>
<p>You can limit the resources for docker in your OS:</p> <ol> <li><p>Create the file <code>/etc/systemd/system/docker_limit.slice</code> with the following content</p> <pre><code>[Unit] Description=Slice that limits docker resources Before=slices.target [Slice] CPUAccounting=true CPUQuota=2000% </code></pre> </li> <...
<p>We ran into an issue with our GKE volume usage.</p> <p>Starting from tonight our deployments couldn't access our main document storage disk anymore, the logs looked something like this:</p> <pre><code>... /go/src/github.com/def/abc/backend/formulare/formulare_generate_http.go:62 +0x55 github.com/def/abc/back...
<p>It seems that Google introduced a GKE update in the night to 2020-04-20. Somehow this update also affected previous versions (in our case 1.18.16-gke.502).</p> <p>We fixed the problem by upgrading to 1.19.8-gke.1600.</p> <p>Other possible workarounds would be to:</p> <ul> <li>Create a clone of the problematic volume...
<p>I have a major problem and will do my best to be short in the explanation. I am running a cronjob on an endpoint and would like to containerize that process. The endpoint needs to have some environments variables set and obviously a <code>TOKEN</code> authentication which is basically the login before I can curl POS...
<p><code>run.sh</code> is never being called. <code>docker-entrypoint.sh</code> needs to exec <code>run.sh</code> by adding <code>exec $@</code> at the bottom. But you don't really need the entrypoint anyways, those environment variables are already being exported into your environment by docker. I'm also not sure w...
<p>I deployed a simple test <code>ingress</code> and an <code>externalName</code> <code>service</code> using <code>kustomize</code>. The deployment works and I get the expected results, but when <code>describing</code> the <code>test-ingress</code> it shows the error: <code>&lt;error: endpoints &quot;test-external-serv...
<p>This is how the <code>kubectl describe ingress</code> command works.<br /> The <code>kubectl describe ingress</code> command calls the <a href="https://github.com/kubernetes/kubectl/blob/ac49920c0ccb0dd0899d5300fc43713ee2dfcdc9/pkg/describe/describe.go#L2623-L2672" rel="nofollow noreferrer">describeIngressV1beta1</a...
<p>i have 3 nodes <code>kubectl get nodes</code></p> <pre><code>NAME STATUS ROLES AGE VERSION a1 Ready master 133m v1.18.6-gke.6600 a2 Ready master 132m v1.18.6-gke.6600 a3 Ready master 132m v1.18.6-gke.6600 </code></pre> <p>so the status of that nodes is Ready I want...
<p>May you are getting the wrong meaning of <strong>cordon</strong> and <strong>drain</strong> node.</p> <p><strong>Cordon node</strong> :</p> <p>it means no more <strong>new</strong> container will get the <strong>scheduled</strong> on this <strong>node</strong> however existing running container will be kept on that ...
<p>I have a question please, for PVC that is bound to one PV through dynamic storageclass on a pod created by a replica set , if that pod gets terminated and restarted on another host will it get the same PV? what i saw that the Pod could not be rescheduled till the same PV was active but i am not able to understand w...
<p>another host mean another Kubernetes node?</p> <p>If POD gets <strong>restarted</strong> or <strong>terminated</strong> and scheduled again on another <strong>node</strong> in that case if PVC and PV exist disk will be mounted to that specific <strong>node</strong> and POD again starts running. Yes here, PVC and PV ...
<p>I am trying to get ingress with cert-manager v0.16.0 working for let's encrypt certs. I use microk8s and have followed a couple of tutorials, none of them let me to the goal.</p> <p>With this <a href="https://www.thinktecture.com/de/kubernetes/ssl-certificates-with-cert-manager-in-kubernetes/" rel="nofollow noreferr...
<p>Looks like cert-manager is not properly set with the CRD, you can try deleting and setting up cert-manager from official documentation once : <a href="https://cert-manager.io/docs/installation/kubernetes/" rel="noreferrer">https://cert-manager.io/docs/installation/kubernetes/</a></p> <p>You can directly set the late...
<p>My scenary is like the image below:</p> <p><a href="https://i.stack.imgur.com/3txty.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3txty.png" alt="enter image description here" /></a></p> <p>After a couple of days trying to find a way to block connections among pods based on a rule i found the <...
<p>Network policy will allow you to do exactly what you described on picture. You can allow or block based on labels or namespaces.</p> <p>It's difficult to help you when you don't explain what you exactly did and what is not working. Update your question with actual network policy YAML you created and ideally also sen...
<p>Is there a way for a <code>Deployment</code> or <code>Job</code> to completely delete itself upon completion?</p> <p>I want it such that when I do <code>kubectl get jobs/deployments/pods</code> they don't show up after they finished (container exited).</p> <p>One possible way I thought of was to call <code>kubectl d...
<p>I found a related <a href="https://stackoverflow.com/a/43116061/4242336">question and answer</a>, but found out it is for <code>CronJobs</code>.</p> <p>Following that answer, there is a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/" rel="nofollow noreferrer">TTL Controller</a> ...
<p>I want to assign <code>RBAC</code> rule to a user providing access to all the resources except <code>'create'</code> and <code>'delete'</code> verb in <code>'namespace'</code> resource using Terraform.</p> <p>Currently we have rule as stated below:</p> <pre><code>rule { api_groups = [&quot;*&quot;] resources...
<p>As we can find in the <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole" rel="nofollow noreferrer">Role and ClusterRole documentation</a>, permissions (rules) are purely additive - there are no &quot;deny&quot; rules:</p> <blockquote> <p>Role and ClusterRole An RBAC Role or ...
<p>I'm looking for a way to run <code>kubectl auth can-i get pods --as system:serviceaccount:default:test</code> using kubernetes go-client.</p> <p>So far I got the below code but it doesn't work as I'm getting a different response in comparison to <code>kubectl auth can-i</code>. I know this is about impersonation and...
<p>I figured it out! I used the singular form of &quot;pod&quot; instead of the plural &quot;pods&quot; in ResourceAttributes.</p> <pre class="lang-golang prettyprint-override"><code>package main import ( &quot;context&quot; &quot;fmt&quot; &quot;os&quot; authv1 &quot;k8s.io/api/authorization/v1&quot;...
<p>kubernetes V19</p> <p>Create a new NetworkPolicy named allow-port-from-namespace that allows Pods in the existing namespace internal to connect to port 80 of other Pods in the same namespace.</p> <p>Ensure that the new NetworkPolicy:</p> <p>does not allow access to Pods not listening on port 80 does not allow access...
<ol> <li>You need to label the namespace first</li> </ol> <p>For e.g <strong>kubectl label ns namespace-name env: testing</strong></p> <p>2.</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-port-from-namespace namespace: staging spec: podSelector: {} policyTypes: - In...
<p>My airflow service runs as a kubernetes deployment, and has two containers, one for the <code>webserver</code> and one for the <code>scheduler</code>. I'm running a task using a KubernetesPodOperator, with <code>in_cluster=True</code> parameters, and it runs well, I can even <code>kubectl logs pod-name</code> and al...
<p>The problem was a bug in how the KubernetesPodExecutor from Airflow v1.10.10 tried to launch the pods. Upgrading to Airflow 2.0 solved the issue.</p>
<p>I have been trying to find how to do this but so far have found nothing, I am quite new to Kubernetes so I might just have looked over it. I want to use my own certificate for the Kubernetes API server, is this possible? And if so, can someone perhaps give me a link?</p>
<p>Yes, you can use your own certificate and set inn the Kubernetes API server.</p> <p>Suppose you have created the certificate move and save them to specific node directory:</p> <pre><code>{ sudo mkdir -p /var/lib/kubernetes/ sudo mv ca.pem ca-key.pem kubernetes-key.pem kubernetes.pem \ service-account-key.pe...
<p>I'd like to run a particular Kubernetes job whenever the pod of particular deployment restarts.</p> <p>In particular, I have a Redis deployment. It is not backed by permanent storage. When the pod in the Redis deployment restarts, I'd like to populate some keys in Redis.</p> <p>Is there a way to trigger a job on p...
<p>The best option comes to my mind is an k8s operator - A simple python/go script watches your target pod (by label, name, namespace, etc.) and performs some actions when the state changes.</p> <p>An operator is just a deployment with special features. There are various ways to implement, one of them is <a href="https...
<p>I have been trying to find how to do this but so far have found nothing, I am quite new to Kubernetes so I might just have looked over it. I want to use my own certificate for the Kubernetes API server, is this possible? And if so, can someone perhaps give me a link?</p>
<p>Ok, so here is my idea. We know we cannot change cluster certs, but there is other way to do it. We should be able to proxy through ingress.</p> <p>First we enabled ingres addon:</p> <pre><code>➜ ~ minikube addons enable ingress </code></pre> <p>Given <code>tls.crt</code> and <code>tls.key</code> we create a secret...
<p>I have a docker container image that requires me to mount a volume containing a specific configuration file, in order for that container to properly start (this image is not one that I have control over, and is vendor supplied). If that volume is not mounted, the container will exit because the file is not found. So...
<p>If you can store the file into the <code>ConfigMap</code> you can mount the file to volume and use it inside the Kubernetes.</p> <p>I am not sure with the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-files" rel="nofollow noreferrer">type of file</a...
<p>I am trying to get Kafka topic lag into Prometheus and finally to the APIServer in order to utilize an external metrics HPA for my application.</p> <p>I am getting the error <strong>no metrics returned from external metrics API</strong></p> <pre><code>70m Warning FailedGetExternalMetric horizontalpo...
<p>In a long tradition of answering my own questions after I ask them, here's what's wrong with the above configuration.</p> <p>The error lies in the prometheus-adapter yaml:</p> <pre><code>rules: external: - seriesQuery: 'kafka_consumergroup_group_lag{topic=&quot;prices&quot;}' resources: template:...
<p>I'm currently writing a kubernetes operator in go using the <code>operator-sdk</code>. This operator creates two <code>StatefulSet</code> and two <code>Service</code>, with some business logic around it.</p> <p>I'm wondering what CRD status is about ? In my reconcile method I use the default client (i.e. <code>r.Lis...
<p>The status subresource of a CRD can be considered to have the same objective of non-custom resources. While the <strong>spec</strong> defines the desired state of that particular resource, basically I declare what I want, the <strong>status</strong> instead explains the current situation of the resource I declared o...
<p>I am having a problem with jenkins kubernetes pod that stopped working after the last pod restart (done by kubernetes).</p> <p>So, I am having errors like this in my log:</p> <pre><code>2021-02-05 11:00:55.856+0000 [id=27] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins 2021-02-05 11:00:56.883+...
<p>I was able to fix this issue by deleting the /plugins folder under /var/jenkins_home and then restarting my Jenkins pod. This created a new /plugins folder and then I no longer had any plugin dependency issues.</p>
<p>My Kubernetes 3 VM cluster (1 controller, 2 workers on Ubuntu 20.04) is having problems with DNS host lookup. It cannot correctly resolve external host names. I found this trying to run Jenkins on my cluster, and Jenkins could not get its plugins on initial setup.</p> <p>Can anyone shed light on the following?</p> <...
<p>Lack of DNS forwarding on a per-pod basis appears to be <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names" rel="nofollow noreferrer">explained</a> by this unusual comment:</p> <blockquote> <p>Note: &quot;Default&quot; is not the default DNS policy. If dnsPoli...
<p>I just setup a kubenetes cluster base on this link <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#multi-platform" rel="noreferrer">https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#multi-platform</a> I check with kubectl get nodes, then the master node is Ready, but ...
<p>Hope you see something like this:</p> <pre><code>{ &quot;kind&quot;: &quot;Status&quot;, &quot;apiVersion&quot;: &quot;v1&quot;, &quot;metadata&quot;: { }, &quot;status&quot;: &quot;Failure&quot;, &quot;message&quot;: &quot;forbidden: User \&quot;system:anonymous\&quot; cannot get path \&quot;/\&quo...
<p>I am using the <a href="https://www.terraform.io/docs/providers/kubernetes/index.html" rel="nofollow noreferrer">Kubernetes Provider</a> to describe services/pods in Terraform.</p> <p>It can get confusing using the Hashicorp Configuration Language to define <a href="https://www.terraform.io/docs/providers/kubernete...
<p>The <code>hashicorp/kubernetes</code> provider does not support raw YAML/JSON, and they have no intention of implementing it.</p> <p>The possible solutions are:</p> <ul> <li><a href="https://awesomeopensource.com/project/sl1pm4t/k2tf" rel="nofollow noreferrer">K2tf</a>, a tool for converting Kubernetes RAW YAML mani...
<p>I'm attempting to take advantage of Spring Cloud Kubernetes in my Spring Boot-based microservice, namely autoconfiguration and service discovery.</p> <p>However, I get an error message (<em>Timeout waiting for informers cache to be ready, is the kubernetes service up?</em>) during the initialization, as well as high...
<p>I managed to get rid of the error messages by using the <strong>Fabric8</strong> client instead of the official client. This simple change was enough to get rid of my problems.</p> <p>This was done by changing the dependency in <code>pom.xml</code> from <code>spring-cloud-starter-kubernetes-client-all</code> to <cod...
<p>I want to enable <code>ReadWriteMany</code> access mode in EKS Persistent Volume. Came accross io2 volumetype by EBS AWS. SO using io2 type volume</p> <p>storage_class.yaml</p> <pre><code>apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: io2 provisioner: ebs.csi.aws.com volumeBindingMode: WaitForFir...
<p>I looks like there is <a href="https://github.com/kubernetes-sigs/aws-ebs-csi-driver/issues/449" rel="nofollow noreferrer">open feature request on kubernetes-sigs/aws-ebs-csi-driver</a> repo but no progress on this. So I guess that it is not supported at the moment but you can monitor the issue for updates.</p>
<p>I have defined a new service with a ClusterIP.</p> <pre><code>[ciuffoly@master-node ~]$ kubectl get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 &lt;none&gt; 443/TCP 4d1h test-reg ClusterIP 10.102....
<p>This is a community wiki answer posted for better visibility. Feel free to expand it.</p> <p>As already confirmed by andrea ciuffoli, switching from Flannel to Calico solved the issue.</p> <p>Flannel is a very simple overlay network that satisfies the Kubernetes requirements.</p> <p>On the other hand, Calico is an o...
<p>I have a custom kubernetes cluster on a serve with public IP and DNS pointing to it (also wildcard). Gitlab was configured with the cluster following this guide: <a href="https://gitlab.touch4it.com/help/user/project/clusters/index#add-existing-kubernetes-cluster" rel="nofollow noreferrer">https://gitlab.touch4it.co...
<p>I had the exact same issue as you, and I finally figured out how to solve it.</p> <p>The first to understand, is that on bare metal, you can't make it working without using MetalLB, because it calls the required Kubernetes APIs making it accepting the IP address you give to the <code>Service</code> of <code>LoadBala...
<p>I am deploying Prometheus with Thanos with the given config:</p> <pre><code>global: scrape_interval: 15s # By default, scrape targets every 15 seconds. # Attach these labels to any time series or alerts when communicating with # external systems (federation, remote storage, Alertmanager). external_labels: ...
<p>There is a standard way to do it since Prometheus 2.27.</p> <p>See <a href="https://github.com/prometheus/prometheus/blob/main/docs/disabled_features.md#expand-environment-variables-in-external-labels" rel="nofollow noreferrer">disabled_features</a></p> <p><code>--enable-feature=expand-external-labels</code></p> <p>...
<p>So, I'm using minikube v1.19.0 in ubuntu and using nginx-ingress with kubernetes. I have two node files: auth and client having docker image made respectively</p> <p>i got 4 kubernetes cinfig files which are as follows:</p> <p>auth-deply.yaml:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1...
<p>Actually I just found out the issue was when reinstalling the minikube, Validating Webhook was not deleted and creating the issue hence, should be removed using following command.</p> <pre class="lang-sh prettyprint-override"><code>kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission </code></pre...
<p>When receive udp packets, I want to get the source IP and source Port from the packet, and expect that doesn't change if the packet is from the same source(same IP and same Port). My packet is sent through kube-proxy in iptables mode, but when my packets paused several seconds, and then the source port would change,...
<p>This is a community wiki answer. Feel free to expand it.</p> <p>As already mentioned in the comments, you can try to use the <a href="https://kubernetes.github.io/ingress-nginx/" rel="nofollow noreferrer">NGINX Ingress Controller</a>. The <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-ud...
<p>excuse me for asking something that has much overlap with many specific questions about the same knowledge area. I am curious to know if kubernetes will scale a pod in order to evict it.</p> <p>Given are the following facts at the time of eviction:</p> <ol> <li><p>The pod is running one instance.</p> </li> <li><p>Th...
<p>I believe these two parts are independent; the pod disruption budget doesn't look at the autoscaling capability, or otherwise realize that a pod is running as part of a deployment that could be temporarily upscaled.</p> <p>If you have a deployment with <code>replicas: 1</code>, and a corresponding PDB with <code>min...
<p>I want to set environment variables via Kubernetes for server.xml in tomcat. Here is my deployment.yaml:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: tomcat-test-pod ... ... env: - name: hostName value: 'test.com' - name: localhost value: 'localhost.com' </code></pre> <p>And here is my server...
<p><code>org.apache.tomcat.util.digester.PROPERTY_SOURCE</code> is a Java system property so you can set it where system properties are accepted:</p> <ul> <li>you can add it to the command line options, e.g. by adding to <code>setenv.sh</code>:</li> </ul> <pre class="lang-sh prettyprint-override"><code>CATALINA_OPTS=&q...
<p>I am trying to write a cron job which hits a rest endpoint of the application it is pulling image of. Below is the sample code:</p> <pre><code>--- apiVersion: batch/v1beta1 kind: CronJob metadata: name: {{ .Chart.Name }}-cronjob labels: app: {{ .Release.Name }} chart: {{ .Chart.Name }}-{{ .Chart.Version ...
<p>You are trying to connect to <code>localhost:8080</code> with your curl which doesn't make sense from what I understand of your CronJob definition.</p> <p>From the docs (at <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#define-a-command-and-arguments-when-you-cre...
<p>I am running a Tensorflow model on an AKS cluster with GPU nodes. The model currently runs in a single TF Serving container (<a href="https://hub.docker.com/r/tensorflow/serving" rel="nofollow noreferrer">https://hub.docker.com/r/tensorflow/serving</a>) in a single pod on a single GPU node.</p> <p>By default the TF ...
<p>Interesting question - as far as I know, this is not possible, also not for two containers running as the same pod (resources are configured on container level), at least not out of the box (see <a href="https://github.com/kubernetes/kubernetes/issues/52757" rel="nofollow noreferrer">https://github.com/kubernetes/ku...
<p>I have my dashboards exposed to <code>&lt;dashboard&gt;.foobar.com</code> with no problem, now I am trying to expose dashboards mentioned above to <code>www.foobar.com/dashboard/&lt;kiali&gt;</code> I have tested with a simple .net backend container with this VS set up:</p> <pre><code>apiVersion: networking.istio.io...
<p>For anyone has the same question, please take a look here:</p> <p>I have this resolved:</p> <p>So first, the VirtualSerive are correct, but remember to add quotes to write section:</p> <pre><code> rewrite: uri: &quot;/&quot; </code></pre> <p>And prefix sections need to be closed with a <code>/</code></p> <p...
<p>AFAIK, the admission controller is the last pass before the submission to the database.</p> <p>However I cannot know which one is enabled, Is there a way to know which one is taking effect?</p> <p>Thanks.</p>
<p>There isn't an admissionscontroller k8s object exposed directly in <code>kubectl</code>.</p> <p>To get a list of admissions controllers, you have to hit the k8s master API directly with the right versions supported by your k8s installation:</p> <pre class="lang-sh prettyprint-override"><code>kubectl get --raw /apis/...
<p>Is there a way to disable WAL replay on crash for Prometheus?</p> <p>It takes a while for a pod to come back up due to WAL replay:</p> <p>We can afford to lose some metrics if it meant faster recovery after the crash.</p> <pre><code>level=info ts=2021-04-22T20:13:42.568Z caller=head.go:714 component=tsdb msg=&quot;W...
<p>Not specifically that I'm aware of. You would have to <code>rm -rf wal/</code> before starting Prom. Usually better to run multiple via Thanos or Cortex than to go down this path.</p>
<p>I am trying to understand default prometheus rules for kubernetes. And then I came across with this expression:</p> <pre><code> sum(namespace_cpu:kube_pod_container_resource_requests:sum{}) / sum(kube_node_status_allocatable{resource=&quot;cpu&quot;}) &gt; ((count(kube_node_status_al...
<p>Nothing, it's not an operator <code>:</code> is just a legal character in metric names. Some standard rulesets use it for grouping rollup rules together but it's just a naming scheme at most.</p>
<p>I'm trying to learn Kubernetes fundamentals, and although I've played around with <code>kubectl</code> and <code>minikube</code> locally, I'd like to expose the basic nginx docker image, over the internet, on a domain I have access to (for this example, <code>nginx.mydomain.com</code>), using DigitalOcean managed Ku...
<p>i am not sure which <strong>IP</strong> address you have added in your <strong>DNS</strong> to resolve your domain address.</p> <p>the idea flow for ingress gose something like :</p> <pre><code>internet traffic &gt; ingress &gt; ingress controller &gt; service &gt; deployment &gt; Pod </code></pre> <p>respective ing...
<p>I'm trying to mirror a minio bucket(70gb of images) to a local machine. while mirroring some images are skipped saying <code>mc: &lt;ERROR&gt; Failed to copy {url}. Please reduce your request</code>. Then that particular file is skipped. How can I mirror without skipping any file in the bucket ? </p> <p>Minio is de...
<p>I think this is because heavy copying to and from cluster and it was solved by resetting MinIO service.</p>
<p>I have an ongoing requirement to patch my nginx-ingress daemonset each time I wish to expose new TCP ports. I have reviewed the documentation and I cannot understand the correct kubectl patch syntax to perform the patch. An excerpt from the yaml follows:</p> <pre><code>spec: revisionHistoryLimit: 10 select...
<p>As already mentioned by David in the comment it is better to keep every change under version control.</p> <p>But if you really need to do this, here is the command:</p> <pre><code>kubectl patch ds -n ingress nginx-ingress-microk8s-controller --type='json' -p='[{&quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quo...
<p>I have a deployment with memory limits</p> <pre><code>resources: limits: memory: 128Mi </code></pre> <p>But my app starts to fail when it is near to the limit, so, there is any way to restart the pod before it reaches a percentage of the memory limit?</p> <p>For example if the limit is 128Mi, restart the pod w...
<p>I am going to address this question from the Kuberentes side.</p> <p>As already mentioned by arjain13, the solution you thought of is not the way to go as it is against the idea of <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits" rel="nofollow noreferrer">R...
<p>We have a java application (microservice) that would be deployed on kubernetes using k8s deployment and one of the requirements is that each pod needs to know all the other pods running that application. So, in other words, we would need a way by which application layer retrieve all the pods that are part of the k8s...
<blockquote> <p>One custom implementation could be to have a persistant data store like database and have each of the pods send a hearbeat entry to indicate its liveness and manage the entries by listening to application lifecycle events</p> </blockquote> <p>I would suggest here to use the liveness probe and readiness ...
<p>We have a java application (microservice) that would be deployed on kubernetes using k8s deployment and one of the requirements is that each pod needs to know all the other pods running that application. So, in other words, we would need a way by which application layer retrieve all the pods that are part of the k8s...
<p>You can use a <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="nofollow noreferrer">headless service</a>. This service returns the IP addresses of the selected pods at a dns lookup instead of load balancing the requests.</p> <p>First create the service. The important ...
<p>I am trying to pull images from my docker-hub repo. I followed the documentation found here: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/</a></p> <p>Howev...
<p>I ran into the same issue with <code>kubectl create secret generic --type=kubernetes.io/dockerconfigjson</code> (&quot;<em>The Secret &quot;xxx&quot; is invalid: data[.dockerconfigjson]: Required value</em>&quot;) and it was because of a mistake in the command line, which I think Marcus's command has too.</p> <p>I h...
<p>I'm trying to wrap my head around the difference between annotations and labels.</p> <p>My understanding of annotations is that it is metadata that adds key-value pairs that cannot be used by Kubernetes for identifying/filtering the resource.</p> <p>Labels on the other hand are metadata key-value pairs that can be u...
<blockquote> <p>Labels are key/value pairs that can be attached to Kubernetes objects such as Pods and ReplicaSets. They can be arbitrary, and are useful for attaching identifying information to Kubernetes objects. Labels provide the foundation for grouping objects.</p> <p>Annotations, on the other hand, provide a stor...
<p>I need to create a RabbitMQ queue from command line.</p> <ol> <li>I have a RabbitMQ setup in kubernetes.</li> <li>I login into a RabbitMQ pod and fetch the rabbitmqadmin for my version 3.8.14</li> <li>I run this:</li> </ol> <p><code>./rabbitmqadmin -u user1 -p password1 -N rabbit@rabbitmq-0.rabbitmq.default.svc.clus...
<p>I got it. I think at some point the API endpoint got updated so all calls must go to http://localhost:15672/rabbitmq/api. Here's the configuration line that was added that caused the issues:</p> <pre><code>management.path_prefix = /rabbitmq </code></pre> <p>Here are the working examples:</p> <p><code>./rabbitmqadmin...
<p>I am deploying kubernetes nginx-ingress on AWS. Is there any way to prevent auto creation of network loadbalancer and me assigning an already existing load balancer in the config?</p> <p>If not, is there any way to provide custom name to AWS NLB from within the nginx ingress configuration?</p>
<p>No, what you're asking for is not supported. There's no way to configure nginx ingress controller to create NLBs with specific names or use existing NLBs.</p> <p>You can however do this manually if you set the nginx ingress controller <code>serviceType</code> to <code>NodePort</code> and then manually register the t...
<p>Im using the following code to install chart that is bounded in my source code (eg. in my <code>app/chart/chart1 </code> in my go bin app), Now I need to move the chart to <strong>git repository</strong> or to <strong>artifactory</strong>,</p> <p>My question is how can I install the chart from outside my program?</p...
<p>It seems that helm during its upgrade/install commands checks first a couple of different locations which you can see <a href="https://github.com/helm/helm/blob/v3.5.4/cmd/helm/install.go#L185" rel="nofollow noreferrer">getting called here</a>. The content of that function is <a href="https://github.com/helm/helm/bl...
<p>In my Kubernetes cluster I want to define a StatefulSet using a local persistence volume on each node. My Kubernetes cluster has worker nodes.</p> <ul> <li>worker-node-1</li> <li>worker-node-2</li> <li>worker-node-3</li> </ul> <p>My <code>StatefulSet</code> looks something like this:</p> <pre><code>apiVersion: apps/...
<blockquote> <p><em>I fear that the <code>PersitenceVolume</code> I define is the problem. This object will create exactly one <code>PV</code> and so only one of my PODs finds the corresponding <code>PV</code> and can be scheduled.</em></p> </blockquote> <p>Yes, you're right. By creating <code>PersistentVolume</code> o...
<p>Is there a better way to list K8s Events that belong to a specific K8s Object?</p> <p>For example, if I wanted to list all events that belonged to a Pod named &quot;podname&quot;, I'd do the following:</p> <pre><code>opts := metav1.ListOptions{ TypeMeta: metav1.TypeMeta{Kind: &quot;Pod&quot;}, FieldSele...
<p>No, but a little bit better way is:</p> <pre><code>fieldSelector, _ := fields.ParseSelector(&quot;involvedObject.name=podname,involvedObject.kind=Pod&quot;) opts := metav1.ListOptions{FieldSelector: fieldSelector.String()} events, err := clientSet.CoreV1().Events(namespace).List(opts) </code></pre>
<p>I'm currently stuck and don`t know how to proceed.</p> <p>This is my Spring Boot application.properties</p> <pre><code>... spring.datasource.driverClassName=org.postgresql.Driver spring.datasource.url=jdbc:postgresql://${POSTGRES_HOST}:5432/postgres spring.datasource.username=${POSTGRES_USER} spring.datasource.pas...
<p>This answer is specific to Springboot application and that is what asked in question.</p> <p>Step 1: Create a generic secret from your keystore or p12 file</p> <pre><code>kubectl create secret generic f-tls-secret --from-file=Certificate.p12 --from-literal=password=changeit </code></pre> <p>Step 2: Mount the secret ...
<p>I'm using the microk8s with default ingress addons.</p> <pre class="lang-sh prettyprint-override"><code>$ microk8s enable ingress Addon ingress is already enabled. $ microk8s status microk8s is running high-availability: no datastore master nodes: 127.0.0.1:19001 datastore standby nodes: none addons: enabled: ...
<p>From your Ingress definition, I see you set-up as ingress class <code>nginx</code></p> <pre><code>$ cat 9999-ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress annotations: kubernetes.io/ingress.class: nginx spec: rules: - host: projects.xtech1999.com http: path...
<p>I am new to Kubernetes and Helm. I deployed a jupyterhub pod on Kubernetes (on GCP) following this line</p> <p><a href="https://zero-to-jupyterhub.readthedocs.io/en/stable/jupyterhub/installation.html" rel="nofollow noreferrer">https://zero-to-jupyterhub.readthedocs.io/en/stable/jupyterhub/installation.html</a></p> ...
<p>I managed to get it working by adding this in yaml file. keyfile.json was created as secret named gcsfs-creds with cubectl secrets.</p> <pre><code> extraEnv: GOOGLE_APPLICATION_CREDENTIALS: &quot;/etc/secrets/keyfile.json&quot; storage: extraVolumes: - name: gcsfs-creds secret: s...
<p>I have a running k8s cluster with two replicas of CoreDNS. But when i try enter the bash prompt of the POD it's throwing me below error</p> <pre><code># kubectl exec -it coredns-5644d7b6d9-285bj -n kube-system sh error: Internal error occurred: error executing command in container: failed to exec in container: faile...
<p>You can use the sidecar pattern following the instructions here: <a href="https://support.rancher.com/hc/en-us/articles/360041568712-How-to-troubleshoot-using-the-namespace-of-a-container#sidecar-container-0-2" rel="noreferrer">https://support.rancher.com/hc/en-us/articles/360041568712-How-to-troubleshoot-using-the...
<p>I'm starting with K8S. I installed 2 Debian 10 VMs on Azure (1 master node &amp; 2 slaves). </p> <p>I installed the master node with this doc: <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/production-envir...
<p>Took me 1 week to solve it.</p> <ul> <li>From the master node, you want to ping/curl Pods located on worker nodes. These Pods are part of a Deployment, itself exposed through a Service.</li> <li>There are some subtilities in Azure networking which make this not &quot;working out of the box&quot; with default Calico ...
<p>I recently encountered an issue where something (which I was not able to identify) deleted a PVC and the corresponding PV in my k8s cluster. The data can be recovered but I have two questions:</p> <ol> <li>Is there some hack to prevent the PVC from being deleted accidentally if someone issues a wrong command which d...
<p>For question 1, you can set the Reclaim Policy to <code>Retain</code>. This means that the PV and PVC can be deleted but the underlying storage volume will stick around forever (or until you delete it in whatever the underlying system is).</p> <p>For 2, yes if you have audit logging turned on. <a href="https://kuber...
<p>I want use metallb and nginx ingress for my k3s cluster.</p> <p>Currently the external IP is <code>&lt;none&gt;</code></p> <pre><code> kubectl -n ingress-nginx get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ingress-nginx-controller-admission ...
<p>In side the <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.45.0/deploy/static/provider/baremetal/deploy.yaml" rel="nofollow noreferrer">deploy.yml</a> the Service is defined as <code>NodePort</code> it has to be changed to <code>LoadBalancer</code>. Then the nginx ingress will run ...
<p><a href="https://i.stack.imgur.com/szaBC.png" rel="nofollow noreferrer">enter image description here</a></p> <p><code>Operation failed. Check pod logs for install-runner for more details.</code></p> <p>I am getting this error while trying to install GitLab runner. What I have done so far</p> <ul> <li>successfully in...
<p>Warning, with GitLab 13.11 (April 2021):</p> <blockquote> <h2><a href="https://about.gitlab.com/releases/2021/04/22/gitlab-13-11-released/#one-click-gitlab-managed-apps-will-be-removed-in-gitlab-14.0" rel="nofollow noreferrer">One-click GitLab Managed Apps will be removed in GitLab 14.0</a></h2> <p>We are deprecatin...
<p>I am trying to have some consumers to process messages from kafka, and I would like to implement kubernetes deployment scalability for elastic message processing capability.</p> <p>I found this code from sarama official guide <a href="https://pkg.go.dev/github.com/Shopify/sarama#NewConsumerGroup" rel="nofollow noref...
<p>Reminder that groups cannot scale beyond the topic partition count</p> <p>Scaling the pods is the correct way to use consumer groups, and using the same group name is correct, however I'd recommend extracting that and the broker address to environment variables so they can easily be changed at deploy time</p> <p>As-...
<p>A PersistentVolumeClaim is successfully bound to PersistentVolume using the &quot;slow&quot; storage class but I can't see it inside any namespace. Is this something like a built-in or <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner" rel="nofollow noreferrer">provisioner</a> related...
<blockquote> <p>but I can't see it inside any namespace</p> </blockquote> <p>Because <code>StorageClass</code> resources aren’t namespaced.</p> <blockquote> <p>Is this something like a built-in or provisioner-related configuration?</p> </blockquote> <p>Yes, <a href="https://stackoverflow.com/a/56441400/3098330">https:/...
<p>I am looking for a helm chart of <a href="https://superset.apache.org/" rel="nofollow noreferrer">Superset</a> to set it up on Kubernetes which is hosted remotely. In other words I would like to call &quot;helm repo add&quot; on a remote url.</p> <p>I found this one <a href="https://github.com/helm/charts#%EF%B8%8F-...
<p>According to the documentation <a href="https://superset.apache.org/docs/installation/running-on-kubernetes" rel="nofollow noreferrer">here</a></p> <p>A helm chart has been published and can be added as</p> <pre><code>helm repo add superset https://apache.github.io/superset </code></pre> <p>Then installed</p> <pre><...
<p>I am very new to Traefik and Kubernetes. I installed Traefik through helm (repo: <a href="https://traefik.github.io/traefik-helm-chart/" rel="noreferrer">https://traefik.github.io/traefik-helm-chart/</a>, helm version 3.5.2, chart traefik-9.19.1). Then I wanted to get prometheus metrics from it.</p> <p>Here is an ex...
<p>Try to remove the <code>expose</code> and <code>exposedPort</code> parameter.</p>
<p>I am trying to deploy <a href="https://github.com/bitnami/charts/tree/master/bitnami/mongodb" rel="nofollow noreferrer">mongodb</a> to my kubernetes cluster. It automatically creates a pvc and pv based on the storage class name i specify. However the pod is stuck on <code>ContainerCreating</code> because of the foll...
<p>I found what the problem was, once i removed the mount options from the storage class and recreated it, it mounted properly.</p> <pre><code>mountOptions: - debug </code></pre> <pre><code>apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: mongodbstorage provisioner: kubernetes.io/aws-ebs parameters: ...
<p>Generally in the kubernetes we can create definition files. for non-running and running pods, namespaces, deployments etc. If we generate yaml file for non running and non existing pods it create required defination file. However, if we have to get the defination file from running pod it also generates lots tags of ...
<blockquote> <p>after running below command it also generates lot of not required elements</p> </blockquote> <p>A large part of the problem you describe is the <code>managedFields:</code>. I agree this is very verbose and mostly annoying output.</p> <p>However, this is now fixed. If you upgrade to <code>kubectl</code> ...
<p>I want to start and stop all services in a kubernetes cluster in way similar to how <code>docker-compose up</code> and <code>docker-compose down</code> can start and stop services in a docker-compose deployment. Is there a command to do this?</p>
<blockquote> <p>Is there a command to do this?</p> </blockquote> <p>No, there is no such command.</p> <blockquote> <p>An alternate solution to stop and start service.</p> </blockquote> <p><strong>1:</strong> First way is to write a shell script to delete the service and create once needed. # It will cost you resources(...
<p>I am trying to use Kubernetes Ingress Nginx Controller and running a simple nginx server in AWS EKS.</p> <p>Browser (https) --&gt; Route 53 (DNS) --&gt; CLB --&gt; nginx Ingress (Terminate TLS) --&gt; Service --&gt; POD</p> <p>But I am receiving 404 error in browser (url used: <a href="https://example.com/my-nginx" ...
<p>From the image you posted of the nginx-port-forward, I see you went on <code>localhost:9443</code> directly, which means the Nginx server you are trying to access serve its content under <code>/</code></p> <p>But in the ingress definition, you define that the service will be served with <code>path: /my-nginx</code>....
<p>I have an API as a Kubernetes service, and I need to run an endpoint in the API every hour. (heavy statistic calculation, takes around 3-5 minutes)</p> <p>Currently I am using curl to call the end point directly:</p> <pre><code>containers: - name: callout image: 'buildpack-deps:curl' args: - /bin/sh ...
<p>This is what came to my mind:</p> <ol> <li>Create a separate deployment for your cronjob task. This deployment would be basically identical to the production deployment, but with a higher CPU claim and (important!) a separate tag. Set the replica count to <code>0</code> by default. This deployment can be updated whe...
<p>Was looking to find kubernetes pvc which are older than certain time limit and remove. Couldn't find enough resource on web. Any idea?</p> <p>Anybody knows what might be the right attribute?</p> <p>This is the script version to list all pvc:</p> <pre><code>from kubernetes import client, config config.load_kube_conf...
<p>You can use the <a href="https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#Read-only" rel="nofollow noreferrer">metadata.creation_timestamp</a> field to check when an object was created:</p> <pre class="lang-python prettyprint-override"><code>pvcs = v1.list_persistent_volume_claim_f...
<p>I try execute</p> <pre><code>kubeadm init --apiserver-advertise-address 49.232.211.230 --pod-network-cidr=10.244.0.0/16 -v=9 </code></pre> <p>print log:</p> <pre><code>[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory &quot;/etc/kubernetes/manifests&quot;. This c...
<p>As it's mentioned in the kubeadm init command logs it's a kubelet server issue or CRI issue, Rest your cluster using the kubeadm reset -f command and Try to perform these steps in order:</p> <ol> <li>Stop Kubelet and CRI services :</li> </ol> <pre><code>sudo systemctl stop kubelet sudo systemctl stop docker (if yo...
<p>Is there a way to mount a Kerberos authenticated NFS server inside a Kubernetes pod as the user who created the pod?</p> <p>We use FreeIPA for user management, and we have a Kubernetes cluster setup for training our deep learning models. We have our data on an NFS, which is authenticated using Kerberos. Here is what...
<p>This is how I do it.</p> <p>For my approach you need:</p> <ul> <li>Workers joined to the kerberso realm. (NFS is mounted bu the worker with the host TGT)</li> <li>Keytabs stored in a safe place, I use vault and vault-agent-injector</li> <li>Sidecar container that will manage the credentials</li> <li>Shared KCM betwe...
<p>In python k8s client, i use below code</p> <p>yaml file</p> <pre><code>apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: test-snapshot namespace: test spec: volumeSnapshotClassName: snapshotclass source: persistentVolumeClaimName: test-pvc </code></pre> <p>python code</p> <p...
<p>As I pointed in part of the comment I made under the question:</p> <blockquote> <p>Have you seen this github issue comment: <a href="https://github.com/kubernetes-client/python/issues/1195#issuecomment-699510580" rel="nofollow noreferrer">github.com/kubernetes-client/python/issues/…</a>?</p> </blockquote> <p>The lin...
<p>I recently pushed a new container image to one of my GKE deployments and noticed that API latency went up and requests started returning 502's.</p> <p>Looking at the logs I found that the container started crashing because of OOM:</p> <pre><code>Memory cgroup out of memory: Killed process 2774370 (main) total-vm:180...
<p>I guess it was caused by <a href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/" rel="nofollow noreferrer">Pod QoS class</a></p> <p>When the system is overcommitted, the QoS classes determine which pod gets killed first so the freed resources can be given to higher priority pods.</p> ...
<p>I have an EKS cluster where having one daemon which mounts a s3 bucket to all pods.</p> <p>Whenever there is some issue or pod restarts, then the mount volume is not accessible and throws the below error.</p> <pre><code>Transport endpoint is not connected </code></pre> <p>For solving this error, I have to manaully u...
<p>Ok, I think I solved it. It seems like sometimes the pod looses the connection, resulting in &quot;Transport not connected&quot;. The workaround I found to fix this is to add an init container, that tries to unmount the folder before. That seems to fix the issue. Note, you want to mount a higher-level folder, so you...
<p>I am reading the doc of <a href="https://istio.io/latest/blog/2019/data-plane-setup/" rel="nofollow noreferrer">istio</a>. It says:</p> <blockquote> <p>istio-init This init container is used to setup the iptables rules so that inbound/outbound traffic will go through the sidecar proxy.</p> </blockquote> <p>In my und...
<p>As I mentioned in the comments, Iptables rules are briefly described <a href="https://github.com/istio/istio/wiki/Understanding-IPTables-snapshot" rel="nofollow noreferrer">here</a>.</p> <p>There is also a Iptables Schematic:</p> <p><a href="https://i.stack.imgur.com/bvnmk.png" rel="nofollow noreferrer"><img src="ht...
<p>I'm been doing the steps in this tutorial: <a href="https://learn.microsoft.com/en-us/azure/aks/ingress-static-ip" rel="nofollow noreferrer">Create an ingress controller with a static public IP address in Azure Kubernetes Service (AKS)</a></p> <p>When I finish the tutorial, I can browse to the DNS name label for the...
<p>Based on <a href="https://github.com/kubernetes/kubernetes/issues/43633#issuecomment-675437741" rel="nofollow noreferrer">this issue comment</a> on k8s github repo, it looks like it should work if you do the following:</p> <ul> <li>create a CNAME record for <code>hello.john.com</code> domain and point it to <code>de...
<p>I was trying to make file before application gets up in kubernetes cluster with initcontainers,</p> <p>But when i am setting up the pod.yaml and trying to apply it with &quot;kubectl apply -f pod.yaml&quot; it throws below error <a href="https://i.stack.imgur.com/KV1mO.png" rel="nofollow noreferrer">error-image</a><...
<p>Like the error says, you cannot update a Pod adding or removing containers. To quote the documentation ( <a href="https://kubernetes.io/docs/concepts/workloads/pods/#pod-update-and-replacement" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/#pod-update-and-replacement</a> )</p> <blockqu...
<p>I create a <em>K8S Secret</em> with Helm in a <em>pre-install hook</em>.</p> <p>This secret is a random password for a database user. When I uninstall the Helm Chart I delete the database and the database user, so I'd like to delete the <em>K8S Secret</em> as-well.</p> <p>Everything works fine, except the secret is ...
<p>Why not just use <code>post-delete</code> along with <code>pre-install</code>?</p> <blockquote> <p>post-delete -- Executes on a deletion request after all of the release's resources have been deleted</p> </blockquote> <pre><code>annotations: &quot;helm.sh/hook&quot;: post-delete &quot;helm.sh/hook&quot;: pre-i...
<p>I want to know if there is any solution in order to submit a flink job to a kubernetes cluster.</p> <p>In the jobmanager deployment file after startup I tried to add a command option to my jobmanager pod but I realized that the command I passed override the image entrypoint.</p> <p>So I want to know if there is a so...
<p>Yes, if you provide a <code>command</code> and/or its <code>args</code>, it overrides the original image's <code>Entrypoint</code> and/or <code>Cmd</code>. If you want to know how exactly it happens, please refer to <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#...