prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>So this is my configuration in application.yaml:</p>
<pre><code>management:
endpoint:
health:
show-details: "ALWAYS"
probes:
enabled: true
endpoints:
enabled-by-default: true
web:
exposure:
include: metrics, health, caches, restart
</code></pre>
<p>And acco... | <p>I dug a bit deeper in this issue as I found it as an interesting feature of <code>spring-boot-actuator</code>.
From my research I found out that this feature with <code>liveness</code> and <code>readiness</code> has been introduced in <code>spring-boot:2.3.0</code> so if you're using an older version this might be t... |
<p>I just started exploring kubernetes concepts. I am using helm chart to do deployment of pod. Got stucked to solve the below problem. Anyone kindly help me to unblock this issue.</p>
<p>I have three containers, lets say A, B and C. container A is having a file => "/root/dir1/sample.txt". Otherwise I can ... | <p>I think your best option is to use an emptyDir and an initContainer that mounts it to another path and copies the original files into it. Its not an uncommon pattern. See it in action in <a href="https://github.com/rabbitmq/cluster-operator/commit/60b048fde7d7314801d34d051f88a7577640efdb" rel="noreferrer">rabbitmq c... |
<p>We performed our kubernetes cluster upgrade from v1.21 to v1.22. After this operation we discovered that our nginx-ingress-controller deploymentβs pods are failing to start with the following error message:
<code>pkg/mod/k8s.io/client-go@v0.18.5/tools/cache/reflector.go:125: Failed to list *v1beta1.Ingress: the serv... | <p>@Philip Welz's answer is the correct one of course. It was necessary to upgrade the ingress controller because of the removed <code>v1beta1</code> Ingress API version in Kubernetes v1.22. But that's not the only problem we faced so I've decided to make a "very very short" guide of how we have finally ended... |
<p>I am planning on building a K8s cluster with many microservices (each running in pods with services ensuring communication). I'm trying to understand how to ensure communication between these microservices is secure. By communication, I mean HTTP calls between microservice A and microservice B's API.</p>
<p>Usually,... | <p>Not sure how to answer this vast question, however, i will try my best.</p>
<p>There are multiple solutions that you could apply but again there is nothing in K8s for auth you can use.</p>
<p>Either you have to set up the third-party OAuth server or IAM server etc, or you write and create your own microservice.</p>
... |
<p>I installed the <a href="https://github.com/prometheus-operator/kube-prometheus" rel="nofollow noreferrer">kube-prometheus-0.9.0</a>, and want to deploy a sample application on which to test the Prometheus metrics autoscaling, with the following resource manifest file: (hpa-prome-demo.yaml)</p>
<pre class="lang-yaml... | <p>It is worth knowing that using the <a href="https://github.com/prometheus-operator/kube-prometheus" rel="nofollow noreferrer">kube-prometheus</a> repository, you can also install components such as <strong>Prometheus Adapter for Kubernetes Metrics APIs</strong>, so there is no need to install it separately with Helm... |
<p>I had installed <code>kube-prometheus-stack</code> from the helm chart repo <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">prometheus-community</a></p>
<pre><code>(k8s: minikube) $ kubectl get deploy,statefulset -n monitoring
NAME ... | <p>Here's how I found the answer. In a helm chart, if there is a folder named <code>charts</code>, that means that the chart is declaring chart dependencies. Looking at the <code>Chart.yaml</code>, we see the grafana dependency:</p>
<pre><code>dependencies:
- name: grafana
version: "6.21.*"
repository: ht... |
<p>I have Docker Desktop and I want to create multiple clusters so I can work on different projects. For example cluster name 1: hello and cluster name 2: world.</p>
<p>I currently have one cluster with the context of docker-desktop that actually working.</p>
| <p>To clarify I am posting Community Wiki answer.</p>
<p>A tool <code>kind</code> met your expectations in this case.</p>
<blockquote>
<p><a href="https://sigs.k8s.io/kind" rel="nofollow noreferrer">kind</a> is a tool for running local Kubernetes clusters using Docker container βnodesβ. kind was primarily designed fo... |
<p>Why do I have to use <code>--verb=list</code> option when I list all resources in the k8s namespace?</p>
<p>I read <a href="https://stackoverflow.com/questions/47691479/listing-all-resources-in-a-namespace">this question</a> and linked GitHub issue, and they worked for me. However, I cannot understand why <code>--ve... | <p>The question you quoted was to list resources. To be able to list, the resource must support the listing. Based on <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#resource-types" rel="nofollow noreferrer">official documentation</a>:</p>
<pre><code>kubectl api-resources --verbs=list,get # All ... |
<p>I use saml2aws with Okta authentication to access aws from my local machine. I have added k8s cluster config as well to my machine.
While trying to connect to k8s suppose to list pods, a simple <code>kubectl get pods</code> returns an error <code>[Errno 2] No such file or directory: '/var/run/secrets/eks.amazonaws.c... | <p>To Integrate Saml2aws with OKTA , you need to create a profile in saml2aws first</p>
<ul>
<li>Configure Profile</li>
</ul>
<pre><code>saml2aws configure \
--skip-prompt \
--mfa Auto \
--region <region, ex us-east-2> \
--profile <awscli_profile> \
--idp-account <saml2aws_profile_name>> ... |
<p>Im trying to make an ingress for the minikube dashboard using the embedded dashboard internal service.</p>
<p>I enabled both <code>ingress</code> and <code>dashboard</code> minikube addons.</p>
<p>I also wrote this ingress YAML file :</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: da... | <p>I have also faced the same issue with minikube(v1.25.1) running in my local.</p>
<p><code>kubectl get ingress -n kubernetes-dashboard</code></p>
<pre><code>NAME CLASS HOSTS ADDRESS PORTS AGE
dashboard-ingress nginx dashboard.com localhost 80 34m
</code></pre>
<p>After d... |
<p>I'm running a kind cluster and from one of the pods I need to access the host machine. I know in minikube you can access it using <code>10.0.0.2</code> is there some way I can access it, the same way I could use <code>host.docker.internal</code> on Docker Desktop?</p>
| <p>Docker uses default subdomain 172.17.0.0/16, and assign the pods IP address 172.17.X.X</p>
<p>Host server can be access using ip address 172.17.0.1</p>
|
<p>When running 'kubectl top nodes' has error:</p>
<p>Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)</p>
<pre><code>k8s version:
kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a... | <p>i had solved this problem, add <code>hostNetwork: true</code> to metries-server.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
spec:
selector:
matchLabels:
k8s... |
<p>I need to deploy an application that have Europe/Rome timezone.</p>
<p>I applied the following deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
labels:
app: myapp
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
... | <p>If you remove the env variable, that should be works. for example:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
namespace: test-timezone
labels:
app: myapp
spec:
replicas: 1
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: mya... |
<p>I've one workflow in which I'm using <code>jsonpath</code> function for a output parameter to extract a specific value from json string, but it is failing with this error <code>Error (exit code 255)</code></p>
<p>Here is my workflow</p>
<pre><code>apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateN... | <p>When an expression fails to evaluate, Argo Workflows simply does not substitute the expression with its evaluated value. Argo Workflows passes the expression <em>as if it were the parameter</em>.</p>
<p><code>{{=}}</code> "expression tag templates" in Argo Workflows must be written according to the <a href... |
<p>I have an environment made of pods that address their target environment based on an environment variable called <code>CONF_ENV</code> that could be <code>test</code>, <code>stage</code> or <code>prod</code>.</p>
<p>The application running inside the Pod has the same source code across environments, the configuratio... | <p>If I understand your goal correctly, I think you may be grossly over-complicating things. I <em>think</em> you want a common properties file defined in your base, but you want to override specific properties in your overlays. Here's one way of doing that.</p>
<p>In base, I have:</p>
<pre><code>$ cd base
$ tree
.
βββ... |
<p>I would like to be able to deploy the AWS EFS CSI Driver Helm chart hosted at <a href="https://kubernetes-sigs.github.io/aws-efs-csi-driver/" rel="nofollow noreferrer">AWS EFS SIG Repo</a> using Pulumi. With Source from <a href="https://github.com/kubernetes-sigs/aws-efs-csi-driver" rel="nofollow noreferrer">AWS EFS... | <p>You're using the wrong version in your chart invocation.</p>
<p>The version you're selecting is the application version, ie the release version of the underlying application. You need to set the Chart version, see <a href="https://helm.sh/docs/topics/charts/#charts-and-versioning" rel="nofollow noreferrer">here</a> ... |
<p>I am trying to run a Spark job on a separate master Spark server hosted on kubernetes but port forwarding reports the following error:</p>
<pre class="lang-none prettyprint-override"><code>E0206 19:52:24.846137 14968 portforward.go:400] an error occurred forwarding 7077 -> 7077: error forwarding port 7077 to po... | <p>After tinkering with it a bit more, I noticed this output when launching the helm chart for Apache Spark <code>** IMPORTANT: When submit an application from outside the cluster service type should be set to the NodePort or LoadBalancer. **</code>.</p>
<p>This led me to research a bit more into Kubernetes networking.... |
<p>I am getting <code>ServiceUnavailable</code> error when I try to run <code>kubectl top nodes</code> or <code>kubectl top pods</code> command in EKS. I am running my cluster in EKS , and I am not finding any solution for this online. If any one have faced this issue in EKS please let me know how we can resolve this i... | <p>Download the <a href="https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml" rel="nofollow noreferrer">components.yaml</a>, find and replace 4443 to 443 and do a <code>kubectl replace -f components.yaml -n kube-system --force</code>.</p>
|
<p>I'm trying to deploy an EKS self managed with Terraform. While I can deploy the cluster with addons, vpc, subnet and all other resources, it always fails at helm:</p>
<pre><code>Error: Kubernetes cluster unreachable: the server has asked for the client to provide credentials
with module.eks-ssp-kubernetes-addons.mod... | <p>OP has confirmed in the comment that the problem was resolved:</p>
<blockquote>
<p>Of course. I think I found the issue. Doing "kubectl get svc" throws: "An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:iam::xxx:user/terraform_deploy is not authorized to perform: s... |
<p>While mounting my EBS volume to the kubernetes cluster I was getting this error :</p>
<pre><code> Warning FailedMount 64s kubelet Unable to attach or mount volumes: unmounted volumes=[ebs-volume], unattached volumes=[ebs-volume kube-api-access-rq86p]: timed out waiting for the condition
</code></pr... | <p><code>This is my ebs-volume the last one which I have connected to the master node...</code></p>
<p>Pod that wish to mount this volume must run on the same node as the PV currently attached. Given the scenario you described; it is currently mounted on your Ubuntu based master node therefore you need to run pod on th... |
<p>I have a situation where my AKS cluster is already in place, two AKS clusters are there & they are internally available within their security zones only. I don't want to go via internet to access the internal resources within the cluster from another cluster.</p>
<p>I was exploring private link service & end... | <p>I have achieved this by creating private link service on load balancer where my internal ingress (private subnet) is connected in destination cluster. This will require resource ID & load balancer details.</p>
<p>Then created a private endpoint to the private link service in my source cluster that will require s... |
<p>I read in a book written by Helm creators the following fact about the --force option :</p>
<blockquote>
<p>Sometimes, though, Helm users want to make sure that the pods are restarted. Thatβs
where the --force flag comes in. Instead of modifying the Deployment (or similar
object), it will delete and re-create it. Th... | <p>Let's take a hypothetical minimal Deployment (many required details omitted):</p>
<pre class="lang-yaml prettyprint-override"><code>spec:
replicas: 3
template:
spec:
containers:
- image: abc:123
</code></pre>
<p>and you change this to <em>only</em> increase the replica count</p>
<pre class="lan... |
<p>I am not able to communicate between two services.</p>
<p>post-deployment.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: python-data-deployment
labels:
spec:
replicas: 1
selector:
matchLabels:
app: python-web-selector
tier: backend
template:
metadata:
labels:
... | <p>Are you able to connect to your pods maybe try port-forward to see if you can connect & then check the connectivity in two pods.
Last check if there is default deny network policy set there - maybe you have some restrictions at network level.</p>
<pre><code>kubectl get networkpolicy -n <namespace>
</code><... |
<p>Hi all we have a Flink application with blue-green deployment which we get using the Flink operator.</p>
<p><a href="https://github.com/lyft/flinkk8soperator" rel="nofollow noreferrer">Flinkk8soperator</a> for Apache Flink. The operator spins up the following three K8s services after a deployment:</p>
<pre><code>my-... | <p>Unfortunately that's not possible OOB to use any kind of <code>regex/wildcards/jsonpath/variables/references</code> inside <code>.backend.serviceName</code> inside Ingres controller.
You are able to use regex only in <code>path</code>: <a href="https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-match... |
<p>I am currently building a CI/CD pipeline where I am trying to test a simple nginx deployment, the problem is when I run <code>kubectl apply -f ./nginx-demplyment.yaml</code> I only get the output that resources got created/updated.</p>
<p>In my use case I the first thing i get is:</p>
<pre class="lang-sh prettyprint... | <p>You can use <code>kubectl wait</code> to wait for the deployment to be in a certain condition. Another option (or possibly used in combination) is to retry curl until the request returns a 200. An example of kubectl wait for your nginx deployment to become ready:</p>
<pre><code>kubectl wait --for=condition=available... |
<p>I'm using GCP composer to run an algorithm and at the end of the stream I want to run a task that will perform several operations copying and deleting files and folders from a volume to a bucket I'm trying to perform these copying and deleting operations via a <code>kubernetespodoperator</code>. I'm having hardship ... | <p>I found a technic for running multiple commands.
First I found the relations between Kubernetespodoperator cmds and arguments properties to Docker's ENTRYPOINT and CMD.</p>
<p>Kubernetespodoperator cmds overwrite the docker original ENTRYPOINT
and Kubernetespodoperator arguments is equivalent to docker's CMD.</p>
<p... |
<p>I have a GKE cluster with 1 node-pool and 2 nodes in it, one with node affinity to only accept pods of production and the other to development and testing pods. For financial purposes, I want to configure like a cronJob or something similar on the dev/test node so I can spend less money but I don't know if that's po... | <p>Yes, you can add another node pool named <code>test</code> so you can have two node pools; one to <code>develop</code> and one to <code>test</code>. You can also turn on the <code>auto [scaling]</code><a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#overview" rel="nofollow norefer... |
<p>I am trying to get ingress EXTERNAL-IP in k8s. Is there any way to get the details from terraform data block. like using data "azurerm_kubernetes_cluster" or something?</p>
| <p>you can create the Public IP in advance with terraform and assign this IP to your ingress service:</p>
<p>YAML:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/azure-load-balancer-resource-group: myResourceGroup # only needed if the LB is in another RG
name: ingr... |
<p>I am following <a href="https://istio.io/latest/docs/tasks/traffic-management/egress/egress-control/#access-an-external-https-service" rel="nofollow noreferrer">this guide</a>.</p>
<p>Ingress requests are getting logged. Egress traffic control is working as expected, except I am unable to log egress HTTP requests. W... | <p>For ingress traffic logging I am using <code>EnvoyFilter</code> to set log format and it is working without any additional configuration. In the egress case, I had to set <code>accessLogFile: /dev/stdout</code>.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: install.istio.io/v1alpha1
kind: IstioOp... |
<p>I have a huge patch file that I want to apply to specific overlays. I usually patch files under overlays as it is supposed to be. But the file is same and I do not want to copy it to each overlay. If I could keep my patch file <code>app-new-manifest.yaml</code> under base and patch it under overlay with a single lin... | <p>You can't include a file that is outside of you current directory, but you <em>can</em> include another directory that has a <code>kustomize.yaml</code> file. So organize your layout like this:</p>
<pre><code>.
βββ base
βββ overlay
βββ patched_based
βββ environment1
βββ environment2
βββ environment3
... |
<p>We have <a href="https://github.com/jonashackt/tekton-argocd-eks" rel="nofollow noreferrer">a full-blown setup using AWS EKS with Tekton</a> installed and want to use ArgoCD for application deployment.</p>
<p><a href="https://argo-cd.readthedocs.io/en/stable/getting_started/" rel="nofollow noreferrer">As the docs st... | <p><a href="https://argo-cd.readthedocs.io/en/stable/getting_started/#4-login-using-the-cli" rel="nofollow noreferrer">The same docs tell us how to extract the password</a> for argo with:</p>
<pre><code>kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
<... |
<p>Now I am remote debugging my java program in kubernetes(v1.15.2) using kubectl proxy forward like this:</p>
<pre><code>kubectl port-forward soa-report-analysis 5018:5018 -n dabai-fat
</code></pre>
<p>I could using intellij idea to remote connect my localhost port 5018 to remote debugging my pod in kubernetes clust... | <p>I could suggest for anyone who looks for ways to debug Java(and Go, NodeJS, Python, .NET Core) applications in Kubernetes to look at <strong>skaffold</strong>. <br/>
It simple CLI tool that uses already existing build and deploy configuration that you used to work with.
There is no need for additional installation i... |
<p>I have a deployment of my backend app which has 6 replicas. In the code of the app, I have a node.js cronjob running every minute. But the problem is that because I have 6 replicas, it runs 6 times in parallel. I want to send env variable to exactly only one Pod in the deployment to ensure that only 1 Pod performs t... | <p>Let Kubernetes schedule a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">CronJob</a> in addition to the application</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
name: app-cron
spec:
schedule: "* * * * *"
jobTemplate:
spec:
... |
<p>In Kubernetes, are <code>podAffinity</code> and <code>podAntiAffinity</code> weights compared to each other? Or independently? What about <code>podAffinity</code> and <code>nodeAffinity</code>? Would <code>podAntiAffinity</code> outweight the <code>podAffinity</code> in the below example? And what if <code>nodeAffin... | <p>All affinity settings for both pods and nodes are weighed the same way if you don't overwrite the default individual weight of 1.</p>
<p>During execution the occurrence of affinity conditions on a node is multiplied by the weight of the condition.</p>
<pre><code>pod a has an affinity to b
pod a has an anti-affinity ... |
<p>How can I make a flask session work across multiple instances of containers using Kubernetes? Or does Kubernetes always maintain the same container for a given session?</p>
| <p>Default Flask sessions are stored client-side (in the browser) as a cookie and cryptographically signed to prevent tampering. Every request to your Flask application is accompanied by this cookie. Therefore, if all running containers have the same app (at least the same secret key used for signing), then they should... |
<p>I love elastic search so on my new project I have been trying to make it work on Kubernetes and skaffold</p>
<p>this is the yaml file I wrote:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: eks-depl
spec:
replicas: 1
selector:
matchLabels:
app: eks
template:
metadata:
... | <p>Here is example YAML file you should consider running if you are planning to run the single Node elasticsearch cluster on the Kubernetes</p>
<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: elasticsearch
component: elasticsearch
release: elasticsearch
name: elasticsearch
name... |
<p>I'm having issues getting the <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">ingress-nginx</a> Helm Chart to install via Terraform with Minikube, yet I'm able to install it successfully via the command line. Here is my vanilla Terraform code -</p>
<pre><code>provider "kubernetes... | <p>This is because Terraform waits for LoadBalancer to get a public IP address, but this never happens, so the <code>Error: timed out waiting for the condition</code> error occurs:</p>
<pre><code>$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) ... |
<p>We are using an ingress (<code>kubernetes_ingress.db_admin_ingress</code>) to expose the service (<code>kubernetes_service.db_admin</code>) of a deployment (<code>kubernetes_deployment.db_admin</code>) in Google Kubernetes Engine (GKE) with Terraform.</p>
<p>When Terraform creates the ingress, a Level 7 Load Balance... | <p>According to Google Kubernetes Engine (GKE) official documentation <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#health_checks" rel="nofollow noreferrer">here</a>, you are able to customize <code>ingress</code>/Level 7 Load Balancer health checks through either:</p>
<ul>
<li><p>the <code>... |
<p>I was looking for method to upgrade k8s version without downtime for Azure AKS and found this amazing blog post <a href="https://omichels.github.io/zerodowntime-aks.html" rel="nofollow noreferrer">https://omichels.github.io/zerodowntime-aks.html</a> but I got error at the start only</p>
<p>So currently running versi... | <p>Here is how I upgraded without downtime, for your reference.</p>
<ol>
<li><p>Upgrade control plane only. (Can finish it on azure portal)<a href="https://i.stack.imgur.com/TcPX2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TcPX2.png" alt="enter image description here" /></a></p>
</li>
<li><p>Add a new No... |
<p>From our Tekton pipeline we want to use ArgoCD CLI to do a <code>argocd app create</code> and <code>argocd app sync</code> dynamically based on the app that is build. We created a new user <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#create-new-user" rel="nofollow noreferrer">as... | <p>The problem is mentioned in <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#local-usersaccounts-v15" rel="nofollow noreferrer">Argo's useraccounts docs</a>:</p>
<blockquote>
<p>When you create local users, each of those users will need additional
RBAC rules set up, otherwise they w... |
<p>I have this microservice based on Spring Boot 2.2.7 and it works very well when locally. However when I try to deploy in a Kubernetes cluster, it fails on loading the Config Map values at the startup and, consequently, everything fails from this point:</p>
<p>The container logging is this:</p>
<pre><code>2022-02-08 ... | <p>I finally found out the cause of this problem.</p>
<p>It's necessary to include this dependency in the pom.xml:</p>
<pre><code><dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-config</artifactId>
<version>${spring-cloud-kuberne... |
<p>I am a bit desperate and I hope someone can help me. A few months ago I installed the <a href="https://www.eclipse.org/packages/packages/cloud2edge/installation/" rel="nofollow noreferrer">eclipse cloud2edge</a> package on a kubernetes cluster by following the installation instructions, creating a persistentVolume a... | <p>based on the iconic <em>Failed to create SSL Connection</em> output in the logs, I assume that you have run into the dreaded <em>The demo certificates included in the Hono chart have expired</em> problem.</p>
<p>The Cloud2Edge package chart is being updated currently (<a href="https://github.com/eclipse/packages/pul... |
<p>I have deployed a MySQL database (statefulset) on Kubernetes zonal cluster, running as a service (GKE) in Google Cloud Platform.</p>
<p>The zonal cluster consist of 3 instances of type e2-medium.</p>
<p>The MySQL container cannot start due to the following error.</p>
<pre><code>kubectl logs mysql-statefulset-0
2022-... | <p>I ran a few more tests but I couldn't replicate this.</p>
<p>To answer this one correctly, we would need much more logs. Not sure if you still have them. If I could guess which was the root cause of this issue I would say it was connected with the PersistentVolume.</p>
<p>In one of the <a href="https://github.com/ku... |
<p>I'm trying to migrate my Nextcloud instance to a kubernetes cluster. I've succesfully deployed a Nextcloud instance using <strong>openEBS-cStor</strong> storage. Before I can "kubectl cp" my old files to the cluster, I need to put Nextcloud in maintenance mode.</p>
<p>This is what I've tried so far:</p>
<u... | <p>The <code>su</code> command fails because there is no shell associated with the <code>www-data</code> user.</p>
<p>What worked for me is explicitly specifying the shell in the <code>su</code> command:</p>
<pre class="lang-sh prettyprint-override"><code>su -s /bin/bash www-data -c "php occ maintenance:mode --on&... |
<p>I have kubernets cluster in gcp with docker container runtime. I am trying to change docker container runtime into containerd. Following steps shows what I did.</p>
<ol>
<li>New node pool added ( nodes with containerd )</li>
<li>drained old nodes</li>
</ol>
<p>Once I perform above steps I am getting " Pod is bl... | <p>You need to add the once annotation to POD so that cluster autoscaler can remove that POD from POD safe to evict.</p>
<pre><code>cluster-autoscaler.kubernetes.io/safe-to-evict": "true"
</code></pre>
<p>above annotation, you have to add in into POD.</p>
<p>You can read more at : <a href="https://cloud.... |
<p>I have a yml file called <code>output.yml</code> which contains a K8s Service, Deployment and Ingress resources like so (lots of fields omitted for brevity):</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: app-name
app.kubernetes.io/instance: instance-name
spec:
sele... | <p>It can be accomplished by doing a <a href="https://mikefarah.gitbook.io/yq/operators/recursive-descent-glob#recursively-find-nodes-with-keys" rel="nofollow noreferrer">recursive decent</a> to identify keys matching your string and update their value part using <code>|=</code></p>
<pre class="lang-none prettyprint-ov... |
<p>I have an application that has react in the front-end and a node service in the back-end. The app is deployed in the GKE cluster. Both the apps are exposed as a NodePort Service, and the fan out ingress path is done as follows :</p>
<pre><code>- host: example.com
http:
paths:
- backend:
service... | <p>If IAP is setup using BackendConfig, then you can have two separate BackendConfig objects for frontend and backend applications but both of them use the same secrete (secretName) for oauthclientCredentials.</p>
<p><em><strong>For frontend app</strong></em></p>
<pre><code>apiVersion: cloud.google.com/v1beta1
kind: Ba... |
<p>Prometheus supports multiple roles in its <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config" rel="nofollow noreferrer">Kubernetes SD config</a></p>
<p>I'm confused about whether I should use a <a href="https://prometheus.io/docs/prometheus/latest/configuration/co... | <p>In short, there are two major differences:</p>
<ul>
<li>an <code>endpoints</code> role gives you more data in labels (to which service a pod belongs, for example);</li>
<li>a <code>pod</code> role targets <strong><em>any</em></strong> pod out there and not just those belonging to a service.</li>
</ul>
<p>What's best... |
<p>I am using <a href="https://kustomize.io/" rel="nofollow noreferrer">https://kustomize.io/</a> have below is my kustomization.yaml file,</p>
<p>I would like to pass <code>newTag</code> image version to labels on <code>deployment.yaml</code> when i use ArgoCD to apply this file. Does anyone have any idea without usin... | <p>You can't do this directly with <code>newTag</code> value. However you can use a PatchTransformer built-in plugin to change <code>appversion</code> value.</p>
<p>Add this</p>
<pre class="lang-yaml prettyprint-override"><code>resources:
- deployment.yaml
patches:
- patch: |-
- op: replace
path: /spe... |
<p>I have a <code>ConfigMap</code> where I am including a file in its data attribute and I need to replace several strings from it. But I'm not able to divide it (<strong>the "replaces"</strong>) into <strong>several lines</strong> so that it doesn't get a giant line. How can I do this?</p>
<p>This is what I ... | <blockquote>
<p>What is the right syntax to do this?</p>
</blockquote>
<p>It is well described in <a href="https://helm.sh/docs/chart_template_guide/yaml_techniques/#controlling-spaces-in-multi-line-strings" rel="nofollow noreferrer">this documentation</a>. There are many different ways to achieve your goal, it all dep... |
<p>I am trying to connect a folder in windows to a container folder. This is for a .NET app that needs to read files in a folder. In a normal docker container, with docker-compose, the app works without problems, but since this is only one of several different apps that we will have to monitor, we are trying to get kub... | <p>Glad that my initial comment solved your issue. I would like to expand my thoughts a little in a form of an official answer.</p>
<p>To mount volumes using Kubernetes on Docker Desktop for Windows the path will be:</p>
<pre class="lang-yaml prettyprint-override"><code>/run/desktop/mnt/host/c/PATH/TO/FILE
</code></pre... |
<p>Based on the instructions found here (<a href="https://kubernetes.io/docs/tasks/access-application-cluster/connecting-frontend-backend/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/connecting-frontend-backend/</a>) I am trying to create an nginx deployment and configure it u... | <p>You need to mount the configMap rather than use it as an environment variable, as the setting is not a key-value format.</p>
<p>Your Deployment yaml should be like below:</p>
<pre class="lang-yaml prettyprint-override"><code>containers:
- name: nginx
image: nginx
volumeMounts:
- mountPath: /etc/nginx
name:... |
<p>We have setup a GKE cluster using Terraform with private and shared networking:</p>
<p>Network configuration:</p>
<pre><code>resource "google_compute_subnetwork" "int_kube02" {
name = "int-kube02"
region = var.region
project = "infrastructure"
net... | <p>I have been missing the peering configuration documented here:
<a href="https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#cp-on-prem-routing" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#cp-on-prem-routing</a></p>
<pre><code>resource "go... |
<p>I try to use the post steps with the Jenkins kubernetes plugin. Does anyone has an idea?</p>
<pre><code>java.lang.NoSuchMethodError: No such DSL method 'post' found among steps
</code></pre>
<p>My pipeline:</p>
<pre><code>podTemplate(
label: 'jenkins-pipeline',
cloud: 'minikube',
volumes: ... | <p>This example shows how to use the post step using the Kubernetes plugin:</p>
<pre><code>pipeline {
agent {
kubernetes {
label "my-test-pipeline-${BUILD_NUMBER}"
containerTemplate {
name "my-container"
image "alpine:3.15.0"
command "sleep&qu... |
<p>Getting this Error from AKS Jenkins Agent pods. Any idea whats will be reason for this Error?
Troubleshooting steps i did.</p>
<p>revert Jenkins to old version => results in same Error
upgrade Jenkins to all new Version including plugins in use => Results in same Error.
Downgraded Jenkins K8s and K8s API plugi... | <p><strong>EDIT:</strong> Doesn't seem to make any difference. Still getting 5000 ms timeouts, so not sure this method works (with Environment variables at least). It might work if you are actually able to change timeout, but I haven't got that figured out.</p>
<hr />
<p>Started seeing the same issue after updating Jen... |
<p>I would like to be able to limit the amount of jobs of a given "type" that run at the same time (maybe based on their label, e.g. no more than N jobs with label <code>mylabel</code> may run at the same time).</p>
<p>I have a long running computation that requires a license key to run. I have N license key... | <p>Unfortunately there is no built-in feature to do it using labels in k8s. But since your jobs are scheduled based on unpredictable user requests, you can achieve your goal like this:</p>
<ul>
<li>create a new namespace <code>kubectl create namespace quota-pod-ns</code></li>
<li>create a ResourceQuota</li>
</ul>
<pre ... |
<p>I wrote a pipeline for an Hello World web app, nothing biggy, it's a simple hello world page.
I made it so if the tests pass, it'll deploy it to a remote kubernetes cluster.</p>
<p>My problem is that if I change the html page and try to redeploy into k8s the page remains the same (the pods aren't rerolled and the im... | <p>According to the information from <a href="https://github.com/jenkinsci/kubernetes-cd-plugin#configure-the-plugin" rel="nofollow noreferrer">Kubernetes Continuous Deploy Plugin</a> p.6. you can add <code>enableConfigSubstitution: true</code> to <code>kubernetesDeploy()</code> section and use <code>${BUILD_NUMBER}</c... |
<ul>
<li>minikube v1.25.1 on Microsoft Windows 10 Home Single Language 10.0.19043 Build 19043
<ul>
<li>MINIKUBE_HOME=C:\os\minikube\Minikube</li>
</ul>
</li>
<li>Automatically selected the virtualbox driver</li>
<li>Starting control plane node minikube in cluster minikube</li>
<li>Creating virtualbox VM (CPUs=2, Memory... | <p>Try this command - It will work. I faced the similar issue on my Laptop.
Tried multiple ways to resolve this issue however nothing has worked for me.
Also, the error message states that VT-X/AMD-V should be enabled in BIOS which is mandatory but this cannot be found in my BIOS settings.
I tried the below command to ... |
<p><code>Kubectl version</code> gives the following output.</p>
<pre><code>Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.4", GitCommit:"b695d79d4f967c403a96986f1750a35eb75e75f1", GitTreeState:"clean", BuildDate:"2021-11-17T15:48:33Z", G... | <p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p>
<p>Based on the comments provided here, there could be several reasons for this behavior.</p>
<ol>
<li>According to the documentation from the <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#ex... |
<p>I have been trying to run a Python Django application on Kubernets but not success. The application runs fine in Docker.</p>
<p>This is the yaml Deployment to Kubernets:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
creationTimesta... | <p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p>
<p>Based on the comments, the solution should be as shown below.</p>
<ol>
<li>Remove <code>volumes</code> definition from the Compose file:</li>
</ol>
<pre><code>version: "3.9"
services:
web:
build: .
... |
<h3>Present state</h3>
<p>In v1.22 Kubernetes dropped support for <code>v1beta1</code> API. That made our release pipeline crash and we are not sure how to fix it.</p>
<p>We use build pipelines to build .NET Core applications and deploy them to the Azure Container Registry. Then there are release pipelines that use <co... | <p>Have you tried changing the Ingress object's <code>apiVersion</code> to <code>networking.k8s.io/v1beta1</code> or <code>networking.k8s.io/v1</code>? <a href="https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/" rel="nofollow noreferrer">Support for Ingress in the extensions/v1beta1 API version is dropped... |
<p>I have an angular application which is deployed on apache container running on Kubernetes. I wanted to setup liveness and readiness probe for pods but I am out of ideas .Any help would be appreciated.</p>
| <p>Base on the link you provided, you can use the following as a start:</p>
<pre><code>apiVersion: v1
kind: Pod
...
spec:
...
containers:
- name: ...
...
livenessProbe:
tcpSocket:
port: 80 # <-- live when your web server is running
initialDelaySeconds: 5 # <-- wai... |
<p>I am using Kubernetes to deploy all my microservices provided by Azure Kubernetes Services.</p>
<p>Whenever I release an update of my microservice which is getting frequently from last one month, it pulls the new image from the Azure Container Registry.</p>
<p>I was trying to figure out where do these images resid... | <p>Clusters with Linux node pools created on Kubernetes v1.19 or greater default to containerd for its container runtime (<a href="https://learn.microsoft.com/en-us/azure/aks/cluster-configuration#container-runtime-configuration" rel="nofollow noreferrer">Container runtime configuration</a>).</p>
<p>To manually remove ... |
<p>I've created a NiFi cluster on the AWS EKS. The initial deployment was working fine. Later I attached Persistent volume and persistent volume claim to the NiFi setup. After starting the NiFi, I'm getting this error:</p>
<pre><code>ERROR in ch.qos.logback.core.rolling.RollingFileAppender[USER_FILE] - openFile(/opt/ni... | <p>Assuming you donΒ΄t have any issues creating pv and pvc, try to use an extra <code>initContainers</code> section to allow the NiFi user with UID and GID 1000 read and write to the provisioned EBS volume:</p>
<pre class="lang-yaml prettyprint-override"><code>initContainers:
- name: fixmount
image: busybox
command:... |
<p>What am I going wrong in the below query?</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /nginx
backend:
... | <p>According to <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">this documentation</a> you need to change ServiceName and ServicePort.</p>
<blockquote>
<p>Each HTTP rule contains (...) a list of paths (for example, <code>/testpath</code>), each of which has an assoc... |
<p>How do I access the Minio console?</p>
<p><code>minio.yaml</code></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
name: minio
labels:
app: minio
spec:
clusterIP: None
ports:
- port: 9000
name: minio
selector:
app: minio
---
apiVersion: apps/v1
... | <p>You can specify --console-address :9001 in your deployment.yaml file as below in args: section .</p>
<pre><code>args:
- server
- --console-address
- :9001
- /data
</code></pre>
<p>Same way your Service and Ingress needs to point to 9001 port now with the latest Minio.</p>
<pre><code>ports:
- protocol: TC... |
<p>This is my pod:</p>
<pre class="lang-yaml prettyprint-override"><code>spec:
containers:
volumeMounts:
- mountPath: /etc/configs/config.tmpl
name: config-main
readOnly: true
subPath: config.tmpl
volumes:
- configMap:
defaultMode: 420
name: config-main
name: config-main
... | <p>To mount as file instead of directory try:</p>
<pre><code>spec:
containers:
volumeMounts:
- mountPath: /etc/configs/config.tmpl
name: config-main
readOnly: true
subPath: config.tmpl
volumes:
- configMap:
defaultMode: 420
items:
- key: config.tmpl
path: config... |
<p>I'm trying to configure a Horizontal Pod Autoscaler (HPA) on Google Kubernetes Engine (GKE) using External Metrics from an Ingress LoadBalancer, basing the configuration on instructions such as</p>
<p><a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/external-metrics-autoscaling" rel="noreferrer">h... | <p>Maybe someone would find this helpful, though the question is old.</p>
<p>My working config looks like next:</p>
<pre><code> metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 95
- type: External
external:
metric:
name: lo... |
<p>I have a cluster, I created namespaces for different teams. Then, I tried to apply an ingress to one namespace with this command <code>kubectl apply -f ing2_dev_plat.yaml -n namespace_name</code>.</p>
<p>After, this error was thrown. How can I properly configure the work of ingress controller in several namespaces?<... | <p>As I said in my comment under the question:</p>
<pre class="lang-text prettyprint-override"><code>nginx: [emerg] duplicate location "/" in /tmp/nginx-cfg1414424955:1045
</code></pre>
<p>may indicate you have the same location defined twice.</p>
<p>If you have any other Ingress resources with <code>path: /<... |
<p>In local working fine but when i deployed on digital ocean Kubernetes server then showing error. please help....</p>
<p><a href="https://i.stack.imgur.com/VxIXr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VxIXr.png" alt="enter image description here" /></a></p>
| <p>Check your node version. It happening in new version of node.</p>
|
<p>Recently my kafka producer running as a cronjob on a kubernetes cluster has started doing the following when pushing new messages to the queue:</p>
<pre><code>{"@version":1,"source_host":"<job pod name>","message":"[Producer clientId=producer-1] Resetting the last s... | <p>Reason:</p>
<blockquote>
<p>the Java API mode generator cannot connect with Kafka</p>
</blockquote>
<p>Solution:</p>
<blockquote>
<p>On each server Add a sentence to the properties file</p>
</blockquote>
<pre class="lang-sh prettyprint-override"><code>host.name = server IP;
</code></pre>
|
<p>I deployed Jenkins via Helm chart(<a href="https://github.com/jenkinsci/helm-charts/releases/tag/jenkins-3.11.4" rel="nofollow noreferrer">jenkins-helm:3.11.4</a>) on my local Kubernetes cluster(rancher desktop). I installed docker on <code>jenkins/inbound-agent</code> image because it is not included where I am usi... | <p>First find the group id of docker from the Host</p>
<pre><code>$ grep docker /etc/group
docker:x:999:
</code></pre>
<p>Then create a user in the Dockerfile which its group is the same is docker group id.</p>
<pre><code>RUN groupadd -g 999 tech
RUN useradd -g tech tech
USER tech
</code></pre>
|
<p>So we are in the process of moving from yarn 1.x to yarn 2 (yarn 3.1.1) and I'm getting a little confused on how to configure yarn in my CI/CD config. As of right now our pipeline does the following to deploy to our kubernetes cluster:</p>
<p>On branch PR:</p>
<ol>
<li><p>Obtain branch repo in gitlab runner</p>
</li... | <p>I had the same question and came to the same conclusion as you. I could not find an easy way to perform a production build on yarn 2. Yarn Workspaces comes closest but I did find the paragraph below in the documentation:</p>
<blockquote>
<p>Note that this command is only very moderately useful when using zero-instal... |
<p>We are trying to configure local-storage in Rancher and storage provisioner configured successfully.
But when I create pvc using local-storage sc its going in pending state with below error.</p>
<pre><code> Normal ExternalProvisioning 4m31s (x62 over 19m) persistentvolume-controller ... | <p>The key to your problem was updating PSP.</p>
<p>I would like to add something about PSP:</p>
<p>According to <a href="https://cloud.google.com/kubernetes-engine/docs/deprecations/podsecuritypolicy" rel="nofollow noreferrer">this documentation</a> and <a href="https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-... |
<p>I have a small instance of influxdb running in my kubernetes cluster.<br>
The data of that instance is stored in a persistent storage.<br>
But I also want to run the backup command from influx at scheduled interval.<br></p>
<pre><code>influxd backup -portable /backuppath
</code></pre>
<p>What I do now is exec into t... | <p>You can consider running a CronJob with <a href="https://bitnami.com/stack/kubectl/containers" rel="nofollow noreferrer">bitnami kubectl</a> which will execute the backup command. This is the same as <code>exec into the pod and run</code> except now you automate it with CronJob.</p>
|
<p>I have few questions regarding how a random string part in kubernetes podname is decided .</p>
<p>how is pod-template-hash decided ?? ( i understand that it is a random string generated by deployment controller). But exactly what are the inputs which the deployment controller considers before generating this random ... | <p>10 characters? That is only the alphanumeric suffix of the replica set name. Pods under a replica set will have additional suffixes of a dash plus 5 characters long alphanumeric string.</p>
<p>The name structure of a Pod will be different depending on the controller type:</p>
<ul>
<li>StatefulSet: StatefulSet name +... |
<p>Shortly, there are two services that communicates with each others via HTTP REST APIs. My deployment is running in an AKS cluster. For ingress controller, I installed this Nginx controller helm chart:
<a href="https://kubernetes.github.io/ingress-nginx" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-... | <p>This is possible with Azure Load Balancer with <a href="https://learn.microsoft.com/en-us/azure/load-balancer/egress-only" rel="nofollow noreferrer">outbound rules</a>; which the LB will do a SNAT and your "other service" will see the fixed frontend public IP. Another method is use <a href="https://learn.m... |
<p>I want to use API endpoint health check like <code>/healthz</code> or <code>/livez</code> or <code>/readyz</code>.
I recently heard about it, tried to search but didn't find any place which tell me how we use it.
I see that <code>/healthz</code> is deprecated.
Can you tell me if have to use it in a pod definition fi... | <p>You can refer to <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/" rel="nofollow noreferrer">these docs</a> for an explanation of how "health checks", or probes as they're called in Kubernetes, work. For your question you may be particularly int... |
<p>I am running a sample webapp python in Kubernetes.
I am not able to figure out how I make use of probes here.</p>
<ol>
<li><p>I want app to recover from broken states by automatically restarting pods</p>
</li>
<li><p>Route the traffic to the healthy pods only.</p>
</li>
<li><p>Make sure the database is up and runnin... | <p>You need to define both</p>
<ul>
<li><code>readinessProbe</code>: allowing to tell whether your <code>Deployment</code> is ready to serve traffic at any point of time during its lifecycle. This configuration item can support different command but in your case, this would be an <code>httpGet</code> matching and endpo... |
<p>I'm having to build a demo Kubernetes cluster in AWS using Kubeadm.</p>
<p>Unfortunately, for several reasons, Kops, and EKS are out of the question in my current environment.</p>
<p>How do I deal with things such as auto-scaling and auto joining worker nodes back to the master if they get terminated for any reason?... | <p>If you're using Ansible, you can set up your launch configuration to pull a git repo, and run a playbook to extract the join token from the Master and run on the worker nodes.</p>
|
<p>I stick to this problem quite long now:</p>
<p>I have a standard NextJS app, which uses environment variables (for client side <code>NEXT_PUBLIC_MY_VAR</code> as well for server side ones <code>MY_OTHER_VAR</code>).</p>
<p>I use the Gitlab CI-CD AutoDevOps with an tiny custom <code>.gitlab-ci.yml</code>-file (see be... | <p>If you stick on Auto Devops on <strong>GITLAB</strong> then YOU HAVE TO set this Gitlab ENV Variable <code>AUTO_DEVOPS_BUILD_IMAGE_EXTRA_ARGS</code> and set it to</p>
<p><code>--build-arg=NEXT_PUBLIC_API_URL=http://your.domain.com/api</code></p>
<p>In your Dockerfile you can assign it via</p>
<pre><code> ARG NEXT... |
<p>I have cassandra operator installed and I setup cassandra datacenter/cluster with 3 nodes.
I have created sample keyspace, table and inserted the data. I see it has created 3 PVC's in my storage section. When I deleting the dataceneter its delete associated PVC's as well ,So when I setup same configuration Datacente... | <p>According to the spec:</p>
<blockquote>
<p>The storage configuration. This sets up a 100GB volume at /var/lib/cassandra
on each server pod. The user is left to create the server-storage storage
class by following these directions...
<a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/s... |
<p>I have a VPC, 4 subnets (2 public and 2 private) and an EKS Cluster which all created with Terraform. My infra is working without a problem right now. I'm thinking about creating a second EKS Cluster, but I'm a little bit confused about subnet tagging.</p>
<p>For example, one of my private subnets was created like b... | <p>To answer my own question, yes tagging the subnet for each EKS Cluster is needed, otherwise load balancers couldn't find where to provision.</p>
<p>In Terraform, I used exact format I asked above</p>
<pre><code>resource "aws_subnet" "vpc-private" {
vpc_id = aws_vpc.vpc.id
cidr_bloc... |
<p>I want to capture <code>subdomain</code> and rewrite URL with <code>/subdomain</code>, For example <code>bhautik.bhau.tk</code> rewrite to <code>bhau.tk/bhautik</code>.</p>
<p>I also <a href="https://github.com/google/re2/wiki/Syntax" rel="nofollow noreferrer">https://github.com/google/re2/wiki/Syntax</a> tried grou... | <p>I believe you want a redirect instead of rewrite. Here is the <code>server-snippet</code> you need:</p>
<pre><code>nginx.ingress.kubernetes.io/server-snippet: |
if ($host ~ ^(?<subdom>\w+)\.(?<basedom>bhau\.tk)$) {
return 302 https://$basedom/$subdom/ ;
}
</code></pre>
<p>If you really want a rew... |
<p>I'm trying to deploy updates. Installation works fine, but when I change the image field in the yaml file for Job and try to roll updates, an error occurs.</p>
<blockquote>
<p>Error: UPGRADE FAILED: cannot patch "dev1-test-db-migrate-job" with kind Job: Job.batch "dev1-test-db-migrate-job" is invalid: spec.templa... | <p>The existing job need to be deleted, because the template section in the job is immutable or not updatable. so you have 2 following options.</p>
<ol>
<li>Always create a new job with a unique name, so it leaves the old jobs and creates a new one - every time if you include the version of image would be sensible.</li... |
<p>When using Kubernetes <code>.yml</code> files, I can do the following:</p>
<pre class="lang-sh prettyprint-override"><code>$ cat configmap.yml
apiVersion: v1
kind: ConfigMap
metadata:
name: my-configmap
data:
foo: ${FOO}
bar: ${BAR}
static: doesNotChange
$ export FOO=myFooVal
$ export BAR=myBarVal
$ cat co... | <p>It is actually possible, to store the <code>secret.yml</code> with <code>stringData</code> instead of <code>data</code> which allows to keep the files in plain text (SOPS encryption is still possible and encouraged)</p>
<pre><code>$ cat secret.yml
apiVersion: v1
kind: Secret
metadata:
name: test-secret
namespac... |
<p>I have configured a Kafka Cluster with Strimzi. I have enabled tls authentication and I have exposed the service with NodePort.</p>
<p>After that I have exported my ca and my password to generate a JKS to connect with Kafka. But the problem is that I'm having the next error:</p>
<blockquote>
<p>java.security.cert.Ce... | <p>As described in the docs, when using node ports listeners, you have to by default disable the hostname verification in your client. The reason is that the node address is not known upfront to add it to the certificates and including all nodes would often not work because the worker nodes might come and go.</p>
<p>If... |
<p>With Kubernetes 1.22, the beta API for the <code>CustomResourceDefinition</code> <code>apiextensions.k8s.io/v1beta1</code> was removed and replaced with <code>apiextensions.k8s.io/v1</code>. While changing the CRDs, I have come to realize that my older controller (operator pattern, originally written for <code>v1alp... | <blockquote>
<p>Do I need to write a new controller for the new API version ?</p>
</blockquote>
<p>Unfortunately, it looks like it does. If you are unable to apply what is described in <a href="https://stackoverflow.com/questions/54778620/how-to-update-resources-after-customresourcedefinitions-changes">this similar que... |
<p>I am trying to create a cronjob , I have written a Springboot application for this and have created a abc-dev.yml file for application configuration</p>
<p>error: unable to recognize "src/java/k8s/abc-dev.yml": no matches for kind "CronJob" in version "apps/v1"</p>
<pre><code>apiVersion... | <p>If you are running kubernetes 1.20 or lower, the correct apiVersion value is:</p>
<p><code>apiVersion: batch/v1beta1</code></p>
<p>If you are running kubernetes 1.21 or higher, its</p>
<p><code>apiVersion: batch/v1</code></p>
|
<p>I have deployed Gitlab from gitlab official helm chart. When I deployed it I didn't enable LDAP. Be informed that I didn't edit the values.yaml rather I used <code>helm update --install XXX</code> command to do it.</p>
<p>My question is how do I extract the helm values.yaml of my existing helm deployment (Name: <cod... | <p>The answer here is very short. Exactly, like @DavidMaze mentioned in comments section you're looking for <a href="https://docs.helm.sh/docs/helm/helm_get_values/" rel="nofollow noreferrer"><code>helm get values</code></a>.</p>
<p>To this command one can use several options.</p>
<blockquote>
<p>This command downloads... |
<p>We have a data processing service that tries to utilize as much CPU and memory as possible. In VMs this service uses max CPU and memory available and keeps on running. But when we run this service to Kubernetes it gets evicted as soon as it hits resource limits. Is there a way to let the service hit max resource usa... | <blockquote>
<p>The kubelet is the primary "node agent" that runs on each node. [<a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/" rel="nofollow noreferrer">1</a>]</p>
<p>When you specify a <a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="nofollow noreferr... |
<p>I see this in Kubernetes doc,</p>
<blockquote>
<p>In Kubernetes, controllers are control loops that watch the state of
your cluster, then make or request changes where needed. Each
controller tries to move the current cluster state closer to the
desired state.</p>
</blockquote>
<p>Also this,</p>
<blockquote>
<p>The ... | <p>I would like to start explaining that the <a href="https://kubernetes.io/docs/concepts/overview/components/#kube-controller-manager" rel="nofollow noreferrer">kube-controller-manager</a> is a collection of individual control processes tied together to reduce complexity.</p>
<p>Being said that, the control process re... |
<p>I'm installing ingress nginx using a modified yaml file</p>
<pre><code>kubectl apply -f deploy.yaml
</code></pre>
<p>The yaml file is just the <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/baremetal/deploy.yaml" rel="nofollow noreferrer">original deploy ... | <p>Two ways to find out:</p>
<ol>
<li><p>You can take a closer look at the helm chart itself <a href="https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx</a></p>
<p>Here you can find deployment s... |
<p>I have a folder containing multiple values.yaml files and I would like to pass all the yaml files in that folder as an argument to helm install.</p>
<p>It is possible to use like <code>helm install example . -f values/values1.yaml -f values/values2.yaml</code></p>
<p>But there are more than 10 files in values folder... | <p>This is not possible as <code>-f</code> expects a file or URL = <code>specify values in a YAML file or a URL (can specify multiple)</code> and helm does not know a command to use a directory.</p>
<p>Maybe you should reduce your values.yaml files to have a base value file and then one environment specific values file... |
<p>I have created a job in kubernetes through <strong>client-go</strong> api. Now I want to get the log of the job, but I can't find the log api of job in <strong>client-go</strong>. Therefore, I want to obtain the name of all the pods in a job to obtain the POD logs by name, and then obtain the logs of the job.</p>
<p... | <p>I create a pod with label, and then I get it through <strong>LabelSelector</strong>.
Like it :</p>
<pre class="lang-golang prettyprint-override"><code> config, err := clientcmd.BuildConfigFromFlags("", "~/.kube/config")
if err != nil {
println("config build error")
}
... |
<p>I am a bit new to Kubernetes and I am working with EKS.
I have two main apps for which there is a number of pods and I have set up a ELB for external access.</p>
<p>I also have a small app with say 1-2 pods. I don't want to set up a ELB just for this small app. I checked the node port, but in that case, I can't use ... | <p>You can try to use the <strong>Host network</strong> (Node) like <strong>hostport</strong> (Not recommended in k8s to use in prod)</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
hostPort: 443
... |
<p>I'm having to build a demo Kubernetes cluster in AWS using Kubeadm.</p>
<p>Unfortunately, for several reasons, Kops, and EKS are out of the question in my current environment.</p>
<p>How do I deal with things such as auto-scaling and auto joining worker nodes back to the master if they get terminated for any reason?... | <p><a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#cluster-autoscaler" rel="nofollow noreferrer">Cluster Autoscaler</a> is what you are looking for to achieve it.</p>
<blockquote>
<p>Cluster Autoscaler is a tool that automatically adjusts the size of the Kubernetes cluster when one of t... |
<p>I have an issue when OpenShift project deployed with autoscaler configuration like this:</p>
<ul>
<li>Min Pods = 10</li>
<li>Max Pods = 15</li>
</ul>
<p>I can see that deployer immediately creates 5 pods and <em>TcpDiscoveryKubernetesIpFinder</em> creates not one grid, but multiple grids with same <em>igniteInstance... | <p>OP confirmed in the comment, that the problem is resolved:</p>
<blockquote>
<p>Thank you, let me know when TcpDiscoveryKubernetesIpFinder early adoption fix will be available. For now I've switched my Openshift micro-service IgniteConfiguration#discoverySpi to TcpDiscoveryJdbcIpFinder - which solved this issue (as i... |
<p>I'm trying to pass toleration values into helm using terraform. But I have got different error messages.</p>
<p>Default values of the <a href="https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-cluster?modal=values&path=vmstorage.tolerations" rel="nofollow noreferrer">chart are here</a>.</p>
<... | <p>Try <strong>dynamic</strong> block</p>
<pre><code>dynamic "toleration" {
for_each = var.tolerations
content {
key = toleration.value["key"]
operator = toleration.value["operator"]
value = toleration.value["va... |
<p>I don't undestand why i can't get certificates on K8S using <strong>cert-manager</strong></p>
<ul>
<li><p>I installed cert-manager : <a href="https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.crds.yaml" rel="nofollow noreferrer">https://github.com/cert-manager/cert-manager/releases/d... | <p>If you don't want to create <strong>kind certificate</strong> you can use</p>
<pre><code>apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: cluster-issuer-name
namespace: development
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: harsh@example.com
pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.