prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I have created 2 pods within the same cluster. One service is initialized as</p>
<pre><code>kubectl create deployment my-web --image=nginx --port=80
kubectl expose deployment my-web --target-port=80 --type=NodePort
</code></pre>
<p>to my understanding, this creates a deployment with one pod <code>my-web-<string&g... | <p>NodePort is used to access a service within the cluster scope.
You might create a firewall rule that allows TCP traffic on your node port. Create a firewall rule that allows TCP traffic on port 32004.
On Ubuntu you can do something like:</p>
<blockquote>
<p>sudo ufw allow 32004/tcp</p>
</blockquote>
<p>And check por... |
<p>Hello I am trying to deploy a simple tomcat service. Below are the details:</p>
<p>1.minikube version: v1.8.1</p>
<p>2.OS: mac</p>
<p>3.The <strong>deployment.yaml</strong> file (I am in the directory of the yaml file)</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: tomcat-deployment
spec:
... | <p>Sara's answer above pointed me to the right direction. Copying the files works but this requires a restart of the tomcat service which reverts the changes. I had to use 'cp -r' on the deployment yaml as per below:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<... |
<p>Imagine you want to get kind/struct called <code>KubeadmControlPlane</code> from the kubernetes API server.</p>
<p>This means you need to import the related struct into your code.</p>
<p>A matching import statement for <code>KubeadmControlPlane</code> would be:</p>
<blockquote>
<p>kubeadm "sigs.k8s.io/cluster-a... | <p>In principle, a <code>go get sigs.k8s.io/cluster-api@v1.4.2</code> (done in the folder where your <code>go.mod</code> is) should be enough to:</p>
<ul>
<li>update your <code>go.mod</code>,</li>
<li>add the library in your <code>$GOPATH</code> and</li>
<li>enable VSCode auto-import to work.</li>
</ul>
<p>That means, ... |
<p>I am deploying some Flink jobs which require access to some services under a service mesh implemented via Linkerd and I'm running into this error:</p>
<pre><code>java.lang.NoClassDefFoundError: Could not initialize class foo.bar.Job
</code></pre>
<p>I can confirm that the jar file contains the class that cannot be ... | <p>Answering to myself after having determined the root cause of the issue.</p>
<p>Regarding Linkerd, everything was correctly setup. The main precaution that one needs to take is adding the <code>linkerd-await</code> binary to the Flink image and making sure to override the entrypoint for the jobmanager since otherwis... |
<p>I have this use case:</p>
<blockquote>
<p>When there is much load on a specific queue in RabbitMQ, i want to start more replicas. Let's say, my app can handle 5 messages ( = tasks) simultaneously and they all take 1 min to complete. When there are more than 10 "ready" messages in the rabbitmq Queue, i want... | <p>Your use case is essentially autoscaling based on RabbitMQ queue length, which is a bit challenging due to the limitations of the native Kubernetes HPA controller, as it "typically" autoscale based on CPU and memory usage.</p>
<p><strong>Alternatively, you may consider utilizing <a href="https://keda.sh/do... |
<p>I am getting the IP address assigned to the pod using <code>kubectl get pods -o custom-columns="POD_IP":.status.podIPs</code> command.</p>
<p>And based on same approach, I am using <code>kubectl get pods -o custom-columns="POD_PORT":.spec.containers.ports.containerPort</code> command to get the p... | <p>Try:</p>
<pre class="lang-bash prettyprint-override"><code>kubectl get pods \
--output=custom-columns=\
"POD_PORT":.spec.containers[*].ports[*].containerPort
</code></pre>
<p>You can include <code>.metadata.name</code> too to aid clarity:</p>
<pre class="lang-bash prettyprint-override"><code>kubectl get po... |
<p>I have a deployment with multiple pods in Azure Kubernetes Service.<br>
There is a K8s service that is used to connect deployment pods.<br>
The service has a private IP accessible in Azure Virtual Network. The service type is LoadBalancer.<br>
I want to monitor and see if the service is up. If it is not up, trigger ... | <p>Using Azure Application Insights there are two [private monitoring options] (<a href="https://learn.microsoft.com/en-us/azure/azure-monitor/app/availability-private-test" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/azure-monitor/app/availability-private-test</a>) described.</p>
<ol>
<li>Allowin... |
<p>I'm having kafka cluster deployed in openshift in different namespace also opentelemetry is delpoyed in another namespace.</p>
<p>This is my yaml file for opentelemetry</p>
<pre><code>apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: demo-otlcol-otlp
namespace: otlcol-demo
spec:
... | <p>I can confirm what <a href="https://stackoverflow.com/users/396567/michael-hausenblas">Michael</a> said. Kafka is atm not supported and not part of Red Hats otel distro. <a href="https://github.com/os-observability/redhat-opentelemetry-collector/blob/52c064b83e0531809db6f5faf4057e127cadf5bd/manifest.yaml" rel="nofol... |
<p>I got a .net6 service hosted in an AKS cluster with app insight and profiler enabled. Logs appear in app insight and live metrics are working and I can see every action in app insight.</p>
<p>When I click the "Profile now" button in the performance tab, it says a profiling session is in progress and I fire... | <p>Sadly, Azure profiler just does not support dotnet 6. There might be other solutions for Azure witr this dotnet version</p>
|
<p>I have created an EKS cluster with ALB setup. I tried installing superset by following the steps provided in <a href="https://superset.apache.org/docs/installation/running-on-kubernetes/" rel="nofollow noreferrer">https://superset.apache.org/docs/installation/running-on-kubernetes/</a></p>
<p>my-values.yaml</p>
<pre... | <p>If you're running PostgreSQL, and you're using EKS 1.23 or higher, you'll need to install a CSI driver, e.g. the <a href="https://github.com/kubernetes-sigs/aws-ebs-csi-driver" rel="nofollow noreferrer">EBS CSI driver</a>. Starting with 1.23, EKS no longer ships with a storage driver (the in-tree driver was deprecat... |
<p>I have deploy my kubernetes cluster in AWS EKS. I have setup prometheus and grafana to monitor the EKS cluster. How to find Max no of running pods throughout the day ??</p>
| <p>In the query editor of the graph panel, enter the PromQL query to retrieve the maximum number of running pods throughout the day. The query should use the max_over_time function to find the highest value over a time range.
This one worked for me - <code>max_over_time(kube_pod_status_phase{phase="Running"}[... |
<p>Im having k8s controller which needs to install some resources and update the status and condition accordantly</p>
<p>The flow in the reconcile is like following:</p>
<ol>
<li>Install the resource and don’t wait</li>
<li>Call to the function <code>checkAvailability</code> and update the status accordantly if ready/ ... | <p>To your questions:</p>
<ol>
<li><p>This is the first time that I use status and conditions, is it right way or do I miss something?</p>
<p>Your approach to managing the status and conditions of Kubernetes resources is generally fine. The <a href="https://book-v1.book.kubebuilder.io/basics/status_subresource.html" re... |
<p>I think I'm going crazy. I had kubernetes setup to deploy a postgres database. Worked fine. I wanted to add an init script so I made a custom image, deployed to private docker hub repo, and then updated the deployment to pull new image. But no matter what I do kubernetes keeps deploying the old database.... I update... | <p>Figured it out. The kubernetes retention policy of the volume was set to retain. I tried setting it to delete but the data was still persisting. I ended up logging on to the instance and blowing away everything where I mounted the PV. This forced the pod to restart, and when it did it actually went through the corre... |
<p>I would like to list pods created within 24 hours. I didn't find any kubectl commands or anything to get those. Could anyone please help me with the kubectl command to get only the pods created in last 24 hours.</p>
| <p>Previous answers didn't work to me, the regex seems wrong and the field with the actual creationTimestamp is the sixth as per today, so :</p>
<pre><code>kubectl get pods -A --sort-by=.metadata.creationTimestamp | awk 'match($6,/^[0-9]+[sm]{1}|^[0-5][0-9]m|^[1-9]h|^1[0-9]*h|^2[0-4]h/) {print $0}'
</code></pre>
<p>It ... |
<p>I just started working with ArgoCD and I have an issue I can't find the answer for.</p>
<p>I have a file called <code>clusters.yaml</code> in my Git repo:</p>
<pre><code>clusters:
- name: cluster1-eu-k8s-002
url: https://cluster1.hcp.northeurope.azmk8s.io:443
values:
nameOverride: ReplaceWithThis
</code></p... | <p>In the <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/application-set/" rel="nofollow noreferrer">Argo CD <code>ApplicationSet</code> controller</a>, you are using <code>{{ index .Clusters.values "nameOverride" }}</code> to access the <code>nameOverride</code> value. However, <code>Clusters</... |
<p>I have a docker-compose file that connects an app with a database.
I'm using docker secrets to hide sensitive data, such as in this case DB credentials, while I can do so with the database service, I'm not able to do the same within the app service, specifically the ConnectionString.
I couldn't find much in the docu... | <p>It's actually not related to <strong>WordPress</strong>, it's general purpose only you can use similar way <em>Docker mounts</em> the <strong>secret</strong> content at <code>/run/secrets/connection_string</code></p>
<p>Your code can read the variable and it will get <strong>path</strong> from there which is <code>/... |
<p>How to achieve internal service to service communication in Anthos multiple clusters Example
service A deployed in GKE cluster and service B deployed in AKS cluster, here how we can call service A from service B (internally) ?</p>
| <p>As suggested by @Harsh Manver you can <a href="https://cloud.google.com/service-mesh/docs/unified-install/off-gcp-multi-cluster-setup" rel="nofollow noreferrer">set up a multi cluster mesh outside Google Cloud</a> to achieve internal service to service communication in Anthos multiple clusters.</p>
<p>As mentioned i... |
<p>Is it possible to modify a live Kubernetes manifest, on-the-fly and non-interactively? I know <code>kubectl edit</code> allows for this behavior, but this requires user interaction in an editor that is opened when the command is invoked. I need to be able to do this without user interaction (for example in a script,... | <p>The Answer is <code>kubectl patch</code> (<a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/" rel="nofollow noreferrer">docs</a>).</p>
<p>For example, Given a deployment you can for example update the <code>.spec.template.spec.containers[].image</code> field using th... |
<p>I've been trying to get the http-01 challenge method working with traefik v2 and cert-manager, both installed through their current helm charts. The LB endpoint can be requested through the ip and hostname, and I've tested that the http host passes on letsdebug (<code>No issues were found with <domain></code>)... | <p>We have faced the same issue and the problem was related to the fact, that the Ingress generated by the <code>certificate manger</code> contained the <code>Ingress Controller</code> reference using the deprecated Annotation <code>kubernetes.io/ingress.class</code>.</p>
<p>What we wanted:</p>
<pre><code>spec:
ingre... |
<p>In my k8 cluster I have pods running that the pod name contains the word "inventory" (actually 2pods with this name)
I need to write a shell script to delete deployment and re-deploy and then it should check the specific pod is running or not and then display a message.
Here is what I tried.</p>
<pre><code... | <p>Can you try this</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>#!/bin/bash
pod_name="devopslk"
namespace="devops"
# Get the pod status
pod_status=$(kubectl get pod... |
<p>Currently, I have two microservices. I want to send message to KubeMQ Queue from first microservice and want it to be received by Second microservice. I am able to send message to a KubeMQ Queue using below code:</p>
<pre><code>Queue queue = new Queue("QueueName", "ClientID", "localhost:5000... | <blockquote>
<p>I need a Listener in the second microservice in order to receive the message from Queue.</p>
</blockquote>
<p>Why polling, when you can be notified through the <a href="https://docs.kubemq.io/learn/message-patterns/pubsub" rel="nofollow noreferrer">KubeMQ Pub/Sub pattern</a>?</p>
<p><a href="https://i.s... |
<p>I am trying to do tls termination at pod level.
ingress(nlb) -->service(clusterip) --> pod</p>
<p>I have set ingress with ssl passthrough by adding the following annotations,</p>
<pre><code>annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/ssl-passthro... | <p>My advice: don't do it! You don't want to have to deal with certs inside your pods. Get the TLS done on your load balancers, managed by your cloud provider, or managed in your cluster by <code>cert-manager</code> and a proper cert provider (like Let's Encrypt)</p>
<p>If you really want to terminate TLS in your pod, ... |
<p>Im using nginx as a reverse proxy to serve an Express.js backend and a Vue.js frontend. The whole application runs in two Docker Compose images, one for development, and one for production. I'd like to be able to test the production image locally with <strong>HTTPS</strong> (especially because Vue's PWA framework de... | <p>With <strong>certbot</strong> there is type of verification method <strong>DNS</strong> and <strong>HTTP</strong></p>
<p><strong>DNS</strong> method verify the <strong>record</strong> in <strong>DNS</strong> while <strong>HTTP</strong> check for <strong>200</strong> response from your <strong>Endpoint</strong>.</p>
... |
<p>I am trying to mount a Kubernetes secret via a <code>kubernetes_manifest</code> like this, however, <code>port</code> is a number <code>5342</code></p>
<pre><code>resource "kubernetes_manifest" "test" {
manifest = {
"apiVersion" = "secrets-store.csi.x-k8s.io/v1alpha1"
... | <p>JMESPath does have a <a href="https://jmespath.org/specification.html#to-string" rel="nofollow noreferrer"><code>to_string</code></a> function.</p>
<p>So, you can use a JMESPath query in the <code>path</code> field and do:</p>
<pre><code>path = "to_string(port)"
</code></pre>
|
<p>I have a deployment. The pod container's have no readinessProbe(s), because the healtcheck will be configured using a BackendConfig.</p>
<p>The service is as follows:</p>
<pre><code>---
apiVersion: v1
kind: Service
metadata:
name: my-app-service
namespace: my-namespace
annotations:
cloud.google.com/neg: '{... | <p>your type field on BackendConfig is TCP, docs say only http/https allowed <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration#direct_health" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-configuration#direct_health</a></p>
|
<p>In a scenario where a zone/dc dropped and 2 master nodes out of 5 are now offline, I would like to restore etcd on the remaining 3 master nodes.</p>
<p>So far the best I could manage was restoring from etcd backup, but I found myself needing to destroy the remaining 2 and recreating them. Otherwise, I got a split br... | <p>As per this <a href="https://platform9.com/kb/kubernetes/restore-etcd-cluster-from-quorum-loss" rel="nofollow noreferrer">doc</a> by Platform9.</p>
<p><strong>Restoring ETCD Backup to Recover Cluster From Loss of Quorum</strong>:</p>
<p>Master nodes going offline or a lack of connectivity between the master nodes le... |
<p>I've setup a PostgreSQL database with Helm Chart using this ConfigMap, that contains the initial script which allows to create the databases and schemas I need:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.postgres.configmap }}
namespace: {{ .Release.Namespace }}
data:
init_script.s... | <p>Update your script with the Postgress User and database name to pass to the psql script as environmental variables.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.postgres.configmap.name }}
namespace: {{ .Release.Namespace }}
data:
init_script.sh: |+
#!/bin/bash
set -e
psq... |
<p>I just started working with ArgoCD and I have an issue I can't find the answer for.</p>
<p>I have a file called <code>clusters.yaml</code> in my Git repo:</p>
<pre><code>clusters:
- name: cluster1-eu-k8s-002
url: https://cluster1.hcp.northeurope.azmk8s.io:443
values:
nameOverride: ReplaceWithThis
</code></p... | <p>The issue you're encountering is related to the way you're accessing the <code>nameOverride</code> value from <code>clusters.yaml</code> in the <code>value</code> field of your ArgoCD ApplicationSet.</p>
<p>In your current configuration, you're using the following expression to access the value:</p>
<pre><code>value... |
<p>I've setup a PostgreSQL database with Helm Chart using this ConfigMap, that contains the initial script which allows to create the databases and schemas I need:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.postgres.configmap }}
namespace: {{ .Release.Namespace }}
data:
init_script.s... | <p>If you are using the standard <a href="https://hub.docker.com/_/postgres" rel="nofollow noreferrer">Docker Hub <code>postgres</code> image</a> and you are just trying to create a database, the easiest thing to do is to use its environment-variable settings</p>
<pre class="lang-yaml prettyprint-override"><code>image:... |
<p>I am following this tutorial: <a href="https://cloud.google.com/sql/docs/mysql/connect-instance-kubernetes" rel="nofollow noreferrer">Connect to Cloud SQL for MySQL from Google Kubernetes Engine</a>.
I have created a cluster. I have created a docker image in the repository. I have created a database. I am able to ru... | <p>I'm pretty sure that you create a cluster by default. If you did that, you used the Compute Engine default parameter that you can see here</p>
<p><a href="https://i.stack.imgur.com/FKEyE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FKEyE.png" alt="enter image description here" /></a></p>
<p>Def... |
<p>Im using nginx as a reverse proxy to serve an Express.js backend and a Vue.js frontend. The whole application runs in two Docker Compose images, one for development, and one for production. I'd like to be able to test the production image locally with <strong>HTTPS</strong> (especially because Vue's PWA framework de... | <p>If the servers are independent - You don't want to expose your production systems private key on a development machine - , you want different certificates and the question becomes "How do you use TLS on your development / testing infrastructure". This is a widely discussed question. E.g.:</p>
<p><a href="h... |
<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... | <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>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.