Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I have currently deployed a small java application to my local Kubernetes cluster. I'm currently trying to test my application by port-forwarding the pod and then using postman to test my Controllers.</p> <p>However, when I am testing I am getting a read timeout exception. No matter how long I set my timeout to be i...
Aaron Sumner
<p>Some k8s deployments allow k8s pods to have only 1 CPU. In this circumstance it is not possible for the client and server to share an event loop (which is the default since it is more efficient to share an event loop if possible). The result is you get read timeouts. So you should configure a separate event loop for...
Graeme Rocher
<p>I am creating namespace using <code>kubectl</code> with <code>yaml</code>. The following is my <code>yaml</code> configuration</p> <pre><code>apiVersion: v1 kind: Namespace metadata: name: "slackishapp" labels: name: "slackishapp" </code></pre> <p>But, when I run <code>kubectl create -f ./slackish-...
Set Kyar Wa Lar
<p>There is nothing wrong with your yaml but I suspect you have the wrong version of kubectl. </p> <p>kubectl needs to be within 1 minor from the cluster you are using as described <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#before-you-begin" rel="noreferrer">here</a>.</p> <p>You can check your v...
Andreas Wederbrand
<p>When I am installing CoreDNS using this command ,by the way,the OS version is: CentOS 7.6 and Kubernetes version is: v1.15.2:</p> <pre><code>kubectl create -f coredns.yaml </code></pre> <p>The output is:</p> <pre><code>[root@ops001 coredns]# kubectl create -f coredns.yaml serviceaccount/coredns created clusterrol...
Dolphin
<p>From this error message</p> <pre><code>Error from server (BadRequest): error when creating &quot;coredns.yaml&quot;: Deployment in version &quot;v1&quot; cannot be handled as a Deployment: v1.Deployment.Spec: v1.DeploymentSpec.Template: v 1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Contai...
ruseel
<p>I have followed the AWS getting started guide to provision an EKS cluster (3 public subnets and 3 private subnets). After creating it, I get the following API server endpoint <a href="https://XXXXXXXXXXXXXXXXXXXX.gr7.us-east-2.eks.amazonaws.com" rel="nofollow noreferrer">https://XXXXXXXXXXXXXXXXXXXX.gr7.us-east-2.ek...
thatguyjono
<p>Don't try and assign a pretty name to the API endpoint. Your cluster endpoint is the address that's used to talk to the control plane. When you configure your kubectl tool, the api endpoint is what kubectl talks to.</p> <p>Once you've got an application running on your EKS cluster, and have a load balancer, or Ingre...
Dale C. Anderson
<p>I followed this tutorial for deploying vault into a minikube cluster: <a href="https://learn.hashicorp.com/tutorials/vault/kubernetes-minikube?in=vault/kubernetes" rel="nofollow noreferrer">https://learn.hashicorp.com/tutorials/vault/kubernetes-minikube?in=vault/kubernetes</a>.</p> <p>I don't understand, however, ho...
Aaron
<p>I found this blog post on hashicorp's site which seems to address configuration once you are up and running: <a href="https://www.hashicorp.com/blog/codifying-vault-policies-and-configuration" rel="nofollow noreferrer">https://www.hashicorp.com/blog/codifying-vault-policies-and-configuration</a>.</p> <p>There's also...
Aaron
<p>On this document.</p> <p><a href="https://github.com/bitnami/charts/tree/master/bitnami/kafka" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/kafka</a></p> <p>it mentioned following:</p> <pre><code>Note: the deployed ingress must contain the following block: tcp: 9094: &quot;{{ .R...
王子1986
<p>I resolved this by referring to this guide.</p> <p><a href="https://minikube.sigs.k8s.io/docs/tutorials/nginx_tcp_udp_ingress/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/tutorials/nginx_tcp_udp_ingress/</a></p> <p>I was missing this step</p> <pre><code>kubectl patch deployment ingress-nginx-control...
王子1986
<p>I have a kubernetes cluster into which I'm intending to implement a service in a pod - the service will accept a grpc request, start a long running process but return to the caller indicating the process has started. Investigation suggests that <code>IHostedService</code> (<code>BackgroundService</code>) is the way ...
Richard Hunt
<blockquote> <p>Investigation suggests that IHostedService (BackgroundService) is the way to go for this.</p> </blockquote> <p>I <a href="https://blog.stephencleary.com/2021/01/asynchronous-messaging-1-basic-distributed-architecture.html" rel="nofollow noreferrer">strongly recommend</a> using a durable queue with a sep...
Stephen Cleary
<p>My cluster sometimes gets a &quot;burst&quot; of information and generates a large number of Kubernetes Jobs at once. And in other times I have ~0 active jobs.</p> <p>I'm wondering how can I make it autoscale the number of nodes to continuously be able to process all these jobs in a reasonable time-frame.</p> <p>I s...
user972014
<p>EKS allows you to deploy <a href="https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html" rel="nofollow noreferrer">cluster autoscaler</a> so when new job can not be scheduled due to lack of available cpu/memory, extra node will be added to the cluster.</p>
Ilia Kondrashov
<p>I am trying to get Service <code>label selectors</code> through <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">Kubernetes Python Client</a>. I am using <a href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/CoreV1Api.md#list_service_for_all_namespaces" rel="...
suren
<p>You should be able to get the selector from a service object, and then use that to find all the pods that match the selector.</p> <p>For example (I am hoping I don't have typos, and my python is rusty):</p> <pre><code>services = v1.list_service_for_all_namespaces(watch=False) for svc in services.items: if svc....
AlexBrand
<p>I have the following ingress.yml:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress namespace: default annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/ssl-redirect: "false" nginx.ingress.kub...
Kok How Teh
<p>Follow these steps to run your code:</p> <ol> <li><strong>ingress</strong>: remove URL-rewriting from <em>ingress.yml</em></li> </ol> <pre class="lang-yaml prettyprint-override"><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress namespace: default annotations: kubernetes.io/ing...
vladimir
<p>I want to know if there is versioning for ingress config similar to what we have in deployments. Suppose there is a misconfiguration I would like to revert to the previous config. I would like to understand about <code>generation</code> in ingress YAML config.</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingr...
Dinesh Kumar
<p>Kubernetes does not offer this natively, and neither does a management tool like Rancher.</p> <p>If you want to do this, you need an infra-as-code tool, like Terreform, ansible, etc. The config files for these can be versioned in a repo.</p> <p>Even without those, you can independently export a give ingress yaml, a...
New Alexandria
<p>I use Python kubernetes-client, and want to wait if the job is done:</p> <pre class="lang-py prettyprint-override"><code>api_instance.create_namespaced_job("default", body, pretty=True) </code></pre> <p>This call just makes a submit job, it will return the response even though the job is still running. How can I w...
Võ Trường Duy
<p>I found the solution. You can recognize the job is complete by watching the jobs and observing the events:</p> <pre class="lang-py prettyprint-override"><code>from kubernetes import client, config, watch config.load_kube_config() api_client = client.BatchV1Api() print("INFO: Waiting for event to come up...") w ...
smrt28
<p>I am trying to get my hands dirty on Kubernetes. I am firing following command:</p> <pre><code>kubectl get deployment </code></pre> <p>and I get the following headers in the output:</p> <p><a href="https://i.stack.imgur.com/mX2TR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mX2TR.png" alt="k...
Mangu Singh Rajpurohit
<p>The Deployment object specifies the desired state of your Deployment, and the Deployment Controller drives the current state of the system towards the desired state.</p> <p>The <code>Desired</code> field specifies the number of replicas you asked for, while the <code>Current</code> field specifies the number of rep...
AlexBrand
<p>I'm running an OpenShift cluster and am trying to figure out what version of OLM in installed in it. I'm considering an upgrade, but would like more details.</p> <p>How can I find the version?</p>
Josiah
<p><strong>From the CLI:</strong></p> <p>You can change kubectl for oc since you are using OpenShift.</p> <p>First find the name of an olm-operator pod. I'm assuming Operator Lifecycle Manager is installed in the olm namespace, but it might be "operator-lifecycle-manager".</p> <pre><code>kubectl get pods -n olm |gre...
Josiah
<p>Currently, I'm using Docker Desktop with <strong>WSL2</strong> integration. I found that <strong>Docker Desktop</strong> automatically had created a cluster for me. It means I don't have to install and use <strong>Minikube</strong> or <strong>Kind</strong> to create cluster. The problem is that, how could I enable <...
tuq
<p>Finally I found the way to fix. I have to deploy ingress Nginx by command:</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.41.2/deploy/static/provider/cloud/deploy.yaml </code></pre> <p>(Follows the instruction at <a href="https://kubernetes.github.io/ingress-...
tuq
<p>I'm new to Kubernetes and I'm trying to understand some security stuff.</p> <p>My question is about the Group ID (= gid) of the user running the container.</p> <p>I create a Pod using this official example: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context...
Sylmarch
<p>Unfortunately, setting the primary group ID is currently not supported in Kubernetes, and will default to <code>gid=0</code>.</p> <p>There is an open issue for implementing this: <a href="https://github.com/kubernetes/features/issues/213" rel="noreferrer">https://github.com/kubernetes/features/issues/213</a></p>
AlexBrand
<p>I'm trying to verify a CSV I built out for my Kubernetes operator using Operator Framework's operator-sdk. While doing that, I'm running into the following error.</p> <p>What does this error from <code>operator-courier verify</code> mean? </p> <pre><code>ERROR: CRD.spec.version does not match CSV.spec.crd.owned.ve...
Josiah
<p>This can occur if you simply have a CRD in your bundle that isn't mentioned in the CSV, but has a <code>spec.version</code> that isn't the same as the CSV.</p> <p>Otherwise, you have a CSV that is probably something like this:</p> <pre><code>apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion spe...
Josiah
<p>I was looking into K8s and Amazon Web Services.<br /> I am confused if they are alternative approaches/solutions for the same problem or complementary.<br /> For instance:<br /> In my understanding if we have a classic 3 tier web application we can have it in AWS where we can have an Amazon LB, EC2 and database back...
Jim
<p>AWS and Kubernetes aren't directly comparable, in my opinion. That would be akin to asking if Ford Motor Company and minivans are comparable.</p> <p>AWS is a platform that provides you lots of options to run applications, including:</p> <ol> <li>a managed VM service called <a href="https://aws.amazon.com/ec2/" rel="...
jarmod
<p>I set up a Kubernetes Cluster on Hetzner following theses steps: <a href="https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner" rel="nofollow noreferrer">https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner</a></p> <pre><code>Client Version: v1.26.3 Kustomize Version: v4.5.7 Server Version: v1.26.4...
cre8
<p>Experiencing the same issue while using <a href="https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner" rel="nofollow noreferrer">kube-hetzner</a> as you, I looked at the configuration file and found the culprit: by default, outbound traffic is filtered, except for a few popular ports like HTTP or HTTPS.</p>...
Laurent
<p>I'm trying to install Openshift 3.11 on a one master, one worker node setup.</p> <p>The installation fails, and I can see in <code>journalctl -r</code>:</p> <pre><code>2730 kubelet.go:2101] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not re...
Magick
<p>The error was using a too recent version of Ansible. </p> <p>Downgrading to Ansible 2.6 fixed the problem.</p>
Magick
<p>Sorry this is my first time working with Redis. I have a redis master deployment and a redis slave deployment (via K8s). The replication from master to slave is working as expected. However, when I kill the master altogether and bring it back up again, the sync wipes out the data of slave as well.</p> <p>I have trie...
HelmBurger
<p>Yes, the correct practice would be to promote the slave to master and then slave the restarted node to it to sync the state. If you bring up an empty node that is declared as the master, the slave will faithfully replicate whatever is - or isn't - on it.</p> <p>You can configure periodic saving to disk, so that you ...
Chris Heald
<ol> <li>i created a self-signed tls certificate and private key via terraform. The files are called server.key and server.crt</li> <li><p>i create a kubernetes tls secret with this certificate and private key using this command:<br> <em>kubectl create secret tls dpaas-secret -n dpaas-prod --key server.key --cert serve...
Assaf
<p>The problem is that you are encoding the <strong>paths</strong> of the certificate files into the secret and not the <strong>contents</strong> of the files.</p> <p>You can see this is the case if you base64-decode the secret strings in your example:</p> <pre><code>$ echo -n bXktdGVzdHMvY2VydHMvc2VydmVyLmNydA== | b...
John
<p>I'm setting up a 2 node cluster in kubernetes. 1 master node and 1 slave node. After setting up master node I did installation steps of docker, kubeadm,kubelet, kubectl on worker node and then ran the join command. On master node, I see 2 nodes in Ready state (master and worker) but when I try to run any kubectl com...
Nitish Goel
<blockquote> <p>root@kubework:/etc/kubernetes# kubectl get nodes The connection to the server localhost:8080 was refused - did you specify the right host or port?</p> </blockquote> <p>Kubcetl is by default configured and working on the master. It requires a kube-apiserver pod and <code>~/.kube/config</code>.</p> <p>F...
davidxxx
<p>I try to run the <a href="https://github.com/GoogleCloudPlatform/elasticsearch-docker/blob/master/5/README.md" rel="nofollow noreferrer">elasticsearch6</a> container on a google cloud instance. Unfortunately the container always ends in CrashLoopBackOff. This is what I did:</p> <h3>install gcloud and kubectl</h3> ...
Fabian
<p>The problem was the f1-micro instance. It doesn't have enough memory to run. Only after upgrading to an instance with 4GB it works. Unfortunately this is way too expensive for me, so I have to look for something else.</p>
Fabian
<p>Using Spring Boot and managing database changes by Liquibase all changes are executed on application start. This is totally fine for fast running changes.</p> <p>Some changes, e.g. adding DB index, can run for a while. If running application on K8s it happens that liveness/readyness checks trigger an application res...
lunanigra
<p>You can use <a href="https://www.liquibase.com/blog/using-liquibase-in-kubernetes" rel="nofollow noreferrer">init container</a> to init your database before application startup.</p>
bilak
<p>I installed a one node Kubernetes with <code>kubeadm</code>. This is on a <code>vServer</code> &quot;bare metal&quot; with dedicated external static IP.</p> <p>With these components/settings:</p> <ul> <li>calico (default settings)</li> <li>MetalLB (Layer 2 config with address range <code>192.168.1.240-192.168.1.250<...
Dieshe
<p>metalLB is not needed at all. When you install traefik add this value file (as <code>traefik.yaml</code> in this case):</p> <pre><code>service: externalIPs: - &lt;your_external_static_ip_here_without_the_brackets&gt; </code></pre> <p>and then install it like this: <code>helm install --values=./traefik.yaml tr...
Dieshe
<p>I need to configure a TCP port on my AKS Cluster to allow RabbitMQ to work</p> <p>I have installed nginx-ingress with helm as follows:</p> <pre><code>kubectl create namespace ingress-basic helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm install nginx-ingress ingress-nginx/ingress-nginx ...
Mark McGookin
<p>I believe the issue here was that helm was configuring so much of my own stuff that I wasn't able to customise too much.</p> <p>I uninstalled the ingress with helm and changed the ingress creation script to this:</p> <pre class="lang-yaml prettyprint-override"><code>helm install nginx-ingress ingress-nginx/ingress-n...
Mark McGookin
<p>I have set up a AWS kops cluster for Kubernetes, i have multiple microservices where in each application need to interact with one another.</p> <p><strong>Scenario: My ta2carbon app tries to invoke a function in ta1carbon app through service(dns) name.</strong> </p> <p><strong>Result: It is failing with timeout er...
Shruthi Bhaskar
<p>DNS resolves a doman name to an IP address, not an IP address + port. </p> <p>There are two potential solutions:</p> <ol> <li><p>Modify your application source to issue API requests to <code>http://ta1carbon:3000</code></p></li> <li><p>Set the <code>port</code> on your <code>ta1carbon</code> service to <code>80</c...
AlexBrand
<p>I have created a hashicorp vault deployment and configured kubernetes auth. The vault container calls kubernetes api internally from the pod to do k8s authentication, and that call is failing with 500 error code (connection refused). I am using docker for windows kubernetes.</p> <p>I added the below config to vault...
Tanmoy Banerjee
<p>Your login request is being sent to the <code>tokenreview</code> endpoint on port 80. I think this is because your <code>kubernetes_host</code> specifies a <code>http</code> URL. The 500 response is because it's not listening on port 80, but on 443 instead (as you can see in your service list output).</p> <p>Try ...
John
<p>I use "<a href="https://hub.docker.com/r/chentex/random-logger/" rel="nofollow noreferrer">chentex/random-logger</a>" image, which write stdout/stderr to the container. I want to make deployment yaml, which run the chentex's image, and put it's logs in file inside shared volume. Can I do it without modifying the ima...
Yagel
<p>It is best practice to send log message to <code>stdout</code> for applications running in a container. The <code>chentex/random-logger</code> just <a href="https://github.com/chentex/random-logger/blob/master/entrypoint.sh#L10-L16" rel="nofollow noreferrer">follows this approach</a> without any option to configure ...
webwurst
<p>I'm using <a href="http://manpages.courier-mta.org/htmlman5/slapd-mdb.5.html" rel="nofollow noreferrer">slapd-mdb</a> and I'm looking for a way to programmatically update "maxsize" parameter using ldapmodify or similar: <a href="http://manpages.courier-mta.org/htmlman5/slapd-mdb.5.html" rel="nofollow noreferrer">htt...
Michel Gokan Khan
<p>The <a href="http://www.openldap.org/doc/admin24/quickstart.html" rel="nofollow noreferrer">"Quickstart"</a> section of the OpenLDAP documentation includes a mdb sample configuration:</p> <pre><code>dn: olcDatabase=mdb,cn=config objectClass: olcDatabaseConfig objectClass: olcMdbConfig olcDatabase: mdb OlcDbMaxS...
Richard Neish
<p>I have used nginx-ingress controller as a sub-chart and I want to override controller.service.nodePorts.http in the subchart. I tried few things and nothing seem to work. Here is what I've tried</p> <ul> <li>using --set controller.service.nodePorts.http=32080 during helm install command</li> <li>declaring this path...
Gaurav Sharma
<p>When overriding values of a sub-chart, you need to nest those configurations under the name of the subchart. For example in values.yaml:</p> <pre><code>mysubchart: x: y </code></pre> <p>In your case, if you imported the nginx controller chart as <code>nginx-controller</code>, you could add this to the main chart...
itaysk
<p>I would like to run some <code>kubectl</code> commands to verify the cluster post install of Helm charts. I could not find any documentation around this. In Helm, theres the concept of showing notes as part of <code>NOTES.txt</code> but doesnt look like you can run any commands at that stage.</p> <p>Is this current...
nixgadget
<p>You can define a <code>job</code> that is executed at a certain point in the <a href="https://helm.sh/docs/topics/charts_hooks/#hooks-and-the-release-lifecycle" rel="nofollow noreferrer">lifecycle</a> during <code>helm install</code>. The <a href="https://helm.sh/docs/topics/charts_hooks/#the-available-hooks" rel="n...
webwurst
<p>We got a couple spring boot applications in k8s that write both application log and tomcat access log to stdout.</p> <p>When the log throughput is really high (either caused by amount of requests or amount of applciation logs) then it sometimes happens that log lines get interrupted.</p> <p>In our case this looks li...
FloxD
<p><code>System.out</code> had better be thread-safe, but that doesn't mean it won't interleave text when multiple threads write to it. Writing both application logs and HTTP server logs to the same stream seems like a mistake to me for at least this reason, but others as well.</p> <p>If you want to aggregate logs toge...
Christopher Schultz
<p>With <code>helm inspect [CHART]</code> I can view the content of <code>chart.yaml</code> and <code>values.yaml</code> of a chart. Is there a way to also view the template files of a chart? Preferably through a Helm command.</p> <p>On a sidenote: this seems like a pretty important feature to me. I would always want ...
Nick Muller
<p><code>helm install yourchart --dry-run --debug</code></p> <p>This will print to stdout all the rendered templates in the chart (and won't install the chart)</p>
itaysk
<p>I am trying to run my spark job on Amazon EKS cluster. My spark job required some static data (reference data) at each data nodes/worker/executor and this reference data is available at S3.</p> <p>Can somebody kindly help me to find out a clean and performant solution to mount S3 bucket on pods ?</p> <p>S3 API is ...
Ajeet
<p>We recently opensourced a project that looks to automate this steps for you: <a href="https://github.com/IBM/dataset-lifecycle-framework" rel="noreferrer">https://github.com/IBM/dataset-lifecycle-framework</a></p> <p>Basically you can create a dataset:</p> <pre><code>apiVersion: com.ie.ibm.hpsys/v1alpha1 kind: Datas...
Yiannis Gkoufas
<p>In my application, I have a rest server which locally interacts with a database via the command line (it's a long story). Anyway, the database is mounted in a local ssd on the node. I can guarantee that only pods of that type will by scheduled in the node pool, as I have tainted the nodes and added tolerances to m...
Andy
<p>You can use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer"><code>Daemonsets</code></a> in combination with <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#running-pods-on-only-some-nodes" rel="nofollow noreferrer"><code>nodeSelec...
webwurst
<p>So I'm working on a project that involves managing many postgres instances inside of a k8s cluster. Each instance is managed using a <code>Stateful Set</code> with a <code>Service</code> for network communication. I need to expose each <code>Service</code> to the public internet via DNS on port 5432. </p> <p>The mo...
Lee Hampton
<p>The Kubernetes ingress controller implementation <a href="https://github.com/heptio/contour" rel="nofollow noreferrer">Contour</a> from Heptio can <a href="https://github.com/heptio/contour/blob/master/docs/ingressroute.md#tcp-proxying" rel="nofollow noreferrer">proxy <code>TCP</code> streams</a> when they are encap...
webwurst
<p>I'm still getting to grips with PromQL. I wrote this query in an attempt to detect the number of kubernetes pods that existed in the last 24 hours within a given namespace.</p> <p><strong>My process here was:</strong></p> <ul> <li>Get the metric filtered to the relevant name-spaces (any airflow ones).</li> <li>Get t...
John Humphreys
<p>I'd recommend substituting <code>increase()</code> with <code>count_over_time()</code>, since <code>increase</code> may miss short-living pods with lifetime smaller than 2x scrape interval. The following query should return the total number of pods seen during the last 24 hours:</p> <pre><code>count(count_over_time(...
valyala
<p>I've seen <a href="https://cloudplatform.googleblog.com/2018/05/Kubernetes-best-practices-Resource-requests-and-limits.html" rel="nofollow noreferrer">articles recommending</a> that resource requests/limit should be implemented. However, none I've found that discuss on <em>what</em> numbers to fill in.</p> <p>For e...
willwill
<p>What I've been doing is to use telegraf to collect resource usage, and use the 95th percentile while the limit is set to 1 CPU and twice the memory request.</p> <p><img src="https://i.stack.imgur.com/FOFRu.png" alt="Screenshot"></p> <p>The problem with this method is</p> <ul> <li>App that utilize multicores durin...
willwill
<p>I'm looking for a way to uniquely identify a cluster:</p> <ul> <li>Something that can't be moved to another cluster such as a secret</li> <li>Something that can be accessed by the application (e.g. an environment variable or stored in an object that can populate env vars</li> <li>Something that is unlikely to change...
znat
<p>With OpenShift 4.x, you can find the unique Cluster ID for each cluster in the <code>clusterversion</code> CRD:</p> <pre><code>$ oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{&quot;\n&quot;}' </code></pre> <p>The <code>clusterversion</code> object looks like this:</p> <pre><code>$ oc get clusterversio...
Simon
<p>I have a Redis pod, and I expect connection requests to this pod from different clusters and applications not running in the cloud. Since Redis does not work with the http protocol, accessing as the route I have done below does not work with this connection string &quot;<code>route-redis.local:6379</code>&quot;.</p>...
seyid yagmur
<p>You already discovered that Redis does not work via the HTTP protocol, which is correct as far as I know. Routes work by inspecting the HTTP Host header for each request, which will not work for Redis. This means that you will <strong>not be able to use Routes for non-HTTP workload</strong>.</p> <p>Typically, such n...
Simon
<p>I have an application running inside <code>kubernetes</code> which has a file mounted through <code>configmaps</code>. Now, from inside the application I want to perform some action when this file (from configmap) gets updated (lets say through <code>kubectl update configmaps xyz</code> command).</p> <p>Lets say I ...
Amudhan
<p>You might be experience a problem <a href="https://medium.com/@xcoulon/kubernetes-configmap-hot-reload-in-action-with-viper-d413128a1c9a" rel="nofollow noreferrer">like this</a>:</p> <blockquote> <p>When a ConfigMap changes, the real path to the config files it contains changed, but this is kinda “hidden” by 2 level...
webwurst
<p>I want to display pod details in the following format using promql/Prometheus.</p> <p><a href="https://i.stack.imgur.com/AGPBm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AGPBm.png" alt="Image1" /></a></p> <p>Furthermore, I want to display CPU and memory utilization of application/component in below fo...
Peter
<h3>Per-pod CPU usage in percentage (the query doesn't return CPU usage for pods without CPU limits)</h3> <pre><code>100 * max( rate(container_cpu_usage_seconds_total[5m]) / on (container, pod) kube_pod_container_resource_limits{resource=&quot;cpu&quot;} ) by (pod) </code></pre> <p>The <code>kube_pod_container_...
valyala
<p>In an Openshift environment (Kubernetes v1.18.3+47c0e71) I am trying to run a very basic container which will contain:</p> <ul> <li>Alpine (latest version)</li> <li>JDK 1.8</li> <li>Jmeter 5.3</li> </ul> <p>I just want it to boot and run in a container, expecting connections to run Jmeter CLI from the command line t...
ElPiter
<p>On your local machine, you are likely using <code>docker run -it &lt;my_container_image&gt;</code> or similar. Using the <code>-it</code> option will run an interactive shell in your container without you specifying a <code>CMD</code> and will keep that shell running as the primary process started in your container....
Simon
<p>I would like to run a sequence of Kubernetes jobs one after another. It's okay if they are run on different nodes, but it's important that each one run to completion before the next one starts. Is there anything built into Kubernetes to facilitate this? Other architecture recommendations also welcome!</p>
Alex Flint
<p>This requirement to add control flow, even if it's a simple sequential flow, is outside the scope of Kubernetes native entities as far as I know.<br> There are many workflow engine implementations for Kubernetes, most of them are focusing on solving CI/CD but are generic enough for you to use however you want.</p> ...
itaysk
<p>I am running different versions of our application in different namespaces and I have set up a prometheus and grafana stack to monitor them. I am using below promql for getting the cpu usage of different pods (as percentage of 1 core) and the value that it returns is matching the values that I get from the <code>kub...
AVarf
<p>The following PromQL query should return summary per-namespace CPU usage across all the pods in Kuberentes (the CPU usage is expressed in the number of used CPU cores):</p> <pre><code>sum(rate(container_cpu_usage_seconds_total{container!=&quot;&quot;}[5m])) by (namespace) </code></pre> <p>The <code>{container!~&quot...
valyala
<p>I am building an application which should execute tasks in a separate container/pods. this application would be running in a specific namespace the new pods must be created in the same namespace as well.</p> <p>I understand we can similar via custom CRD and Operators, but I found it is overly complicated and we need...
Manish Bansal
<p>Yes, this is certainly possible using a <code>ServiceAccount</code> and then connecting to the API from within the Pod.</p> <ul> <li><p>First, create a <code>ServiceAccount</code> in your namespace using</p> <pre><code>kubectl create serviceaccount my-service-account </code></pre> </li> <li><p>For your newly created...
Simon
<p>I need to do configs for Openshift and Kubernetes in one repo. I use Templates in Openshift, but Kubernetes can't understand what a Template is. What can I use that will work in both OpenShift and vanilla Kubernetes?</p>
Mankasss
<p>As you noted, <code>Templates</code> is an OpenShift-specific resource. I would not recommend using it but instead use something like <a href="https://kustomize.io/" rel="nofollow noreferrer">Kustomize</a> to do templating for both OpenShift and also for Kubernetes.</p> <p>Since Kubernetes 1.14, there is the <code>k...
Simon
<p>I'm using Kubernetes with kube-state-metrics and Prometheus/grafana to graph various metrics of the Kubernetes Cluster.</p> <p>Now I'd like to Graph how many <strong>new</strong> PODs have been created per Hour over Time.</p> <p>The Metric <code>kube_pod_created</code> contains the Creation-Timestamp as Value but ...
powo
<p>The following query returns the number of pods created during the last hour:</p> <pre><code>count(last_over_time(kube_pod_created[1h]) &gt; time() - 3600) </code></pre> <p>How does it work?</p> <p>The <code>last_over_time(kube_pod_created[1h])</code> returns creation timestamps for pods, which were active during the...
valyala
<p>I made a OKD 4.9 cluster.</p> <p>I successfully installed openshift and made a cluster, but I got a question now.</p> <p>There is a sentence in OKD document.</p> <p>&quot;The only supported values is 3, which is the default value&quot;</p> <p>I think there is an important reason to do not use 5, 7 masters.</p> <p>Co...
jonghyun Kim
<blockquote> <p>I think there is an important reason to do not use 5, 7 masters.</p> <p>Could you guys tell me why?</p> </blockquote> <p>Technically it is still possible to have 5 or 7 Master Nodes, there is nothing in place to stop you. It is just not supported, so if you have a problem with it you'll have to deal wit...
Simon
<p>After the upgrading <code>kubectl</code>, I am unable to login on Openshift cluster.</p> <p>When i am trying to login with <code>oc login</code> command it is reverting the below error message:</p> <pre><code>Error: unknown command &quot;login&quot; for &quot;kubectl&quot; Did you mean this? logs plugin Run '...
Imtiaz Ahmed
<p>It looks like you have symlinked <code>oc</code> to <code>kubectl</code> somehow.</p> <p>As you note, <code>kubectl</code> does not have a <code>login</code> method, you need to actually use the <code>oc</code> CLI tool to log into your OpenShift cluster. This will get the proper tokens that you need to talk to the ...
Simon
<p>I've setup cert mananger on microk8s following <a href="https://cert-manager.io/docs/installation/kubernetes/" rel="nofollow noreferrer">these</a> instructions, I had it working 6 months ago but have since had to start again from scratch. Now when I setup my Cluster Issuer I'm getting the error below.</p> <p>Everyth...
matt_lethargic
<p>After uninstalling and reinstalling everything including Microk8s I tried again no luck. Then I tried using the latest helm chart v1.0.2 which had a newer cert-manager version, seemed to work straight away.</p> <p>Another note, mainly to myself. This issue was also caused by having search domains setup in netplan, o...
matt_lethargic
<p>I am setting up HPA on custom metrics - basically on no. of threads of a deployment.</p> <p>I have created a PrometheusRule to get average of threads (5 min. based). On the container, I am doing cont. load to increase the threads and average value is also going high.</p> <p>I started with 2 replicas and when current...
Sunil Agarwal
<p>Finally after a week, found the root cause.</p> <p>So the issue was with the label. I had 2 deployments with same label. So what internal hpa is doing is it's getting stats for all the pods with that label and then doing scale up/down. As soon as I corrected the labels, hpa worked as expected.</p> <p>But the same on...
Sunil Agarwal
<p>I want to monitor disk usages of persistent volumes in the cluster. I am using <a href="https://github.com/coreos/kube-prometheus" rel="noreferrer">CoreOS Kube Prometheus</a>. A dashboard is trying to query with a metric called <strong>kubelet_volume_stats_capacity_bytes</strong> which is not available anymore with...
Cemal Unal
<p>Per-PVC disk space usage in percentage can be determined with the following query:</p> <pre><code>100 * sum(kubelet_volume_stats_used_bytes) by (persistentvolumeclaim) / sum(kubelet_volume_stats_capacity_bytes) by (persistentvolumeclaim) </code></pre> <p>The <code>kubelet_volume_stats_used_bytes</code> metric show...
valyala
<p>I want to generate a password in a Helm template, this is easy to do using the <code>randAlphaNum</code> function. However the password will be changed when the release is upgraded. Is there a way to check if a password was previously generated and then use the existing value? Something like this:</p> <pre><code>ap...
Mikhail Janowski
<p>You can build on <a href="https://stackoverflow.com/users/435563/shaunc">shaunc</a>'s idea to use the <a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#using-the-lookup-function" rel="noreferrer">lookup</a> function to fix the original poster's code like this:</p> <pre><code>apiVersion: v1 ...
Jan Dubois
<p>I see that kubernets uses pod and then in each pod there can be multiple containers.</p> <p>Example I create a pod with</p> <pre><code>Container 1: Django server - running at port 8000 Container 2: Reactjs server - running at port 3000 </code></pre> <p>Since the containers inside cant have port conflicts, then its b...
Santhosh
<p>The typical way to think about this delineation is &quot;which parts of my app scale together?&quot;</p> <p>So for your example, you probably wouldn't even choose a common pod for them. You should have a Django pod and separately, a ReactJS server pod. Thus you can scale these independently.</p> <p>The typical case ...
Chris Trahey
<p>I have a Kubernetes v1.17.0 cluster with multiple nodes. I've created PVC with access mode set to RWO. From the Kubernetes docs:</p> <blockquote> <p>ReadWriteOnce -- the volume can be mounted as read-write by a single node</p> </blockquote> <p>I'm using a Cinder volume plugin which doesn't support ReadWriteMany....
Lukas
<p>As I gathered from your answers to the comments, you do not want to use affinity rules but want the scheduler to perform this work for you.</p> <p>It seems that this issue has been known since at least 2016 but has not yet been resolved, as the scheduling is considered to be working as expected: <a href="https://gi...
Simon
<p>Typically, if I have a remote server, I could access it using ssh, and VS Code gives a beautiful extension for editing and debugging codes for the remote server. But when I create pods in Kuberneters, I can't really ssh into the container and so I cannot edit the code inside the pod or machine. And the kuberneters p...
user3086871
<p>If your requirement is &quot;kubectl edit xxx&quot; to use VSCode.</p> <p>The solution is:</p> <ul> <li><p>For <strong>Linux,macos</strong>: <code>export EDITOR='code --wait'</code></p> </li> <li><p>For <strong>Windows</strong>: <code>set EDITOR=code --wait</code></p> </li> </ul>
Hlex
<p>I have a question regarding the timeout in exec type container probe in openshift/kubernetes. My openshift version is 3.11 which has kubernetes version 1.11</p> <p>I have defined a readiness probe as stated below</p> <pre><code>readinessProbe: exec: command: - /bin/sh - -c - check_readiness.sh in...
dsingh
<p>Yes, that is correct, Container Execution Checks do not support the <code>timeoutSeconds</code> argument. However, <a href="https://docs.openshift.com/container-platform/3.11/dev_guide/application_health.html" rel="nofollow noreferrer">as the documentation notes</a>, you can implement similar functionality with the ...
Simon
<p>I am trying to deploy a docker image on a kubernetes cluster.</p> <p>What I want to achieve on the cluster is the same output as I achieve when I run this command locally (The output will be some generated files)</p> <pre><code>sudo docker run \ --env ACCEPT_EULA=&quot;I_ACCEPT_THE_EULA&quot; \ --volume /my-fold...
Ioan Kats
<p>try this:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: test namespace: default spec: template: metadata: name: test labels: app: test spec: volumes: - name: my-folder hostPath: path: /my-folder containers: - name...
Bijan
<p>I tried to set externalPI with below command</p> <p><code>oc patch svc &lt;serviceName&gt; -p '{&quot;spec&quot;:{&quot;externalIPs&quot;:[&quot;giving.my.ip.here&quot;]}}'</code></p> <p>but getting below error</p> <p><code>Error from server (Forbidden): services &quot;&lt;myServiceName&gt;&quot; is forbidden: spec....
Ranjeet
<p><code>Forbidden: externalIPs have been disabled</code> is likely due to the configuration of your OpenShift cluster that currently does not allow you to create Services with an external IP.</p> <p>So you may need to contact your OpenShift Administrator to allow these.</p> <p>In OpenShift 3.x, you need to specify the...
Simon
<p>I am trying to expose my RabbitMQ deployment and access it on my browser. For the deployment I created the following yml:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: blur-rabbitmq labels: app: blur-rabbitmq spec: replicas: 1 selector: matchLabels: ...
marcelo
<p>You need to either port forward a local port to the cluster via <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer"><code>kubectl port-forward</code></a> or you need to create an <a href="https://kubernetes.io/docs/concepts/services...
asthasr
<p>As beginener, I have tried k9s and kubernetes '<code>kubectl top nodes</code>',for the cpu and memory usage and values are matched.Meanwhile I tried with prometheus UI, with '<code>avg(container_cpu_user_seconds_total{node=&quot;dev-node01&quot;})</code>' and '<code>avg(container_cpu_usage_seconds_total{node=&quot;d...
Aksahy Awate
<p>The following PromQL query returns CPU usage (as the number of used CPU cores) by pod in every namespace:</p> <pre><code>sum(rate(container_cpu_usage_seconds_total{container!=&quot;&quot;}[5m])) by (namespace, pod) </code></pre> <p>The <code>container!=&quot;&quot;</code> filter is needed for filtering out cgroups h...
valyala
<p>I have a <strong>deployment.yaml</strong> containing deployment of <em>3 containers</em> + <em>LB service</em> and the <strong>cloudbuild.yaml</strong> containing <em>steps to build container images every time there's new commit to a certain branch on Bitbucket git repo</em>.</p> <p>All is working fine except the f...
dzhi
<p>Found a solution by using image tag or URI variables in deployment fine and substituting them with sed during build-time.</p> <p><strong>deplyment.yaml</strong></p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: namespace: dev name: app labels: app: app spec: replicas: 3 selector: matc...
dzhi
<p>I deploy Prometheus on my minikube cluster which has 5 nodes. I also deploy a microservice on the cluster. Prometheus can collect the data normally.</p> <p>I use <code>wrk2</code> which is a workload generator to send requests to my microservices. Jaeger shows that the requests are processed normally.</p> <p>The fol...
MissSirius
<p>Prometheus requires at least two <a href="https://docs.victoriametrics.com/keyConcepts.html#raw-samples" rel="nofollow noreferrer">raw samples</a> on the lookbehind window specified in square brackets for calculating the <a href="https://docs.victoriametrics.com/MetricsQL.html#irate" rel="nofollow noreferrer">irate(...
valyala
<p>I am trying to create a GKE cluster of node size 1. However, it always create a cluster of 3 nodes. Why is that? </p> <pre><code>resource "google_container_cluster" "gke-cluster" { name = "sonarqube" location = "asia-southeast1" remove_default_node_pool = true initial_node_count = 1 } resource "google_cont...
Jiew Meng
<p>Ok, found I can do so using <code>node_locations</code>: </p> <pre><code>resource "google_container_cluster" "gke-cluster" { name = "sonarqube" location = "asia-southeast1" node_locations = [ "asia-southeast1-a" ] remove_default_node_pool = true initial_node_count = 1 } </code></pre> <p>Without tha...
Jiew Meng
<p>I have the following terraform configuration in my terraform code</p> <pre><code>data &quot;external&quot; &quot;region&quot; { program = [&quot;sh&quot;, &quot;test.sh&quot;] query = { aws_region = var.aws_region vault_url = var.vault_url vault_role = var.vault_role } } provider &quot;vault&quot...
jyothi swarup
<p>A typical approach for this is to run <code>vault login</code> (or some other equivalent process) <em>before</em> running Terraform, and then have Terraform read those ambient credentials the same way that the Vault client itself would.</p> <p>Although Terraform providers typically accept credentials as part of thei...
Martin Atkins
<p>What is the best way to create a persistent volume claim with ReadWriteMany attaching the volume to multiple pods? </p> <p>Based off the support table in <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes" rel="noreferrer">https://kubernetes.io/docs/concepts/storage/persistent-volumes</a>, GCEP...
leeman24
<p>It's possible now with <a href="https://cloud.google.com/filestore/" rel="noreferrer">Cloud Filestore</a>. </p> <p>First create a Filestore instance.</p> <pre class="lang-sh prettyprint-override"><code>gcloud filestore instances create nfs-server --project=[PROJECT_ID] --zone=us-central1-c --tier=STAND...
Antoine
<p>I'm using Shedlock version 4.22.0 with JDBC integration. I have one configuration class</p> <pre><code>@Configuration @EnableScheduling @EnableSchedulerLock(defaultLockAtMostFor = &quot;PT30S&quot;) public class ShedLockConfiguration { @Bean public LockProvider lockProvider(DataSource dataSource) { ret...
Bożek Mariusz
<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...
Lukas
<p>I have a simple Kubernetes deployment. It consists of a single, unreplicated container. There is no service exposing the container. The container has a health check which checks that it is correctly configured and can communicate with its external dependencies. I update the deployment using <code>kubectl apply</code...
Ben Butler-Cole
<p>You have not mentioned your deployment strategy. But one generic problem I have seen with k8s deployments is that if the application fails to boot up, it will be restarted infinitely. So you might have to <code>kubectl delete deploy/******</code> explicitly after detecting the deployment failed status. (There is als...
Amrit
<p>I have all my JSON files located in Redis cache.</p> <p>I want to get it served through Nginx.</p> <pre><code> # redis-cli -h redis-master redis-master:6379&gt; get &quot;zips/80202.json&quot; &quot;{\&quot;zipCode\&quot;:\&quot;80202\&quot;,\&quot;City\&quot;:\&quot;DENVER\&quot;,\&quot;StateCode\&quo...
Kannaiyan
<p>Here is the nginx configuration used to serve with redis key,</p> <pre><code>resolver local=on ipv6=off; server { listen 9000; location / { set $target ''; access_by_lua ' local key = ngx.var.request_uri if not key then ngx.log(ngx.ERR, &quot;no key ...
Kannaiyan
<p>I have an application such as below structure which multiple services has their own Dockerfile.ı would like to deploy my application via Jenkins using Helm to kubernetes but I can not decide what is the best way to handle this?</p> <p>Should I try to use multi-stage builds if yes how can I handle this? Should I cre...
semural
<p>A helm chart represent a whole application. You have 1 application with 2 slices. So you need only 1 helm chart.</p>
Softlion
<p><code>OpenShift 4.6</code></p> <p>There is a basic set up in OpenShift: [Pod &lt;- Service &lt;- Route]. A service running in the pod have an HTTP endpoint responding for 90 seconds or longer. And in some cases it is normal, so I would like to allow this behavior.</p> <p>Nevertheless, after a request to the route is...
diziaq
<p>You might be looking for the <code>haproxy.router.openshift.io/timeout</code> annotation, with which you can annotate your Route:</p> <pre><code>oc annotate route myroute --overwrite haproxy.router.openshift.io/timeout=2s </code></pre> <p>You can find more information about Route configuration in the documentation: ...
Simon
<p>I am trying to implement CI/CD pipeline for my microservice deployment creating in Spring Boot. I am trying to use my SVN repository, Kubernetes and Jenkins for implementing the pipeline. When I am exploring the deployment using Kubernetes and Jenkins, I found tutorials and many videos for deploying in both test and...
Mr.DevEng
<p>It's completely up to you how you want to do this. In general, we create separate k8s clusters for prod and staging(etc). And your Jenkins needs to deploy to different cluster depending on your pipeline. If you want a true CI/CD, then one pipeline is enough - which will deploy to both the clusters (or environments)....
Amrit
<p>I am trying to create/apply this kubectl .yaml file <a href="https://github.com/Azure/aad-pod-identity/blob/master/deploy/infra/deployment.yaml" rel="nofollow noreferrer">https://github.com/Azure/aad-pod-identity/blob/master/deploy/infra/deployment.yaml</a> via Terrraform`s null_resource to the AKS to install Azure...
S0meth1ng
<p>Because of differences between Unix-like operating systems and Windows, it's rarely possible to use <code>local-exec</code> in a portable way unless your use-case is very simple. This is one of the reasons why <a href="https://www.terraform.io/docs/provisioners/index.html#provisioners-are-a-last-resort" rel="norefer...
Martin Atkins
<p>There's a need to create an AWS security group rule using Terraform, then triggering a null resource.</p> <p>E.G.</p> <ul> <li>health_blue. (aws_security_group_rule)</li> <li>wait_for_healthcheck. (null_resource)</li> </ul> <p>I have already tried adding a dependency between the security group rule and the null reso...
Theo Sweeny
<p>With the configuration you showed here, <code>null_resource.wait_for_healhtcheck</code> depends on <code>aws_security_group_rule.health_blue</code>.</p> <p>(You currently have that dependency specified redundantly: the reference to <code>aws_security_group_rule.health_blue</code> in <code>triggers</code> already est...
Martin Atkins
<p>I am trying to run a simple wordcount application in Spark on Kubernetes. I am getting following issue.</p> <pre><code>Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Operation: [get] for kind: [Pod] with name: [spark-wordcount-1545506479587-driver] in namespace: [non-default-namespace] faile...
hp2326
<p>This is because your dns is unable to resolve. kubernetes.default.svc. Which in turn could be issue of your networking and iptables. </p> <p>run this on specific node </p> <pre><code>kubectl run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools </code></pre> <p>and check</p> <pre><code>nsloo...
user303730
<p>I cannot really understand the purpose and usage of topologyKey in pod affinity. The documentations says:</p> <blockquote> <p><strong>topologyKey</strong> is the key of node labels. If two Nodes are labelled with this key and have identical values for that label, the scheduler treats both Nodes as being in the same ...
yrazlik
<p>Required as part of a <strong>affinity.podAffinity</strong> or <strong>affinity.podAntiAffinity</strong> <em>spec</em> section, the <strong>topologyKey</strong> field is used by the scheduler to determine the domain for Pod placement.</p> <p>The topologyKey <em>domain</em> is used to determine relative placement of ...
Drew
<p>This thread shows multiple containers can be created using YAML configuration, creating one Pod with multiple containers inside: <a href="https://stackoverflow.com/questions/67082250/create-a-pod-with-a-single-app-container-with-multiple-images-in-kubernetes-clus">Create a pod with a single app container with multip...
solarflare
<p>So it seems that <code>oc new-app</code> does not let you create a Pod with multiple container images as far as I can see.</p> <p>User &quot;bodo&quot; above had the right idea I think. You can use the following command to generate the YAML file and then edit that YAML to add more containers to the Pod:</p> <pre><co...
Simon
<p><em>Situation</em></p> <p>I want to have a <code>pool</code> of <code>serving</code> pods (say I have 50 <code>serving</code> pods lying around). They will be exposed via a LoadBalancer Service.</p> <p>I want to make sure that:</p> <ol> <li>each pod serves only one TCP connection and keep this connection alive un...
Tran Triet
<p>So I guess this would work.</p> <p>First set a ReadinessProbe to poll an endpoint/tcp port on your pod very agressivly (as often as possible).</p> <p>Then as soon as you get a connection make sure that the ReadinessProbe fails, but at the same time make sure the LivenessProbe DOESN'T fail. </p> <p>Finally, after ...
Andreas Wederbrand
<pre><code>apiVersion: v1 kind: Pod metadata: name: kaniko spec: containers: - name: kaniko image: gcr.io/kaniko-project/executor:latest args: - "--context=dir:///workspace" - "--dockerfile=/workspace/Dockerfile" - "--destination=gcr.io/kubernetsjenkins/jenkinsondoc:latest" ...
user8024713
<p>the folder looks like</p> <p>In host:</p> <pre><code>/home/sabadsulla/kanikodir/Dockerfile </code></pre> <p>When it turns to PV/PVC, in pod container</p> <pre><code>/workspace/Dockerfile </code></pre> <p>Then for <code>kanino executor</code>, if we map the context to <code>workspace</code>, the dockerfile will ...
Larry Cai
<p>I have an Openshift 4.6 platform running an applicative pod. We use postman to send request to the pod.</p> <p>The applicative pod return a 200 http response code, but get a 502 in postman. So there is a interim component inside OpenShift/K8s that should transform the 200 into a 502.</p> <p>Is there a way to debug/t...
Nicolas Malinconico
<p>The HTTP 502 error is likely returned by the OpenShift Router that is forwarding your request to your application.</p> <p>In practice this often means that the OpenShift Router (HAProxy) is sending the request to your application and it does not receive any or an unexpected answer from your application.</p> <p>So I ...
Simon
<p>While going through the helm documentation, i came across rollback feature. Its a cool feature, but i have some doubts about the implementation of that feature.</p> <p>How they have implemented it? If they might have used some datastore to preserve old release config, what datastore it is?</p> <p>Is there any upp...
lokanadham100
<p>As the <a href="https://docs.helm.sh/helm/#helm-rollback" rel="nofollow noreferrer">documentation</a> says, it rolls back the entire release. Helm generally stores release metadata in its own configmaps. Every-time you release changes, it appends that to the existing data. Your changes can have new deployment image,...
Amrit
<p>I am trying to achieve zero-downtime deployment on k8s. My deployment has one replica. The pod probes look like this:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: app namespace: ${KUBE_NAMESPACE} spec: selector: matchLabels: app: app replicas: 1 template: metadata: ...
kkpattern
<p>After digging around Google and doing some tests. I found it's not needed to manually replying 500 to probes after prestop.</p> <p>According to <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">documentation</a></p> <blockquote> <p>At the same time ...
kkpattern
<p>Few pods in my openshift cluster are still restarted multiple times after deployment.</p> <p>with describe output:<br /> <code>Last State: Terminated</code> <code>Reason: OOMKilled</code><br /> <code>Exit Code: 137</code></p> <p>Also, memory usage is well below the memory limits. Any other parameter whi...
dev
<p>„OOMKilled“ means your container memory limit was reached and the container was therefore restarted.</p> <p>Especially Java-based applications can consume a large amount of memory when starting up. After the startup, the memory usage often drops considerably.</p> <p>So in your case, increase the ‚requests.limit.memo...
Simon
<p>I have a question about best practices designing deployments and or stateful sets for stateful applications like wordpress and co. The current idea i had was to make a fully dynamic image for one specific cms. With the idea i can mount the project data into it. Like themes, files etc. In the case of wordpress it wo...
Melvin
<p>I don't think Wordpress is really stateful in this matter and it should be deployed like a regular deployment.</p> <p>Stateful Set is typically things like databases that needs storage. As an example, Cassandra would typically be a Stateful Set with mounted Volume Claims. When one instance dies, a new one is brough...
Andreas Wederbrand
<p>What would be the best setup to run <code>sonatype\nexus3</code> in Kubernetes that allows using the Docker repositories? </p> <p>Currently I have a basic setup:</p> <ul> <li>Deployment of <code>sonatype\nexus3</code></li> <li>Internal service exposing port 80 and 5000</li> <li>Ingress + kube-lego provides HTTPS a...
Niel de Wet
<h1>tl;dr</h1> <p>Nexus needs to be served over SSL, otherwise docker won't connect to it. This can be achieved with a k8s ingress + <a href="https://github.com/jetstack/kube-lego/" rel="noreferrer">kube-lego</a> for a <a href="https://letsencrypt.org/" rel="noreferrer">Let's Encrypt</a> certificate. Any other real ce...
Niel de Wet
<p>Unable to mount a Kubernetes secret to <code>${HOME}/.ssh/id_rsa</code> path.</p> <p>Following are my secrets.yaml created using</p> <pre><code> kubectl create secret generic secret-ssh-auth --type=kubernetes.io/ssh-auth --from-file=ssh-privatekey=keys/id_rsa </code></pre> <pre><code>apiVersion: v1 data: ssh-priv...
Noobie
<p>K8s Secret <a href="https://kubernetes.io/docs/concepts/configuration/secret/#ssh-authentication-secrets" rel="nofollow noreferrer">type: kubernetes.io/ssh-auth</a> (i.e. ssh-key-secret) does not work out of the box as mount point for <code>SSH</code>, since it mounts it under the filename <code>ssh-privatekey</code...
Neon
<p>I'm trying to connect to an existing kubernetes that's running on AWS and run arbitrary commands on it using Java. Specifically, we are using fabric8 (although I am open to another api if you can provide a sufficient answer using one). The reason I need to do this in Java is because we plan to eventually incorporate...
Alex Parker
<p>Here is the official Java client for Kubernetes.</p> <p><a href="https://github.com/kubernetes-client/java" rel="nofollow noreferrer">https://github.com/kubernetes-client/java</a></p> <p>It gives you a clean interface and write code in java to execute against kubernetes.</p> <p>As listed in the documentation page...
Kannaiyan
<p>I have a K8s, currently running in single node (master+kubelet,172.16.100.81). I have an config server image which I will run it in pod. The image is talking to another pod named eureka server. Both two images are spring boot application. And eureka server's http address and port is defined by me. I need to transfer...
user84592
<p>Generally, you don't need nodePort when you want two pods to communicate with each other. A simpler clusterIP is enough.</p> <p>Whenever you are exposing a deployment with a service, it will be internally discoverable from the DNS. Both of your exposed services can be accessed using: <code>http://config-server.defa...
Amrit
<p>I've previously used both types, I've also read through the docs at:</p> <p><a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="noreferrer">https://kubernetes.io/docs/concepts/storage/persistent-volumes/</a> <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="noreferrer">h...
Chris Stryczynski
<p>Volume decouples the storage from the Container. Its lifecycle is coupled to a pod. It enables safe container restarts and sharing data between containers in a pod.</p> <p>Persistent Volume decouples the storage from the Pod. Its lifecycle is independent. It enables safe pod restarts and sharing data between pods.<...
itaysk
<p>I am new to OpenShift and I have a deployment config there. And I know how to see the node (ip) of my current pods,</p> <p>the deployment config have been deployed many times, and the pods have been redeployed to many nodes as well. how can I check the history nodes that the pods have been deployed to?</p>
user13904118
<p>Note that in OpenShift or Kubernetes in general it should not matter on which node your application runs on. This should be completely transparent to you and you should not need to care too much about which exact node your application is running on.</p> <blockquote> <p>I am new to OpenShift and I have a deployment c...
Simon
<p>With the following code, I'm able to fetch all the Pods running in a cluster. How can I find the Pod Controller (Deployment/DaemonSet) using the Kubernetes go-client library?</p> <pre class="lang-golang prettyprint-override"><code>var kubeconfig *string if home := homedir.HomeDir(); home != &quot;&quot; { kubeco...
AngryPanda
<p>By following @Jonas suggestion I was able to get Pod's manager. Here's a fully working sample:</p> <pre class="lang-golang prettyprint-override"><code>package main import ( &quot;context&quot; &quot;flag&quot; &quot;fmt&quot; metav1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot; &quot;k8s.io/c...
AngryPanda
<p>Azure Admins created a cluster for us. On VM I installed <code>&quot;az cli&quot; and &quot;kubectl&quot;</code>. With my account from Azure Portal I can see that Kubernetes Service and Resource Group to which it belongs. From the level of that cluster in Azure Portal I can see that I have a role:</p> <blockquote> <...
vel
<p>In my case to refresh recently granted credentials helped this one:</p> <pre class="lang-bash prettyprint-override"><code>az account set --subscription &quot;your current subscription name&quot; </code></pre> <p>It leds to re-login and fix the issue.</p>
vladimir
<p>I have an EKS cluster where having one daemon which mounts a s3 bucket to all pods.</p> <p>Whenever there is some issue or pod restarts, then the mount volume is not accessible and throws the below error.</p> <pre><code>Transport endpoint is not connected </code></pre> <p>For solving this error, I have to manaully u...
Lijo Abraham
<p>Ok, I think I solved it. It seems like sometimes the pod looses the connection, resulting in &quot;Transport not connected&quot;. The workaround I found to fix this is to add an init container, that tries to unmount the folder before. That seems to fix the issue. Note, you want to mount a higher-level folder, so you...
GuySoft
<p>We followed the solution suggested in <a href="https://stackoverflow.com/questions/71957287/apache-ignite-c-sharp-client-connection-configuration-for-kubernetes">Apache Ignite C# Client Connection configuration for kubernetes</a> as thick client to connect the ignite cluster running in kubrenetes.</p> <p>We get the ...
Prem
<p>This Ignite issue on Alpine Linux was fixed in 2.13, which was released yesterday - please try upgrading.</p> <p><a href="https://issues.apache.org/jira/browse/IGNITE-16749" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/IGNITE-16749</a> <a href="https://www.nuget.org/packages/Apache.Ignite/2.13.0" ...
Pavel Tupitsyn
<p>I have created ConfigMap from Openshift 4 Windows 10 CLI:</p> <pre><code>.\oc create configmap my-cacerts --from-file=cacerts </code></pre> <p>I can see ConfigMap with name <strong>my-cacerts</strong> and download binary file <strong>cacerts</strong> from it using web interface of Openshift 4</p> <p>Now I mount it (...
tillias
<p>Your <code>volumes</code> definition is incorrect, <code>config-map</code> <strong>does not exist and is invalid</strong>, but it seems the API is silently falling back to an <code>EmptyDir</code> here, thus leading to an empty directory.</p> <p>When you create a <code>ConfigMap</code> using the <code>oc</code> comm...
Simon
<p>I have a Python process that I want to fire up every <em>n</em> minutes in a Kubernetes cronjob and read a number of messages (say 5) from a queue, and then process/convert some files and run analysis on results based on these queue messages. If the process is still running after <em>n</em> minutes, I don't want to ...
Tim
<p>Duplicate cronjobs seems to be the way to achieve what you are looking for. Produce 3 duplicates with single job at a time. You could template the job manifest and produce multiple as in the following example. The example is not in your problem context, but you can get the idea. <a href="http://kubernetes.io/docs/ta...
gordanvij
<p>I executed a scenario where I deployed Microsoft SQL Database on my K8s cluster using PV and PVC. It work well but I see some strange behaviour. I created PV but it is only visible on one node and not on other workers nodes. What am I missing here, any inputs please?</p> <p>Background:</p> <p>Server 1 - Master</p>...
Solutions Architect
<blockquote> <p>I am guessing because my POD is running on server-4, PV got created on server four when created POD and refer PVC (claim) in it.</p> </blockquote> <p>This is more or less correct and you should be able to verify this by simply deleting the Pod and recreating it (since you say you do not have a Replic...
Simon