prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I want to run 2 containers in a pod (sidecar pattern), Of which one of the container must be running with restricted access. In K8s service account is common for all containers in the pod, is it possible to run a sidecar with a different service account or with no service account?</p>
| <p>I just asked the same question for init container in the slack group. The answer was a no.</p>
<p>Although, one user had the idea of manually mounting a SA token into the initcontainer or sidecar in your case and disabling automounting of SA.</p>
|
<p>I have a PV/PVC in my kubernetes cluster.</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0003
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
storageClassName: slow
nfs:
path: /tmp
server: 17... | <p>You can use <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/" rel="nofollow noreferrer"><code>kubectl patch</code> command</a> to add <code>mountOptions</code> to existing PV in the cluster:</p>
<pre><code>kubectl patch pv pv0003 --patch '{"spec": {"... |
<p>I've encountered rather strange behavior of my kubernetes cluster (1.18.20, calico 3.14.2): when I attempt to upload two-megabyte JSON file to pod via curl through <code>NodePort</code> service, transmission is interrupted with <code>Recv failure: Connection reset by peer</code>.
Traffic capture shows that both clie... | <p>Unfortunately, the source of the problem was in misconfiguration of IDS/IPS.</p>
<p>Nothing to do with <strong>kube-proxy</strong>.</p>
|
<p>In helm, there are Math functions <a href="https://helm.sh/docs/chart_template_guide/function_list/#math-functions" rel="nofollow noreferrer">https://helm.sh/docs/chart_template_guide/function_list/#math-functions</a> and they have a <code>div</code> function which divides integer! but is there any way to get a deci... | <p>Unfortunately there are no functions available in Helm templates which support floating point division.</p>
<p>Easiest would be to register a custom function which does the conversion and division.</p>
<p>If you can't register your custom functions, there is still a way to do this with what's available in Help templ... |
<p>I have a baremetal cluster deployed using Kubespray with kubernetes 1.22.2, MetalLB, and ingress-nginx enabled. I am getting <code>404 Not found</code> when trying to access any service deployed via helm when setting <code>ingressClassName: nginx</code>. However, everything works fine if I don't use <code>ingressCla... | <blockquote>
<p>Running <code>kubectl get ingressclass</code> returned 'No resources found'.</p>
</blockquote>
<p>That's the main reason of your issue.</p>
<p><em>Why?</em></p>
<p>When you are specifying <code>ingressClassName: nginx</code> in your Grafana <code>values.yaml</code> file you are <a href="https://kubernet... |
<p>I have an application which stores logs in a file at a configurable location.
Let's say <code>/abc/pqr/application.log</code></p>
<p>Application is being migrated to Kubernetes where it will run in a single pod. If I run <code>kubectl log <pod-name></code>, I get anything that gets printed on <code>stdout</cod... | <p><code>kubectl logs</code> command takes everything from <code>stdout</code> and <code>stderr</code>, so you need to supply logs there.</p>
<p>It's a common practice when containerised applications write their logs to <code>stdout</code> and <code>stderr</code>.</p>
<p>This way there are two main options:</p>
<ol>
<l... |
<p>Having trouble deploying Hashicorp Vault on kubernetes/helm. Can't get vault to work at all. I've really tried changing almost all the parameters I could and still can't get it to work and I don't know where the issue lies exactly.</p>
<p>The error I get is mainly based on <code>Error Checking Seal status/Client sen... | <p>As you mentioned you faced issued of <code>Error Checking Seal status/Client sent an HTTP request to an HTTPS server & vault is sealed</code></p>
<p>Once you have deployed the vault using the helm chart you have to unseal the vault using the CLI first time and after that UI will be available to use.</p>
<p>Refer... |
<p>I am trying to copy and paste few commands inside the labs.play-with-k8s free instance provided by kubernetes. Both the commands the Ctrl+c and Ctrl+v doesn't work.</p>
<p>I found few options like ctrl + shift +insert to copy but that also doesn't seems to work for me.</p>
<p>Any suggestion please.</p>
| <p>ctrl + insert to copy and shift + insert to paste</p>
|
<p>In Kubernetes we can request resources using different API versions:</p>
<pre><code>kubectl get roles.v1.rbac.authorization.k8s.io foo -n bar -oyaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: foo
namespace: bar
rules:
- apiGroups:
- ""
resources:
- endpoints
- secrets
... | <blockquote>
<p>If a resource was stored when the newer API version (v1) did not exist
yet, would this be a problem when the older API version (v1beta1) is
removed?</p>
</blockquote>
<p>Kubernetes supports a huge elastic deprecation system, which allows you to create, migrate and maintain API versions in time, however(... |
<p>Since I added some additonal initContainers to my Airflow helm chart <a href="https://github.com/apache/airflow/tree/main/chart" rel="nofollow noreferrer">(link)</a>, I was trying to set a default <code>initContainerResources</code> to my helm values and deployment yaml:</p>
<ul>
<li>values.yaml</li>
</ul>
<pre><cod... | <p>Turned out I had the schema validation process blocking me from adding additional parameters. Just added the desired key to the schema and it worked:</p>
<p>values.schema.json</p>
<pre><code> "initContainerResources": {
"description": "Add default ressource... |
<p>I am looking for a way to get all object's metadata within a k8s cluster and send it out to an external server.</p>
<p>By metadata, I refer to objects <code>Name</code>, <code>Kind</code>, <code>Labels</code>, <code>Annotations</code>, etc.
The intention is to build an offline inventory of a cluster.</p>
<p>What wou... | <p>Posting this as a community wiki, feel free to edit and expand.</p>
<hr />
<p>There are different ways to achieve it.</p>
<ol>
<li><p>From this <a href="https://github.com/kubernetes/kubectl/issues/151#issuecomment-402003022" rel="nofollow noreferrer">GitHub issue comment</a> it's possible to iterate through all res... |
<p>I have one docker image and I am using following command to run it. </p>
<pre><code>docker run -it -p 1976:1976 --name demo demo.docker.cloud.com/demo/runtime:latest
</code></pre>
<p>I want to run the same in Kubernetes. This is my current yaml file.</p>
<p><div class="snippet" data-lang="js" data-hide="false" da... | <p><code>kubectl run</code> is the close match to <code>docker run</code> based on the requested scenario.</p>
<p>Some examples from Kubernetes documentation and it's purpose :</p>
<pre class="lang-sh prettyprint-override"><code>kubectl run -i --tty busybox --image=busybox -- sh # Run pod as interactive shell
kubectl ... |
<p>I've updated <code>kubectl client version</code> to the latest but I am not able to update <code>kubectl server version</code> to the latest due to which client and server versions are different. The problem is: how can I update <code>kubectl server version</code>?</p>
<p>P.S i'm running minikube on docker locally</... | <p>Posted community wiki answer for better visibility. Feel free to expand it.</p>
<hr />
<p>You need to upgrade your minikube version in order to upgrade the kubectl server version.</p>
<p>Based on <a href="https://stackoverflow.com/questions/45002364/how-to-upgrade-minikube/64362273#64362273">this answer</a> to upgra... |
<p>My kubectl cp isnt working due to tar not being in my bin folder of my container. I can't seem to find how to get it installed.</p>
<p>I get an error when trying:</p>
<pre><code>kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir
</code></pre>
<p><strong>Error:</strong></p>
<blockquote>
<p>rpc error: code = 2 desc... | <p>It looks like there is no Tar into your Docker</p>
<p>I would suggest installing the Tar first at the above <strong>Dockerfile</strong> level commands</p>
<p>You can add the Tar into Docker using</p>
<p><strong>Docker image</strong> : <code>RUN yum install -y tar</code></p>
|
<p>Basically I'm builing a system on google cloud. Most services are working on k8s cluster but some codes are not. Lambda and operator of composer, dataflow job are the examples. (Composer is also k8s but different cluster)</p>
<p>I picked kafka as event channel to interconnect the services and I have to decide proper... | <p>There are a different solutions to your problems</p>
<p>You can deploy the Kafka on K8s cluster and use the service mesh to interconnect both clusters. So broker and service can connect with each other without any worry.</p>
<p>If you are on GCP you can use the MCS service or traffic director and other service mesh.... |
<p>I'm trying to setup TLS for a service that's available outside a Kubernetes cluster (AWS EKS). With cert-manager, I've successfully issued a certificate and configured ingress, but I'm still getting error <code>NET::ERR_CERT_AUTHORITY_INVALID</code>. Here's what I have:</p>
<ol>
<li><p><strong>namespace</strong> <co... | <p>Your ClusterIssuer refers to LetsEncrypt staging issuer. Remove that setting / the default should use their production setup. As pointed out in comments: <a href="https://acme-v02.api.letsencrypt.org/directory" rel="nofollow noreferrer">https://acme-v02.api.letsencrypt.org/directory</a></p>
<p>Deleting the previousl... |
<p>At work we use Kubernetes hosted in GCP. I also have a side project hosted in my <em>personal</em> GCP account using Google App Engine (deploy using <code>gcloud app deploy</code>).</p>
<p>Often when I try to run a command such as <code>kubectl logs -f service-name</code>, I get an error like "Error from server (Fo... | <p>Had the same problem and doing all of the:</p>
<pre><code>gcloud auth login
gcloud auth list
gcloud config set account
gcloud projects list
</code></pre>
<p>didn't help. I knew <code>gcloud</code> switched fine as I was able to list other resources with it directly.
But it seems <code>kubectl</code> can't pick those... |
<p>The authentication using kyecloak isn't working as expected, it been used Istio vs Keycloak.
Istio components configured : Gateway, Virtualservice, AuthorizationPolicy, RequestAuthentication</p>
<p>using a valid token: <strong>401 Jwt issuer is not configured</strong></p>
<p><a href="https://i.stack.imgur.com/zYMaM... | <p>I encountered similar issue.</p>
<p>The JWT token had following value for issuer:
"iss": "http://localhost:8080/auth/realms/dev"</p>
<p>I matched the same value in my JwtRules i.e. localhost.
However I changed jwksUri to cluster IP address of Keycloak.
This seems to have worked.</p>
<p>jwtRules:<... |
<p>I have a Django project deployed in Kubernetes and I am trying to deploy Prometheus as a monitoring tool. I have successfully done all the steps needed to include <code>django_prometheus</code> in the project and locally I can go go <code>localhost:9090</code> and play around with querying the metrics.</p>
<p>I have... | <p>You do not have to expose services, if the promehteus is installed on the same cluster as your app. You can communicate with apps between namespaces by using Kubernetes DNS resolution, going by the rule:</p>
<pre><code>SERVICENAME.NAMESPACE.svc.cluster.local
</code></pre>
<p>so one way is to change your prometheus j... |
<p>I am trying to do the following, so where MYVALUE in host needs to change to include Release Name. Can't figure how to do this, as you can't use env variables like <code>{{ .Release.Name }}</code> directly in to a values.yaml file.</p>
<p>I did do a <code>fullnameOverride</code> and put <code>fullnameOverride: myrel... | <p>It seems that helm does not support any template rendering capabilities in a <code>values.yaml</code> file - there are multiple topics on the helm GitHub:</p>
<ul>
<li><a href="https://github.com/helm/helm/issues/9754" rel="nofollow noreferrer">Canonical way of using dynamic object names within values.yaml</a></li>... |
<p>I have a local website.
The website was created by a docker-compose and it is listening on a localhost port 3000.</p>
<p>When I try:</p>
<pre><code>curl 127.0.0.1:3000
</code></pre>
<p>I can see the response.</p>
<p>What I did:</p>
<p>From my domain provider I edited the DNS to point to my server, then I changed ngi... | <p>To clarify the issue I am posting a community wiki answer.</p>
<p>The answer that helped to resolve this issue is available at <a href="https://stackoverflow.com/questions/57764237/kubernetes-ingress-to-external-service">this link</a>. Based on that - the clue of the case is to create manually a Service and an Endp... |
<p>I have a Django project deployed in Kubernetes and I am trying to deploy Prometheus as a monitoring tool. I have successfully done all the steps needed to include <code>django_prometheus</code> in the project and locally I can go go <code>localhost:9090</code> and play around with querying the metrics.</p>
<p>I have... | <p>No need to expose the application outside the cluster.</p>
<p>Leveraging the Kubernetes service discovery, add the job to scrape Services, Pods, or both:</p>
<pre><code>- job_name: 'kubernetes-service-endpoints'
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels: [__meta_kubernetes_ser... |
<p>I'm trying to connect an external webflow page to our kubernetes cluster ingress on GCP GKE. Specifically, I want everything at <a href="http://www.domain.com" rel="nofollow noreferrer">www.domain.com</a> to go to the external webflow service, and everything at <a href="http://www.domain.com/app" rel="nofollow noref... | <p>The reason why the steps on the question you quoted <a href="https://stackoverflow.com/questions/65919773/ingress-nginx-proxy-to-outside-website-webflow-hosted">Ingress Nginx Proxy to Outside Website (Webflow hosted)</a> are not working, is because that question focuses on EKS (Amazon Elastic Kubernetes Service). Ex... |
<p>My secret file looks like:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: secret
type: Opaque
stringData:
"user.name": "user"
"user.password": "password"
</code></pre>
<p>And I am trying to get a value with the next code:</p>
<pre><code>{{- $secret := looku... | <p>You can use the <code>index</code> function to access map values with dots in them like:</p>
<pre><code>{{- print (index $secret.data "user.password")}}
</code></pre>
|
<p>I have the following architecture for the PostgreSQL cluster:</p>
<p><a href="https://i.stack.imgur.com/TlP1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TlP1l.png" alt="enter image description here" /></a></p>
<p>Here, there are multiple clients that interacts with PostgreSQL pods via pgpool,... | <p>Without substantial custom code to allow TCP connection transfers between hosts, you kind of can't. When a process shuts down, all TCP streams it has open will be closed, that's how normal Linux networking functions. If you poke a round on your search engine of choice for things like "TCP connection migration&q... |
<p>I have the following architecture for the PostgreSQL cluster:</p>
<p><a href="https://i.stack.imgur.com/TlP1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TlP1l.png" alt="enter image description here" /></a></p>
<p>Here, there are multiple clients that interacts with PostgreSQL pods via pgpool,... | <blockquote>
<p>Is there a way in kubernetes to handle it so that connections to pgpool k8s service are load balanced/ recreated to other pods...</p>
</blockquote>
<p>Connections to pgpool k8s service is load balance by kube-proxy. Endpoints (pgpool pods) that back the service will automatically be update whenever ther... |
<p>Hi i have installed minikube but when i run minikube start i get this error :</p>
<pre><code>😄 minikube v1.17.1 on Ubuntu 20.04
✨ Using the docker driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🏃 Updating the running docker "minikube" container ...
🐳 Pr... | <p>You can use <code>minikube delete</code> to delete the old cluster. After that start minikube using <code>minikube start</code></p>
|
<p>Running Spark on Kubernetes, with each of 3 Spark workers given 8 cores and 8G ram, results in</p>
<pre><code>Executor app-xxx-xx/0 finished with state KILLED exitStatus 143
</code></pre>
<p>seemingly no matter how simple the computation or what flags I pass to <code>spark-submit</code>.</p>
<p>For instance,</p>
<pr... | <p>Learned a couple things here. The first is that 143 KILLED does not seem to actually be indicative of failure but rather of executors receiving a signal to shutdown once the job is finished. So, seems draconian when found in logs but is not.</p>
<p>What was confusing me was that I wasn't seeing any "Pi is rough... |
<p>This is sort of strange behavior in our K8 cluster.</p>
<p>When we try to deploy a new version of our applications we get:</p>
<pre><code>Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "<container-id>" network for pod "application-6647b7cbdb-4tp... | <p>Posting comment as the community wiki answer for better visibility</p>
<hr />
<p>This issue was due to <code>kubelet</code> certificate expired and fixed following <a href="https://github.com/kubernetes/kubeadm/issues/2054#issuecomment-606916146" rel="nofollow noreferrer">these steps</a>. If someone faces this issue... |
<p>I'm trying to setup and expose a service (ArgoCD) to outside a cluster. Note: I'm fairly new to Kubernetes, so quite probably I have some misconceptions. If you can see one, please help me get rid of it. If more information is needed to diagnose what's happening, please let me know, I'll add it.</p>
<p>I have nginx-... | <p>Right, the issue was somewhat complicated, but I've figured it out. Basically, it consists of 2 problems:</p>
<ol>
<li>https configuration and</li>
<li>ingress configuration</li>
</ol>
<p>The main problem about https configuration was solved in a separate <a href="https://stackoverflow.com/q/69964611/3995261">questi... |
<p>I wrote a service to retrieve some information from the Kubernetes cluster. Below is a snippet from the <code>kubernetes_service.py</code> file that works perfectly when I run it on my local machine.</p>
<pre class="lang-py prettyprint-override"><code>from kubernetes.client.rest import ApiException
from kubernetes i... | <p>I believe you'll want <a href="https://github.com/kubernetes-client/python-base/blob/3aa8b4c94282707a20482f71e86624f3b39a2cc6/config/__init__.py#L24" rel="nofollow noreferrer"><code>kubernetes.config.load_config</code></a> which differs from the <code>load_kube_config</code> you're currently using in that the packag... |
<p>I have a configMap file:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
labels:
owner: testdb
name: testdb-configmap
data:
host: postgres
port: "5432"
</code></pre>
<p>and a secret file:</p>
<pre><code>aapiVersion: v1
kind: Secret
type: Opaque
metadata:
labels:
owner: testdb
... | <p>Kubernetes can <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config" rel="nofollow noreferrer">set environment variables based on other environment variables</a>. This is a core Kubernetes Pod capability, and doesn... |
<p>I'd like to know if <code>kubectl</code> offers an easy way to list all the secrets that a certain pod/deployment/statefulset is using, or if there is some way to cleanly retrieve this info. When doing a <code>kubectl describe</code> for a pod, I see I can get a list of mounted volumes which include the ones that co... | <p>To <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">List all Secrets</a> currently in use by a pod use:</p>
<pre><code>kubectl get pods -o json | jq '.items[].spec.containers[].env[]?.valueFrom.secretKeyRef.name' | grep -v null | sort | uniq
</code></pre>
<p>In the other h... |
<p>Is there any way we can run pod based on the alert fired from Prometheus? We have a scenario where we need to execute a pod based on the disk pressure threshold.
I am able to create alert but I need to execute a pod. How can I achieve that?</p>
<pre><code>groups:
- name: node_memory_MemAvailable_percent
rules:... | <p>I think the Alertmanager can help you, using the <code>webhook</code> receiver (<a href="https://prometheus.io/docs/alerting/latest/configuration/#webhook_config" rel="nofollow noreferrer">documentation</a>).</p>
<p>In this way, when the alert is triggered, Prometheus sends it to the Alertmanager, then the Alertmana... |
<p>Today I am facing a problem that the redis in the kubernetes cluster shows error like this:</p>
<pre><code>2021-11-16T05:32:18 [INFO] - increment delete failed...,MobcError(RedisCMDError(An error was signalled by the server: You can't write against a read only replica.))
</code></pre>
<p>I check my redis config and ... | <blockquote>
<p>why not only keep the master service and replica servcie?</p>
</blockquote>
<p>You can do it, if you could implement it. as redis helm maybe dont use specific labels to run Read/Write replicas so it's hard to divert and create the different services for <strong>read & write</strong>.</p>
<p>If you a... |
<p>I have to get the existing microservices run. They are given as docker images.
They talk to each other by configured hostnames and ports.
I started to use Istio to view and configure the outgoing calls of each microservice.
Now I am at the point that I need to rewrite / redirect the host and the port of a request th... | <p>There are two solutions which can be used depending on necessity of using <code>istio</code> features.</p>
<p>If no <code>istio</code> features are planned to use, it can be solved using native kubernetes. In turn, if some <code>istio</code> feature are intended to use, it can be solved using <code>istio virtual ser... |
<p>I have a VM with kubernetes installed using kubeadm (NOT minikube). The VM acts a the single node of the cluster, with taints removed to allow it to act as both Master and Worker node (as shown in the kubernetes documentation).
I have saved, transfered and loaded a my <em>app:test</em> image into it. I can easily ru... | <blockquote>
<p>image doesn't appear when i run sudo <code>docker images --all</code></p>
</blockquote>
<p>Based on your comment, you are using K8s v1.22, which means it is likely your cluster is using <code>containerd</code> container runtime instead of <code>docker</code> (you can check with <code>kubectl get nodes -... |
<p>I have an API that recently started receiving more traffic, about 1.5x. That also lead to a doubling in the latency:</p>
<p><a href="https://i.stack.imgur.com/clJmx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/clJmx.png" alt="latency" /></a></p>
<p>This surprised me since I had setup autoscalin... | <p>Turns out the answer is that you <strong>cannot loadbalance gRPC requests using a GKE loadbalancer</strong>.</p>
<p>A GKE loadbalancer (as well as Kubernetes' default loadbalancer) picks a new backend every time a new TCP connection is formed. For regular HTTP 1.1 requests each request gets a new TCP connection and ... |
<p>We have a AWS EKS running (setup using Pulumi), where we installed Tekton as described in the <a href="https://buildpacks.io/docs/tools/tekton/" rel="nofollow noreferrer">Cloud Native Buildpacks Tekton docs</a>. The <a href="https://github.com/jonashackt/tekton-argocd-eks" rel="nofollow noreferrer">example project i... | <p><strong>TLDR;</strong></p>
<p>I created a fully comprehensible example project showing all necessary steps and running pipelines here: <a href="https://gitlab.com/jonashackt/microservice-api-spring-boot/" rel="noreferrer">https://gitlab.com/jonashackt/microservice-api-spring-boot/</a> with the full <code>.gitlab-ci.... |
<p>i am using kubernetes plugin in jenkins.i want to run an init script before slave container provision on kubernetes.the kubernetes plugin pod template won't allow me to or i cannot find a way to run it.can anybody please help me with this.i need to run a certain set of commands on the kubernetes slave container befo... | <p>1 - You don't need to use the slave image, jenkins will have an agent container regardless, you should only specify containers you want it to run additionally.</p>
<p>2 - On the containers you can specify the entrypoints or pre-provision whatever you want beforehand and just worry about the execution. That means you... |
<p>I've created a Jenkins pipeline and I am running it on GKE (using Kubernetes plugin). In one of the steps I am running java application in one of the containers. Application is writing logs to stdout. I would like to see the logs from this application in Stackdriver. How can I achieve it? Currently I am not able to ... | <p>If you are already running the Jenkin on GCP instance it would be quite easy and directly get the logs to Stackdriver.</p>
<p><a href="https://faun.pub/jenkins-on-google-compute-engine-611bd86e295b" rel="nofollow noreferrer">https://faun.pub/jenkins-on-google-compute-engine-611bd86e295b</a></p>
<p>You can also integ... |
<p>I have a VM with kubernetes installed using kubeadm (NOT minikube). The VM acts a the single node of the cluster, with taints removed to allow it to act as both Master and Worker node (as shown in the kubernetes documentation).
I have saved, transfered and loaded a my <em>app:test</em> image into it. I can easily ru... | <h2>One can do so with a combination of crictl and ctr, if using containerd.</h2>
<p><strong>TLDR:</strong> <a href="https://blog.scottlowe.org/2020/01/25/manually-loading-container-images-with-containerd/" rel="nofollow noreferrer">these steps</a>, which are also described in the crictl <a href="https://github.com/con... |
<p>I am trying to utilize Rancher Terraform provider to create a new RKE cluster and then use the Kubernetes and Helm Terraform providers to create/deploy resources to the created cluster. I'm using this <a href="https://registry.terraform.io/providers/rancher/rancher2/latest/docs/resources/cluster_v2#kube_config" rel=... | <p>Generally speaking, Terraform always needs to evaluate provider configurations during the planning step because providers are allowed to rely on those settings in order to create the plan, and so it typically isn't possible to have a provider configuration refer to something created only during the apply step.</p>
<... |
<p>I am using <code>MobaXterm_21.2</code> installed version.
When I run <code>kubectl version</code>, it's working as expected:</p>
<pre><code> kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff... | <p>The solution is to use PowerShell directly in the MobaXterm - steps how to configure that can be <a href="https://codetryout.com/mobaxterm-windows-command-prompt/" rel="nofollow noreferrer">found here</a> (instead of <code>CMD</code> choose <code>Powershell</code>):</p>
<blockquote>
<p>MobaXterm comes with various c... |
<p>I have a number of <strong>restful services</strong> within our system</p>
<ul>
<li>Some are our <strong>within</strong> the kubernetes <strong>cluster</strong></li>
<li><strong>Others</strong> are on <strong>legacy</strong> infrasture and are <strong>hosted on VM's</strong></li>
</ul>
<p>Many of our <strong>restful... | <p>It depends on whether you want requests to be routed through your ingress controller or not.</p>
<p>Requests sent to the full URL configured in your Ingress resource will be processed by your ingress controller. The controller itself — NGINX in this case — will proxy the request to the Service. The request will then... |
<p>I'm using <strong>Pulumi-Typescript</strong> to deploy infrastructure in GCP.</p>
<p>I have 1 Google Kubernetes Engine resource already deployed in my project.
To use that existing resource in Pulumi operation, I found documentation on pulumi import in which I explored about how it actually works.
By referring that ... | <p>The only place in the Pulumi code base containing that warning is here:</p>
<p><a href="https://github.com/pulumi/pulumi/blob/272c4643b20d40113689475fd2f9fe3134e6d431/pkg/resource/deploy/step_generator.go#L540-L551" rel="nofollow noreferrer">https://github.com/pulumi/pulumi/blob/272c4643b20d40113689475fd2f9fe3134e6d... |
<p>I am trying to deploy the jpetstore application (<a href="https://github.com/IBM-Cloud/jpetstore-kubernetes" rel="nofollow noreferrer">https://github.com/IBM-Cloud/jpetstore-kubernetes</a>) into kubernetes in EKS and i am having trouble interpreting this command as it is used for IBM cloud:</p>
<pre><code>ibmcloud k... | <p><strong>Cluster Name:</strong></p>
<pre><code>$ kubectl config get-clusters
NAME
kubernetes
</code></pre>
<p><strong>Cluster end point info:</strong></p>
<pre><code>$ kubectl cluster-info
Kubernetes master is running at https://172.17.0.109:6443
dash-kubernetes-dashboard is running at https://172.17.0.109:6443/api/v... |
<p>I am taking a course in Udemy and I am new to the world of <strong>Kubernetes</strong> and I am trying to configure <strong>ingress nginx controller</strong> in Kubernetes but it returns <strong>404 not found</strong> when i send a request at specified URL, it has been 10 days that I am trying to fix it, i've looked... | <p>After a few days of research I finally solved the problem, the problem was with IIS Web Server which I had enabled when I was working on a project in ASP.NET core, I uninstalled it and the problem was solved.</p>
<p>How to uninstall IIS from Windows 10:</p>
<ul>
<li>Go to Control Panel > Programs and Features</li... |
<p>I want to deploy a microservices application with multiple microservices and two operators for external applications.</p>
<p>The microservices are consolidated under the helm chart. The external stateful applications like Cassandra DB and Kafka have an operator.</p>
<p>How do I combine and manage the lifecycle of th... | <p>You can use a helm-based operator which can be scaffolded out using an existing helm chart. <a href="https://sdk.operatorframework.io/docs/building-operators/helm/" rel="nofollow noreferrer">https://sdk.operatorframework.io/docs/building-operators/helm/</a></p>
|
<p>I'm struggling to expose a service in an AWS cluster to outside and access it via a browser. Since my <a href="https://stackoverflow.com/q/69801758/3995261">previous question</a> haven't drawn any answers, I decided to simplify the issue in several aspects.</p>
<p>First, I've created a deployment which should work w... | <p>Since you've used your own answer to complement the question, I'll kind of answer all the things you asked, while providing a divide and conquer strategy to troubleshooting kubernetes networking.</p>
<p>At the end I'll give you some nginx and IP answers</p>
<p>This is correct</p>
<pre><code>- host: test3.projectname... |
<p>I have the following situation (this is my motivation to ask the question, not the question itself):</p>
<ul>
<li>I've got a web application that accepts uploads from users.
<ul>
<li>The users access the application through an Ingress,</li>
<li>then a Service,</li>
<li>Then a Deployment with two Pods.</li>
<li>Appli... | <p>The only resources in K8s that produce logs are Pods! Pods lead to the creation of containers, which for their part lead to the creation of Linux processes on the K8s nodes. Those processes write logs that are "reaped" by the container runtime and made available to K8s, e.g. when you run <code>kubectl logs... |
<p>I'm trying to create a validating webhook</p>
<pre class="lang-sh prettyprint-override"><code>kubebuilder create webhook batch \
--version v1 \
--kind Webhook \
--defaulting \
--programmatic-validation
</code></pre>
<p>but it always gives me an error.</p>
<pre><code>fa... | <p>I just got the same problem, seems like kubebuilder look at a file called <code>PROJECT</code> at the root of your project to validate whether the API has been created or not. So before you create the defaulting webhook, make sure you have created the API before you create the webhook, I'm having a hard time explain... |
<p>I want to create a cluster which is very similar to this one where they are using azure.
<a href="https://medium.com/devops-dudes/how-to-setup-completely-private-azure-kubernetes-service-aks-clusters-with-azure-private-links-b800a5a6776f" rel="nofollow noreferrer">Link to the tutorial</a></p>
<p>Whatever tutorials i... | <p>The AKS tutorial you posted aim to create completely Private Azure Kubernetes Service (AKS).</p>
<p>Anyway, either case you can use <a href="https://eksctl.io/introduction/" rel="nofollow noreferrer">eksctl</a> to easily create one, here's a quick example where public access to control plane is disabled and allow no... |
<p>I am researching the K8s architecture, focusing on the flow of pod spinning in the system.</p>
<p>I was wondering <em><strong>how</strong></em> (that is, who is initiating the communication) and <em><strong>when</strong></em> the different components of the control plane communicate with each other.</p>
<p>I have fo... | <p>Answering your questions:</p>
<p><strong>Who initiates the resource check of each node?</strong></p>
<p>The component responsible for that is <em>"Node Status Manager"</em> which is a sub-control loop of the "<em>SyncLoop"</em> which is a <a href="https://kubernetes.io/docs/reference/command-line... |
<p>I have a script that creates users with specific access.</p>
<p>the script runs the following commands:</p>
<pre><code>kubectl create serviceaccount username
kubectl create clusterrole readonlyuser --non-resource-url=* --verb=get,list,watch --resource=pods,pods/attach,pods/exec,pods/port-forward,pods/proxy,services/... | <p>The error message state the following:</p>
<pre><code> cannot create resource "pods/exec" in API group "" in the namespace "namespace"
</code></pre>
<p>So created another clusterrole and rolebinding as follow:</p>
<pre><code>kubectl create clusterrole exec-readonlyuser --verb create --r... |
<p>I am currently studying distributed systems and have seen that many businesses relies on side-car proxy pattern for their services. For example, I know a company that uses an nginx proxy for authentication of their services and roles and permissions instead of including this business logic within their services.</p>... | <p>I recommend you to define what really you need and continue your research based on this, since this topic is too broad and doesn't have one correct answer.</p>
<p>Due to this, I decided to post a community wiki answer. Feel free to expand it.</p>
<p>There can be various reasons for running some containers in one pod... |
<p>To make a persistent namespace with <code>unshare</code> you use the syntax:</p>
<pre><code>touch /root/mynetns1
unshare --net==/root/mynetns1
</code></pre>
<p>To make a persistent namespace with <code>ip</code> you use the syntax:</p>
<pre><code>ip netns add mynetns2
</code></pre>
<p>The <code>ip</code> command doe... | <p>Both <code>unshare --net=/somefile</code> and <code>ip netns add somename</code> create a new network namespace and bind-mount it to somewhere. The only difference is that <code>unshare</code> bind-mounts it to whatever file you specify, and <code>ip</code> bind-mounts it to a new file in <code>/var/run/netns/</code... |
<p>In minikube, API server fails to connect to my audit log webhook, I see the following error in the api-server logs</p>
<pre><code>E0308 08:30:26.457841 1 metrics.go:109] Error in audit plugin 'webhook' affecting 400 audit events: Post "http://ca-audit.armo-system:8888/": dial tcp: lookup ca-audit.arm... | <p>Actually I don't know well about minikube but I have used audit for k8s so my answer wouldn't be help for minikube environment.</p>
<p><em>First</em>, k8s dns format is incorrect. It should be <strong>{service-name}.{namespace}.svc or {service-name}.{namespace}.svc.cluster.local</strong>. Of course, http:// or https... |
<p>In Kubernetes, I have the following section in deployment.yaml. I am using ConfigMap and I want to set the path dynamically based on the pod metadata or label or env variable in pod. Does ConfigMap support setting path dynamically?</p>
<pre><code>spec:
volumes:
- name: configmap... | <p>This is call substitution which kubectl does not support out of the box. However, you can easily achieve what you want by using <a href="https://stackoverflow.com/questions/14155596/how-to-substitute-shell-variables-in-complex-text-files">envsubst</a> command which will substitute <code>$ENVIRONMENT</code> in your y... |
<p>We are running a Kubernetes cluster on AKS. The cluster runs on multiple node pools. Autoscaling is enabled to make sure nodes are added or removed when necessary.</p>
<p>I can see the current used amount of nodes by navigating to AKS -> Settings -> Node pools on the Azure Portal. However, I'm not able to get ... | <p>AFAIK there is not such a metric. a small workaround could be:</p>
<p>In the Portal go to your AKS -> Monitoring -> Metrics. In the Scope select your AKS, Scope Namespace is <code>Container service</code> and then you have the following metrics:</p>
<ul>
<li><p><code>Cluster Health</code> - determines if the a... |
<p>I'm working on a POC for getting a Spark cluster set up to use Kubernetes for resource management using AKS (Azure Kubernetes Service). I'm using spark-submit to submit pyspark applications to k8s in cluster mode and I've been successful in getting applications to run fine.</p>
<p>I got Azure file share set up to st... | <blockquote>
<p>The owner and user are root.</p>
</blockquote>
<p>It looks like you've mounted your volume as root. Your problem:</p>
<pre><code>chmod: changing permissions of '/opt/spark/work-dir/output/counts': Operation not permitted
</code></pre>
<p>is due to the fact that you are trying to change the permissions o... |
<p>I am deploying application with helm chart.
I am facing an issue with StorageClass rook-ceph whenever I deploy a chart my pods are in pending state because pvc are not getting created. Logs for pvc are</p>
<pre><code>Warning ProvisioningFailed 96s (x13 over 20m) rook-ceph.cephfs.csi.ceph.com_csi-cephfsplugin-... | <p>try to restart MDS service, if you can copy the data of pvc to a new one, it should work also</p>
|
<p>I wanted to create alerts in Grafana for My Kubernetes Clusters.
I have configured Prometheus, Node exporter, Kube-Metrics, Alert Manager in my k8s Cluster.
I wanted to setup Alerting on Unschedulable or Failed Pods.</p>
<ol>
<li>Cause of unschedulable or failed pods</li>
<li>Generating an alert after a while</li>
<... | <p>Based on the comment from <a href="https://stackoverflow.com/users/8803619/suresh-vishnoi" title="14,017 reputation">Suresh Vishnoi</a>:</p>
<blockquote>
<p>it might be helpful <a href="https://awesome-prometheus-alerts.grep.to/rules.html#kubernetes" rel="noreferrer">awesome-prometheus-alerts.grep.to/rules.html#kube... |
<p>Trying to following the use-case examples given in the official Kubernetes documentation for using secrets as environment variables (referenced <a href="https://kubernetes.io/docs/concepts/configuration/secret/#use-case-as-container-environment-variables" rel="nofollow noreferrer">here</a> ), I made both my secret a... | <p><code>imagePullSecrets</code> has a different format than just the ID and password. You need to specify the registry FQDN and the username and password. You can find more information in <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">Pull an I... |
<p>Assume there is a backend application with a private key stored in a .env file.</p>
<p>For the project file structure:</p>
<pre><code>|-App files
|-Dockerfile
|-.env
</code></pre>
<p>If I run the docker image locally, the application can be reached normally by using a valid public key during the API request. However... | <p>Moving this out of comments for better visibility.</p>
<hr />
<p>First and most important is docker is not the same as kubernetes. What works on docker, won't work directly on kubernetes. Docker is a container runtime, while kubernetes is a container orchestration tool which sits on top of docker (not always docker ... |
<p>In Kubernetes, I have the following section in deployment.yaml. I am using ConfigMap and I want to set the path dynamically based on the pod metadata or label or env variable in pod. Does ConfigMap support setting path dynamically?</p>
<pre><code>spec:
volumes:
- name: configmap... | <p>As an alternative to <a href="https://stackoverflow.com/questions/14155596/how-to-substitute-shell-variables-in-complex-text-files">envsubst</a>, that was absolutely correct answered by @gohm's, you may wanna try to use combination of job, that will check your configmap and pass proper values to your <code>path</cod... |
<p>I have 3 configs in service:</p>
<pre class="lang-py prettyprint-override"><code>1 - appsettings.development.json
2 - appsettings.testing.json
3 - appsettings.production.json
</code></pre>
<p>And i have 3 launch settings for them as well in <code>launchsettings.json</code>:</p>
<pre class="lang-json prettyprint-over... | <h2>Short answer</h2>
<p>No, there is no such option.</p>
<h2>Longer one</h2>
<p>First of all, you can easily set environment variables using <code>Environment.SetEnvironmentVariable("name", "value")</code>. But that's probably not what you want.</p>
<p>What you might want is to configure environmen... |
<p>Say I have several services in kubernetes. And I have one entry point to the cluster, it's a public facing service that is meant to validate the JWT token (from AWS cognito).</p>
<p>The entry point routes the request to an internal service, and that in turn usually makes more requests to other internal services.</p>... | <p>Posted a community wiki answer for better visibility. Feel free to expand it.</p>
<hr />
<p>As David Szalai’s comment mentioned, it depends on your security and project requirements:</p>
<blockquote>
<p>If you go with a zero-trust model inside k8s, you can use mTLS with a service mesh between services. Passing JWTs ... |
<p>I've created a cronjob in kubernetes to do scheduled backups of my postgresql db (assuming that I have PGPASS Secret already created):</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-backup-dev
spec:
# Backup the database every day at 2AM
schedule: "0 2 * * *"
jobTem... | <p>You need a shared volume.</p>
<p>If the pods are on the same host, you can use a <code>hostPath</code> volume.</p>
<p>If the pods are on a cluster, you need a different storage backend, like NFS, EFS (on AWS), CephFS or GlusterFS.</p>
|
<p>What is the purpose of <code>kubectl logs deploy/my-deployment</code> shown at <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#interacting-with-deployments-and-services" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/kubectl/cheatsheet/#interacting-with-deployments-and-services</a>?... | <p>If your deployment has multiple pod replicas, then <code>kubectl logs deployment/...</code> will just pick one on its own.</p>
<p>Here is an example:</p>
<pre><code>kubectl get pods -n kube-system | grep coredns
coredns-78fcd69978-dqf95 1/1 Running 0 42h
coredns-78fcd69978-vgvf2 1/1 R... |
<p>I am just exploring and want to helm my k8dash, but got the weird error since I have been able to deploy on AWS EKS.</p>
<p>I am running them on my Minikube <code>V1.23.2</code></p>
<p>My helm version is <code>v3.6.2</code></p>
<p>Kubernetes kubectl version is <code>v1.22.3</code></p>
<p>Basically if I do helm templ... | <p>You have to install additional CRDs as both <code>VirtualServer</code> and <code>VirtualServerRoute</code> are not oob, but nginx resources.</p>
<p><a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions" rel="nofollow noreferrer">CustomResourceDefinit... |
<p>Giving the port forward object</p>
<pre><code>from kubernetes.stream import stream, portforward
pf = portforward(
k8s_client_v1.connect_get_namespaced_pod_portforward,
pod_name,
name_space,
ports=port
)
pf.socket(port)
</code></pre>
<p><code>pf</code> is a socke... | <p>I am not an expert on sockets, but I managed to wrap the socket from the port forwarding with a <code>http.client.HTTPConnection</code>. I wanted to patch <code>requests</code>, but I could not make it work.</p>
<p>Anyway, this way the http requests can be implemented more conveniently in a high level fashion. Not s... |
<p><strong>EDIT:</strong></p>
<p>I deleted minikube, enabled kubernetes in Docker desktop for Windows and installed <code>ingress-nginx</code> manually.</p>
<pre><code>$helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace
Relea... | <h2>Reproduction</h2>
<p>I reproduced the case using minikube <code>v1.24.0</code>, Docker desktop <code>4.2.0</code>, engine <code>20.10.10</code></p>
<p>First, <code>localhost</code> in ingress appears due to logic, it doesn't really matter what IP address is behind the domain in <code>/etc/hosts</code>, I added a di... |
<p>I'm trying to configure a <code>gitlab-ci.yml</code> file to automatically build two Docker images. I've seen it being done with docker-compose, but in my case I don't want to use docker-compose.</p>
<p>The <code>docker-compose.yml</code> configuration that I've seen is something like this:</p>
<pre class="lang-yaml... | <p>You could make use of Kaniko as a docker build tool and GitLabs feature called matrix builds.</p>
<p><strong>How to use kaniko for building docker images</strong></p>
<p>Snippet below is taken from the official GitLab <a href="https://docs.gitlab.com/ee/ci/docker/using_kaniko.html#building-a-docker-image-with-kaniko... |
<p>I am using helm 3, and would like to concatenate 3 secretRefKeys into a single value of Env Var.</p>
<p>This is my cronjob.yaml file:</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
name: my-cronjob
spec:
schedule: {{ .Values.cron }}
jobTemplate:
spec:
template:
spec:
i... | <p>That's correct; when you submit the pod spec to the Kubernetes API it will contain that literal string including the <code>$(...)</code> references (and also the <code>secretRef:</code> blocks and not the values of the secrets).</p>
<p>When Kubernetes creates the Pods and starts the containers, at that point the clu... |
<p>I am using helm 3, and would like to concatenate 3 secretRefKeys into a single value of Env Var.</p>
<p>This is my cronjob.yaml file:</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
name: my-cronjob
spec:
schedule: {{ .Values.cron }}
jobTemplate:
spec:
template:
spec:
i... | <p><code>helm template</code> is not going to resolve those environment variables, it is just going to render the template, as the documentation states.</p>
<p>You will need to deploy the chart. I've made a simple example:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
spec:
... |
<p>I am backuping my Postgresql database using this cronjob:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-backup
spec:
schedule: "0 2 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: postgres-backup
image: ... | <p><a href="https://stackoverflow.com/users/3638081/confused-genius">@confused genius</a> gave me a great idea to create another same container to access the dump files so this is the solution that works:</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-backup
spec:
schedule: "0 ... |
<p>I have a multi-container pod in k8s, let's call them A and B. When stopping the pod, A must stop before B because A needs B until it's off.</p>
<p>To do that, I registered a <code>preStop</code> hook on A so A can gracefully stop before B.</p>
<p>However I'm not sure this is a good solution, because I miss some info... | <p>Typically, during pod deletion, the container runtime sends a TERM signal to the main process in each container.</p>
<p>According to <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">the official documentation</a>:</p>
<blockquote>
<ol>
<li><p>If on... |
<p>I am using a service account with a role assigned to it using OIDC. I opened shell in the pod and checked current role,</p>
<p><a href="https://i.stack.imgur.com/57fNu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/57fNu.png" alt="enter image description here" /></a></p>
<p>but my service is doin... | <blockquote>
<p>The containers in your pods must use an AWS SDK version that supports
assuming an IAM role via an OIDC web identity token file.</p>
</blockquote>
<p>Check if you meet the minimum requirement for <a href="https://github.com/boto/boto3" rel="nofollow noreferrer">boto3</a> is 1.9.220, for <a href="https://... |
<p>I have 3 vps with docker installed. I have created a docker image and I would like to know if there is a possibility to configure docker or docker-compose in such a way that these 3 containers run only once a day at random hours.</p>
<p>I have not found any way other than to configure the command to start the docker... | <p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p>
<p>Possible solutions to this problem are listed below.</p>
<p><strong>Docker</strong></p>
<p>Bash script, which is called from Linux crontab to start Docker.</p>
<p><strong>Kubernetes</strong></p>
<p>Since Docker / Do... |
<p>I am using Velero to create and backup and restore, Velero has controllers which get triggered when I can create the custom objects.</p>
<pre><code>import veleroApi "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
restoreObj := veleroApi.Restore{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav... | <p>If you would like to create a client for custom object follow the following steps:</p>
<ol>
<li>Describe the custom resource for which you would like to create a rest client:</li>
</ol>
<pre><code>kubectl describe CustomResourceDefinition <custom resource definition name>
</code></pre>
<p>Note down the <code>A... |
<p>My use case is to make a kubernetes pod's metrics be available for consumption every 2 secs. It is required to poll the pod at this interval to maintain a healthy control plane (determine pods that are possibly choked and avoid routing traffic to those endpoints).</p>
<p>I'm using metrics-server right now, but it is... | <p>I think the easiest would be to add a /metrics endpoint on your workloads and then scrape that using <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus" rel="nofollow noreferrer">prometheus</a> and the implement the <a href="https://github.com/prometheus-community/helm-charts/tr... |
<p>I have an Nginx ingress controller in my Kubernetes cluster and I use bitnami/nats.</p>
<p>The services produced are the following:</p>
<pre><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nats-client ClusterIP 10.72.13.82 <none> 4222/TCP ... | <p>Do you mind opening an issue <a href="https://github.com/bitnami/charts/issues" rel="nofollow noreferrer">here</a>? That way we could ask for more information and provide a better help. Once it is solved we can come back here a post the findings so other users can get it too.
Please, when opening issue provide all t... |
<p>I have a Kubernetes cluster with an install of <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">kube-prometheus-stack</a> (Prometheus 2.27.1, kube-state-metrics v2.0.0)</p>
<p>I would like to have a query to return how much time each pod w... | <p>One working solution is this:</p>
<pre><code>sum by(namespace, pod) (
(last_over_time(kube_pod_completion_time[1d])
- last_over_time(kube_pod_created[1d]))
or
(time() - kube_pod_created)
)
</code></pre>
<p>The first part inside <code>sum</code> handles the case of pods that have terminated. We pic... |
<p>We run a Kubernetes-compatible (OKD 3.11) on-prem / private cloud cluster with backend apps communicating with low-latency Redis databases used as caches and K/V stores. The new architecture design is about to divide worker nodes equally between two geographically distributed data centers ("regions"). We c... | <p>Posting this out of comments as community wiki for better visibility, feel free to edit and expand.</p>
<hr />
<p>Best option to solve this question is to use <a href="https://istio.io/latest/docs/tasks/traffic-management/locality-load-balancing/" rel="nofollow noreferrer"><code>istio - Locality Load Balancing</code... |
<p>We run a Kubernetes-compatible (OKD 3.11) on-prem / private cloud cluster with backend apps communicating with low-latency Redis databases used as caches and K/V stores. The new architecture design is about to divide worker nodes equally between two geographically distributed data centers ("regions"). We c... | <p>So effective region-pinning solution is more complex than just using <code>nodeAffinity</code> in the "preferred" version. This alone will cause you a lot of unpredictable surprises due to the opinionated character of Kubernetes that has zone spreading hard-coded, as seen in this <a href="https://github.c... |
<ol>
<li><p>I created a build config from the git repo (Docker based app).</p>
<p><code>oc new-build <git-url> --name=myApp</code></p></li>
<li><p>Created a deployment config using:</p>
<p><code>oc create dc myApp --image=<image-stream-repo></code></p></li>
</ol>
<p>I am adding labels to this deployment ... | <p>To set a label on a <code>Pod</code> using a <code>DeploymentConfig</code>, the label must be placed in a much more deeply nested key, as shown below, or else it will be set on the <code>DeploymentConfig</code> itself, not the <code>Pod</code>:</p>
<pre><code>objects:
- kind: DeploymentConfig
apiVersion: v1
... |
<p>I have 2 kubernetes clusters in the IBM cloud, one has 2 Nodes, the other one 4.</p>
<p>The one that has 4 Nodes is working properly but at the other one I had to temporarily remove the worker nodes due to monetary reasons (shouldn't be payed while being idle).</p>
<p>When I reactivated the two nodes, everything see... | <h1>Problem resolved…</h1>
<p>The cause of the problem was an update of the cluster to the kubernetes version 1.21 while my cluster was meeting the following conditions:</p>
<ul>
<li>private and public service endpoint enabled</li>
<li>VRF disabled</li>
</ul>
<h2>Root cause:</h2>
<p>In Kubernetes version 1.21, Konnecti... |
<p>I want to implement custom logic to determine readiness for my pod, and I went over this: <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.kubernetes-probes.external-state" rel="noreferrer">https://docs.spring.io/spring-boot/docs/current/reference/html/actuator... | <p>customCheck is a key for your custom HealthIndicator. The key for a given HealthIndicator is the name of the bean without the HealthIndicator suffix</p>
<p>You can read:
<a href="https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.health.writing-custom-health-indicators" r... |
<p>I have situation where I am deploying some chart, let's call it "myChart".</p>
<p>Let's suppose I have a pipeline, where I am doing below:</p>
<pre><code>helm delete myChart_1.2 -n <myNamespace>
</code></pre>
<p>An <strong>right after</strong> I am installing new one:</p>
<pre><code>helm delete myCha... | <p>Helm delete (aka. uninstall) should remove the objects managed in a given deployment, before exiting.</p>
<p>Still, when the command returns: you could be left with resources in a Terminating state, pending actual deletion.</p>
<p>Usually, we could find about PVC, that may still be attached to a running container.</... |
<p>Can I replicate data between Kubernetes PV into two separate clusters situated in different data centers?</p>
<p>I have a cluster with associated PV running in Primary site. I have a separate cluster running in DR site.</p>
<p>How do I continuously replicate data in primary site to DR site so that when application i... | <p><a href="https://stackoverflow.com/users/1328672/narain">Narain</a> is right. <strong>Kubernetes doesn't contain any functionality that would allow you to synchronize two PVs used by two different clusters</strong>. So you would need to find your own solution to synchronize those two filesystems. It can be an existi... |
<p>I want to list my deployments based on a key value pair found in the <code>.spec.selector.matchLabels</code> field.</p>
<p>Doing so using the plain <code>labels</code> is easy, but I could not find a way to match / fetch the deployment that satisfies the condition that a certain <code>key=value</code> is present in ... | <p>It is not supported:</p>
<ul>
<li><a href="https://github.com/kubernetes/client-go/issues/713#issuecomment-557540936" rel="nofollow noreferrer">https://github.com/kubernetes/client-go/issues/713#issuecomment-557540936</a></li>
<li>and <a href="https://github.com/kubernetes/kubernetes/issues/53459" rel="nofollow nore... |
<p>I'm confused with the following response.</p>
<p>what's the meaning of <code>"apiVersion": "v1",</code>???</p>
<p>I'm expecting the <code>apiVersion</code> to be <code>v1beta1</code>.</p>
<pre><code>$ curl http://127.0.0.1:8080/apis/batch/v1beta1
{
"kind": "APIResourceList",... | <p>Modular structure of K8s API, which allows for versioning and grouping.
You can find more information about on the following pages:</p>
<ul>
<li><a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md" rel="nofollow noreferrer">https://github.com/kubernet... |
<p>I'm trying to deploy a Kubernetes Operator using <a href="https://kopf.readthedocs.io/en/stable/" rel="nofollow noreferrer">Kopf</a> and I'm getting the following error:</p>
<pre><code>kopf._cogs.clients.errors.APIForbiddenError: ('exchangerates.operators.brennerm.github.io is forbidden: User "system:serviceacc... | <p>User <a href="https://stackoverflow.com/users/857383/sergey-vasilyev" title="3,401 reputation">Sergey Vasilyev</a> has tested this configuration and mentioned in the comment:</p>
<blockquote>
<p>You are right, "*" works. I tried your repo locally with Minikube 1.24.0 & K8s 1.22.3 — it works, there are ... |
<p>I have 3 vps with docker installed. I have created a docker image and I would like to know if there is a possibility to configure docker or docker-compose in such a way that these 3 containers run only once a day at random hours.</p>
<p>I have not found any way other than to configure the command to start the docker... | <p>If "randomness" is part of your application behaviour, then you should contain this logic inside one of services / containers, so this is no-brainer. You are running entire stack with <code>docker-compose</code> and it just works.</p>
<p>Other than that <code>Crontab</code> or other external scheduler (lik... |
<p>I am running Spark on Kubernetes and need to monitor the Spark Job in runtime.<br />
How can I access the SparkUI page of my job while it's running?</p>
| <ol>
<li>Enable port forwarding for the Spark driver pod:</li>
</ol>
<pre class="lang-sh prettyprint-override"><code>kubectl port-forward <driver-pod-name> 4040:4040
</code></pre>
<ol start="2">
<li>Access the SparkUI from your web via <code>http://localhost:4040</code></li>
</ol>
<hr />
<p>You can also make sure... |
<p>We are running a single NodeJS instance in a Pod with a request of 1 CPU, and no limit. Upon load testing, we observed the following:</p>
<pre><code>NAME CPU(cores) MEMORY(bytes)
backend-deployment-5d6d4c978-5qvsh 3346m 103Mi
backend-deployment... | <p>Although Node.js runs the main application code in a single thread, the Node.js runtime is multi-threaded. Node.js has an internal <a href="https://nodejs.org/en/docs/guides/dont-block-the-event-loop/" rel="nofollow noreferrer">worker pool</a> that is used to run background tasks, including I/O and certain CPU-inte... |
<p>On my kubernetes nodes there are</p>
<ol>
<li>prioritized pods</li>
<li>dispensable pods</li>
</ol>
<p>Therefore I would like to have QoS class of <code>Guaranteed</code> for the prioritized pods.
To achieve a <code>Guaranteed</code> class the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/quality... | <blockquote>
<p>Is it possible to set explicitly the <code>Guaranteed</code> class to a pod even with difference CPU request and limit?</p>
</blockquote>
<p><strong>Yes, however you will need to use an additional plugin: <a href="https://github.com/kubernetes-sigs/scheduler-plugins/tree/master/kep/9-capacity-scheduling... |
<p>I'm using spring boot 2.5.6 and I'm generating the docker image with the spring boot maven plugin.
I'm deploying the application using AWS EKS with nodes managed by fargate.</p>
<p>The plugin configuration is the following</p>
<pre><code><plugin>
<groupId>org.springframework.boot</groupId>
... | <p>Posting this out of comments for better visibility.</p>
<hr />
<p>An important thing to mention is when <code>free</code> command is run inside a pod's container, it shows all available memory on the node where this pod is scheduled and running.</p>
<p>At this point it's very important to have memory <code>resources... |
<p>we are planning to introduce AWS spot instances in production ( non-prod is running with spot already ). In order to achieve HA we are running HPA with minimum replicas 2 for all critical deployments. Because of the spot instances behaviour we want to run on-demand instances and one pod should be running on on-deman... | <p>Short answer is <code>No</code>. No such way to define per replica. As you are already using podAntiAffinity, just by adding the same pod labels, you can ensure no two replicas stays in the same host (if that's not what you are already doing). And then use <a href="https://github.com/aws/aws-node-termination-handler... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.