prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>Question on Memory resource on GKE.</p>
<p>i have a node which has 8G memory and workload with the following resources :</p>
<pre><code>resources:
limits:
memory: 2560Mi
requests:
cpu: 1500m
memory: 2Gi
</code></pre>
<p>recently iβve noticed many cases where i see on the VM log it... | <p>There are few concepts that needs to be explained here. First would be the importance of <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits" rel="nofollow noreferrer">Requests and Limits</a>. See the example:</p>
<blockquote>
<p>when a process in the container... |
<p>I am running a local deployment and trying to redirect HTTPS traffic to my backend pods.
I don't want SSL termination at the Ingress level, which is why I didn't use any tls secrets.</p>
<p>I am creating a self signed cert within the container, and Tomcat starts up by picking that and exposing on 8443.</p>
<p>Here i... | <p>There are several thingns you need to setup if you want to use ssl-passthrough.</p>
<ol>
<li><p>First is to set proper host name:</p>
<pre><code>spec:
rules:
- host: example.com <- HERE
http:
...
</code></pre>
<p>It's mentioned <a href="https://kubernetes.github.io/ingress-nginx/user-guide/tls/#s... |
<p>There were a namespace "sandbox" on the node which was deleted, but there is still a challenge for a certificate "echo-tls".
But i can not access anymore sandbox namespace to delete this cert.
Could anyone help me deleting this resource ?</p>
<p>Here are the logs of the cert-manager :</p>
<pre><c... | <ol>
<li>Usually certificates are stored inside Kubernete secrets: <a href="https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets</a>. You can retrieve secrets using <code>kubectl get secrets --all-namespace... |
<p>I have application that have some user settings and it runs on kubernetes cluster.
I would like the user settings to survive application crash/pod restart.</p>
<p>I was thinking first about having a DB instance for keeping it outside of kubernetes. Then I thought, maybe I could just abuse etcd to store small amount ... | <p>you can use <code>Persistent Volume</code> and <code>Persistent Volume claim</code>. <code>pvc</code> or <code>Persistent Volume claim</code> will keep data incase of pod restart or pod crash. this the best way i think to store user data. you can have the suitable storage type and resource size as per your requirem... |
<p>I use <code>--driver=docker</code> and <code>minikube tunnel</code> in Windows (WSL2 and native) and macOS (Intel and M1) which makes the app running in the minikube cluster accessible in browser at <code>localhost</code> after applying <code>ingress-nginx</code>.</p>
<p>To make things consistent across Linux, macOS... | <p>After short investigation it seems to me there is a wide problem related to <code>minikube</code>, <code>--vm-driver=docker</code> and <code>ingress</code>. And it seems it affects all the platforms, not only your specific case.</p>
<p>There are 2 open issues on github related to this. Both are fresh and opened:</p>... |
<p>I have some questions about terminology that I should use. I have searched up the components that I am using, but I am still not sure. Can you please check if these are right way to describe each component? If not, can you please revise it?</p>
<ol>
<li>I develop microservices using Spring Framework (Spring boot).</... | <p>I would say that you deploy services, not components, but your team might have its own terminology.</p>
<p>You do deploy on Kubernetes.</p>
<p>Docker is used to create and manage containers and container images. Kubernetes does not use Docker but can use images created via Docker to deploy containers in Pods (via th... |
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: ns1
resources:
- r1a.yaml
- r1b.yaml
- r1c.yaml
- r1d.yaml
- r1e.yaml
- r2.yaml # needs to be placed in namespace ns2
</code></pre>
<p>Let's assume above situation. The problem is objects specified in <code>r2.yaml</code... | <p>I've looked into this and I came up with one idea.</p>
<pre><code>βββ base
β βββ [nginx.yaml] Deployment nginx ns: default
| βββ [nginx2.yaml] Deployment nginx ns: default
| βββ [nginx3.yaml] Deployment nginx ns: default
| βββ [nginx4.yaml] Deployment nginx ns: default
| βββ [nginx5.yaml] Deployment n... |
<p>I am trying to make my ingress run over https but I'm getting <code>HTTP ERROR 403</code>, and I don't know what am I missing here.</p>
<p>I am trying to access them on <code>my-local-domain.com</code> and I added that entry on my <code>etc/hosts</code> file as
<code>127.0.0.1 my-local-domain.com</code> so I can acc... | <p>I don't know if this will help, but here are some advices:</p>
<ol>
<li><p><strong>Determine the source of your error</strong><br />
You provide us a lot of code, but no details of the error. Is the 403 thrown by your webservice, your api or by your ingress-controller? You can check that in the error-page. Errors fr... |
<p>I have some questions about terminology that I should use. I have searched up the components that I am using, but I am still not sure. Can you please check if these are right way to describe each component? If not, can you please revise it?</p>
<ol>
<li>I develop microservices using Spring Framework (Spring boot).</... | <p>In Kubernetes an app as a unit is called Service. It has components reachable under it, for example: deployment, pod, etc. This set of components could be for microservice or service, but terminology just a service.</p>
<p>You can list all services using <code>kubectl get services</code></p>
<p>The Docker is related... |
<p>I am new to Google Cloud Platform and the following context:</p>
<p>I have a Compute Engine VM running as a MongoDB server and a Compute Engine VM running as a NodeJS server already with Docker. Then the NodeJS application connects to Mongo via the default VPC internal IP. Now, I'm trying to migrate the NodeJS appl... | <p>In my case traffic from GKE to GCE VM was blocked by Google Firewall even thou both are in the same network (default).</p>
<p>I had to whitelist cluster pod network listed in cluster details:</p>
<p><code>Pod address range 10.8.0.0/14</code></p>
<p><a href="https://console.cloud.google.com/kubernetes/list" rel="nor... |
<p>I have a cluster in AWS and have a deployment there. Now I want to attach an external AWS disk there. I am following the tutorial but didn't get how to indicate my disk there. Here is the code:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: test-ebs
spec:
containers:
- image: k8s.gcr.io/test-webserver... | <p><code>volumeID</code>: This is the AWS volume that will be used.</p>
<p>You can use the AWS CLI to get the volume ID assigned to your instance.</p>
<p>CLI command:</p>
<p><code>aws ec2 describe-volumes</code></p>
<p>see the <a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-volumes.html" rel="nof... |
<p>Is there a way to make a volume as <code>ReadWriteMany</code> instead of having a NFS share? Does GCP support <code>ReadWriteMany</code> volumes? I'm right now using NFS share and a persistent volume pointing it to NFS Share and then mounting it to pods. But this has a issue.</p>
<p>When NFS share has crashed or un... | <p>With Kubernetes, you need a NFS like persistent volume to ReadWriteMany. On Google Cloud, <a href="https://cloud.google.com/filestore" rel="nofollow noreferrer">Filestore</a> is the product to achieve that. You have <a href="https://cloud.google.com/filestore/docs/accessing-fileshares" rel="nofollow noreferrer">a do... |
<p>I have a cluster in AWS and have a deployment there. Now I want to attach an external AWS disk there. I am following the tutorial but didn't get how to indicate my disk there. Here is the code:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: test-ebs
spec:
containers:
- image: k8s.gcr.io/test-webserver... | <p>If the pod creation was successful with the volume attached (state of the ebs volume will change from "available" to "in-use" in AWS console), you could just do a <code>kubectl describe pod</code> and it should show up in Volumes with <code>VolumeID</code> similar to what you have in AWS:</p>
<p>... |
<p>quick question as I am sure its an easy fix, just cannot seem to figure it out!</p>
<p>We have a site that runs on <a href="http://www.awesomeapp.com" rel="nofollow noreferrer">www.awesomeapp.com</a> - all working perfectly on ingress routing</p>
<p>However I want to also redirect the route domain to <a href="http:/... | <p>nginx.ingress.kubernetes.io/server-snippet: |
return 301 https://www.awesomeapp.com$request_uri;</p>
|
<p>I am not able to use <code>kubectl</code> command inside <code>gitlab-ci.yml</code> file.</p>
<p>I have already gone through the steps mentioned in the doc to add an existing cluster in the <a href="https://docs.gitlab.com/ee/user/project/clusters/add_remove_clusters.html#existing-kubernetes-cluster" rel="nofollow n... | <p>To automate deployment with an existing cluster, You need to follow below steps:</p>
<p><em>1. Add you cluster to gitlab project.</em></p>
<p>Follow <a href="https://docs.gitlab.com/ee/user/project/clusters/add_remove_clusters.html#existing-kubernetes-cluster" rel="nofollow noreferrer">this doc</a>, and add your exi... |
<p>I have a process running inside an Ubuntu container and would like to redeploy the container if the process gets killed. I added the following liveness probe in container spec </p>
<pre><code> livenessProbe:
exec:
command:
- ps -ef | grep my_process_name
initialDelaySeconds: 120
periodSeconds... | <p>Make sure <code>ps</code> is installed. If it does not run: <code>apt-get update && apt-get install procps</code></p>
<p>For the ease of copy-pasting OP's comment under the question :-).</p>
<p>Below, <code>worker.py</code> is the process that needs to be checked:</p>
<pre><code>livenessProbe:
exec:
co... |
<p>I am adding the external authentication using auth-url annotation. How to set conditional request headers for the auth-url api which depends on incoming calls? Can I set the request headers in nginx controller according to incoming calls?</p>
<p>Edited:</p>
<p>Hi,
This is about adding a custom header(Id) which is ex... | <p><strong>My next question is If it is set how can I set it conditionally depending on from which host server the request is coming through?</strong></p>
<p>The best way would be to create two ingress objects with one where the external auth enabled for host <code>hw1.yourdoman</code>. For some reason while testing th... |
<p>I'm working on the setup of a new Rails project, hosted with Google Kubernetes Engine. Everything was going fine until I switched my deployed server to production mode, with <code>RAILS_ENV=production</code>.</p>
<p>My Kubernetes pods don't reach the ready state anymore. The readiness probe is forbidden to hit the s... | <p>Another potential cause of readiness 403 errors with Rails 6 is the allowed hosts list defined in config.</p>
<p>Typically, you'll have a line of code in <code>config/environments/production.rb</code> that looks something like:</p>
<pre class="lang-rb prettyprint-override"><code>config.hosts << "www.mydom... |
<p>I've split out the initial <code>azure-pipelines.yml</code> to use templates, iteration, etc... For whatever reason, the new images are not being deployed despite using <code>latest</code> tag and/or <code>imagePullPolicy: Always</code>.</p>
<p>Also, I basically have two pipelines <code>PR</code> and <code>Release</... | <blockquote>
<p>For whatever reason, the new images are not being deployed despite using latest tag</p>
</blockquote>
<p>How should Kubernetes know that there is a new image? Kubernetes config is <em>declarative</em>. Kubernetes is already running what once was "latest" image.</p>
<blockquote>
<p>Here is an e... |
<p>I installed istio using these commands:</p>
<pre><code>VERSION = 1.0.5
GCP = gcloud
K8S = kubectl
@$(K8S) apply -f istio-$(VERSION)/install/kubernetes/helm/istio/templates/crds.yaml
@$(K8S) apply -f istio-$(VERSION)/install/kubernetes/istio-demo-auth.yaml
@$(K8S) get pods -n istio-system
@$(K8S) label namespace de... | <p>If you used <code>istioctl</code>, it's pretty easy:</p>
<pre><code>istioctl x uninstall --purge
</code></pre>
<p>Of course, it would be easier if that command were listed in <code>istioctl --help</code>...</p>
<p>Reference: <a href="https://istio.io/latest/docs/setup/install/istioctl/#uninstall-istio" rel="noreferr... |
<p>I'm currently trying to deploy NGINX Ingress Controller on my AWS eks Cluster.
I have 4 nodes running:</p>
<pre><code>NAME STATUS ROLES AGE VERSION
ip-10-230-35-48.ec2.internal Ready <none> 7h44m v1.19.6-eks-49a6c0
ip-10-230-39-9.ec2.internal Ready <none&... | <p>This is expected behavior when <code>externalTrafficPolicy</code> is set to <code>Local</code> in the service (which is what you have). With <code>externalTrafficPolicy: Local</code> , you don't get any extra hops - once the traffic arrives at the node, it doesn't leave the node.
Load Balancer will send traffic only... |
<p>I have the helm chart mongodb installed on my k8s cluster (<a href="https://github.com/bitnami/charts/tree/master/bitnami/mongodb" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/mongodb</a>).</p>
<p>I also have kube-prometheus-stack installed on my k8s cluster. (<a href="https://gith... | <p>Installing prometheus using the <em>"prometheus-community/kube-prometheus-stack"</em> helm chart could be quite an extensive topic in itself considering the fact that it has a lot of configurable options.</p>
<p>As the helm chart comes with "prometheus operator", we have used PodMonitor and/or Se... |
<p>I'm deploying two statefulset pods of same image running as headless service. I wish to pass seperate env variables to containers running same images inside statefulset pods. May anyone tell me how to achieve this ?</p>
| <p>It is not possible to expose different values of same environment variable to different containers of a <code>Statefulsets</code> as the pods in a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="noreferrer"><code>Statefulsets</code></a> are identical replicas of the same applica... |
<p>I'm trying to create a RabbitMQ instance using RabbitMQ cluster Kubernetes operator, but there is an issue with PersistentVolumeClaims. I'm running Kubernetes 1.18.8 using Docker Desktop for Windows.</p>
<p>I have installed the operator like this:</p>
<pre><code>kubectl apply -f "https://github.com/rabbitmq/clu... | <p>Yes, your local hostpath can not work as dynamic volume provisioner. This operator needs an storageclassname which can dynamically create PVs.
In your case, your operator waiting continuously for PV to get created. In stead you can manually create an PV and PVC if you are doing in local machine.
Check this example -... |
<p>How can I forward traffic from a remote Kubernetes pod to a server running on my local machine? The intention is to test a remote server making calls to a service running on my local machine. I've used <code>kubectl port-forward</code> to forward traffic from my local service to remote service, but I need to do this... | <p>There's probably a "more K8s" way, but here's an idea in case you don't find anything better - use ssh.</p>
<p>Specifically, set up and expose SSH on the pod so it's accessible from your local machine. Then just use ssh on your machine to create a <a href="https://robotmoon.com/ssh-tunnels/#remote-port-for... |
<p>I try to create new Kubernetes cluster on Amazon EKS using <code>eksctl</code> script.</p>
<p>I created IAM user with this permissions :</p>
<p><a href="https://i.stack.imgur.com/1232T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1232T.png" alt="enter image description here" /></a></p>
<p>when ... | <p>For the first problem (IAM policies) you should follow the <a href="https://eksctl.io/usage/minimum-iam-policies/" rel="nofollow noreferrer">eksctl minimum IAM policies</a> documentation.</p>
<p>For the second problem you list (authenticator) it appears you don't have any of the three binaries <code>eksctl</code> is... |
<h3>Notice</h3>
<p>The root cause of this is the same than <a href="https://stackoverflow.com/questions/66446178/istio-health-check-sidecar-fails-when-i-enable-the-jwt-requestauthentication">Istio: Health check / sidecar fails when I enable the JWT RequestAuthentication</a>, but after further diagnose, I have reworded ... | <p><code>jwksUri: "http://uaa:8090/uaa/token_keys"</code> will not work from istiod, because <code>http://uaa</code> will be interpreted as <code>http://uaa.istio-system.svc.cluster.local</code>. That's why your workaround are solving the problem.</p>
<p>I don't understand why your workaround 2 is not a suffi... |
<p>I am trying to run spark sample SparkPi docker image on EKS. My Spark version is 3.0.<br />
I created spark serviceaccount and role binding. When I submit the job, there is error below:</p>
<pre class="lang-sh prettyprint-override"><code>2020-07-05T12:19:40.862635502Z Exception in thread "main" java.io.IOE... | <p>I had the same problem. I solved it by changing the k8s job.</p>
<p>Hadoop is failing to find a username for the user. You can see the problem by running <code>whoami</code> in the container, which yields <code>whoami: cannot find name for user ID 185</code>. The spark image <code>entrypoint.sh</code> contains <a hr... |
<p>I am running load test of 24 hours using Jmeter in Azure Kubernetes service. I am using Throughput shaping timer in my jmx file. No listener is added as part of jmx file.
My test stopped abruptly after 6 or 7 hrs.</p>
<p>jmeter-server.log file under Jmeter slave pod is giving warning --> <strong>WARN k.a.j.t.Vari... | <p>It looks like your <a href="https://jmeter-plugins.org/wiki/ThroughputShapingTimer/#Schedule-Feedback-Function" rel="nofollow noreferrer">Schedule Feedback Function</a> configuration is wrong in its last parameter</p>
<p><a href="https://i.stack.imgur.com/4vVTz.png" rel="nofollow noreferrer"><img src="https://i.stac... |
<p>I am trying to add the redisbloom module to a redis helm chart (bitnami/redis), or ideally the redis cluster chart (bitnami/redis-cluster).</p>
<pre><code># Chart.yaml
apiVersion: v2
name: my-app
description: My app and redis (with redisbloom module loaded)
type: application
version: 0.1.0
appVersion: 0.1.0
depende... | <p>I think you need to build custom redis image based on bitnami image with required module and after that use extraVars var to specify your module like: --loadmodule /usr/lib/redis/modules/redisearch.so</p>
<p>My Dockerfile for that (I need to have redisearch module):</p>
<pre><code>#### My customization
FROM redislab... |
<p>I need to set up the Ambassador API gateway in front of all my services.
Ambassador will be performing multiple actions like rate limiting, logging, DDoS protection, etc.</p>
<p>Especially from DDoS protection point of view, is it best practice to host Ambassador API gateway outside main application Kubernetes clust... | <p>As much i know there is two thing</p>
<p><strong>Ambassador API gateway</strong> and <strong>Edge stack</strong></p>
<p>Ambassador is open source while edge stack is paid version.</p>
<p>You can install the edge stack on VM and linux but for API gateway only YAML and helm are available.</p>
<p>you can put rate-limit... |
<p>I would like to create a kubernetes Cronjob that create jobs (according to its schedule) only if the current date is between a configurable start date and end date.</p>
<p>I can't find a way to do this with the basic cronjob resource. Is there a way to do this ? Ideally without resorting to overkill components (airf... | <p>Actually there is no way to configure the end date. You can run it in every day. You have to stop it manually when the end date will come.</p>
|
<p>I am running an Argo workflow and getting the following error in the pod's log:</p>
<pre><code>error: a container name must be specified for pod <name>, choose one of: [wait main]
</code></pre>
<p>This error only happens some of the time and only with some of my templates, but when it does, it is a template th... | <p>This happens when you try to see logs for a pod with multiple containers and not specify for what container you want to see the log. Typical command to see logs:</p>
<pre><code>kubectl logs <podname>
</code></pre>
<p>But your Pod has two container, one named "wait" and one named "main". You... |
<p>I'm trying to make a GET request to an application in Kubernetes (GKE) but is always returning 400 Bad Request.</p>
<p>The POST, PUT and DELETE methods are working perfectly.</p>
<p>And the strangest thing is that when I use the port-forward directly to the pod I haven't problem with the GET request.</p>
<p>I've tri... | <p>I managed to find the solution to the problem.</p>
<p>The problem is that <strong>Ingress don't accept HTTP GET requests with body</strong> and responds with error 400.</p>
<p>The saddest thing is that I found nothing about this problem in the Kubernetes documentation anywhere.</p>
<p>I searched for good practice in... |
<p>Config config = new ConfigBuilder().withMasterUrl("https://c2.eu-de.containers.cloud.ibm.com:78945").build();
try (KubernetesClient client = new DefaultKubernetesClient(config)) {</p>
<pre><code> client.pods().inNamespace("default").list().getItems().forEach(
pod -> Syst... | <p>From your error looks like your <code>ServiceAccount</code> doesn't have the required access to perform that specific operation. You've posted code for listing <code>Pod</code> objects but your error is complaining about listing <code>Namespace</code> objects.</p>
<pre><code>User "system:serviceaccount:badefaul... |
<p>I had set-up the Kubernetes cluster using kubeadm and it was working fine. I was able to deploy pods and service. I had tried restarting the cluster and it used to come up without any issues. Suddenly, after a few days, I had to restart my machine(hosting clusters on vms) and the cluster started not coming up. Not a... | <p>For better visibility of this post I am posting the solution that worked for this OP as <code>Community Wiki</code>.</p>
<p>The issue was resolved by completing tip posted by <code>@suren</code> who adviced to remove <code>var/lib/kubelet</code> and re-install kubelet.</p>
<p>Some additional troubleshooting steps c... |
<p>I'm wondering if anyone can help with my issue, here's the setup:</p>
<ul>
<li>We have 2 separate kubernetes clusters in GKE, running on v1.17, and they each sit in a separate project</li>
<li>We have set up VPC peering between the two projects</li>
<li>On cluster 1, we have 'service1' which is exposed by an <strong... | <p>As mentioned in one of the answers <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips" rel="nofollow noreferrer">IP aliases (VPC-native)</a> should work out of the box. If using a route based GKE cluster rather than VPC-native you would need to use custom routes.</p>
<p>As per this <a href="h... |
<p>In Kubernetes <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/" rel="noreferrer" title="Configure Liveness, Readiness and Startup Probes"><code>Kubernetes Health Check Probes</code></a>, what happens if <code>timeoutSeconds</code> exceeds <code>periodSeco... | <p>There is a diagram in this <a href="https://www.openshift.com/blog/liveness-and-readiness-probes" rel="noreferrer">blog post</a> which illustrate your question clearly:</p>
<p><a href="https://i.stack.imgur.com/IlqKb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/IlqKb.png" alt="Probe Timeline" /></a></p>... |
<p>I have a Kibana dashboard that I currently access through the root of my host : <code>https://my.host.com/</code>. I want to change it so I can access it through the path <code>https://my.host.com/kibana/</code>. For this, I used the <code>rewrite-target</code> annotation as provided in the <a href="https://kubernet... | <p>I managed to fix this at the application level. In my <code>kibana.yml</code> config file, I had to tell Kibana that it was running behind a reverse proxy. So I set <code>server.basePath: /kibana</code>.</p>
<p>Note that the configuration I made above for the Ingress is still needed, as the application is still reac... |
<p>My requirement is to optimize and secure base image for nodeJS. I have tried building it on SCRATCH using multistage docker but the final container getting into crashed state.</p>
<p>Looking for a sample docker file working on SCRATCH base.</p>
| <p>It's very much possible to build NodeJS applications on docker scratch image. Commands on the Scratch needs to be thoroughly verified by pointing to right path for node executable, if not it will result in crash as there will be no command line interface on scratch base.</p>
<p>Here is the dockerfile for sample Node... |
<p>By default, <code>kubectl</code> configuration is located at <code>~/.kube/config</code>. Is it possible to specify the kubeconfig file explicitly when using the <code>kubectl</code> command?</p>
| <p><code>kubectl</code> can use the <code>KUBECONFIG</code> in three different ways:</p>
<ol>
<li><p>Using the <code>KUBECONFIG</code> present in <code>~/.kube/config</code> if nothing is specified in <code>kubectl</code> command.</p>
</li>
<li><p>Using the <code>KUBECONFIG</code> defined by using the <code>KUBECONFIG<... |
<p>I created a Pod with two container β one container was successfully created, while other container failed.</p>
<p>Now, when I execute below command then I see that βStatusβ is βErrorβ:</p>
<pre><code>C:\Users\test123>kubectl get pod pod3-two-nginx-containers-port-error
NAME READY... | <p>Kubernetes is not showing the wrong status.</p>
<ul>
<li>From <code>kubectl get pod <<POD_NAME>></code> command you get the Podβs status.</li>
<li>From <code>kubectl describe pod <<POD_NAME>></code> you get the Pod <strong>phaseβs</strong> status.</li>
</ul>
<p><code>kubectl describe pod</cod... |
<p>I have a simple NodeJS project running on a K3s cluster on a Raspberry Pi 4. The cluster has a service to expose it. The code is as follows...</p>
<pre><code>spec:
type: LoadBalancer
ports:
- protocol: TCP
port: 3000
targetPort: 3000
</code></pre>
<p>I want to try and use port 80 instead of 3000 ... | <p>k3s comes with a pre-installed traefik ingress controller which binds to 80, 443 and 8080 on the host, alhtough you should have seen that with ss or netstat</p>
<p>You should see this service if you run:</p>
<pre><code>kubectl get service --all-namespaces
</code></pre>
<p>Although you should have seen it with netsta... |
<p>I'm new to Kubernetes and I'm trying to deploy a React app to my cluster. Here's the basic info:</p>
<ul>
<li>Docker Desktop, single-node Kubernetes cluster</li>
<li>React development frontend, exposing port 3000</li>
<li>Node.js/Express backend, exposing port 8080</li>
<li>NGINX Ingress Controller, serving my React... | <p><strong>TL;DR</strong></p>
<p>Switch your <code>pathType</code> in both <code>/api</code> and <code>/</code> path to <strong><code>Prefix</code></strong>.</p>
<p>I've included some explanation with fixed <code>Ingress</code> resource below.</p>
<hr />
<p>For the reproduction purposes I used the <code>titanic</code> ... |
<p>I am running docker for Mac in latest Mojave. Tried to enable Kubernetes from the preferences. Since then the message is just 'kubernetes is starting'. But it never completes. I am confused as to what has to be done.
Is there anything that I need to change in the network config part? </p>
<p>Just before this, I tri... | <p>I had this same issue on MacOS Catalina. Resetting to factory defaults did finally resolve the issue for me.</p>
<p>Select Troubleshoot from the drop down menu or preferences and click the bug. Then select Reset to factory defaults.</p>
<p>Obviously this is a destructive solution, so use with care.</p>
<p><a href="h... |
<p>I have configured a <code>pod</code> as follows:</p>
<pre><code> livenessProbe:
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
readinessProbe:
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 3
</code></pre>
<p>Readiness and Liveness probes are tcp-socker based</p... | <p><code>initialDelaySeconds</code>: Number of seconds after the container has started before liveness or readiness probes are initiated.</p>
<p>Now pod can get failed because of <code>CrashLoopBackOff</code> even before starting the probes. <strong>This is the concept here</strong>. It can occur if you set the contain... |
<p>I'm having a hard time getting EKS to expose an IP address to the public internet. Do I need to set up the ALB myself or do you get that for free as part of the EKS cluster? If I have to do it myself, do I need to define it in the terraform template file or in the kubernetes object yaml?</p>
<p>Here's my EKS cluster... | <p>You need to install the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/" rel="nofollow noreferrer">AWS Load Balancer Controller</a> by following the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/installation/" rel="nofollow noreferrer">installat... |
<p>Kubernetes will be using the same server or we can use multiple servers with k8s. if yes then how it will be work ?</p>
<p>In case of one instance full then would it create a new instance to route everything to the new server?</p>
<p>If anyone can show a real example of K8s then it would be great!</p>
| <p>For this I can suggest <a href="https://kubernetes.io" rel="nofollow noreferrer">Kubernetes docs</a> to start reading from but briefly,</p>
<p>Kubernetes deals with resources or networking in the Master nodes (Control Plane).
Worker nodes simply have the kube-proxy and basic control mechanisms coming from kubelet se... |
<p>I have setup a kubernetes cluster on AWS using <code>kops</code>.</p>
<p>I am trying to automate deployment with github actions.</p>
<pre><code>name: Build and Deploy
on:
push:
branches:
- develop
jobs:
build_docker_image:
- uses: actions/checkout@v2
- name: Build the tagged Docker image
... | <p>By looking your workflow config file, all the jobs running parallelly.</p>
<p>But, probably it's not what you want.</p>
<p>Pushing image needs a built image and deployment job needs an updated built image.</p>
<p>On Access kubernetes cluster, just access into your cluster and do,</p>
<pre><code>cat $HOME/.kube/confi... |
<p>I have deployed many things with Helm into my Kubernetes cluster. My values.yaml file contains a lot of fields.</p>
<p>The only modification I want to perform is add an additional environment variable to my cron job. (This cron job creates a pod where a python script should be able to read this environment variable)... | <p>This has got to do with the definition of the <code>--reuse-values</code> flag. As per the documentation <a href="https://helm.sh/docs/helm/helm_upgrade/" rel="nofollow noreferrer">here</a>:</p>
<pre><code>--reuse-values : when upgrading, reuse the last release's values and merge in any overrides from the command li... |
<p>I'm trying to replicate the <code>kubectl get pods</code> command in Python3 using the <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">kubernetes python library</a>. Except, I'm working with a remote kubernetes cluster, NOT my localhost. The configuration host is a particular web addr... | <p>I know two solutions that may help in your case.
I will describe both of them and you may choose which one suits you best.</p>
<h3>Using kubeconfig file</h3>
<p>I recommend setting up a <code>kubeconfig</code> file which allows you to connect to a remote cluster.
You can find more information on how to configure it ... |
<p>Recently <a href="https://github.com/helm/charts/tree/b9278fa98cef543f5473eb55160eaf45833bc74e/stable/prometheus-operator" rel="nofollow noreferrer">prometheus-operator</a> chart is deprecated and the chart has been renamed <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus... | <p><strong>March 18, 2021</strong>.</p>
<p>I migrated from <em>prometheus-operator</em> to <em>kube-prometheus-stack</em> and faced some difficulties.</p>
<p>Below is a list of errors which I encountered and the steps I took to work-around this.</p>
<hr />
<p><strong>Error 1</strong>: <code>unknown field "metricRe... |
<p>I have a master node that has disk pressure and is spamming the log full with endless messages like these:</p>
<blockquote>
<p>Mar 18 22:53:04 kubelet[7521]: W0318 22:53:04.413211 7521 eviction_manager.go:344] eviction manager: attempting to reclaim ephemeral-storage</p>
<p>Mar 18 22:53:04 kubelet[7521]: I0318 22... | <p>There's three ways to set Kubelet options. First is <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/" rel="nofollow noreferrer">command line options</a> like <code>--eviction-hard</code>. Next is a <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/" r... |
<p>I would like to see the output from my pre-install/post-install helm hooks when using <code>skaffold dev</code>, but this does not seem to work.</p>
<p>Which filters does skaffold use to get all the pods for log tailing? Is there a way to force skaffold to pick up the hooks by applying some labels (e.g. <code>skaffo... | <p>Thanks @acristu for the question. Skaffold dev here.
Currently, skaffold is unaware of pods deployed in the pre and post helm hooks.
The reason, we don't parse the manifests in these hooks and hence can't transform those to add the required label <code>skaffold.dev/run-id</code></p>
<p>Currently there is no way to f... |
<p>The problem is that after deploying new deployment like</p>
<pre><code>kubectl apply -f deployment.yml
</code></pre>
<p>(let's say deployment with one replica)</p>
<p>Kubernetes will create second pod and shutdown the previous one - ok so far.</p>
<p>But immediately after kubectl apply I would like to detect in CI/C... | <p>Known issue since 2018. Havent resolved yet.</p>
<p>Please refer to <a href="https://github.com/kubernetes/kubectl/issues/450" rel="nofollow noreferrer">Kubectl returns pods in various states when only those in Running state are selected via --field-selector, or -o jsonpath</a> for more details.</p>
<p>In short: The... |
<p>Kubernetes not able to find metric-server api.I am using Kubernetes with Docker on Mac. I was trying to do HPA from <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/" rel="noreferrer">following example</a>. However, when I execute command <code>kubectl get hpa</code>, My... | <p>Use official metrics server - <a href="https://github.com/kubernetes-sigs/metrics-server" rel="noreferrer">https://github.com/kubernetes-sigs/metrics-server</a></p>
<p>If you use one master node, run this command to create the <code>metrics-server</code>:</p>
<pre><code>kubectl apply -f https://github.com/kubernetes... |
<p>I have installed grafana using helm chart.I wanted to add pie chart plugin.So
installed grafana plugin with command <code>kubectl exec -it kube-prometheus-stack-chart-grafana-9dc44fc4b-ndbpt -n syg-monitoring -c grafana grafana-cli plugins install grafana-piechart-panel</code>
so its installed.</p>
<pre><code>instal... | <p>You will need to run <code>service grafana-server restart</code>.</p>
<p>If you're using <a href="https://github.com/grafana/helm-charts/tree/main/charts/grafana" rel="nofollow noreferrer">this</a> grafana helm chart, you might as well just add the plugins you need in the <code>plugins</code> parameter. See <a href=... |
<p>Until now I'm using Docker for a hand-made hosting solution on single-VPCs, with fail2ban installed on host and watching at Docker logs from Nginx containers (Each server can host multiple websites, served through an Nginx proxy)</p>
<p>I wonder how it would be possible to achieve same feature with Kubernetes, espe... | <p>That's an old question probably resolved by the author, but for other community members I decided to provide an answer with a few clarifications.</p>
<p>I have tried to find a <code>fail2ban</code> solution that can help with this case. Unfortunately, I did not find anything suitable and easy to use at the same time... |
<p>I'm getting a strange error message which I don't understand when trying to use Dhall for Kubernetes. Here is my configuration:</p>
<pre><code>let k8s = ./k8s.dhall
let utils = ./utils.dhall
let Env = utils.Env
in \(env : Env) ->
k8s.Ingress::{
, metadata = k8s.ObjectMeta::{
, name = Some ... | <p>Clearing my Dhall cache seems to have resolved the issue. Not sure what happened.</p>
<pre><code>$ rm -rf ~/.cache/dhall*
</code></pre>
<p>Hope this helps someone else.</p>
|
<p>I am new to Kubernetes and currently deploy an application on AWS EKS.</p>
<p>I want to configure a <code>Service</code> of my K8s cluster deployed on AWS EKS.</p>
<p>Here is the description of my issue: I did an experiment. I spin up <strong>2</strong> Pods running the same web application and expose them using a s... | <p>Had the exact issues and while using the <code>-H "Connection: close"</code> tag when testing externally load balanced connections helps, I still wanted inter-service communication to benefit from having IPVS with <code>rr</code> or <code>sed</code>.</p>
<p>To summarize, you will need to setup the followin... |
<p>I am currently trying to set up an EKS cluster on AWS with CloudFormation. I have been following the guide on <a href="https://en.sokube.ch/post/aws-kubernetes-aws-elastic-kubernetes-service-eks" rel="nofollow noreferrer">https://en.sokube.ch/post/aws-kubernetes-aws-elastic-kubernetes-service-eks</a>.</p>
<p>However... | <p>User or role that created EKS cluster <strong>is the only</strong> IAM entity that has access to EKS cluster. From <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>When you create an Amazon EKS cluster, the IAM entity user ... |
<p>I've setup k3s v1.20.4+k3s1 with Klipper Lb and nginx ingress 3.24.0 from the helm charts.
I'm following <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes" rel="nofollow noreferrer">this article</a> but I'm stumbling upon a very weir... | <p>Ok I found the issue. It was actually not related to the config I previously posted by to my <code>kustomization.yaml</code> config where I had:</p>
<pre><code>commonLabels:
app: myapp
</code></pre>
<p>Just removing that <code>commonLabels</code> solved the issue.</p>
|
<p>I am learning Spring boot kubernetes and trying to setup spring cloud gateway for my services. I believe with Spring cloud gateway we don;t have to use ribbon for load balancing any more. So If I don;t use ribbon then the configuration for routes changes as well. I looked over the sites for suggestion and following ... | <p>I am Still working on fixing the Spring Cloud Gateway project of main but following has worked for me. I have configured the routes via Zuul so make sure your dependencies and configuration related to it matches :-</p>
<pre><code><dependencies>
<dependency>
<groupId>org.springframework.... |
<p>If I have to integrate an external service, I have 3 options to make it accessible from Kubernetes cluster.</p>
<ol>
<li>Use ExternalName in Kubernetes Service object</li>
<li>Use ExternalIP in Kubernetes Service Object</li>
<li>Set up an Endpoint object and map the endpoint to a Service Object</li>
</ol>
<p>Third ... | <p>You can create a AWS EKS ExternalName Service pointing to the DNS Name of a AWS Network Load Balancer Kafka Broker Port 9094 which points to the DNS Names of the Kafka Brokers provided by MSK on Kafka Broker Port 9094.
<a href="https://www.reddit.com/r/aws/comments/cge9nx/suggestions_dns_for_msk_endpoints/" rel="nof... |
<p>I am using K8S version 19.</p>
<p>I tried to install second nginx-ingress controller on my server (I have already one for Linux so I tried to install for Windows as well)</p>
<pre><code>helm install nginx-ingress-win ingress-nginx/ingress-nginx
-f internal-ingress.yaml
--set controller.nodeSelector."beta\.kub... | <p>If this <code>Pod</code> is managed by a <code>Deployment</code>,<code>StatefulSet</code>,<code>DaemonSet</code> etc., it will be automatically recreated every time you delete it, so trying to remove a <code>Pod</code> in most situations makes not much sense.</p>
<p>If you want to check what controlls this <code>Pod... |
<p>I have a problem with fabric8io <a href="https://github.com/fabric8io/kubernetes-client" rel="nofollow noreferrer">kubernetes-client</a> using.</p>
<p>What i want: Creating Kafka cluster with Strimzi operator in Kubernetes.
If i do all steps from <a href="https://strimzi.io/docs/operators/latest/quickstart.html" rel... | <p>I'm from Fabric8 team. <code>Kafka</code> is a Custom Resource which means it's model is not registered in KubernetesClient so this is the reason why you're facing <code>No resource type found for:kafka.strimzi.io/v1#Kafka</code> error from KubenetesClient. KubernetesClient provides two methods for dealing with Cust... |
<p>In <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="noreferrer">GKE Ingress documentation</a>
it states that:</p>
<blockquote>
<p><em>When you create an Ingress object, the GKE Ingress controller creates a Google Cloud HTTP(S) Load Balancer and configures it according to the informatio... | <p>I think the question you're actually asking is slightly different than what you have written. You want to know if multiple Ingress resources can be linked to a single GCP Load Balancer, not GKE Ingress controller. Based on the <a href="https://kubernetes.io/docs/concepts/architecture/controller/" rel="noreferrer">c... |
<p>I'm trying to generate my Kubernetes manifests (<code>deployment.yml</code> and <code>service.yml</code>) using <a href="https://www.eclipse.org/jkube/" rel="nofollow noreferrer">JKube</a> via this command : <code>mvn k8s:resource</code></p>
<p>But I'm getting this error :</p>
<pre><code>[INFO] Scanning for projects... | <p><strong>Update</strong>:</p>
<p>Apparently this was a bug in Eclipse JKube(<a href="https://github.com/eclipse/jkube/issues/624" rel="nofollow noreferrer">eclipse/jkube#624</a>) that wasn't allowing users to configure image name using provided properties in simple Dockerfile mode. This has been fixed in new release ... |
<p>I have two nodes for my cluster: Windows and Linux. And I have one master node.
For Linux I installed NGINX controller and everything works perfectly fine!!!</p>
<pre><code>helm install nginx-ingress ingress-nginx/ingress-nginx \
-f internal-ingress.yaml \
--set controller.nodeSelector."beta\.kubernetes... | <ul>
<li><p>helm install creates kubernetes objects in the current namespace of your context.
You should use separate namespace for nginx-ingress-win release using --create-namespace --namespace namespacename flags</p>
</li>
<li><p>Please run the helm install command with --debug flag to see what is the problem</p>
</l... |
<p>I am trying to run a pod with 2 containers. Main container executes a docker java image which runs the cron job and the other sidecar(logstash) container reads the log and ship it to the Kibana server. As main container completes once the cron job is finished but sidecar container keeps running as it doesn't gracefu... | <p>You can wait for the process to finish by the process PID. The <code>bash</code> interpreter has a build in command called <code>wait</code> where if called with a child PID as argument, it will wait until the child had finished.</p>
<p>So you can create the following entrypoint.sh and add it to your java container.... |
<p>I have tried to deploy the <code>producer-service</code> app with MySQL database in the Kubernetes cluster. When i try to deploy <code>producer app</code> then the following validation error has thrown.</p>
<pre><code>error: error validating "producer-deployment.yml": error validating data: apiVersion not ... | <p>Multiple issues:</p>
<ol>
<li><p>It would be <code>apiVersion: v1</code> not <code>apiVerion: v1</code> in the <code>Service</code></p>
</li>
<li><p>wrong <code>Spec.ports</code> formation of <code>Service</code>. As <code>nodePort</code>, <code>port</code>, <code>targetPort</code> and <code>protocol</code> are und... |
<p>According to <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">Termination of Pods</a>, step 7 occurs simultaneously with 3. Is there any way I can prevent this from happening and have 7 occur only <em>after</em> the <code>Pod</code>'s graceful term... | <p>Unfortunately kubernetes was designed to remove the Pod from the endpoints at the same time as the prestop hook is started (see link in question to <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">kubernetes docs</a>):</p>
<blockquote>
<p>At the sa... |
<p>I've tried to avoid, but really haven't had the need, to set specific env vars for a React FE. But I'm working on social authentication, with Azure AD specifically, and now I do have a use case for it.</p>
<p>I acknowledge the <code>AAD_TENANT_ID</code> and <code>AAD_CLIENT_ID</code> aren't exactly "secret"... | <p>I am guessing you are using <strong>create-react-app</strong> app for React FE. You have to make sure that your environment variables starts with <code>REACT_APP_</code> else it will be ignored inside app.
According to create-react-app documentation</p>
<pre><code>Note: You must create custom environment variables b... |
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: test-deployment
labels:
app: test
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
name: test
labels:
app: test
spec:
containers:
- name: server
image: test_m... | <p>It's better if you use, <code>statefulset</code> instead of <code>deployment</code>. Statefulset's pod name will be like <code><statefulsetName-0></code>,<code><statefulsetName-1></code>... And you will need a <code>clusterIP</code> service. with which you can bound your pods. see the doc for more detail... |
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: test-deployment
labels:
app: test
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
name: test
labels:
app: test
spec:
containers:
- name: server
image: test_m... | <p>You can't.</p>
<p>It is the property of the pods of a <code>Deployment</code> that they do not have an identity associated with them.</p>
<p>You could have a look at <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer"><code>Statefulset</code></a> instead of a De... |
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: test-deployment
labels:
app: test
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
name: test
labels:
app: test
spec:
containers:
- name: server
image: test_m... | <p>if you are using the <code>kind: Deployment</code> it won't be possible ideally in this scenario you can use <code>kind: Statefulset</code>.</p>
<p>Instead of POD to POD communication, you can use the Kubernetes <strong>service</strong> for communication.</p>
<p>Still, statefulset manage the pod name in the sequence... |
<p>Firstly I succesfully mounted, my Linux path on Pod.
I used azure file share and mounted folders appear on File Share.</p>
<pre><code> volumeMounts:
- name: ads-filesharevolume
mountPath: /opt/front/arena/host
volumes:
- name: ads-filesharevolume
azureFile:
secretName: fa-fileshare-sec... | <p>Both Windows and Linux containers run at the same time:</p>
<p><a href="https://i.stack.imgur.com/23cHn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/23cHn.png" alt="enter image description here" /></a></p>
<p>Mount for Linux:</p>
<pre><code> volumeMounts:
- name: azure
mountPath: /... |
<p>For any example, the client-go connect to the kubernetes cluster with the kubeconfig file, but I don't want to do that. I've createed a service account, now I have a ServiceAccount Token, how to connect to the kubernetes cluster with this token outside of the kubernetes cluster?</p>
<pre><code>package main
import (... | <p>The client-go already has built-in authentication both <strong>In Cluster Authentication</strong> (to be used from a Pod with a ServiceAccount) and also <strong>Out of Cluster Authentication</strong> (to be used from outside the cluster, e.g. for local development)</p>
<p>The client-go has examples of both:</p>
<ul>... |
<p>I was playing with Kubernetes in Minikube. I could able to deploy spring boot sample application into Kubernetes. </p>
<p>I am exploring Kubernetes configMap. I could successfully run a spring boot application with a spring cloud starter and picking the property keys from config map. Till here I am successful.</p>
... | <p>To access ConfigMaps and get Refresh events:</p>
<ol>
<li><p>see annotations on config properties class
<code>@Configuration(proxyBeanMethods = false)</code>
see also <code>@RefreshScope</code> on config properties class.</p>
<pre><code>@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "... |
<p>Vagrant, vm os: ubuntu/bionic64, swap disabled</p>
<p>Kubernetes version: 1.18.0</p>
<p>infrastructure: 1 haproxy node, 3 external etcd node and 3 kubernetes master node</p>
<p><em><strong>Attempts:</strong></em> trying to setup ha rancher so I am setting up ha kubernetes cluster first using kubeadm by following the... | <p>As @<a href="https://stackoverflow.com/users/6914338/shadowlegend">shadowlegend</a> said the issue is solved, so the problem was with configuration <code>ufw</code> rule to allow cidr of vms network but does not allow from kubernetes(from docker containers). Configure <code>ufw</code> to allow certain ports docu... |
<p>I have an nginx ingress in Kubernetes with both a whitelist (handled by a <code>nginx.ingress.kubernetes.io/whitelist-source-range</code> annotation) and also a custom port mapping (which exposes an SFTP server port 22 via a <code>--tcp-services-configmap</code> configmap). The whitelist works great for 80 and 443,... | <p>Firstly take a look at this issue: <a href="https://www.google.com/url?q=https://github.com/kubernetes/ingress-nginx/issues/3202&sa=D&source=hangouts&ust=1617960974480000&usg=AFQjCNFEc_ZuZIZTwjqrhYMpnDtt1mztAg" rel="nofollow noreferrer">ip-whitelist-support</a>.</p>
<blockquote>
<p>IPs are not whitel... |
<p>this is my deployment.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
... | <p>Only execute one command</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
</code></pre>
<p>Question is over</p>
|
<p>We create the cluster using the following command</p>
<pre class="lang-sh prettyprint-override"><code>kops create cluster --node-count=3 --node-size=c5.2xlarge --master-count=3 --master-size=c5.xlarge --zones=eu-west-1a --name=${KOPS_CLUSTER_NAME} --yes
</code></pre>
<p>We are using kops cluster. We export the kubec... | <p>After going through the <a href="https://kops.sigs.k8s.io/cli/kops_export_kubecfg/" rel="nofollow noreferrer">docs</a>, found that we can actually give the validity of the <code>kubeconfig</code> as an argument</p>
<pre class="lang-sh prettyprint-override"><code>$ kops export kubecfg --admin=87600h0m0s --kubeconfig ... |
<p>I have an aks cluster and I want to install a kong ingress controller with my pre-existing IP address, but I can't find a way to set this value when installing with helm</p>
<p>in <a href="https://github.com/Kong/charts/blob/main/charts/kong/values.yaml" rel="nofollow noreferrer">value.yaml</a> file, I didn't found ... | <p>you can just do this:</p>
<pre><code>helm template kong/kong --generate-name --set proxy.loadBalancerIP="yourIP"
</code></pre>
|
<p><strong>Not able to connect to internet from inside the pod</strong></p>
<p>My system Spec Include : I have created a Kubernetes cluster using 2 system one acts as master the other as worker node .</p>
<p>Operating System : NAME="Red Hat Enterprise Linux" VERSION="8.3 (Ootpa)" ID="rhel"... | <p>There are couple of possibilities for this kind of issue:</p>
<ul>
<li><p>It could be that this is not an issue with CoreDNS itself but rather the Kubernetes networking problem where the traffic to ClusterIPs is not directed correctly to Pods. It could be that kube-proxy is responsinble for that.</p>
<p>Here's a <a ... |
<p>I am using Jenkins with the kubernetes plugin to run my jobs and I need to run a pipeline that:</p>
<ol>
<li>builds a docker image</li>
<li>submit it to the registry</li>
<li>Uses that same image in the following steps to perform the tests.</li>
</ol>
<pre><code>Container(image:A): build image B
Container(image:B) ... | <p>Thank you zett42 for your answer, I was able to achieve my objective with your suggestions.</p>
<p>Basically the solution was to set in the build stage a global environment variable. I post here the full solution to help others in my same problem:</p>
<pre><code>pipeline {
agent none
stages {
stage("Bui... |
<p>Is <code>NetworkPolicy</code> a stateful firewall?</p>
<p>For example, if I allow ingress from a certain IPs on certain ports, is the return traffic automatically allowed on ephemeral? Ditto for allowed egress.</p>
<p>How does this play with a default block policy in place?</p>
<p>Are there any other considerations ... | <p>NetworkPolicy is stateful and will allow an established connection to communicate both ways.</p>
|
<p>I have an ASP.NET Core Multi-Container docker app which I am now trying to host to Kubernetes cluster on my local PC. But unfortunately one container is starting and other is giving error <strong>address already in use</strong>.</p>
<p>The Deployment file is given below:</p>
<pre><code>apiVersion: apps/v1
kind: Depl... | <p>To quote this answer: <a href="https://stackoverflow.com/a/62057548/12201084">https://stackoverflow.com/a/62057548/12201084</a></p>
<blockquote>
<p>containerPort as part of the pod definition is only informational purposes.</p>
</blockquote>
<p>This means that setting containerPort does not have any influence on wha... |
<p>Hey it's been quite days struggling to make the sample book app running. I am new to istio and trying to get understand it. I followed this <a href="https://www.docker.com/blog/getting-started-with-istio-using-docker-desktop/" rel="nofollow noreferrer">demo</a> of an other way of setting up the bookinfo. I am using ... | <p>In my opinion, this is a problem with the <code>MetalLB</code> configuration.</p>
<p>You are trying to give <code>MetalLB</code> control over IPs from the <code>192.168.49.2/28</code> network.<br />
We can calculate for <code>192.168.49.2/28</code> network: <strong>HostMin</strong>=<code>192.168.49.1</code> and <str... |
<p>By default, when no value is specified in the configuration, kube-proxy might be running in either iptables or userspace mode:</p>
<blockquote>
<p>--proxy-mode ProxyMode</p>
<p>Which proxy mode to use: 'userspace' (older) or 'iptables' (faster) or 'ipvs' or 'kernelspace' (windows). <strong>If blank, use the best-ava... | <p>The Mode which kube-proxy comes up with is mentioned in kube-proxy log file.</p>
<pre><code>W0322 08:09:44.312816 1 server_others.go:578] Unknown proxy mode "", assuming iptables proxy
I0322 08:09:44.313052 1 server_others.go:185] Using iptables Proxier.
</code></pre>
<p>Check in Code <a href="... |
<p>I have a k8s deployment which consists of a cron job (runs hourly), service (runs the http service) and a storage class (pvc to store data, using gp2).</p>
<p>The issue I am seeing is that gp2 is only readwriteonce.</p>
<p>I notice when the cron job creates a job and it lands on the same node as the service it can m... | <p>Focusing only on the part:</p>
<blockquote>
<p>How can I schedule a workload (<code>Pod</code>, <code>Job</code>, <code>Cronjob</code>) on a specific set of <code>Nodes</code></p>
</blockquote>
<p>You can spawn your <code>Cronjob</code>/<code>Job</code> either with:</p>
<ul>
<li><code>nodeSelector</code></li>
<li><c... |
<p>I am running a Kubernetes cluster where I have enabled the two service meshes Istio and Linkerd on different occasions.</p>
<p>When I try to deploy a Spark Standalone cluster where each Spark worker and Master will run in different pods, the workers cannot connect to the Spark Master.</p>
<p>It is possible to run ... | <p>service mesh like Istio requires bind address as 0.0.0.0 so it's not possible to run spark app on cluster mode unless you add exlude Inbound/Outbound Spark ports into config.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="... |
<p>I have a requirement in which I need to create a cronjob in kubernetes but the pod is having multiple containers (with single container its working fine).</p>
<p>Is it possible? </p>
<p>The requirement is something like this:
1. First container: Run the shell script to do a job.
2. Second container: run fluentbit ... | <p>I need to agree with the answer provided by @Arghya Sadhu. It shows how you can run multi container <code>Pod</code> with a <code>CronJob</code>. Before the answer I would like to give more attention to the comment provided by @Chris Stryczynski:</p>
<blockquote>
<p>It's not clear whether the containers are run in p... |
<p>I would like to deploy my pods in a specific namespace. I think about Pod Affinity but can't find a solution on how to select specific namespace.
Does anybody do it?</p>
| <p>As part of Anti-Affinity you can provide <code>namespaceSelector: {}</code> to allow the <code>labelSelector</code> to match labels on pods from all namespaces instead of the pod's own namespace only.</p>
<p>The comment in the source code about the NamespaceSelector:
<a href="https://github.com/kubernetes/kubernetes... |
<p>I have the following Jenkinsfile:</p>
<pre><code>node {
stage('Apply Kubernetes files') {
withKubeConfig([credentialsId: 'jenkins-deployer', serverUrl: 'https://192.168.64.2:8443']) {
sh 'kubectl apply -f '
}
}
}
</code></pre>
<p>While running it, I got "kubectl: not found". I installed K... | <p>I know this is a fairly old question, but I decided to describe an easy workaround that might be helpful.<br />
To use the <a href="https://plugins.jenkins.io/kubernetes-cli/" rel="noreferrer">Kubernetes CLI</a> plugin we need to have an executor with <code>kubectl</code> installed.</p>
<p>One possible way to get <c... |
<p>I have a script to extract the logs of crushed pods, but i want also to give as a parameter the pod names (In case I need also the logs from other pods, not just crushed ones). My script looks like this:</p>
<pre><code>#!/bin/bash
y=1;
for pod in "$@"
do
echo "Pod name: $y: $pod";
... | <p>You can add this at the end of the file:</p>
<pre><code>for pod in $@
do
echo "Printing logs for requested pod $pod"
kubectl logs -n namespace $pod | tail -n 10
done
</code></pre>
<p>Hope that helps to progress your script</p>
|
<p>I have a pod in namespace Foo and a service account in namespace Bar. Can I run the pod as the service account from the other namespace? Or will the fact that the pod & service account belong to different namespaces block me?</p>
| <p>No, you cannot. Your pod and service account need to be in the same namespace. As, <strong>Service accounts and Pods are namespaced</strong>.</p>
<p>As far the k8s doc:</p>
<blockquote>
<p>When you create a pod, if you do not specify a service account, it is automatically assigned the default service account in the ... |
<p>I am new to Kubernetes. I am trying to implement zoneminder on Kubernetes. I noticed from google I found quantumobject which is implementing zoneminder on docker, but the resources of implementing it on Kubernetes are really less. I tried implementing it on Kubernetes but somehow it doesn't show the video stream and... | <p>I was just quickly researching this myself. Should run fine - it can even run multiple pods with shared storage per <a href="https://zoneminder.readthedocs.io/en/stable/installationguide/multiserver.html" rel="nofollow noreferrer">https://zoneminder.readthedocs.io/en/stable/installationguide/multiserver.html</a></p>... |
<p>I'm using Shedlock version 4.22.0 with JDBC integration.
I have one configuration class</p>
<pre><code>@Configuration
@EnableScheduling
@EnableSchedulerLock(defaultLockAtMostFor = "PT30S")
public class ShedLockConfiguration {
@Bean
public LockProvider lockProvider(DataSource dataSource) {
ret... | <p>Execution should be triggered by a <code>@Scheduled</code> <a href="https://spring.io/guides/gs/scheduling-tasks/" rel="nofollow noreferrer">annotation</a>. ShedLock only prevents parallel task execution, it does not schedule anything. If you have the <code>@Scheduled</code> annotation, check the <code>shedlock</cod... |
<p>I am trying to monitor filesystem usage for pods in k8s. I am using Kubernetes (microk8s) and hostpath persistent volumes. I am running Kafka along with a number of producers to see what happens when I go past the PVC size limit among other things. I have tried getting information from the API server but it is not ... | <p>Since with <code>hostPath</code> your data is stored directly on the worker you won't be able to monitor the usage. Using <code>hostPath</code> has many drawbacks and while its good for testing it should not be used for some prod system. Keeping the data directly on the node is dangerous and in the case of node fail... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.