prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I am setting up my first ingress in kubernetes using nginx-ingress. I set up the <code>ingress-nginx</code> load balancer service like so:</p> <pre><code>{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "ingress-nginx", "namespace": "...", "labels": { "k8s-addon": "ingress-ngin...
<p>Adding another cause for the <code>Too many redirects error</code>.</p> <p>While working with <em>ingress-nginx</em> as an ingress controller in front of some k8s services.</p> <p><strong>One of the services</strong> (ArgoCD in my case) <strong>handled TLS termination by itself and always redirects HTTP requests to ...
<p>I am learning about Volumes in the <code>Kubernetes</code>.<br /> I understood the concept of Volume and types of volume.<br /> But, I am confused about the <code>mouthPath</code> property. Following my <code>YAML</code> file:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: nginx-alpine-volume spec: ...
<p>Consider the mount path as the directory where you are attaching or mounting the files or system</p> <p>While your actual volume is <strong>emptyDir</strong></p> <p>What basically the idea is there to both container have different mount path</p> <p>as both containers need to use different folders</p> <p>While as you...
<p>I'm using the <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">kube-prometheus-stack</a> chart and I'm trying to get rid of all the <code>kube_secret</code> metrics.</p> <p>When I query these metrics I see that they originate from a job na...
<p>I'm silly - I defined the <code>kubernetes-service-endpoints</code> job in <code>prometheus.prometheusSpec.additionalScrapeConfigs</code>...</p> <p>In order to remove all <code>kube_secret</code> metrics I dropped metric names that matched <code>kube_secret_.+</code> for this job and in the service monitor of <code>...
<p>How can I get events messages from a pod, like this command using client-go Kubernetes API:</p> <pre><code>kubectl describe pod spark-t2f59 -n spark Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 1...
<p>Since you know the namespace and the pod name, you can do:</p> <pre><code>package main import ( &quot;context&quot; &quot;fmt&quot; metav1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot; &quot;k8s.io/client-go/kubernetes&quot; &quot;k8s.io/client-go/rest&quot; ) func main() { config, _ := ...
<p>I'm a newbie to lightweight virtual machines. I'm going to install Knative with Kata Container Runtime. Is it possible?</p> <p>I know that Kubernetes works with Kata Container runtime. But, Does Knative work properly with that?</p>
<p>Knative should work fine with Kata Containers (I know of no incompatibility, and the runtime pods are pretty standard), but I don't think I've seen it tested or written up before.</p>
<p>I had a project that wanted to update the DNS configuration of Pod with Operator,</p> <pre><code>get dns message get matched pod modify: pod.Spec.DNSConfig = CRD_SPEC pod.Spec.DNSPolicy = corev1.DNSNone client.Update(ctx,&amp;pod) </code></pre> <p>But when I implemented it, I got the following error:</p> <pr...
<p>Like the message says you cannot update a DNS config of a pod: <code>Forbidden: pod updates may not change fields other than spec.containers[*].image, spec.initContainers[*].image</code>.</p> <p>If you want to inject a DNS config into all pods you need to add the configuration before the pod is created. Look into <a...
<p>I have created a GKE Service Account.</p> <p>I have been trying to use it within GKE, but I get the error:</p> <pre><code>pods &quot;servicepod&quot; is forbidden: error looking up service account service/serviceaccount: serviceaccount &quot;serviceaccount&quot; not found </code></pre> <p>I have followed the setup g...
<p>One of the reasons for getting this error can be if you have created a service account in one namespace and trying to use that service account only for another namespace.</p> <p>We can resolve this error by rolebinding the service account with a new namespace. If the existing service account is in default namespace ...
<p>I'm trying to setup a very simple 2 node k8s 1.13.3 cluster in a vSphere private cloud. The VMs are running Ubuntu 18.04. Firewalls are turned off for testing purposes. yet the initialization is failing due to a refused connection. Is there something else that could be causing this other than ports being blocked? I'...
<p>In order to address the error (dial tcp 127.0.0.1:10248: connect: connection refused.), run the following:</p> <pre class="lang-sh prettyprint-override"><code>sudo mkdir /etc/docker cat &lt;&lt;EOF | sudo tee /etc/docker/daemon.json { &quot;exec-opts&quot;: [&quot;native.cgroupdriver=systemd&quot;], &quot;log-dr...
<p>I'm trying to do TCP/UDP port-forwarding with an ingress.</p> <p>Following the docs: <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/</a></p> <p>It says to set: <code>-...
<p>You could say the helm chart is biased in that it doesn't expose the option to set those args as chart value. It will set them by itself based on conditional logic when it's required according to the values.</p> <p>When I check the nginx template in the repo, I see that <a href="https://github.com/kubernetes/ingress...
<p>What options are available to me if I want to restrict the usage of Priorty Classes, if I'm running a managed Kubernetes service (AKS)?</p> <p>The use-case here is that, I am as cluster admin want to restrict the usage of these. So that developers are not using those that are supposed to be used by critical componen...
<p>Cloud managed cluster does not allow you to customize the api-server. In this case, you can use <a href="https://kubernetes.io/blog/2019/08/06/opa-gatekeeper-policy-and-governance-for-kubernetes/#policies-and-constraints" rel="nofollow noreferrer">opa gatekeeper</a> or <a href="https://kyverno.io/policies/other/allo...
<p>I had a project that wanted to update the DNS configuration of Pod with Operator,</p> <pre><code>get dns message get matched pod modify: pod.Spec.DNSConfig = CRD_SPEC pod.Spec.DNSPolicy = corev1.DNSNone client.Update(ctx,&amp;pod) </code></pre> <p>But when I implemented it, I got the following error:</p> <pr...
<p>As the message says, Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/pods/#pod-update-and-replacement" rel="nofollow noreferrer">does not support updating most pod's fields directly</a>:</p> <blockquote> <p>Kubernetes doesn't prevent you from managing Pods directly. It is possible to update some fi...
<p>Does anyone know if there is a way to define static selectors based on the namespace name instead of label selectors? The reason is that some of the namespaces are created by an operator and I don't have any control over the labels.</p> <p>Thanks Essey</p>
<p>Each namespace has the so-called <a href="https://kubernetes.io/docs/reference/labels-annotations-taints/#kubernetes-io-metadata-name" rel="nofollow noreferrer">well-known label</a> <code>kubernetes.io/metadata.name</code></p> <p>So your <code>namespaceSelector</code> can be something like:</p> <pre class="lang-yaml...
<p>I'm trying to apply egress port range for my k8s network policy like this:</p> <pre><code> egress: - to: - ipBlock: cidr: 10.0.0.0/24 ports: - protocol: TCP port: 32000 endPort: 32768 </code></pre> <p>Starting fine but when I describe that, I only see that port <code>32000</code> is...
<p>It seems you took this example from <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#targeting-a-range-of-ports" rel="nofollow noreferrer">Targeting a range of Ports</a>. Here are 2 questions:</p> <ol> <li><p>I see <code>endPort</code> works only with <code>NetworkPolicyEndPort</co...
<p>Using latest VSCode and the plugin version.</p> <p>AWS Toolkit is working fine.</p> <p>kubectl get pods works fine from terminal.</p> <p>Kubernetes extension showing the cluster name, BUT while trying to open Nodes or other things getting this error:</p> <pre><code>Unable to parse config file: /Users/yurib/.aws/conf...
<p>according to the <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html" rel="nofollow noreferrer">docs</a></p> <p>should config looks like that:</p> <pre><code>[default] aws_access_key_id = xxxxxxxxxxxxxxx aws_secret_access_key = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy </code></pre> <p>I had...
<p>I'm running my deployment on OpenShift, and found that I need to have a GID of 2121 to have write access.</p> <p>I still don't seem to have write access when I try this:</p> <pre><code>security: podSecurityContext: fsGroup: 2121 </code></pre> <p>This gives me a <code>2121 is not an allowed group</code> error....
<p><code>FSGroup</code> is used to set the group that owns the pod volumes. This group will be used by Kubernetes to change the permissions of all files in volumes, when volumes are mounted by a pod.</p> <blockquote> <ol> <li><p>The owning GID will be the FSGroup</p> </li> <li><p>The setgid bit is set (new files create...
<p>I have a service that uses Spring Cloud Kubernetes Config to reload its configuration when a value in a ConfigMap changes. That all works great.</p> <p>Is it possible to use Spring Cloud Kubernetes (or one of its dependencies) to <strong>write</strong> a ConfigMap value? I didn't see any examples of this in the do...
<p>Based on Eugene's reply:</p> <p>No, this is impossible at the moment to do so. You can go to <a href="https://github.com/spring-cloud/spring-cloud-kubernetes#1-why-do-you-need-spring-cloud-kubernetes" rel="nofollow noreferrer">GitHub</a> and create an issue with the explanation of your use case, and this feature <st...
<p>My k8s version:</p> <pre><code> kubectl version Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;22&quot;, GitVersion:&quot;v1.22.2&quot;, GitCommit:&quot;8b5a19147530eaac9476b0ab82980b4088bbc1b2&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-09-15T21:38:50Z&quot;, GoVersion:&quot;go1.16...
<p>That's your <strong>v1.20</strong> cluster version, that doing that. Short answer is you should <strong>upgrade cluster to 1.21</strong>, where cronjobs works more or less stable.</p> <p>Check</p> <ol> <li><a href="https://stackoverflow.com/questions/67520866/no-matches-for-kind-cronjob-in-version-batch-v1(https://s...
<p>I've installed <strong>Prometheus</strong> and <strong>Grafana</strong> to monitor my <strong>K8S cluster</strong> and <strong>microservices</strong> using <strong>helm charts</strong>:</p> <pre><code>helm install monitoring prometheus-community/kube-promehteus-stack --values prometheus-values.yaml --version 16.10.0...
<p>Let's take a look to the <strong>Kong deployment</strong> first <strong>(</strong> pay extra attention to the bottom of this file <strong>)</strong>:</p> <p><code>kubectl edit deploy -n kong kong-kong</code> :</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: annotations: [...] creationTimestamp:...
<p>I had a Jenkins values.yaml file written prior to v1.19, I need some help to change it to be v1.19 compliant.</p> <p>In the old <code>Values.yaml</code> below, I tried adding <code>http path:/</code>. Should the <code>pathType</code> be <code>ImplementationSpecific</code>?</p> <p>Only <code>defaultBackend</code> wor...
<p>There are several changes to the definition of Ingress resources between <code>v1.18</code> and <code>v1.19</code>.</p> <p>In <code>v1.18</code>, we defined paths like this (see: <a href="https://v1-18.docs.kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource" rel="nofollow noreferrer">A mi...
<p>I want to watch Kubernetes pod events for a certain application.</p> <p>I went with NewSharedInformerFactoryWithOptions. I have added appropriate labels selector, But it is not getting filtered out. As I want to filter it using the label: 'app=nats-box'</p> <p>Here is the code -</p> <pre><code>req, err := labels.New...
<p>You can directly provide the label string in the <code>opts.LabelSelector</code>:</p> <pre><code>labelOptions := informers.WithTweakListOptions(func(opts *metav1.ListOptions) { opts.LabelSelector = &quot;app=nats-box&quot; }) factory := informers.NewSharedInformerFactoryWithOptions(clientset, 0, informers.WithNa...
<p>I am able to create an EKS cluster but when I try to add nodegroups, I receive a &quot;Create failed&quot; error with details: &quot;NodeCreationFailure&quot;: Instances failed to join the kubernetes cluster</p> <p>I tried a variety of instance types and increasing larger volume sizes (60gb) w/o luck. Looking at the...
<p>In my case, the problem was that I was deploying my node group in a private subnet, but this private subnet had no NAT gateway associated, hence no internet access. What I did was:</p> <ol> <li><p>Create a NAT gateway</p> </li> <li><p>Create a new routetable with the following routes (the second one is the internet ...
<p>I have a project that needs to <strong>inject or update environment variables</strong> in the pod container, using <code>kubebuilder</code> and <code>controller-runtime</code>,</p> <p>My plan is as follows:</p> <pre><code>func Reconcile(){ // get added environment variables // get matched pods // update ...
<p>You can't do this on a running pod without killing the pod and restarting it with a new config (containing your updated env vars) because these are set at pod startup.</p> <p>Some options:</p> <ol> <li>Kill the pod and recreate it with the new env vars.</li> <li>Update the env vars in the deployment instead of the p...
<p>is it possible to setup a prometheus/grafana running on centos to monitor several K8S clusters in the lab? the architecture can be similar to the bellow one, although not strictly required. Right now the kubernetes clusters we have, do not have prometheus and grafana installed. The documentation is not very much cle...
<p>You have different solution in order to implement your use case :</p> <ol> <li>You can use <a href="https://prometheus.io/docs/prometheus/latest/federation/" rel="nofollow noreferrer">prometheus federation</a>. This will allow you to have a central prometheus server that will scrape samples from other prometheus ser...
<p>I have the following nodejs dockerfile:</p> <pre><code># pull image FROM node:13.12.0-alpine # set working directory WORKDIR /app # add `/app/node_modules/.bin` to $PATH ENV PATH /app/node_modules/.bin:$PATH # install app dependencies COPY package.json ./ COPY package-lock.json ./ RUN npm install # add app COPY ...
<p>ideally, you should be running the process of <strong>nohup</strong> in background</p> <p>there is no issue due to <strong>CMD</strong> or <strong>ENTRYPOINT</strong></p> <pre><code>#!/bin/sh nohup node server dev &gt; startup.log &amp;&amp; node data/scripts/custom.js &gt; custom.log </code></pre> <p>use <strong>&...
<p>I'm working on Kubernetes deployment services using minikube locally on my windows 10 machine, so when I expose my service which is an expressjs API I can reach it via: <code>localhost:3000</code></p> <p><a href="https://i.stack.imgur.com/2s3ii.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2s3ii...
<p>A few things could be happening here:</p> <ol> <li><p>After the Nginx configuration changed, the stop and reload of the application was not performed; this is necessary to load the new configuration and is performed with the commands <code>nginx -s stop</code>, and then <code>nginx -s reload</code>.</p> </li> <li><p...
<p>I have deployed an ingress in Kubernetes and using two applications on different ingress namespaces.</p> <p>When I access the APP2 I can reach the website and it's working fine but APP1 is displaying BLANK page. No errors just BLANK and response 200 OK.</p> <p>Basically I integrated ArgoCd with Azure AD. The integra...
<p>The problem is that you didn't configure the argo-cd root path.</p> <hr /> <p><em>Why?</em></p> <p>First, it's worth to remind that NGINX Ingress controller <a href="https://docs.nginx.com/nginx-ingress-controller/installation/running-multiple-ingress-controllers/#running-multiple-nginx-ingress-controllers" rel="nof...
<p>I want to be able to know the Kubernetes uid of the Deployment that created the pod, from within the pod.</p> <p>The reason for this is so that the Pod can spawn another Deployment and set the <code>OwnerReference</code> of that Deployment to the original Deployment (so it gets Garbage Collected when the original De...
<p>The behavior is correct, the <code>Downward API</code> is for <code>pod</code> rather than <code>deployment/replicaset</code>.</p> <p>So I guess the solution is set the name of deployment manually in <code>spec.template.metadata.labels</code>, then adopt <code>Downward API</code> to inject the labels as env variable...
<p>I am trying to create an Istio <code>Virtualservice</code>. However, I am getting the below error, despite me having the cluster-admin role bound to.</p> <pre><code>UPGRADE FAILED: could not get information about the resource: virtualservices.networking.istio.io &quot;admin-ui&quot; is forbidden: User &quot;vaish@ad...
<p>The solution was to add the user to the cluster-admin role</p>
<p>Coming from classic Java application development and being new to &quot;all this cloud stuff&quot;, I have a (potentially naive) basic question about scalability e.g. in Kubernetes.</p> <p>Let's assume I've written an application for the JVM (Java or Kotlin) that scales well locally across CPUs / CPU cores for compu...
<p>Scale your code as Kubernetes Jobs, try <a href="https://keda.sh/docs/2.4/concepts/scaling-jobs/" rel="nofollow noreferrer">keda</a>.</p>
<p>I deployed an EFS in AWS and a test pod on EKS from this document: <a href="https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html" rel="nofollow noreferrer">Amazon EFS CSI driver</a>.</p> <p>EFS CSI Controller pods in the <code>kube-system</code>:</p> <pre><code>kube-system efs-csi-controller-5bb76d96d8-b...
<p>Posted community wiki answer for better visibility. Feel free to expand it.</p> <hr /> <p>Based on @Miantian comment:</p> <blockquote> <p>The reason was the efs driver image is using the different region from mine. I changed to the right one and it works.</p> </blockquote> <p>You can find steps to setup the Amazon E...
<p>I fail to deploy istio and met this problem. When I tried to deploy istio using <code>istioctl install --set profile=default -y</code>. The output is like:</p> <pre><code>➜ istio-1.11.4 istioctl install --set profile=default -y ✔ Istio core installed ...
<p>I made a silly mistake Orz.</p> <p>After communiation with my cloud provider, I was informed that there was a network security policy of my cloud server. It's strange that one server has full access and the other has partial access (which only allow for port like 80, 443 and so on). After I change the policy, everyt...
<p>We're having a bare metal K8s cluster with an NGINX Ingress Controller.</p> <p>Is there a way to tell how much traffic is transmitted/received of each Ingress?</p> <p>Thanks!</p>
<p>Ingress Controllers are implemented as standard Kubernetes applications. Any monitoring method adopted by organizations can be applied to Ingress controllers to track the health and lifetime of k8s workloads. To track network traffic statistics, controller-specific mechanisms should be used.</p> <p>To <strong>observ...
<p>I'm developing a Kubernetes scheduler and I want to test its performance when nodes join and leave a cluster, as well as how it handles node failures.</p> <p>What is the best way to test this locally on Windows 10?</p> <p>Thanks in advance!</p>
<p>Unfortunately, you can't add nodes to Docker Desktop with Kubernetes enabled. Docker Desktop is single-node only.</p> <p>I can think of two possible solutions, off the top of my head:</p> <ul> <li>You could use any of the cloud providers. Major (AWS, GCP, Azure) ones have some kind of free tier (under certain usage,...
<p>I am attempting to install gitlab using helm. I have a certificate issued to me by the internal Certificate Authority and I have used the <code>.pem</code> and <code>.key</code> file to generate a tls secrete with this command:</p> <pre><code>kubectl create secret tls gitlab-cert --cert=&lt;cert&gt;.pem --key=&lt;ce...
<p>Posted community wiki answer for better visibility. Feel free to expand it.</p> <hr /> <p>Based on @sytech comment:</p> <blockquote> <p>The error you have there is <code>CERT_WEAK_SIGNATURE_ALGORITHM</code>. It seems you should probably regenerate your certificate using a stronger algorithm.</p> </blockquote> <p>You...
<p>I have an ingress, defined as the following:</p> <pre><code>Name: online-ingress Namespace: default Address: Default backend: default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;) Rules: Host Path Backends ---- ---- -------...
<p>If I understood your issue correctly, you have a problem with captured groups.</p> <p>According to <a href="https://github.com/kubernetes/ingress-nginx/tree/main/docs/examples/rewrite#rewrite-target" rel="nofollow noreferrer">Nginx Rewrite targets</a> it seems to me,</p> <ul> <li>your patch should be <code>path: /on...
<p>I have a Google Cloud Composer 1 environment (Airflow 2.1.2) where I want to run an Airflow DAG that utilizes the <a href="https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/operators.html" rel="nofollow noreferrer">KubernetesPodOperator</a>.</p> <p>Cloud Composer <a href="https://cloud....
<p>Cloud Composer uses FUSE to mount certain directories from Cloud Storage into Airflow worker pods running in Kubernetes. It mounts these with default permissions that cannot be overwritten, because that metadata is not tracked by Google Cloud Storage. A possible solution is to use a bash operator that runs at the be...
<p>When working with helm charts (generated by <code>helm create &lt;name&gt;</code>) and specifying a docker image in values.yaml such as the image &quot;kubernetesui/dashboard:v2.4.0&quot; in which the exposed ports are written as <code>EXPOSE 8443 9090</code> I found it hard to know how to properly specify these por...
<p>A Docker image never gets to specify any host resources it will use. If the Dockerfile has <a href="https://docs.docker.com/engine/reference/builder/#expose" rel="nofollow noreferrer"><code>EXPOSE</code></a> with two port numbers, then both ports are exposed (where &quot;expose&quot; means almost nothing in modern ...
<p>I am trying to explore vault enterprise but getting permission denied for sidecar when I use the vault enterprise but seems to work fine when I tried to use local vault server.</p> <p>Here is the repository that contains a working example with the local vault <a href="https://github.com/Adiii717/vault-sidecar-inject...
<p>Finally able to resolve the weird issue with vault, posting as an answer might help someone else.</p> <p>The only thing that I missed to understand the flow between vault server, sidecar, and Kubernetes.</p> <p><a href="https://i.stack.imgur.com/qHDWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.co...
<p>For my React App made with <code>create-react-app</code>, I want to use Kubernetes secrets as environment variables.</p> <p>These secrets are used for different NodeJS containers in my cluster and they work just fine. I used a shell to echo the variables within the frontend container itself, and they are there but I...
<p>The build command for <code>create-react-app</code> takes in environment variables present during the build phase, causing the environment variables added later to be missing.</p> <p>The fix I made involves combining removing the build command in the Dockerfile and then combining the build and run command in the sam...
<p>I was given a docker compose file for superset which included volumes mounted from the repo itself. <a href="https://github.com/apache/superset/blob/master/docker-compose-non-dev.yml" rel="nofollow noreferrer">docker-compose-non-dev.yml</a></p> <p>I have to deploy this as containers in a pod in an EKS cluster. I can...
<p>Docker compose is a tool geared towards local deployments (as you may know) and so it optimizes its workflows with that assumption. One way to work this around is by wrapping the docker image(s) that compose <code>up</code> with the additional files you have on your local environment. For example a wrapper <code>doc...
<p>I have created a service like this:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Service metadata: name: amen-sc spec: ports: - name: http port: 3030 targetPort: 8000 selector: component: scc-worker </code></pre> <p>I am able to access this service, from within...
<p>Make sure you have DNS service configured and corresponding pods are running.</p> <pre class="lang-text prettyprint-override"><code>kubectl get svc -n kube-system -l k8s-app=kube-dns </code></pre> <p>and</p> <pre class="lang-text prettyprint-override"><code>kubectl get pods -n kube-system -l k8s-app=kube-dns </code>...
<p>I need to setup integration tests in a Spring Boot project using Postgres, Redis and Elasticsearch (at some point later also Kafka will be added). So far I've found two options:</p> <ol> <li>H2 Database and Embedded Redis. This could work but we are using some Postgres specific functions in some of our queries so th...
<p>You can run testcontainers in Kubernetes based builds. You just need a container runtime available in your build (container). This could be rootless docker and is independent of the container runtime used by your kubernetes cluster.</p>
<p>I was given a docker compose file for superset which included volumes mounted from the repo itself. <a href="https://github.com/apache/superset/blob/master/docker-compose-non-dev.yml" rel="nofollow noreferrer">docker-compose-non-dev.yml</a></p> <p>I have to deploy this as containers in a pod in an EKS cluster. I can...
<p>You can convert <em>docker-compose.yaml</em> files with a tool called <a href="https://kompose.io/" rel="nofollow noreferrer"><code>kompose</code></a>.<br /> It's as easy as running</p> <pre class="lang-text prettyprint-override"><code>kompose convert </code></pre> <p>in a directory containing <em>docker-ccompose.ya...
<p>I have job failure alerts in prometheus, which resolves itself right after 2 hours I got the alert where the alert actually is not resolved. How come Prometheus resolves it? Just so you know, this is only happening with this job alert.</p> <p>Job Alert:</p> <pre><code> - alert: Failed Job Status expr: increase(...
<p><code>kube_job_status_failed</code> is a gauge representing the number of failed job pods at a given time. The expression <code>increase(kube_job_status_failed[30m]) &gt; 0</code> asks the question: &quot;have there been new failures in the last 30 minutes?&quot; If there haven't, it won't be true, even if old failu...
<p>I have been learning Kubernetes for a few weeks and now I am trying to figure out the right way to connect a web server to a <code>statefulset</code> correctly.</p> <p>Let's say I deployed a master-slave Postgres <code>statefulset</code> and now I will connect my web server to it. By using a cluster IP service, the ...
<p>Well, your thinking is correct - the master should be read-write and replicas should be read only. How to configure it properly? There are different possible approaches.</p> <hr /> <p>First approach is what you thinking about, to setup two headless services - one for accessing primary instances, the second one to ac...
<p>I installed Prometheus on my Kubernetes cluster with Helm, using the community chart <a href="https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack" rel="nofollow noreferrer">kube-prometheus-stack</a> - and I get some beautiful dashboards in the bundled Grafana instance. I now wanted the re...
<p>Unfortunately, I don't have access to Azure AKS, so I've reproduced this issue on my GKE cluster. Below I'll provide some explanations that may help to resolve your problem.</p> <p>First you can try to execute this <code>node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate</code> rule to see if i...
<p>As stated in the title, I currently have a configuration with 2 ingress-nginx v1.0.0 on gke v1.20.10.</p> <p>When I deploy one alone the configuration is working and I have no issue, but when I deploy the second one the validatingwebhook and then try to deploy an ingress the 2 validatingwebhook try to evaluate the n...
<p>So for those that may encounter this error.</p> <p>I tried different things before finding what was wrong. You have to rename all the labels but the version of the ingress-nginx, I did not think that it would break for so little, but it does. In the end I'm using something like this:</p> <pre><code>--- apiVersion: a...
<p>I'm maintaining a Kubernetes cluster which includes two PostgreSQL servers in two different pods, a primary and a replica. The replica is sync'ed from the primary via log shipping.</p> <p>A glitch caused the log shipping to start failing so the replica is no longer in sync with the primary.</p> <p>The process for b...
<p>This happens due to <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy" rel="nofollow noreferrer">restartPolicy</a>. Container lifecycle is terminated due to its process being completed. If you do not want a new container to be created you need to change the restart policy for ...
<p>I want to use <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go</a> to copy a file from my file system to a container and vice versa.</p> <pre><code>kubectl cp &lt;file-spec-src&gt; &lt;file-spec-dest&gt; -c &lt;specific-container&gt; </code></pre> ...
<p>Since the answer to this is pretty old, here is how I did it :</p> <pre><code>package main import ( &quot;bytes&quot; &quot;fmt&quot; &quot;io&quot; &quot;k8s.io/apimachinery/pkg/runtime/schema&quot; &quot;k8s.io/apimachinery/pkg/runtime/serializer&quot; &quot;k8s.io/cli-runtime/pkg/genericclioptions&qu...
<p>I will briefly describe my application workflow: I have one application (cronjob), this application read my database and I want to, based on the output from database, run a few jobs in Kubernetes. Sometimes 1 job, sometimes 10 jobs, it depends. Additionally, I would like to pass some env's to this job.</p> <p>How Ca...
<p>Have you considered using Tekton?</p> <p>Their EventListener would allow you to trigger jobs through some HTTP endpoint, and may allow you to set environment variables based on your payload.</p> <p>See:</p> <ul> <li><a href="https://github.com/tektoncd/pipeline/blob/main/docs/pipelines.md" rel="nofollow noreferrer">...
<p>I'm trying to use helm from my github actions runner to deploy to my GKE cluster but I'm running into a permissions error.</p> <p>Using a google cloud service account for authentication</p> <p><strong>GitHub Actions CI step</strong></p> <pre><code> - name: Install gcloud cli uses: google-github-actions/...
<p>It seems you're trying to deploy code by using the GKE <strong>viewer role</strong> , hence your getting the permission issue. You can create the required <strong>IAM policies</strong> and <strong>role based access control (RBAC)</strong> as per your <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/...
<p>I have been playing with Digital Ocean's new managed Kubernetes service. I have created a new cluster using Digital Ocean's dashboard and, seemingly, successfully deployed my yaml file (attached). </p> <p>running in context <code>kubectl get services</code></p> <p><code>NAME TYPE CLUSTER-IP ...
<p>Slightly more detailed answer: DigitalOcean manages firewall rules for your NodePort services automatically, so once you expose the service, the NodePort is automatically open to public traffic from all worker nodes in your cluster. See <a href="https://docs.digitalocean.com/products/kubernetes/resources/managed/#wo...
<p>My Terraform code describes some AWS infrastructure to build a Kubernetes cluster including some deployments into the cluster. When I try to destroy the infrastructure using <code>terraform plan -destroy</code> I get a cycle:</p> <pre><code>module.eks_control_plane.aws_eks_cluster.this[0] (destroy) module.eks_contr...
<p>You can control the order of destruction using the <code>depends_on</code> meta-argument, like you did with some of your Terraform code.</p> <p>If you add the <code>depends_on</code> argument to all of the required resources that are needing to be destroyed first and have it depend on the <code>eks-cluster</code> Te...
<p>I had found a definition, when reviewing a project, that intrigued me: the use of Ingress with a Service of type LoadBalancer without installing the load balancer itself on <a href="https://kind.sigs.k8s.io/docs/user/loadbalancer/" rel="nofollow noreferrer">Kind</a>. As defined, it seems to work but I don't know why...
<blockquote> <p>If MetalLB is not installed on the cluster, what the LoadBalancer do here?</p> </blockquote> <p><strong>MetalLB</strong> is the <code>load-balancer</code> implementation for <strong>bare metal</strong> <strong>Kubernetes</strong> clusters. So MetaLB comes into the picture if you are on the baremetal or ...
<p>I am installing gitlab with helm, I have created the certificate in kubernetes with the below commands.</p> <p>However when i run the helm install, and i enter the address in the browers (<strong>ip-address.nip.io</strong>) I still get &quot;Your connection is not private&quot; message. I have installed the certific...
<p>Check your ingress <strong>hosts</strong> config and <strong>secrets</strong> are properly getting set</p> <pre><code>spec: tls: - secretName: cert-secret hosts: - app.dev.example.com &lt;---- this entry should match below - secretName: dev-wildcard-tls-cert hosts: - &quot;*.app.example.com&...
<p>I have a problem mounting 2 files in a pod, one is being treated as a directory for some reason (maybe stupid one, but I looked and looked, couldn't find a solution).</p> <p>in my <code>config</code> folder there's 2 files:</p> <pre><code>config |- log4j.properties |- server.main.properties </code></pre> <p>Running ...
<blockquote> <p>subPath: server.properties</p> </blockquote> <p>Wouldn't you want to use it as below?</p> <blockquote> <p>subPath: server.main.properties</p> </blockquote>
<p>How can I make <code>Skaffold</code> forward privileged/protected/special ports which have numbers below <code>1024</code>? In my <code>skaffold.yaml</code> I added:</p> <pre class="lang-yaml prettyprint-override"><code>portForward: - resourceType: service resourceName: foo port: 80 localPort: 80 </code></pre>...
<p>I solved the issue by granting the capability to open privileged ports for both <code>skaffold</code> and <code>kubectl</code> binaries:</p> <pre class="lang-sh prettyprint-override"><code>sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/kubectl; sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/skaffold; </c...
<p>I deployed mysql using this command:</p> <pre><code>helm install --namespace ns-mysql project-mysql --version 8.8.8 </code></pre> <p>In the future, when I'll need to change the three passwords: mysql-password, mysql-replication-password and mysql-root-password, is there a standard way to do that with helm?</p> <p>NO...
<p>You need to use the ordinary MySQL commands to change the passwords. Running <code>helm update</code> with the changed passwords isn't a bad idea (especially if you have other components that are getting the password from the same Secret) but it can't on its own actually change the password.</p> <p>The problem here...
<p>Facing this error <strong>error: there was a problem with the editor &quot;vi&quot;</strong> when trying to change a deployment file in the Kubernetes cluster (AKS)</p> <p><code>kubectl edit deploy xxxxx -o yaml</code></p> <p>upon exiting the file, the below error is thrown with no changes applied.</p> <p>This issue...
<p>The issue is that kubectl is using vi instead of vim.</p> <p>To resolve run (or add to your .bashrc or .bash_profile):</p> <p><code>export EDITOR=vim</code></p> <p>Then run your kubectl edit command.</p> <p>Enjoy.</p>
<p>I am currently using command <code>curl -sfL https://get.k3s.io</code> to download k3s. The script <strong><a href="https://get.k3s.io/" rel="nofollow noreferrer">get.k3s.io</a></strong> is using third party internet calls to URLs:</p> <pre><code>GITHUB_URL=https://github.com/k3s-io/k3s/releases STORAGE_URL=https://...
<p>K3s GitHub page has instructions for <a href="https://github.com/k3s-io/k3s#manual-download" rel="nofollow noreferrer">Manual Download</a>. You just download the appropriate version from <a href="https://github.com/k3s-io/k3s/releases" rel="nofollow noreferrer">releases</a>, and use it like any other binary.</p> <p>...
<p>We want to use <a href="https://hub.tekton.dev/tekton/task/buildpacks" rel="nofollow noreferrer">the official Tekton buildpacks task</a> from Tekton Hub to run our builds using Cloud Native Buildpacks. The <a href="https://buildpacks.io/docs/tools/tekton/" rel="nofollow noreferrer">buildpacks documentation for Tekto...
<p><a href="https://github.com/tektoncd/cli/" rel="nofollow noreferrer">tkn cli</a> has the switch --use-pipelinerun to the command <code>tkn pipeline start</code>, what this command does is to reuse the params/workspaces from that pipelinerun and create a new one, so effectively &quot;restarting&quot; it.</p> <p>so to...
<p>I'm new with Kubernetes, i'm testing with Minikube locally. I need some advice with Kubernetes's horizontal scaling.<br /> In the following scenario :</p> <ul> <li>Cluster composed of only 1 node</li> <li>There is only 1 pod on this node</li> <li>Only one application running on this pod</li> </ul> <p>Is there a bene...
<p>Yes, you are right. Pods on the same node are anyhow utilizing the same CPU and Memory resources and therefore are expected to go down in event of node failure.</p> <p>But, you need to consider it at pod level also. There can be situation where the pod itself gets failed but node is working fine. In such cases, mult...
<p>There is a utility called <strong>nsenter</strong> in ubuntu. nsenter is a small tool allowing to enter into namespaces. It will enter into your docker container. I want to control the host machine from the docker container. How do I connect the host machine from the container using the nsenter utility?</p>
<p><code>nsenter</code> allows you to join the Linux namespaces of a targeted process id (PID).</p> <p>First, run a container that shares your hosts PID namespace with <code>--pid=host</code>. The container has to be privileged with <code>--privileged</code>, otherwise executing <code>nsenter</code> will fail with an &...
<p>I was trying to upgrade from bitnami pg image 11 -&gt; version 14. When trying to do so i was prompted with the following error:</p> <p><code>The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 14.0</code></p> <p>In order to get around this, I created a new postgre...
<p>Yeah, backup and restoring the way you did is always a good option with new <strong>PVC</strong> and <strong>PV</strong>.</p> <p>Pg_dump &amp; Pg_restore is a robust native option i think you can use the <code>-j</code> to start the multiple <strong>threads</strong> to migrate the data.</p> <p>To migrate the TB of d...
<p>Afaik, the K8s <code>NetworkPolicy</code> can only allow pods matching a label to do something. I do not want to:</p> <ul> <li>Deny all traffic</li> <li>Allow traffic for all pods except the ones matching my label</li> </ul> <p>but instead:</p> <ul> <li>Allow all traffic</li> <li>Deny traffic for pods matching my la...
<p>As you mentioned in the comments, you are using the Kind tool for running Kubernetes. Instead of <a href="https://github.com/aojea/kindnet" rel="nofollow noreferrer">kindnet CNI plugin</a> (default CNI plugin for Kind) which does not support <a href="https://kubernetes.io/docs/concepts/services-networking/network-po...
<p>I have created a custom <strong>alpine</strong> image (alpine-audit) which includes a <em>jar</em> file in the <em><strong>/tmp</strong></em> directory. What I need is to use that alpine-audit image as the <strong>initContainers</strong> base image and copy that <em>jar</em> file that I've included, to a location wh...
<p>When you are mouting a volume to a directory in pod, that directory have only content of the volume. If you are mounting <code>emptyDir</code> into your <code>alpine-audit:0.1.0</code> the /tmp directory becomes empty. I would mount that volume on some other dir, like <code>/app</code>, then copy the <code>.jar</cod...
<p>for days I'm trying to track down a weird behaviour concerning NodePort Services when running Kubernetes on openSUSE Leap 15.3.</p> <p>For testing purposes on my own server I installed 3 VMs with openSUSE 15.3. With this article: <a href="https://stackoverflow.com/questions/62795930/how-to-install-kubernetes-in-suse...
<p>FINALLY found the solution:</p> <p>Weird behaviour of SUSE concerning ip_forward sysctl setting. During OS Installation the Option &quot;IPv4 forwarding&quot; was activated in the installer. After OS was installed, additionally added &quot;net.ipv4.ip_forward = 1&quot; and &quot;net.ipv4.conf.all.forwarding = 1&quot...
<p>I started learning about Kubernetes and I installed minikube and kubectl on Windows 7.</p> <p>After that I created a pod with command:</p> <pre><code>kubectl run firstpod --image=nginx </code></pre> <p>And everything is fine:</p> <p>[![enter image description here][1]][1]</p> <p>Now I want to go inside the pod with ...
<p>One error for certain is gitbash adding Windows the path. You can disable that with a double slash:</p> <pre><code>kubectl exec -it firstpod -- //bin/bash </code></pre> <p>This command will only work if you have bash in the image. If you don't, you'll need to pick a different command to run, e.g. <code>/bin/sh</code...
<p>Does anyone know how to configure Promtail to watch and tail custom log paths in a Kubernetes pod? I have a deployment that creates customized log files in a directory like so <code>/var/log/myapp</code>. I found some documentation <a href="https://github.com/jafernandez73/grafana-loki/blob/master/docs/promtail-setu...
<p>Posting comment as the community wiki answer for better visibility:</p> <hr /> <p><em>Below information is taken from README.md from the GitHun repo provided by atlee19:</em></p> <p><strong>This docs assume</strong>:</p> <ul> <li><p>you have loki and grafana already deployed. Please refered to official documentation...
<p>I am using Kustomize to manage multiple variations of the same cluster. I am using <code>nameSuffix</code> option to add a suffix to all my resources:</p> <pre><code>nameSuffix: -mysfx </code></pre> <p>My problem is that everything works fine but adding this suffix only to one Service resource cause me an issue. My ...
<p>Skipping selected <code>kind</code>s doesn't work because this feature wasn't implemented - from <a href="https://github.com/kubernetes-sigs/kustomize/issues/519#issuecomment-527734888" rel="nofollow noreferrer">this comment on GitHub issue 519</a>.</p> <p>Also <a href="https://github.com/keleustes/kustomize/tree/al...
<p>I am mounting an <code>emptyDir</code> volume so it can be used for sharing files between containers running in the same pod. Lets say the mount point is called <code>/var/log/mylogs</code>. When I mount the <code>emptydir</code> all of the pre-existing files that were in mylogs get deleted. I know this is part of t...
<p>Consider using <code>PersistentVolumes</code> instead, since it serves as a long-term storage in your Kubernetes cluster. They exist beyond containers, pods, and nodes. A pod uses a persistent volume claim to to get read and write access to the persistent volume. <code>PersistentVolume</code> decouples the storage f...
<p>I have my <a href="https://support.dnsimple.com/articles/a-record/" rel="nofollow noreferrer">A record</a> on Netlify mapped to my Load Balancer IP Address on Digital Ocean, and it's able to hit the nginx server, but I'm getting a 404 when trying to access any of the apps APIs. I noticed that the status of my Ingres...
<p>I just needed to add the field <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/basic-configuration/" rel="noreferrer"><code>ingressClassName</code></a> of <code>nginx</code> to the ingress spec.</p>
<p>I am trying to configure Kubernetes on docker-for-desktops and I want to change the default network assigned to containers. </p> <blockquote> <p>Example: the default network is <code>10.1.0.0/16</code> but I want <code>172.16.0.0/16</code>. </p> </blockquote> <p>I changed the docker network section to <code>Subn...
<p>On Windows, edit this file for a permanent fix:</p> <pre><code>%AppData%\Docker\cni\10-default.conflist </code></pre>
<p>I created a Dockerfile for running Jupyter in Docker.</p> <pre><code>FROM ubuntu:latest FROM python:3.7 WORKDIR /app ADD . /app RUN pip install -r requirements.txt CMD [&quot;jupyter&quot;, &quot;notebook&quot;, &quot;--allow-root&quot;, &quot;--ip=0.0.0.0&quot;] </code></pre> <p>My requirements.txt file looks li...
<p>There are many reasons on getting the <code>CrashLoopBackOff</code> error. In your case, it seems like your deployment file is locked or a lack of resources prevents the container from loading.</p> <p>As I understood, you've built docker image locally and added it to your local Docker registry. Since <code>imagePull...
<p>How can I delete more than couple of pods at a time?</p> <p>The commands I run:</p> <pre><code>kubectl delete pod pod1 kubectl delete pod pod2 kubectl delete pod pod3 </code></pre> <p>The approach I want to use:</p> <pre><code>kubectl delete pod pod1 pod2 pod3 </code></pre> <p>Any commands or style that can help me ...
<p>The approach that you say that you want:</p> <pre><code>kubectl delete pod pod1 pod2 pod3 </code></pre> <p><strong>actually works</strong>. Go ahead and use it if you want.</p> <p>In Kubernetes it is more common to operate on subsets that share common labels, e.g:</p> <pre><code>kubectl delete pod -l app=myapp </cod...
<p>I am working on a use case where sidecar container runs a shell script continuously on changes directory permission of main container. I want to Start side container only after Main Container in pod is ready .</p> <p>I was looking at Init Containers and what I could see is init containers are good candidate when we...
<p>I am not aware of any K8s native feature or hook that satisfies the use case you describe.</p> <p>I would solve it like this:</p> <p>Run your sidecar container within the same Pod as a regular container and get it to executes a script that pings the readiness endpoint of your application container before proceeding ...
<p>I use GKE for years and I wanted to experiment with GKE with AutoPilot mode, and my initial expectation was, it starts with 0 worker nodes, and whenever I deploy a workload, it automatically scales the nodes based on requested memory and CPU. However, I created a GKE Cluster, there is nothing related to nodes in UI,...
<p>The principle of GKE autopilot is NOT TO worry about the node, it's managed for you. No matter if there is 1, 2 or 10 node to your cluster, you don't pay for them, you pay only when a POD run in your cluster (CPU and Memory time usage).</p> <p>So, you can't handle the number of node, number of pools and low level ma...
<p>Managing Resources for Containers.</p> <blockquote> <p>When you specify a Pod, you can optionally specify how much of each resource a Container needs. The most common resources to specify are CPU and memory (RAM); there are others.</p> </blockquote> <p>Kubernetes defined a special metrics for CPU and Memory allocati...
<p>Different ways:</p> <ol> <li><p>See current usage with: <code>kubectl top pod</code></p> </li> <li><p>Deploy the Kubernetes dashboard to see short-term data</p> </li> <li><p>Deploy Prometheus to see also trend usage</p> </li> </ol>
<p>Let's say I and the partner company I'm dealing with live in a country that employs <a href="https://en.wikipedia.org/wiki/Daylight_saving_time" rel="noreferrer">Daylight Saving Time</a>.</p> <p>I have a CronJob in a kubernetes cluster that uploads files to the partner company daily at, say, 4:00, 10:00, 16:00, and ...
<p>Time Zones was added to CronJob in Kubernetes 1.22. To cite <a href="https://github.com/kubernetes/kubernetes/issues/47202#issuecomment-950887675" rel="nofollow noreferrer">github thread</a></p> <blockquote> <p>Just to clarify, it's available in 1.22.</p> </blockquote> <blockquote> <p>It was implemented in a very st...
<p>I have a cluster of 4 raspberry pi 4 model b, on which Docker and Kubernetes are installed. The versions of these programs are the same and are as follows:</p> <p>Docker:</p> <pre><code>Client: Version: 18.09.1 API version: 1.39 Go version: go1.11.6 Git commit: 4c52b90 Built: ...
<p>Posting comment as the community wiki answer for better visibility:</p> <p>Reinstalling both Kubernetes and Docker solves the issue</p>
<p>I am trying to do <a href="https://rancher.com/docs/k3s/latest/en/installation/airgap/#install-options" rel="nofollow noreferrer">offline setup of k3s</a> i.e. without internet connectivity for <em>Single Server Configuration</em> by below steps, but at the end k3s service status is <code>loaded</code> instead of <c...
<p>There is an <a href="https://github.com/k3s-io/k3s/issues/1103" rel="nofollow noreferrer">open issue</a> for offline installation- default gateway need to be set.</p> <p>follow <a href="https://github.com/k3s-io/k3s/issues/1144#issuecomment-559316077" rel="nofollow noreferrer">this comment</a>, it should work.</p> <...
<p>It might take a while to explain what I'm trying to do but bear with me please.</p> <p>I have the following infrastructure specified: <a href="https://i.stack.imgur.com/mHJcE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mHJcE.png" alt="enter image description here" /></a></p> <p>I have a job ca...
<p>How about specify the port in the ConfigMap:</p> <pre><code>... data = { DB_DOCKER_URL = ${kubernetes_service.questo_dynamodb_service.metadata.0.name}:8000 ... </code></pre> <p>Otherwise it may default to 443.</p>
<p>Are there any third party tools for Kubernetes UI? Such as to view pods on the main page or to edit the config of an object?</p>
<p>Here we go the list of K8s dashboard alternatives</p> <ul> <li><strong>Lens - K8s</strong> <a href="https://k8slens.dev/" rel="nofollow noreferrer">https://k8slens.dev/</a></li> </ul> <p>The best K8s IDE for <strong>monitoring</strong>, <strong>Debugging</strong></p> <ul> <li><strong>K8Dash</strong> <a href="https:/...
<p>I have a StatefulSet like this:</p> <pre><code>apiVersion: apps/v1 kind: StatefulSet metadata: namespace: myns name: myapp spec: replicas: 3 template: spec: containers: - name: mycontainer image: ... ... env: - name: MY_ENV1 value: &quot;1&quot; </cod...
<p>The problem with the issue was that I forgot to add <code>version: v1</code> in the target section of the patch. Then you should also remove the <code>-</code> in front of the tag name in the value section. The result should be something like this:</p> <pre><code>apiVersion: apps/v1 kind: StatefulSet metadata: nam...
<p>So I wish to limit resources used by pod running for each of my namespace, and therefor want to use resource quota. I am following this <a href="https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/" rel="nofollow noreferrer">tutorial</a>. It works well, but I wish somethin...
<p>Instead of using straight pod definitions (<code>kind: Pod</code>) use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">deployment</a>.</p> <p><em>Why?</em></p> <p>Pods in Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/pods/#working-with-pod...
<p>I'm trying to make argocd cli output yaml/json to prep it for script ingestion.</p> <p>According to this PR: <a href="https://github.com/argoproj/argo-cd/pull/2551" rel="nofollow noreferrer">https://github.com/argoproj/argo-cd/pull/2551</a> It should be available but I can't find the option in cli help nor in docume...
<p>Some commands accept the <code>-o json</code> flag to request JSON output.</p> <p>Look in the <a href="https://github.com/argoproj/argo-cd/tree/master/docs/user-guide/commands" rel="nofollow noreferrer">commands documentation</a> to find commands which support that flag.</p> <p><code>argocd cluster list -o json</cod...
<p>I have a container that keeps crashing in my k8s cluster for unknown reasons. The container's process is an nginx server. The container appears to be receiving a SIGQUIT signal.</p> <h5>Dockerfile</h5> <pre><code># build environment FROM node:16-alpine as build WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH COPY...
<p>Your liveness probe is configured as <code>HTTPS</code> on port 80. Just change it to <code>HTTP</code>. Look at the key <code>spec.containers.livenessProbe.httpGet.scheme</code>.</p> <p>Kubernetes thinks that your pod isn't alive (bad liveness probe) and cause the SIGQUIT.<br /> Normally this will help you. When yo...
<p>Our AKS cluster was configured to auto-renew Let's Encrypt certificates through Ingress Cert-Manager annotation and this worked perfectly until we upgraded to AKS 1.20.7. This then stopped working and the certificates started to expire without them being renewed - I double-checked all changes to K8S and CertManager ...
<p>i was facing the same issue, updating the version of Cert-manager resolved the issue.</p> <p>i was not on AKS but was using the GKE and i upgraded to the 1.5 cert-manager releases.</p> <p>Currently as of now supported releases are the : <strong>1.5 &amp; 1.6</strong></p> <p><a href="https://cert-manager.io/docs/inst...
<p>I'm using Traefik as IngressRoute.</p> <p>With <code>kubectl api-resources</code> it is defined as:</p> <pre><code>NAME SHORTNAMES APIVERSION NAMESPACED KIND ... ingressroutes ...
<p>Kubernetes Dashboard does not have the ability to display Traefik IngressRoute, the same way it shows Ingress, without changing it's source code.</p> <p>If you want, you can create feature request in <a href="https://github.com/kubernetes/dashboard/labels/kind%2Ffeature" rel="nofollow noreferrer">dashboard GitHub re...
<p>i'm learning docker/k8s; I want to pass/store a .pem file to my boostrap container which runs on a k8s cluster. This container uses the .pem to create a k8s secret (kubectl create secrets ...) which will be used by the other apps running on k8s by mounting the kubernetes secrets.</p> <p>I can think of the following ...
<p>(Although one could say that K8S Secrets are type of Config map). <br> I think that the <strong>better approach is to use K8S Secrets (over Config maps)</strong> like specified in <a href="https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets" rel="nofollow noreferrer">here</a>.</p> <pre><code>apiVer...
<p>I have been running an application stack successfully on a server using the <em>k3s</em> Kubernetes implementation. I am now attempting to deploy it on my Windows PC in Docker Desktop. I get a <strong>404 not found</strong> when accessing the application on the localhost.</p> <ul> <li>I tried using 'localhost', '127...
<p>I couldn't get this working on Docker Desktop. I switched to <a href="https://rancherdesktop.io/" rel="nofollow noreferrer">Rancher Desktop</a> and it worked.</p>
<p>I am looking to output a comma separated list of all user accounts from Kubernetes.</p> <p>I understand that one can return a list of namespaces, pods, and so on from Kubernetes using the 'kubectl get namespace' and 'kubectl get pods' command. However, is there an equivalent for returning a list of Kubernetes users?...
<p>This really depends on your k8s setup and rbac model.</p> <p>I would suggest that you look at the objects talked about here <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/rbac/</a></p> <p>In the end, the comman...
<p>I'm trying to make a server-client communication between pods in a K8s cluster using the python <code>socket</code> library.</p> <p>When running outside of a cluster, the server-client connection works, however in the k8s the server doesn't even set up:</p> <pre><code>import socket server_socket = socket.socket(soc...
<p>Here, I've build a little bit of an example with a client and a server python apps, talking to each other via k8s service. Almost from scratch (clone all the files from <a href="https://github.com/jabbson/q69936079" rel="nofollow noreferrer">here</a> if you want to follow along)</p> <h1>Server</h1> <h2>server.py</h2...
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment" rel="noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment</a> mentions that a <code>deployment</code> creates a <code>replicaSet</code> but appends a <code>pod-temp...
<p>Correct, the documentation states this really well:</p> <blockquote> <p>The <code>pod-template-hash</code> label is added by the Deployment controller to every ReplicaSet that a Deployment creates or adopts.</p> <p>This label ensures that child ReplicaSets of a Deployment do not overlap. It is generated by hashing t...
<p>Let's consider a python web application deployed under uWSGI via Nginx.</p> <blockquote> <p>HTTP client ↔ Nginx ↔ Socket/HTTP ↔ uWSGI (web server) ↔ webapp</p> </blockquote> <p>Where nginx is used as reverse proxy / load balancer.</p> <p><strong>How to scale this kind of applications in kubernetes?</strong> Several ...
<p>It depends.</p> <p>I see two scenarios:</p> <ol> <li><p><strong>Ingress is used</strong></p> <p>In this case there's no need to have nginx server within the pod, but it can be <code>ingress-nginx</code> which will be balancing traffic across a kubernetes cluster. You can find a good example in <a href="https://githu...
<p>My Argo setup is on GKE.</p> <p>What I observed is after a successful completion of a workflow, it's getting auto deleted. However, if a workflow fails, the workflow and all the node pods remain in the cluster.</p> <p>I could not find any documentations around this. I'll be extremely grateful if you could share some...
<p><a href="https://argoproj.github.io/argo-workflows/fields/#ttlstrategy" rel="nofollow noreferrer">https://argoproj.github.io/argo-workflows/fields/#ttlstrategy</a></p> <p>Setting up ttlStrategy in my workflow/workflowTemplate spec solved this issue.</p>
<p>I usually use the kustomize supplied with kubectl. I'm wondering if there is a way to find the kustomize version that is shipped with kubectl ?</p>
<p>For earlier version of kubectl, there was no such way of doing it and there was an issue related to it: <a href="https://github.com/kubernetes-sigs/kustomize/issues/1424" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/kustomize/issues/1424</a></p> <p>But it has been fixed recently and it seems starting...
<p>I need to restrict pod egress traffic to external destinations. Pod should be able to access any destination on the internet and all cluster internal destinations should be denied.</p> <p>This is what I tried and it is not passing validation:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networki...
<p>I did it using <code>NetworkPolicy</code>. Allow traffic to kubernetes and istio related services (could be more restrictive not just based on the namespace):</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: myapp-eg-system spec: podSelector: matchLabels: app: myapp ...
<p>I use Network load balancer which was provisioned using the yaml file I got here: <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/aws/deploy-tls-termination.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/kubernetes/ingress-nginx/controll...
<p>i would suggest try checking out the</p> <p>The annotation <code>nginx.ingress.kubernetes.io/ssl-passthrough</code> instructs the controller to send <strong>TLS</strong> connections directly to the backend instead of letting <strong>NGINX</strong> decrypt the communication.</p> <p>You should also check out the</p> <...
<p>I'm running a Ubuntu container with SQL Server in my local Kubernetes environment with Docker Desktop on a Windows laptop. Now I'm trying to mount a local folder (<code>C:\data\sql</code>) that contains database files into the pod. For this, I configured a persistent volume and persistent volume claim in Kubernetes,...
<p>Based on this info from <a href="https://github.com/docker/for-win/issues/5325#issuecomment-567481915" rel="noreferrer">GitHub for Docker</a> there is no support hostpath volumes in WSL 2.</p> <p>Thus, <strong>next workaround can be used</strong>.</p> <p>We need just to append <code>/run/desktop/mnt/host</code> to t...