prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I deployed a web app in minikube.</p> <p>Deployment:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: myapp spec: replicas: 3 selector: matchLabels: app: maypp template: metadata: labels: app: myapp spec: containers: - name: myapp ima...
<p>The problem is the missing <code>selector</code> field in the <code>Service</code>.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: myservice spec: type: NodePort selector: app: myapp ports: - port: 8080 </code></pre> <p>Services route the traffic to the pods based on the selector defined i...
<p>I am experimenting jenkins in k8s cluster. My environment is minikube.</p> <p>I setup a standalone jenkins server in ubuntu, then I used <a href="https://plugins.jenkins.io/kubernetes/" rel="nofollow noreferrer">k8s plugin</a> to startup slave pods for jobs. Sometimes when I misconfigured, pods are very short-lived....
<p><a href="https://grafana.com/docs/loki/latest/clients/promtail/configuration/#target_config" rel="nofollow noreferrer">https://grafana.com/docs/loki/latest/clients/promtail/configuration/#target_config</a></p> <pre><code># Period to resync directories being watched and files being tailed to discover # new ones or st...
<p>Requirement: Want to deploy Minio and another backend service using an ingress with HTTPS (Not for production purposes)</p> <p>I have been trying to create an ingress to access two services externally from the Kubernetes cluster in GKE. These are the attempts I tried.</p> <p>Attempt One</p> <pre><code>apiVersion: ex...
<p>According to kubernetes doc, simple fan-out example should solve your problem. A simple fan-out example is given below where same host has two different paths for two different services.</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: simple-fanout-example spec: rules: - host: foo...
<p>I'm setting up an InferenceService using Argo and KFServing with Amazon EKS (Kubernetes). Its important to know that our team has one EKS cluster per environment, which means there can be multiple applications within our cluster that we don't control.</p> <p><strong>Here is what we have setup so far</strong></p> <o...
<p>tl;dr You can use <a href="https://eksctl.io/usage/autoscaling/" rel="noreferrer">taints</a>.</p> <blockquote> <p>Which pods need to be assigned to our GPU nodes?</p> </blockquote> <p>The pods of the jobs that require GPU.</p> <p>If your <strong>training</strong> job requires GPU you need to assign it using the <cod...
<p>I've created a Helm test but when it succeeds or fails, it only outputs a simple message about whether it succeeded or failed <em>(see below)</em>. I would like for it to be able to output custom info about what tests it ran and some info about them. So if it failed, I'd see which things failed specifically. And eve...
<p>As I stated in the comment:</p> <blockquote> <p>Hello, <code>$ helm test</code> has a parameter <code>--logs</code> where it's description states: &quot;dump the logs from test pods (this runs after all tests are complete, but before any cleanup)&quot;.</p> </blockquote> <p><code>helm test RELEASE_NAME --logs</code>...
<p>My application consists of three different pods (Web, API and DB) and a PV and these pods will run in their own namespaces. These pods are deployed with a custom Helm Script.</p> <p>So for example:</p> <pre><code>Namespace1: Web1, API1, DB1 and PV1 Namespace2: Web2, API2, DB2 and PV2 ... NampesaceN: WebN, APIN, DBN ...
<p>I think you just need to ensure that if a type of Pod (Web or API etc.) is already scheduled on a Node then same type of Pod should not be scheduled again. And for that you need &quot;Antiaffinity&quot; and in that as well &quot;Pod antiaffinity&quot; instead of &quot;Node antiaffinity&quot;.</p> <p>Read <a href="ht...
<p>This question arose when we ran a <code>kubectl delete -f</code> on a file that somehow contained the declaration of the namespace where an entire test deployment existed.</p> <p>The system (not configured by us, hence a bit obscure to us) had volumes provisioned by an OpenEBS system.</p> <p>Within the deleted names...
<p>Basically the flow is like:</p> <ul> <li>when a namespace is deleted, all the objects inside this namespace is also will be deleted</li> <li>Now, if there is any PVC in that deleted namespace then it will be deleted</li> <li>According to the rules, If a PVC is deleted then it's bounded PV will also be deleted if the...
<p>I am running command <strong>kubectl top nodes</strong> and getting error : </p> <pre><code>node@kubemaster:~/Desktop/metric$ kubectl top nodes Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io) </code></pre> <p>Metric Server pod is running with ...
<p>It started working after I edited the metrics-server deployment yaml config to include a DNS policy.</p> <p><strong>hostNetwork: true</strong></p> <p><img src="https://i.stack.imgur.com/8nOBy.png" alt="Click here to view the image description " /></p> <p>Refer to the link below: <a href="https://www.linuxsysadmins.c...
<p>our server running using Kubernetes for auto-scaling and we use newRelic for observability but we face some issues</p> <p>1- we need to restart pods when memory usage reaches 1G it automatically restarts when it reaches 1.2G but everything goes slowly.</p> <p>2- terminate pods when there no requests to the server</p...
<p>If you want to be sure your pod/deployment won't consume more than <code>1.0Gi</code> of memory then setting that <code>MemoryLimit</code> will do job just fine.</p> <p>Once you set that limits and your container exceed it it becomes a potential candidate for termination. If it continues to consume memory beyond its...
<p>I'm trying to make changes to the <code>values.yaml</code> of a helm chart from a repository. After adding the repository and successfully installing the chart locally, I cannot find it. I realize <a href="https://stackoverflow.com/questions/62736862/where-does-helm-install-charts-locally">this question</a> asks the...
<pre><code>helm env </code></pre> <p>Will list all of the paths</p> <pre><code>HELM_BIN=&quot;helm&quot; HELM_CACHE_HOME=&quot;/Users/username/Library/Caches/helm&quot; HELM_CONFIG_HOME=&quot;/Users/username/Library/Preferences/helm&quot; HELM_DATA_HOME=&quot;/Users/username/Library/helm&quot; HELM_DEBUG=&quot;false&qu...
<p>I think I am misunderstanding Kubernetes CronJobs. On the CKAD exam there was a question to have a CronJob run every minute, but it should start after an arbitrary amount of time. I don't see any properties for CronJobs or Jobs to have them start after a specific time. Should that be part of the cron string or am I ...
<p>You can schedule your CronJob to start at specific date/time and than run every minute or however you would like to set it. There is a <a href="https://www.freeformatter.com/cron-expression-generator-quartz.html" rel="nofollow noreferrer">powerful online tool</a> that can help you with it. For example:</p> <pre><cod...
<p>I was wondering if it was possible to bind my minikube network to my <code>host</code> network.</p> <p>I tried:</p> <pre><code>minikube start --memory=10000 --cpus=4 --vm-driver=docker --kubernetes-version=v1.19.6 --mount --mount-string=&quot;/usr/local/citizennet/db:/usr/local/citizennet/db&quot; --network=&quot;ho...
<p>I haven't found a way to expose the <code>minikube</code> instance with <code>--driver=docker</code> to the host network (apart from <code>$ kubectl port-forward svc/svc-name --address=0.0.0.0 local_port:pod_port</code> ran on the host).</p> <p>It produces the same error as original poster is experiencing:</p> <pre>...
<p>Whitelisting ips is possible with this annotation: <code>ingress.kubernetes.io/whitelist-source-range: &quot;1.1.1.1/24&quot;</code></p> <p>Is it possible to do <strong>the same with blacklisting?</strong> would be nice to block some suspicous requests.</p>
<p>Unfortunately support for blocking ip addresses is not supported natively by traefik and any requests were <a href="https://github.com/traefik/traefik/pull/4454" rel="nofollow noreferrer">declined</a> with a comment:</p> <blockquote> <p>We want to keep the IP filtering section as simple as possible and we think that...
<p>I am new to kubernete and have a bit confused about <code>apply</code> and <code>rollout</code> command. If I update the kubernete configuration file, should I use <code>kubectl apply -f</code> or <code>kubectl rollout</code>?</p> <p>if I update kubernete configuration and I run <code>kubectl apply -f</code>, it wil...
<p>One major difference I can think of is <code>kubectl apply</code> can be used for all Kubernetes objects (<code>Pod</code>, <code>Deployment</code>, <code>ConfigMaps</code>, <code>Secrets</code>, etc.) where as the <code>kubectl rollout</code> applies specifically to objects that deals with some computation like <co...
<p>We deployed our app, Pod and Service in Azure Kubernetes Service but we cannot connect to our container app from the VM from another Virtual Network. It seems that Service Type internal load balancer cannot be used for those purpose when we want to establish network connection from Azure resource (VM) from another V...
<p>The article you shared is creating an Ingress controller and resource. Ingress controllers are not started automatically with a cluster, they act as a reverse proxy and a load balancer and watches Ingress objects from all namespaces. Use this page to choose the ingress controller implementation that best fits your ...
<p>I can't seem to find an answer to this but what is the relationship between an HPA and ReplicaSet? From what I know we define a Deployment object which defines replicas which creates the RS and the RS is responsible for supervising our pods and scale up and down.</p> <p>Where does the HPA fit into this picture? Does...
<p>When we create a deployment it create a replica set and number of pods (that we gave in <code>replicas</code>). Deployment control the RS, and RS controls pods. Now, HPA is another abstraction which give the instructions to deployment and through RS make sure the pods fullfil the respective scaling.</p> <p>As far th...
<p>I am trying to start minikube with comand &quot;minikube start --vm-driver=virtualbox&quot;. Befora i install the VirtualBox 6.1.18 for Linux(ubuntu 20.04). but when i run the start command the shell throw a error. can anyone help me with that</p> <p>thannks a lot!!!</p> <pre><code> StartHost failed, but will try ag...
<p>This is usually caused by virtualization been disabled in the bios of your machine and not allowing VirtualBox to start properly . Usually you just need to enter your bios setup and enabling Secure Virtual Machine Mode<br /> For details checkout this post <a href="https://appuals.com/fix-amd-v-is-disabled-in-the-bio...
<p>I have a master node and it works fine. when I get nodes it gives me a master node now I want to add a new master node with following command:</p> <pre><code>kubeadm join 45.82.137.112:8443 --token 61vi23.i1qy9k2hvqc9k8ib --discovery-token-ca-cert-hash sha256:40617af1ebd8893c1df42f2d26c5f18e05be91b4e2c9b69adbeab1edf...
<p>bro,I've solved the problem,my kubeadm version is 1.20.1 this is my join command: <code>kubeadm join 192.168.43.122:6444 \ --token 689yfz.w60ihod0js5zcina \ --discovery-token-ca-cert-hash sha256:532de9882f2b417515203dff99203d7d7f3dd00a88eb2e8f6cbf5ec998827537 \ --control-plane \ --certificate-key 8792f355dc22227029a...
<p>I am working to containerize our spring boot microservice based application using docker.</p> <p>While trying to write the docker image I have noticed about base OS.</p> <p>What is the industry standard to deploy docker containers to production environments using official images from docker hub.</p> <p>eg:oracle/ope...
<p>The &quot;OS&quot; on which a Docker Image is based is user-land stuff only, so not really an OS in the the traditional sense. You cannot compare the risk of not keeping that one fully updated with the risk of not keeping a real OS fully updated.</p> <p>In any case: One way to mitigate your concern is to use a <a hr...
<p>I'm trying to set up <code>hostPath</code> to share a file between pods.</p> <p>I'm following this guide <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="nofollow noreferrer">Configure a Pod to Use a PersistentVolume for Storage</a>.</p> <p>Here are the con...
<p><strong>MINIKUBE specific</strong></p> <p>I was getting the same error when running a local cluster on minikube for Mac.</p> <p>Minikube actually creates a VM and then runs your containers on it. So the hostPath actually refers to paths inside that VM and not on your local machine. That is why all mounts show up as ...
<p>I want to write some data into volume i.e one of the directory which is residing in this volume, I can exec a pod, but i am not aware how to check the attached volume and write data to it.</p> <p>I can find the volumes and mount point using:</p> <pre><code>kubectl describe pods pod-name </code></pre>
<p>You can get the volumes mounted on the pod using the output of <code>kubectl describe pod</code> which has the <code>Mounts</code> section in each container's <code>spec</code>.</p> <p>An example from the <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-application-introspection/#using-kubec...
<p>I am passing the authorization header in ingress yaml file</p> <pre><code> nginx.ingress.kubernetes.io/configuration-snippet: | proxy_set_header Authorization &quot;Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni......&quot; </code></pre> <p>but getting the error</p> <blockquote> <p>2021/03/01 09:23:58 [emerg] 947#...
<p>you can pass the authorization header</p> <pre><code>annotations: nginx.ingress.kubernetes.io/configuration-snippet: | proxy_set_header Authorization $http_authorization; </code></pre>
<p>I want to deploy airflow in Openshift.</p> <p>I am using this values.yaml: <a href="https://github.com/bitnami/charts/blob/master/bitnami/airflow/values.yaml" rel="nofollow noreferrer">https://github.com/bitnami/charts/blob/master/bitnami/airflow/values.yaml</a></p> <p>I want to clone my dag files from the Bitbucket...
<p>First of all, your <code>values.yaml</code> file should have <code>git</code> at the beggining:</p> <pre><code>git: dags: ## Enable in order to download DAG files from git repositories. ## enabled: true repositories: - repository: branch: master name: dags path: docke...
<p>I am trying to run zookeeper as cluster in Azure Kubernetes Service. All the instances are staring with <strong>myid:1</strong>, not sure what configuration I need to change. Any help is appreciated.</p> <p>Here's my configuration file,</p> <pre><code>apiVersion: v1 kind: Service metadata: name: zk-hs labels: ...
<p>After a week I came up with the below configuration that worked,</p> <pre><code>apiVersion: v1 kind: Service metadata: name: zk-hs labels: app: zk spec: ports: - port: 2888 name: server - port: 3888 name: leader-election clusterIP: None selector: app: zk --- apiVersion: v1 kind: Service...
<p>What is the difference between used and hard quota for memory in kubernetes? How to write correct values in quota of limits.memory &amp; requests.memory? i dont understand it &amp; i didn't find any explanation of this</p>
<h2>Background</h2> <p><a href="https://kubernetes.io/docs/concepts/policy/resource-quotas/" rel="nofollow noreferrer">Resource Quota</a> is limit of specific resource which is namespace wide.</p> <blockquote> <p>A resource quota, defined by a ResourceQuota object, provides constraints that limit aggregate resource con...
<p>Currently we are using ${HOME}/bin/kustomize edit set nameprefix prefix1</p> <p>But it is adding nameprefix to all of our resources like deployment.yaml and service.yaml.</p> <p>We want to apply nameprefix to deployment.yaml only and not apply it to service.yaml</p>
<p>Posting for better visibility:</p> <p><strong>If you are using</strong>:</p> <pre><code>kustomize edit set nameprefix prefix1 </code></pre> <p>This command will set <em><strong>namePrefix</strong></em> inside your current <strong>kustomization</strong>. As stated in the question - this is the way how it works, <em...
<p>I have the following <code>ConfigMap</code>. I'm trying to split the two datasources out into two separate files, and merge them at &quot;build time&quot; using Kustomize.</p> <p>But I just can't figure out how to do that?</p> <p>This is what I have:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: gr...
<p>You have to create two separate files for datasource. Create directory to put the base configuration:</p> <pre><code>$ mkdir -p $DEMO_HOME/base </code></pre> <p>First datasource should look like this:</p> <pre><code>$ cat &lt;&lt;EOF &gt;$DEMO_HOME/base/datasource1.yaml </code></pre> <pre><code> apiVersion: 1 d...
<p>using 0.13.2 Helm provider terraform, I have a Chart with a subchart nested:</p> <pre><code>├── charts │   └── postgres │   ├── Chart.yaml │   ├── templates │   │   ├── deployment.yaml │   │   ├── env.yaml │   │   └── service.yaml │   └── values.yaml ├── Chart.yaml ├── templates │   ├── confi...
<p>You can't directly do this. In discussing <a href="https://docs.helm.sh/docs/topics/charts/#scope-dependencies-and-values" rel="nofollow noreferrer">Scope, Dependencies, and Values</a>, the Helm documentation notes (with a motivating example):</p> <blockquote> <p>Charts at a higher level have access to all of the v...
<p>I want to create a simple Secret API Object in K8S that its data comes from a file, for example:</p> <pre><code>kubectl create secret generic mongo-key --from-file=mongodb-keyfile </code></pre> <p>But I want to create it using a config file instead of a direct kubectl command, like this:</p> <pre><code>apiVersion: v...
<p>You can add a read-only volume mount that references a directory. Then, the keys of your secrets will reference files in that mounted path. <a href="https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod" rel="nofollow noreferrer">Here</a> are some docs.</p> <p>Alternatively, you...
<p>I have a simple demo Flask application that is deployed to kubernetes using minikube. I am able to access the app using the Services. But I am not able to connect using ingress.</p> <p><strong>Services.yaml</strong></p> <pre><code>apiVersion: v1 kind: Service metadata: name: services-app-service spec: selector: ...
<p>The <strong>ingress</strong>, and <strong>ingress-dns</strong> addons are currently only supported on <strong>Linux</strong>. Currently not supported on windows. <strong><a href="https://minikube.sigs.k8s.io/docs/drivers/docker/#known-issues" rel="nofollow noreferrer">MoreInfo</a></strong></p> <p><a href="https://i....
<p>Is it possible to allow egress traffic only to the specific service? This is my naive try to do that:</p> <pre><code>kind: NetworkPolicy metadata: name: default-deny-all-egress namespace: default spec: podSelector: {} egress: - ports: - protocol: TCP port: 53 - protocol: UDP port: 53 ...
<p>No, as far as I know you can do that only using <code>podSelector</code>. However, if you have an access to cluster, I think you can still manually add additional labels for needed pods and use <code>podSelector</code></p> <p><a href="https://docs.projectcalico.org/security/kubernetes-network-policy#create-egress-po...
<p>I'm dockerizing a laravel application, my image is based on an apache image, this is being hosted in AKS, where I'm mounting azure files with images share inside /public/images, the problem is apache would add header inside the image resulting in corrupting the images</p> <p><a href="https://i.stack.imgur.com/vHkrz....
<p>We fixed the issue, simply in the vhost.conf, we needed to turn off EnableMMAP</p> <pre><code>EnableMMAP off </code></pre>
<p>I am new at Kubernetes and completely new to setting it up in <code>EKS</code>.</p> <p>I am trying to achieve sharing of <code>GPU</code> between multiple pods, but for that going through few of the documents and articles, I found out I should update the <code>kube-scheduler configuration</code> with parameters whic...
<p>I think you need a custom kubescheduler, and for your pods to be able to specify whether they want to use the default or the custom scheduler.</p> <p>Kubernetes supports this: <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/" rel="nofollow noreferrer">https://kubernetes.io/d...
<p>I'm trying to configure NGINX Ingress controller as the correct entry point to my Kubernetes cluster. Inside the cluster, I've created two REST Web services as well as frontend application. I'm trying to achieve the following scenario.</p> <ul> <li>When the ingress IP is hit without any parameters it should be route...
<p>You need to specify the ingress path type otherwise , depending on the ingress class specific implementation it will default to either exact or prefix (I assume in your case it is defaulting to exact)</p> <p>So, you need to do something like</p> <pre><code>spec: rules: - http: paths: - path: /first-r...
<p>I am using the following command to gracefully delete any stale pods in <em>Pending</em> state:</p> <p><code>kubectl get pod -n my-namespace | grep Pending | awk '{print $1}' | xargs kubectl delete pod -n my-namespace</code></p> <p>However, I would like to add a condition that deletes only those pods who have been i...
<p>It is difficult to calculate how much time a Pod has spent in a particular Status by using <code>kubectl</code> solely and without a help of some 3rd party tools. However, I got a solution that you may find useful.</p> <p>You can list all Pods that are in <code>Pending</code> state <strong>and</strong> are older tha...
<p>What is the best way to authenticate to the Kubernetes API of a GKE cluster in the context of a Google Cloud Function? After digging into the source code of <code>google-auth-library</code> and <code>@kubernetes/client-node</code>, I came up with the solution below by using some undocumented APIs. It works, but I wo...
<p><em>The error above seems to be due to either the user not being valid or not having the correct permissions.</em></p> <p>You can use the <code>@google-cloud/container</code> library to fetch details about your cluster from GKE and use the returned information to set up the configuration in the client for <code>@kub...
<p>I am working on Springboot and Kubernetes and I have really simple application that connects to Postgres database. I want to get the value of datasource from configmap and password from secrets as mount file.</p> <p>Configmap file :</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: customer-config data...
<p>Spring Boot 2.4 added support for <a href="https://docs.spring.io/spring-boot/docs/2.4.3/reference/htmlsingle/#boot-features-external-config-files-configtree" rel="nofollow noreferrer">importing a config tree</a>. This support can be used to consume configuration from a volume mounted by Kubernetes.</p> <p>As an exa...
<p>To redirect any HTTP traffic to HTTPS on tls enabled hosts, I have added the below annotation to my ingress resources</p> <pre><code>nignx.ingress.kubernetes.io/force-ssl-redirect: true </code></pre> <p>With this when I curl the host in question, I get redirected as expected</p> <p><a href="https://i.stack.imgur.com...
<p>As @mdaniel have mentioned your snippet shows <code>nignx.ingress.kubernetes.io/force-ssl-redirect: true</code> but annotations should be strings. Notice that in your &quot;complete&quot; config, you have both <code>force-ssl-redirect: &quot;true&quot;</code> <em>(now correctly a string)</em> and <code>ssl-redirect...
<p>Having YAML document something like:</p> <pre class="lang-yaml prettyprint-override"><code>--- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-scraping --- apiVersion: apps/v1 kind: Deployment metadata: name: allow-webhooks </code></pre> <p>I am trying to get something like</p> <pre cl...
<p>With <a href="https://github.com/mikefarah/yq" rel="noreferrer">mikefarah/yq</a> on versions beyond 4, you could do a <code>select</code> and update <code>|=</code> operation on the required document</p> <pre class="lang-sh prettyprint-override"><code>yq e 'select(.kind == &quot;NetworkPolicy&quot;).apiVersion |= &q...
<p>After deleting kubernetes cluster with &quot;terraform destroy&quot; I can't create it again anymore.</p> <p>&quot;terraform apply&quot; returns the following error message:</p> <blockquote> <p>Error: Kubernetes cluster unreachable: invalid configuration: no configuration has been provided, try setting KUBERNETES_MA...
<p>Before doing something radical like manipulating the state directly, try setting the KUBE_CONFIG_PATH variable:</p> <pre><code>export KUBE_CONFIG_PATH=/path/to/.kube/config </code></pre> <p>After this rerun the <code>plan</code> or <code>apply</code> command. This has fixed the issue for me.</p>
<p>This question is a follow up of: <a href="https://stackoverflow.com/q/66453781/562440">How to list really all objects of a nonexistant namespace?</a></p> <p>Long story short:</p> <pre><code>$ kubectl get namespaces NAME STATUS AGE argo Active 27d default Active 27d kube-node...
<p>This worked:</p> <pre><code>$ kubectl create namespace argo-events namespace/argo-events created $ kubectl patch eventsource/pubsub-event-source -p '{&quot;metadata&quot;:{&quot;finalizers&quot;:[]}}' --type=merge -n argo-events eventsource.argoproj.io/pubsub-event-source patched $ kubectl patch eventbus/default -...
<p>I would like to use some kubernetes ingress (doesn't matter the ingress type) on google cloud GKE 1.19.7-gke.1302, and nginx ingress deployed by nginx-ingress-0.8.0 helm chart, and my need is to fetch a cookie and use it later to authenticate to our service. When I use nginx as deployment it works, but when I use n...
<p>Posting this answer to make it more visible as issue was identified and solved in <code>comment section</code>.</p> <p>Root cause of this issue was <code>Nginx Ingress Controller</code> misconfiguration.</p> <p>In the OP's setup <code>Nginx Ingress Controller</code>, <code>v.0.8.0</code> was used. After redeploying ...
<p>I have two pods running for a specific service. I want to get logs related to both the pods and check for specific text.</p> <p>For that I used ,as described <a href="https://stackoverflow.com/questions/33069736/how-do-i-get-logs-from-all-pods-of-a-kubernetes-replication-controller">here</a>:</p> <p><code>kubectl lo...
<p><code>kubectl logs</code> is limited to viewing a single pod’s logs at a time. However, you can use the <code>-l</code> flag to use a selector (label query) to filter on. For example:</p> <pre><code>kubectl logs -l app=nginx -l app=php </code></pre> <p>Use <code>-c</code> flag if you need to see container logs. Mor...
<p>I have multiple dags using Celery Executor but I want one particular dag to run using Kubernetes Executor. I am unable to deduce a good and reliable way to achieve this.</p> <p>I have an <code>airflow.cfg</code> in which I have declared <code>CeleryExecutor</code> to be used. And I don't want to change it since it ...
<p>Now there is the <a href="https://airflow.apache.org/docs/apache-airflow/stable/executor/celery_kubernetes.html" rel="nofollow noreferrer">CeleryKubernetesExecutor</a> (can't see when it was exactly introduced), which requires to set up Celery and Kubernetes up, but also offers the functionalities from both.</p> <p>...
<p>I know about snapshots and tested volume cloning. And it works, when storage class is the same.</p> <p>But what if I have two storage classes: one for fast ssd and second for cold storage hdd over network and I want periodically make backup to cold storage? How to do it?</p>
<p>This is not a thing Kubernetes supports since it would be entirely up to your underlying storage. The simple version would be a pod that mounts both and runs <code>rsync</code> I guess?</p>
<p>I am trying to set up a bare metal Kubernetes server including the metallb <code>LoadBalancer</code>. Therefore, I followed the instructions published on the website of the kind project <code>https://kind.sigs.k8s.io/docs/user/loadbalancer/</code>. To test my installation I tried to deploy the default <code>nginx</c...
<p>The problem concern about MetalLB controller. I have face this issue as well for my action reintall MetalLB again. refer: <a href="https://github.com/metallb/metallb/issues/673" rel="nofollow noreferrer">https://github.com/metallb/metallb/issues/673</a></p> <p>Remove</p> <pre><code>kubectl delete -f https://raw.gith...
<p>I have 2 node pools in my azure kubernetes cluster. where one node pool is Spot VM node pool and another is a regular VM node pool. I have deployed 2 pods on the spot node pool. So, I want that if the spot node pool is get evicted then the pods on the same are to be rescheduled on regular node pool automatically?</p...
<p>You could use a NoSchedule taint on the spot nodes. That will not evict any running pods from the node, but it will not schedule any new pods to them (unless you specifically specify a matching toleration).</p> <p>You can have a look at this documentation page for more details: <a href="https://kubernetes.io/docs/co...
<p>According to the Kubernetes docs <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="noreferrer">K8s Docs</a> as of v1.6 and later we are able to use:</p> <pre><code>envFrom: - configMapRef: name: &lt;config-file&gt; </code></pre> <p>To define all the configMaps d...
<p>I have used both and some of my deployments used tens of environment variables. It depends very much of your specifics and the way you manage your settings.</p> <p>In general if you have specific configmaps for specific applications where your application uses all or most of the keys in the configmaps, then <code>en...
<p>My team has a special requirement to delete all pod logs every X hours. This is cause the logs contain some sensitive info - we read and process them with fluentbit, but it's an issue that the logs are still there after. I couldn't find any normal way to rotate them by time, only recommendations on the docker daemon...
<p>Kubernetes doesn’t provide built-in log rotation, but this functionality is available in many tools.</p> <p>According to <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/" rel="noreferrer">Kubernetes Logging Architecture</a>:</p> <blockquote> <p>An important consideration in node-level log...
<p>I have a Seldon deployment like this:</p> <pre><code>apiVersion: machinelearning.seldon.io/v1alpha2 kind: SeldonDeployment metadata: name: mlflow spec: name: wines predictors: - graph: children: [] implementation: MLFLOW_SERVER modelUri: gs://seldon-models/mlflow/elasticnet_wine ...
<p>Probably the default liveness and readiness probes have too short timeouts to allow the classifier container to finish installing the dependencies. Before the container starts up, Kubernetes already restarts it because it failed liveness/readiness probe.</p> <p>In my case I had to add the following to Seldon deploym...
<p>Given there is a pod (e.g. postgres) running in kubernetes, <code>kubectl port-forward pod 15432:5432</code> is being used to expose the pod to host.</p> <p>normally, it is accessible in host through running the postgres client: <code>psql -h 127.0.0.1 -p 15432</code>, OR by accessing <code>http://127.0.0.1:15432</c...
<p>When using Docker for Mac or Windows a virtual machine is used to run your containers. Even with <code>--net=host</code> the container will not run on your desktop directly, but on the VM. 127.0.0.1 is therefore the VM IP, not the host IP. You can use, as you stated, <code>host.docker.internal</code> on Mac / Window...
<h2>UPDATE</h2> <p>Regarding space, I realized I can mount the root path '/' into the container and use this piece of code to get my stats:</p> <pre><code>import shutil total, used, free = shutil.disk_usage(&quot;/&quot;) print(&quot;Total: %d GiB&quot; % (total // (2**30))) print(&quot;Used: %d GiB&quot; % (used // ...
<p>Resource usage metrics, such as pod or node CPU and memory usage, are available in Kubernetes through the Metrics API.<br /> You can access the <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/resource-metrics-api.md" rel="nofollow noreferrer">Metrics API</a>...
<p>I have a service running on kubernetes exposed via nodeport like so:</p> <pre><code>test-service NodePort 100.100.246.5 &lt;none&gt; 30005:30005/TCP </code></pre> <p>That service is reachable from other nodes and is working properly; however, I don't see see that kubernetes liste...
<p>Kubernetes services are not implemented as processes listening on a specific port. Instead iptables (or IPVS) is used and services are basically iptables rules. That's why they won't show up in your netstat. You can find more info about it <a href="https://kubernetes.io/docs/concepts/services-networking/service/#pro...
<p>Okay, the title is quite mouthful. But it's actually describing the situation.</p> <p>I deployed a service on GKE in namespace argo-events. Something was wrong with it so I tore it down:</p> <pre><code>kubectl delete namespace argo-events </code></pre> <p>Actually, that's already where the problems started (I suspec...
<p>By using command <code>$ kubectl get all</code> you will only print a few resources like:</p> <ul> <li>pod</li> <li>service</li> <li>daemonset</li> <li>deployment</li> <li>replicaset</li> <li>statefulset</li> <li>job</li> <li>cronjobs</li> </ul> <p>It won't print all resources which can be found when you will use <c...
<p>I'm trying to move a number of docker containers on a linux server to a test kubernets-based deployment running on a different linux machine where I've installed kubernetes as a <a href="https://k3s.io/" rel="nofollow noreferrer">k3s</a> instance inside a vagrant virtual machine.</p> <p>One of these containers is a ...
<p>By default, hostPath directories are created with permission 755, owned by the user and group of the kubelet. To use the directory, you can try adding the following to your deployment:</p> <pre><code> spec: securityContext: fsGroup: &lt;gid&gt; </code></pre> <p>Where gid is the group used by the process...
<p>I have deployed a statefulset in AKS - My goal is to load balance traffic to my statefulset.</p> <p>From my understanding I can define a LoadBalancer Service that can route traffic based on Selectors, something like this.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx sp...
<p>As much i know it's not possible to do the selector-based routing with ingress.</p> <p>selector based routing is mostly used during a Blue-green deployment or canary deployment you can only achieve this by using the service mesh. You can use any of the service mesh like <strong>istio</strong> or <strong>APP mesh</st...
<p>This is an easy to run version of the code I wrote to do port-forwarding via client-go. There are hardcoded pod name, namespace, and port. You can change them with the one you have running.</p> <pre class="lang-golang prettyprint-override"><code>package main import ( "flag" "net/http" "os" "path/fi...
<p>The <code>*rest.Request</code> has a <code>Prefix(string)</code> method you can use to insert the missing subpath:</p> <pre class="lang-golang prettyprint-override"><code>reqURL := clientset.RESTClient().Post(). Prefix(&quot;api/v1&quot;). Resource(&quot;pods&quot;). Namespace(&quot;default&q...
<p>Lets say I have one master(192.168.1.1) and one worker(192.168.1.2) nodes in my cluster. And if I create a service of NodePort 30001, then will it work with master IP(192.168.1.1:30001) or worker IP(192.168.1.2:30001)?</p>
<p>The service type <code>NodePort</code> opens the port on <strong>all</strong> the nodes of the cluster and the pods associated with the <code>NodePort</code> service can be accessible using the <code>IP:port</code> combination where <code>IP</code> represents the nodes' external IP and <code>port</code> represents t...
<p>I am trying to do the following tutorial: <a href="https://itnext.io/docker-mongodb-authentication-kubernetes-node-js-75ff995151b6" rel="noreferrer">https://itnext.io/docker-mongodb-authentication-kubernetes-node-js-75ff995151b6</a></p> <p>However, in there, they use raw values for the mongo init.js file that is pla...
<p>you can make use of a shell script to retrieve env variables and create the user.</p> <p><strong>initdb.d/init-mongo.sh</strong></p> <pre><code>set -e mongo &lt;&lt;EOF use $MONGO_INITDB_DATABASE db.createUser({ user: '$MONGO_INITDB_USER', pwd: '$MONGO_INITDB_PWD', roles: [{ role: 'readWrite', db: '$...
<p>I am running kubernetes on Docker-desktop for windows. I am connecting to the cluster from my WSL. all my pods are running correctly. I am trying to mount a volume on my jupyterlab (pod) using hostpath. below is my config</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: jupyter labels: app...
<p>It looks like an issue with how the path is being written on Windows, I see the issue reported in the references below.</p> <p>Solution:</p> <ul> <li>If your file is in say C: drive, it should be converted to the below</li> </ul> <pre><code>/host_mnt/c/path/to/my/folder </code></pre> <ul> <li>If the above does not w...
<p>I have added helm as podtemplate in value.yaml file</p> <pre><code> podTemplates: helm: | - name: helm label: jenkins-helm serviceAccount: jenkins containers: - name: helm image: lachlanevenson/k8s-helm:v3.1.1 command: &quot;/bin/sh -c&quot; ...
<p>I have solved it by add containerTemplate to agent.</p> <pre><code> stage('Deploy dev') { agent { kubernetes { containerTemplate { name 'helm' image 'lachlanevenson/k8s-helm:v3.1.1' ttyEnabled true ...
<p>I am using kubernetes 1.13.2 on bare metals (No Provider).</p> <p>I already have a master and a worker node set up while ago, but now my new worker node cannot join to the cluster and receives "Unauthorized" message when it tries to register</p> <p>I have renewed my token on my master, and created a new join comm...
<p>The issue was caused by Docker and/or Kubernetes version mismatch between Kubernetes nodes.<br /> The problem was resolved after reinstalling Docker and Kubernetes to the correct versions.</p> <p>Kubernetes <code>version skew support policy</code> describes the maximum version skew supported between various Kubernet...
<p>I am trying to setup a Jenkins declarative pipeline to use two different agents during its execution. The agents are dynamically spawned by the Kubernetes plugin. For sake of argument and simplicity, let's assume I want to do this:</p> <p>On Agent 1 (Cloud name: &quot;ubuntu&quot;):</p> <ul> <li>Run apt-get and some...
<p>Found a solution. Very hacky but it works:</p> <pre><code>pipeline { agent none stages { stage (&quot;Provision dev agent&quot;) { agent { kubernetes { cloud 'dev-cloud' label &quot;dev-agent-${env.BUILD_NUMBER}&quot; slaveConnectTimeout 300 idleMinutes...
<p>I did command om master node</p> <pre><code>microk8s add-node From the node you wish to join to this cluster, run the following: microk8s join 192.168.0.xxx:25000/token If the node you are adding is not reachable through the default interface you can use one of the following: microk8s join 192.168.0.yyy:25000/toke...
<p>Solution may be as @Sultan Zhumatayev said downgrading <a href="https://microk8s.io/" rel="nofollow noreferrer">microk8s</a> to <code>1.18</code> and node will join and appear in node list.</p> <p>However firstly to check where problem lies you can execute commands: <code>$ microk8s status</code> and <code>$ microk...
<p>I have a Kubernetes cluster 1.17, and I want to add some <code>extraArgs</code> and <code>extraVolumes</code> (like in <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/control-plane-flags/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/c...
<p>That's the way to go to upgrade <code>static pod definitions</code> of <code>control plane components</code>, but instead of <a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/" rel="nofollow noreferrer">init</a> command I guess you meant <a href="https://kubernetes.io/docs/reference/setu...
<p>I'm playing around with Kubernetes on Virtualbox. I have created 2 VMs, one is the Master - the other one is the Worker. The Worker is a clone of the basis installation of the master. I guess that's the root-cause of the problem, maybe there's some config left over which causes conflicts.</p> <p>When I try to join t...
<p>There are several problems or questions you mentioned</p> <blockquote> <p>a Node with name &quot;test-virtualbox&quot; and status &quot;Ready&quot; already exists in the cluster.</p> </blockquote> <p><code>kubeadm</code> uses the hostname as the node name by default, as you Clone the worker from the master, they sho...
<p>I want to share some secrets with my Kubeflow pipeline so I can use them as environment variables in my containers. I've written a pipeline-secrets.yaml that looks like this:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: pipeline-secrets namespace: kubeflow type: Opaque data: mysql_db_name: &lt;SE...
<p>So, in the end, what I did was write a get-data-components.yaml to create my component and wrote the function below and it worked:</p> <pre><code>def build_get_data(): component = kfp.components.load_component_from_file(os.path.join(COMPONENTS_PATH, 'get-data-component.yaml'))() component.add_volume(k8s_clie...
<p>In general, how can I get the group name for any type of resource?</p> <p>And in particular, what should I use for group here:</p> <pre class="lang-yaml prettyprint-override"><code> - path: cm.patch.yaml target: kind: ConfigMap group: &quot;&quot; # &lt;------ version: v1 name: m...
<p>Look in the <a href="https://kubernetes.io/docs/reference/kubernetes-api/" rel="nofollow noreferrer">Kubernetes API documentation</a>.</p> <p>If you look at, for example, <a href="https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/storage-class-v1/" rel="nofollow noreferrer">StorageClas...
<p>I have deployed a statefulset in AKS - My goal is to load balance traffic to my statefulset.</p> <p>From my understanding I can define a LoadBalancer Service that can route traffic based on Selectors, something like this.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx sp...
<p>+1 to <a href="https://stackoverflow.com/users/5525824/harsh-manvar">Harsh Manvar's</a> answer but let me add also my 3 cents.</p> <blockquote> <p>My question is can any of the ingress controller support routing rules which can do Path based routing to endpoints based on selectors? Instead of routing to another serv...
<p>We usually add the <code>Kubernetes</code> configuration file inside the <code>.kube</code> directory in our Home directory when we use either <code>Windows</code> or <code>Linux</code> operating systems. But when I try to create a <code>.kube</code> directory on <code>Mac OS</code>, it says,</p> <blockquote> <p>You...
<p>I created the <code>.kube</code> directory using the terminal app on Mac and also noticed that the <code>.kube</code> directory can be created at any location on your Mac.</p> <p>Even though you created it, it will not display in Finder. You have to open the Terminal and check its' availability using <code>ls</code>...
<p>I am receiving this error when starting a Pod</p> <pre><code>Failed to pull image &quot;docker-username/docker-private-repository:latest&quot;: rpc error: code = Unknown desc = Error response from daemon: pull access denied for docker-username/docker-private-repository, repository does not exist or may require 'dock...
<p>So the problem was the docker-server value. Based on tutorials I've watched I was using api V1, while my image was pushed/created to dockerhub with V2, may be it's not relevant and V1 was deprecated. When I create a secret service I need to use V2 server <code>https://index.docker.io/v2/</code>, like:</p> <pre><code...
<p>We're using <a href="https://github.com/fluent/fluentd-kubernetes-daemonset" rel="nofollow noreferrer">https://github.com/fluent/fluentd-kubernetes-daemonset</a> to deploy Fluentd in our K8s cluster. We have 5 nodes in the cluster, which means there are 5 Fluentd pods.</p> <p>Each Fluentd pod in the DaemonSet expose...
<p>Solution in our case was using <a href="https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md#include-podmonitors" rel="nofollow noreferrer">pod monitors</a> CRD from the prometheus operator with <code>podMetricEndpoints</code> pointing at the right port:...
<p>Having a .NET Core API running inside a docker container on a Kubernetes cluster: how to tell the API the name of the pod.</p> <p>Is there anyway to forward or inject the information?</p> <p>This could be usefull to pin issues down to pods by enriching logs or connections.</p>
<p>The <code>Downward</code> API provides the way to expose information to containers.</p> <p>Description from the <a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/" rel="nofollow noreferrer">docs</a>:</p> <blockquote> <p>This page shows how a Pod can use envi...
<p>Thought to post this because it might help someone. I couldn't find Kubernetes NiFi setup without helm package, so I have prepared the below configuration YAML for Kubernetes NiFi Cluster setup.</p> <p>Here's the link for <a href="https://stackoverflow.com/questions/66362583/kubernetes-zookeeper-cluster-setup">Zooke...
<p>Please comment if you see any issues anywhere in the configuration or if you would like to provide any suggestions. Increase disk storage configuration according to your usage.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: nifi-hs labels: app: nifi spec: ports: - port: 1025 name: nodepo...
<p>What will be the equivalent for creating a job:</p> <pre><code>kubectl -n my-ns create job --from=cronjob/my-cron-job my-job </code></pre> <p>using <a href="https://github.com/kubernetes-client/javascript" rel="noreferrer">javascript kubernetes-client</a> ?</p>
<p>Found the solution to my question, with the help of this <a href="https://github.com/kubernetes-client/python/issues/991#issuecomment-545101606" rel="nofollow noreferrer">comment</a></p> <p>This is how it looks like with <a href="https://github.com/kubernetes-client/javascript" rel="nofollow noreferrer">javascript k...
<p>I have a very hard time understanding what kubernetes network architecture is really like.</p> <p>As a basic understanding &quot;there's a machine behind each IP&quot;, but with this stuff of containers inside pods inside nodes inside a cluster hosted somewhere.</p> <p>Adding services, deployments and other kubernet...
<p>&quot;there's a machine behind each IP&quot;</p> <p>i am not sure about for which IP you are talking about</p> <p>There are multiple components in Kubernetes if we focus main</p> <ul> <li>POD (It runs docker container)</li> <li>Deployment</li> <li>Service</li> <li>Ingress</li> </ul> <p>Now if talk about managing the...
<p>Can you pass a binary from a Jenkins host to an agent?</p> <p>I've got Jenkins running in Kubernetes, and the terraform plugin installed on my Jenkins master with the binary located at <code>/var/jenkins_home/tools/org.jenkinsci.plugins.terraform.TerraformInstallation/terraform/terraform</code></p> <p>I would like t...
<p>As a @David Maze mentioned binary from <a href="https://www.jenkins.io/" rel="nofollow noreferrer">Jenkins</a> needs to be manually installed on every node, which can be a difficult to manage. However you can set Jenkins to run pipeline steps inside a container where the image contains the tools you need, which simp...
<p>OS : OSX (mac)</p> <p>Docker : 18.06.0-ce (edge)</p> <p>Kubernetes : 1.10.3</p> <p>I use Kubernetes for the first time.</p> <p>I tried Google but could not find the manual for Kubernetes, which operates on the Mac.</p> <p>Running <code>kubectl version</code> outputs <code>The connection to the server localhost...
<p>I came across this issue when changing from minikube to the Docker Desktop supplied Kubernetes. For me, the issue was caused by a stale .kube configuration. Posting my workaround here as this was the first result I found on google when looking to troubleshoot the issue.</p> <h3>1. Uninstall Minikube</h3> <p>I had or...
<p>I want to create an Openshift route that accepts SMTP traffic.</p> <p>I can do it with a nodeport but I loose the DNS and load balancing features a route offers me.</p> <p>Can I just use a TCP route on port 25?</p> <p>Is this possible?</p>
<p>Short answer: No you can't<br /> <code>&quot;Routes&quot;</code>can only &quot;listen&quot; on ports 80 and 443</p> <p><code>&quot;NodePort&quot;</code>Service is the way to go here</p> <p>As for DNS and load balancing, you need to use/install a load balancer in front of your cluster. OCP requires 2 in fact. One for...
<p>I have a K3s (v1.20.4+k3s1) cluster with 3 nodes, each with two interfaces. The default interface has a public IP, the second one a 10.190.1.0 address. I installed K3s with and without the -flannel-backend=none option and then deployed flannel via &quot; kubectl apply -f <a href="https://raw.githubusercontent.com/co...
<p>The problem was resolved in the comments section but for better visibility I decided to provide an answer.</p> <p>As we can see in the <a href="https://rancher.com/docs/k3s/latest/en/installation/network-options/#:%7E:text=By%20default%2C%20K3s%20will%20run,VXLAN%20as%20the%20default%20backend." rel="noreferrer">K3s...
<p>I'm building a helm chart with a MySQL dependency. It's being set up okay when empty, but I want to run an <code>sh</code> file on the pod that would copy some data from somewhere else. For this I want to use the <code>initializationFiles</code> constructions from the documentation <a href="https://github.com/helm/c...
<p>MUAHAHA I did it. The scripts inside <code>./docker-entrypoint-initdb.d/</code> are executed by the <code>mysql</code> user.</p> <p>After poking around inside the pod I've found a directory for which the <code>mysql</code> user has write permissions. So I just write the file there and delete afterwards to initialize...
<p>As I have seen few related posts but none answered my question, I thought I would ask a new question based on suggestions from other users as well <a href="https://stackoverflow.com/questions/64223630/job-invalid-selector-not-auto-generated/64224974?noredirect=1#comment117481868_64224974">here</a>.</p> <p>I have the...
<p>First of all, to select pods (spawned by your <code>CronJob</code>) that should be allowed by the <code>NetworkPolicy</code> as ingress sources or egress destinations, you may set specific label for those pods.</p> <p>You can easily set a label for <code>Jobs</code> spawned by <code>CronJob</code> using labels field...
<p><code>kubectl patch --help</code> gives an example where you can patch a specific element with a specific operation:</p> <pre><code>kubectl patch pod valid-pod --type='json' -p='[{&quot;op&quot;: &quot;replace&quot;, &quot;path&quot;: &quot;/spec/containers/0/image&quot;, &quot;value&quot;:&quot;new image&quot;}]' <...
<p>Kubectl patch uses <a href="http://jsonpatch.com" rel="noreferrer">json patch</a> under the hood. Possible op's are : Replace, Add, Remove</p> <p>Example:</p> <pre><code>[ { &quot;op&quot;: &quot;replace&quot;, &quot;path&quot;: &quot;/baz&quot;, &quot;value&quot;: &quot;boo&quot; }, { &quot;op&quot;: &quot;add&...
<p>I am able initialize the terraform</p> <ul> <li>provider.helm: version = &quot;~&gt; 2.0&quot;</li> <li>provider.kubernetes: version = &quot;~&gt; 2.0&quot;</li> <li>provider.null: version = &quot;~&gt; 3.1&quot;</li> </ul> <p>Terraform has been successfully initialized! using terraform Terraform v0.12.20 but when I...
<p>Helm repository datasource has been removed in version 2.0.</p> <p><a href="https://registry.terraform.io/providers/hashicorp/helm/1.2.4/docs/data-sources/repository" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/helm/1.2.4/docs/data-sources/repository</a></p> <blockquote> <p>Data Sourc...
<p>I've done quite a bit of searching and cannot seem to find anyone that shows a resolution to this problem.</p> <p>I'm getting intermittent 111 Connection refused errors on my kubernetes clusters. It seems that about 90% of my requests succeed and the other 10% fail. If you &quot;refresh&quot; the page, a previously ...
<p>Did you find a solution to this? I am seeing something very similar on a minikube setup.</p> <p>In my case, I believe I also see the nginx controller restarting after the 502. The 502 is intermittent, frequently the first access fails, then reload works.</p> <p>The best idea I've found so far is to increase the Ng...
<p>I am working with an Argo workflow.</p> <p>There is a DAG step in my <code>entrypoint</code> which follows several normal steps. One of these steps does a <code>sys.stdout</code>. Once inside of the DAG step, I want some of the tasks to reference the results from the <code>sys.stdout</code>.</p> <p>I know if we want...
<h1>A bit of background about template outputs</h1> <p>Argo Workflows supports a number of different <a href="https://github.com/argoproj/argo-workflows/blob/master/docs/workflow-concepts.md#template-types" rel="noreferrer"><em>types of templates</em></a>.</p> <p>Each type of template supports different types of refere...
<p>I am new to Kubernetes, but I have been using Docker and Docker Compose for a long time. I am trying to find more information about how Kubernetes handles shared/read only config files compared to Docker Compose.</p> <p>In my <code>docker-compose.yaml</code> file I am sharing specific config files to my containers ...
<p>Kubernetes ConfigMap object will come handy here.</p> <blockquote> <p>A ConfigMap is an API object used to store non-confidential data in key-value pairs.</p> </blockquote> <p>Example:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: elastic-demo data: # property-like keys; each key maps to a simple...
<p>I'm struggling with this cross-communication between pods even though clusterIP services are set up for them. All the pods are on the same master node, and in the same namespace. In Summary:</p> <pre><code>$ kubectl get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE ...
<p>When all else fails..... go back to the manual. I tried finding the 'issue' in all the wrong places, while I just had to follow Rancher's installation documentation for k3s (sigh).</p> <p><a href="https://rancher.com/docs/k3s/latest/en/quick-start/" rel="nofollow noreferrer">Rancher's documentation</a> is very good ...
<p>Is it possible to block egress network access from a sidecar container? I'm trying to implement capability to run some untrusted code in a sidecar container exposed via another trusted container in same pod having full network access. It seems 2 containers in a pod can't have different network policies. Is there som...
<p>You are correct, all containers in a pod share the same networking so you can't easily differentiate it. In general Kubernetes is not suitable for running code you assume to be actively malicious. You can build such a system around Kubernetes, but K8s itself is not nearly enough.</p>
<p>I have a preemptible node pool of size 1 on GKE. I've been running this node pool with size 1 for almost a month now. Every day the node restarts after 24 hours and rejoins the cluster. Today it restarted but did not rejoin the cluster.</p> <p>Instead, I noticed that according to <code>gcloud compute instances list...
<p>We were experiencing a similar problem on GKE with preemptible nodes, seeing error messaging like these from the nodes:</p> <pre><code>Extend the docker.service configuration to set a higher pids limit Docker command line is updated. Restart docker to pick it up level=info msg=&quot;Processing signal 'terminated'&qu...
<p>So I have GCP set up and Kubernetes, I have a web app (Apache OFBiz) running on pods in the GKE cluster. We have a domain that points itself to the web app, so essentially it's accessible from anywhere on the internet. Our issue is since this is a school project, we want to limit the access to the web app to the int...
<p>When I want to test a VPN, I simply create a new VPC in my project and I connect both with Cloud VPN. Then, in the new VPC, you can create VM that simulate computer in the other side of the VPN and thus simulate what you want.</p>
<p>How to deploy the helm release for the first time when there's already the deployment, svc, etc. running with the same name.</p> <p>Is there's any way to import the config running, which is not being handled by helm?</p> <p>Or deleting the same name objects is the only solution to deploy the helm release first time?...
<p>Addressing the error message and part of the question:</p> <blockquote> <p>How to deploy the helm release for the first time when there's already the deployment, svc, etc. running with the same name.</p> </blockquote> <p>You can't deploy resources with Helm that weren't created by Helm. It will give you the same mes...
<p>I have an AWS EKS Cluster with only public subnets (we don't need private subnets for security reasons and I really want to avoid the NAT data transfer charges). In the cluster, we have serviceA and serviceB. Both are exposed via public-facing LB backed Ingress (Traefik).</p> <p>So here is my problem: We have a conf...
<p>Adding the following rewrite to the CoreDNS configmap worked for me:</p> <pre><code>rewrite name external.url.to.servicaA traefik-service.traefik-namespace.svc.cluster.local </code></pre> <p>Of course this comes with the downside of maintaining this entry in a seperate configmap. Would have preferred a solution with...
<p>Kubernetes v1.19 in AWS EKS</p> <p>I'm trying to implement horizontal pod autoscaling in my EKS cluster, and am trying to mimic what we do now with ECS. With ECS, we do something similar to the following</p> <ul> <li>scale up when CPU &gt;= 90% after 3 consecutive 1-min periods of sampling</li> <li>scale down when C...
<p>The Horizontal Pod Autoscaler automatically scales the number of Pods in a replication controller, deployment, replica set or stateful set based on observed metrics (like <code>CPU</code> or <code>Memory</code>).</p> <p>There is an official walkthrough focusing on <code>HPA</code> and it's scaling:</p> <ul> <li><em>...
<p>I'm trying to use <code>Kubernetes</code> with <code>Docker</code>. My image runs with Docker. I have one master-node and two worker-nodes. I also created a local registry like this <code>$ docker run -d -p 5000:5000 --restart=always --name registry registry:2</code> and pushed my image into it. Everything worked fi...
<p>It appears that in some situations solution described <a href="https://github.com/distribution/distribution/issues/1874#issuecomment-468101614" rel="nofollow noreferrer">here</a> solved the problem:</p> <ol> <li><code>sudo systemctl edit docker</code></li> <li>Add below lines:</li> </ol> <ul> <li><code>[Service]</co...
<p><strong>Example:</strong></p> <p><strong>Namespace: a</strong></p> <pre><code> PVC: a-pvc Pod: main-pod-to-work-with </code></pre> <p><strong>Mounts:</strong></p> <pre><code>a-pvc; name: a-pvc-mount; path: /pvc/a-files b-pvc; name: b-pvc-mount; path: /pvc/b-files c-pvc; name: c-pvc-mount; path: /pvc/c-files </code>...
<p>[<strong>TL;DR</strong>] In the same <code>namespace</code>, one <code>PVC</code> can be re-used by two or more different <code>pod</code>s. However, it is impossible for a <code>pod</code> to mount volumes based on <code>PVCs</code> from two different <code>namespaces</code> (that would violate the main idea behind...
<p>I'm trying to implement an endpoint through nginx ingress on kubernetes. The same configuration seems to work on another controller deployment in the same cluster, but here I'm getting very random 404 responses mixed in with the expected response.</p> <p>Configuration for ingress-nginx-controller deployment, modifie...
<p>I was working on a React app, which was deployed using Kubernetes. From my experience, 404 page shows up - the fact that some response is returned - means deployment is working.</p> <p>In my case whenever, I got 404, there was issue with the front end code. So, you should check your front end - specifically, the rou...
<p>I have an ELK stack running on the Kubernetes cluster with security enabled. Everything is running fine and I am able to push data to an index. After logging in to Kibana as an admin user, and I to &quot;Discover&quot; it asks me to create an index pattern. So I have some metricbeat data, and I create a pattern and ...
<p>What finally worked for me was destroy and recreate Kibana. After recreating kibana i was able to see all the index patterns i have been trying to save</p>
<p>I have had some success getting the name of the pod into my container for logging purposes,</p> <pre><code> env: - name: ID_NAME valueFrom: fieldRef: fieldPath: metadata.name </code></pre> <p>however I would like to extend that by logging the deplo...
<p>There's no way to get the <code>ownerReference</code> inside the Pod using the Downward APIs: this is the list of the unique items supported.</p> <p><a href="https://github.com/kubernetes/kubernetes/blob/cea1d4e20b4a7886d8ff65f34c6d4f95efcb4742/pkg/apis/core/pods/helpers.go#L61-L100" rel="nofollow noreferrer">https:...
<p>I've deployed Prometheus to a Kubernetes cluster using the <code>prometheus-community/kube-prometheus-stack version 13.10.0</code> Helm chart, and would like to edit my <code>prometheus.yml</code> file in the <code>/etc/prometheus/</code> directory.</p> <p>The reason for this is I need to add an extra scrape config ...
<p>Here is the link that seems to be a solution: <a href="https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2108-L2146" rel="nofollow noreferrer">https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2108-L2146</a></...