prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I'm attempting to add some <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/" rel="nofollow noreferrer">recommended labels</a> to several k8s resources, and I can't see a good way to add labels for things that would change frequently, in this case "app.kubernetes.io/insta... | <p>Kustomize's <code>commonLabels</code> transformer is a common way to handle this, sometimes via a component. It really depends on your overall layout.</p>
|
<p>I just start using kustomize. I have the following yaml files for kustomize:</p>
<pre><code>ls -l ./kustomize/base/
816 Apr 18 21:25 deployment.yaml
110 Apr 18 21:31 kustomization.yaml
310 Apr 18 21:25 service.yaml
</code></pre>
<p>where deployment.yaml and service.yaml are generated files with jib and they are fi... | <p>I got the same issue and fixed.
This issue is related to Kustomize version installed. Check! <code>kustomize version</code>.
From Kustomize v3.0.x
and above, we need to mention namespace in patches too. After added namespace in patches yaml files, issue get resolved.</p>
<p>In your example add namespace under metad... |
<p>I encountered the following error when added <strong>spring-cloud-starter-kubernetes-config</strong> dependency to my pom.xml:</p>
<pre><code>io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred. Caused by: java.security.cert.CertificateException: Could not parse certificate: java.io.IOExcep... | <p>That problem could happen due to the installed <code>kubectl</code>. The easiest way to avoid this problem - rename <code>~/.kube</code> (directory with configs) to some other name like <code>~/.kube-hide</code></p>
<pre><code>mv ~/.kube ~/.kube-hide
</code></pre>
<p>And when you will need to use your <code>kubectl<... |
<p>How can I make <code>Skaffold</code> forward privileged/protected/special ports which have numbers below <code>1024</code>? In my <code>skaffold.yaml</code> I added:</p>
<pre class="lang-yaml prettyprint-override"><code>portForward:
- resourceType: service
resourceName: foo
port: 80
localPort: 80
</code></pre>... | <p>This should work. We changed Skaffold's behaviour to prevent it from allocating system ports (≤ 1024), but user-defined port-forwards with explicit <code>localPort</code>s will still be honoured.</p>
<p>You didn't say what ports you were seeing being allocated, but I suspect they were ports 4503–4533, in which you'... |
<p>How is it possible to use more than one domain in the same cluster?</p>
<p>At the moment I've running ONE cluster with <strong>one domain</strong> pointing to a hardware <code>loadbalancer</code> and <code>traefik</code> as an <code>ingress-controller</code>.</p>
<p>Now I wanna add a second domain pointing to differ... | <blockquote>
<p>a second ingress-controller with a second LoadBalancer (and pointing
the second domain to that second LB)?</p>
</blockquote>
<p><strong>No</strong> there is no requirement for a second LoadBalancer. You can single LB backed by the ingress controller and map the multiple domains.</p>
<p><strong>to point ... |
<p>I have a Kubernetes project managed by Kustomized (Kubernetes). This project deploys two deployments in the same namespace.</p>
<p>Basically, I have the following directory structure:</p>
<pre><code>kustomize -> app1 -> kustomization.yaml
kustomize -> app1 -> namespace.yaml
kustomize -> app1 -> app... | <p>You can have this directory structure:</p>
<pre><code>kustomize -> ns -> namespace.yaml
kustomize -> app1 -> kustomization.yaml
kustomize -> app1 -> app1.yaml
kustomize -> app2 -> kustomization.yaml
kustomize -> app2 -> app2.yaml
</code></pre>
<p>Also you can add a <code>kustomization... |
<p>I have these volume mounts right now defined in my deployment,</p>
<pre><code>volumeMounts:
- name: website-storage
mountPath: /app/upload
readOnly: false
subPath: foo/upload
- name: website-storage
mountPath: /app/html
readOnly: true
subPat... | <p>The cause of the issue is that during pod initialization there is an attempt to create directory <code>website-content</code> in the <code>/app/html</code> location which will cause error as the <code>/app/html</code> is mounted read only.</p>
<p>You cannot create a folder in the read only system that means you can'... |
<ol>
<li>node.js express server bound to port 8080</li>
</ol>
<pre><code>server.listen(8080, () => {
logger.log({
level: 'info',
message: 'Listening on port ' + port
})
})
</code></pre>
<ol start="2">
<li>Docker image with node.js code + npm modules with port 8080 exposed</li>
</ol>
<pre><code>FROM no... | <p>There are some potential sources of errors here.</p>
<p>First potential problem is that your Docker image does not work as expected. You can try this: Use <code>nginx:latest</code> as your image and try if this works. If this works the Kubernetes parts are working correctly and you can do further investigation on y... |
<p>I have one question regarding helmfile. The question is: how to set annotations to deployment using helmfile? I've tried by using set instruction but It's not working. Also didn't find any information in docs.</p>
| <p>Checked very similar stack question <a href="https://stackoverflow.com/questions/49856305/how-do-i-assign-value-to-variable-in-helmfile">How do I assign value to variable in helmfile?</a>?</p>
<p>you can do <a href="https://github.com/cloudposse/geodesic/blob/0.12.0/rootfs/conf/kops/helmfile.yaml#L63-L137" rel="nofo... |
<p>i am a begginer in kubernetes i am trying to run an elasticsearch cluster in it for nthat i am following this (tutorial)[https://phoenixnap.com/kb/elasticsearch-helm-chart] followed all the commands as it is and in the ebnd when i do</p>
<pre><code>kubectl get pods --namespace=default -l app=elasticsearch-master -w
... | <p>There is an <a href="https://github.com/elastic/helm-charts/issues/775" rel="nofollow noreferrer">open issue around this helm on GitHub</a>.</p>
<pre><code>Check once which storage class you have for PVC creation.
</code></pre>
<p>however, still, there could be multiple reasons for this issue like <strong>PVC</stro... |
<p>I'm using a Microk8s setup with the following configuration -</p>
<p><strong>deployment.yaml</strong></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins
labels:
app: jenkins
spec:
selector:
matchLabels:
app: jenkins
replicas: 1
strategy:
type: RollingUpdate
ro... | <p>In order to solve this problem on Microk8s, enable dns addon BEFORE deploying with command <code>microk8s enable dns</code></p>
|
<p>The <strong>metrics-server-v0.3.6</strong> deployment that is installed into GKE clusters by default is using an outdated version of addon-resizer (<strong>addon-resizer:1.8.11-gke.0</strong>) that causes CPU utilization and throttling issues. See <a href="https://www.gitmemory.com/issue/kubernetes/autoscaler/4141/8... | <p>You cannot update those deployments. Any updates you make will be reverted to the original deployment spec.</p>
<p>Looks like the "fix" will be released with 1.22 and initially backported to 1.21 as well. It will likely make it back to 1.19+ eventually.</p>
|
<p>I am using client-go to continuouslly pull log streams from kubernetes pods. Most of the time everything works as expected, until the job runs couple of hours.</p>
<p>The code is like below:</p>
<pre><code>podLogOpts := corev1.PodLogOptions{ Follow: true, }
kubeJob, err := l.k8sclient.GetKubeJob(l.job.GetNamespace()... | <p>When you contact logs endpoint what happens is that apiserver is forwarding your request to the kubelet which is hosting your pod. Kubelet server then start streaming content of the log file <a href="https://github.com/kubernetes/kubernetes/blob/985ac8ae5089d3312640b0fca795469fb8025f2a/pkg/kubelet/server/server.go#L... |
<p>I've been reading other questions about getting K8s environment variables to work in a Next.js app, but no accepted answer till now.</p>
<p>My app works fine using .env.local but it's getting an error (undefined) when deployed to K8s.</p>
<p>This is my next.config.js</p>
<pre class="lang-js prettyprint-override"><co... | <p>You should add the <code>ENV_VARS</code> in a <code>.env.local</code> file. in form of a <code>configMap</code>. (<a href="https://nextjs.org/docs/basic-features/environment-variables" rel="noreferrer">https://nextjs.org/docs/basic-features/environment-variables</a>)</p>
<p>In Kubernetes you create a <code>configMap... |
<p>I am using an EKS cluster with 4 nodes. There are multiple applications running in the kubernetes cluster(nearly 30-40 pods) with different cpu and memory requests.</p>
<p>Now I wish to increase the memory of one particular pod, now how to choose what maximum memory I can assign to the pod in my cluster.</p>
<p>My I... | <p>There may be namespace specific limits, which could be lower than whats available at the node level. In this case, you will have to consider the namespace limits.</p>
<p>However, if thats not the case, as a starting value, you may the below command and look at the "Requests" column and choose the request v... |
<p>I have the following local 2-node kubernetes cluster-</p>
<pre><code>$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
srl1 Ready control-plane,master 2d18h v1.21.2 xxx.xxx.12.58 &l... | <p>May you have misunderstanding you have to use the <code>kind: deployment</code> if you want to manage the replicas (PODs - 1,2,3...n) on Kubernetes.</p>
<p>Daemon set behavior is like it will run the POD on each available node in the cluster.</p>
<p>So inside your cluster, there are <strong>two nodes</strong> so <st... |
<p>Hy there,</p>
<p>I'm trying to configure Kubernetes Cronjobs monitoring & alerts with Prometheus. I found this helpful <a href="https://medium.com/@tristan_96324/prometheus-k8s-cronjob-alerts-94bee7b90511" rel="nofollow noreferrer">guide</a></p>
<p>But I always get a <strong>many-to-many matching not allowed: ... | <p>I ran into the same issue when I followed that article, but for me, I actually get duplicate job names but in different namespaces.</p>
<p>Ex. When running <code>kube_job_status_start_time</code>:</p>
<pre><code>kube_job_status_start_time{instance="REDACTED",job="kube-state-metrics",job_name=&quo... |
<p>This is the output with <code>custom-columns</code></p>
<pre><code>$ kubectl -n web get pod -ocustom-columns="Name:.metadata.name,Image:.spec.containers[0].image"
Name Image
mysql-0 myrepo.mydomain.com/mysql:5.7
mysql-1 myrepo.mydomain.com/mysql:5.7
mysql-2 myrepo.mydomain.com/mysql:5.7
</code><... | <p>Using kubectl using plain <code>jsonpath</code>:</p>
<pre><code>kubectl get pod -n <namespace> -o jsonpath='{range .items[*]}{.metadata.name}={.spec.containers[*].image}{"\n"}{end}'
</code></pre>
<p>Example:</p>
<pre><code>kubectl get pod -n default -o jsonpath='{range .items[*]}{.metadata.name}={.sp... |
<p>We are trying to write a consumer that would subscribe to a particular topic and do some processing when a couple conditions in the data are met. One operation in the processing however can be done only once, and for the purpose of simplicity let us consider that to be a POST http request that is not idempotent.</p>... | <ol>
<li>Does the above look good for making the Consumer Idempotent?</li>
</ol>
<blockquote>
<p>Yes, from the POV of Idempotency, your code looks good. Since you're working with Kafka consumers, you don't need an exclusive for loop for message processing. Consumers are invoked on each message arrival. Your psuedo-code... |
<p>So I'm not sure if I'm using this feature incorrectly or it's a limitation of "anti-affinity" but I'm at a loss. I have a batch of jobs that I want to run with each one having their own node. Should be relatively simple, add the anti-affinity to only run the pod where the hostname + label does not exist. D... | <p>So as a shot in the dark I upgraded my cluster from 1.20 to 1.21 and it magically fixed itself. So it's possible this was just a 1.20 problem. I have a issue on the kubernetes github to look into it but all I can say is that if you're on 1.20 and having trouble with pod level anti-affinity maybe try upgrading.</p>
|
<p>We are using NFS volume (GCP filestore with 1TB size) to set RWX Many access PVC in GCP, the problem here is:
for example I allot a PVC of 5Gi and mount it to a nginx pod under /etc/nginx/test-pvc, instead of just allotting 5Gi it allots the whole NFS volume size.</p>
<p>I logged into the nginx pod and did a df -kh:... | <blockquote>
<p>Is there anything I'm missing ? Or is this the behaviour of NFS ?</p>
</blockquote>
<p>No, nothing at all. This is simply the way it works. And it's nothing specific to NFS either.</p>
<p><code>5Gi</code> of storage capacity defined in your <code>PV</code> can be treated more like a <strong>declaration<... |
<p>We are running Spark 3.1.1 on Kubernetes in client mode.</p>
<p>We are a simple scala spark application that loads parquet files from S3 and aggregates them:</p>
<pre><code>sparkSession.read.parquet(paths).as[MyRawEvent]
</code></pre>
<p>Our application runs perfectly on the happy-path: driver pod starts running, ex... | <p>Well, that's was an easy one.</p>
<p>I had to catch all exceptions to ensure that spark context is being closed no matter what:</p>
<pre><code> def main(args: Array[String]): Unit = {
// some code
implicit val sparkSession = SparkSession.builder().getOrCreate
try {
// application code with potenti... |
<p>I frequently update a Docker image using the same tag on Azure Container Registry. I would like to automatically run a rolling update when a new tag is pushed to my ACR, so pods are automatically updated with the latest version of the image.</p>
<p>ACR provides a Webhook feature to automatically call a webhook when ... | <p>Yes, it's possible. If ACR can call a webhook whenever a new image is pushed (even with the same tag), you can call a webhook service in your cluster. The service can then, for example, update an annotation in the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#podtemplatespec-v1-core" ... |
<p>Hi I am using ambassador for ny project. I have 2 services and 2 host files. When I apply "kubectl apply -f host1.yml" and "kubectl apply -f host2.yml" I got below error:
How can I produce the correct TLS cert by using Ambassador edge stack 1.13 ? What is wrong here?</p>
<pre><code>kubectl get ho... | <p>You should try installing the <strong>Cert-manager</strong> with the <strong>ambassador</strong>. Edge stack supports the Let's encrypt in <code>acmeProvider</code> but only with one challenge <code>HTTP-01</code>.</p>
<p>Your <strong>HTTP-01</strong> cert-challenge is getting failed while cert-manager supports the ... |
<p>I am writing the simplest fxn possible using <code>client-go</code> that justs performs in-cluster authentication and returns a pointer to the <code>kubernetes.Clientset</code> object</p>
<pre class="lang-golang prettyprint-override"><code>// getInClusterAuth performs in cluster authentication and returns the client... | <p>you can use k8s.io/client-go/kubernetes/fake.NewSimpleClientset to mock a clientSet in your unit test .</p>
<pre><code>
import (
"context"
"testing"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s... |
<p>I am trying to install Kubernetes in Mac. I followed these instructions - <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/tools/install-kubectl/</a> (for MacOs)</p>
<p>Followed all the 5 steps mentioned in that link</p>
<pre><code>1. curl -... | <p>For Mac M1 - install Rosetta <code>softwareupdate --install-rosetta</code></p>
<p>Working on my M1 Big Sur 11.5.1</p>
<p>For more info , have a look on this link <a href="https://support.apple.com/en-gb/HT211861" rel="nofollow noreferrer">Rosetta</a></p>
<p>Check this <a href="https://apple.stackexchange.com/questio... |
<p>I search (since many days ...) How to use Ingress Nginx in order to use External url as backend.</p>
<p>Yes I use Service object with externalName. I also test many many directive in nginx without succes...</p>
<p>The goal is simple:</p>
<ul>
<li>user can resolv and join only my public URL (url-public.com & url-... | <p>Reply to my self. The problem was my Ingress (and all my K8S cluster) is under HTTP Squid proxy.</p>
<p>I have mounted all env variable for proxy but it seems the Ingress container doesn't use it ...</p>
<p>So, to get it working, I allow my cluster to outbound 80/443 ports to the destination.</p>
<p>You just need th... |
<p>We are deploying a Rails application on Kubernetes.</p>
<p>The <code>assets:precompile</code> task run as part of the Docker image build process.</p>
<p>We want to run rake tasks like rake db:migrate task and other tasks on each deployment.</p>
<p>Current solution, we are using kubectl exec.</p>
<pre><code>deplyment... | <blockquote>
<p>We need to use kubernentes cronjob (.yaml) to start our rake taks</p>
</blockquote>
<p>I don't think you need a k8s <strong>cronjob</strong> to run your db migrations. You might wanna use the <em>job</em> resource in k8s, and run it as part of your CI/CD script. Run it right before you apply your deploy... |
<p><code>kubectl explain serviceaccount.secrets</code> describes ServiceAccount Secrets as the secrets allowed to be used by Pods running using this ServiceAccount, but what effect does adding a Secret name to this list have?</p>
<p>The ServiceAccount token Secret (which is automatically added to this list) gets automa... | <p>It holds the name of all secrets containing tokens for that SA so when the controller goes to rotate things, it knows where to find them.</p>
|
<h2>Overview</h2>
<p>Kubernetes scheduling errs on the side of 'not shuffling things around once scheduled and happy' which can lead to quite the level of imbalance in terms of CPU, Memory, and container count distribution. It can also mean that <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-s... | <p>After more research I'm fairly certain that using an outside tool like <a href="https://github.com/kubernetes-sigs/descheduler" rel="nofollow noreferrer">Descheduler</a> is the best way currently.</p>
<p>There doesn't seem to be a combination of Taints, Affinity rules, or Topology constraints that can work together ... |
<p>I read a bit about <code>Deployment</code> vs <code>StatefulSet</code> in Kubernetes. We usually need <code>StatefulSet</code> when we have a stateful app, so every pod can have its own volume.</p>
<p>Now, I have a task to introduce persistence for <code>RabbitMq</code>. I will have only one pod replica of <code>Rab... | <p>Even with 1 replica, a statefulset still gets you some thing, like stable network ID. You are right that most features stop mattering but it's really up to your specific needs.</p>
|
<p>We are using <a href="https://github.com/kubeflow/kfserving/tree/v0.5.1" rel="nofollow noreferrer">KFServing</a> in our kubernetes cluster. The project provides InferenceService struct and clientset in the folder pkg/.</p>
<p>How to import these packages under <a href="https://github.com/kubeflow/kfserving/tree/v0.5... | <p>Looking at the <code>kfserving</code> <code>go.mod</code> file at <code>v0.5.1</code>, I see <a href="https://github.com/kubeflow/kfserving/blob/aa1042a3b6f72a65f16e13771ce335b1844ad7fc/go.mod#L46-L71" rel="nofollow noreferrer">a big block of <code>replace</code> directives</a>. By design, <a href="https://golang.or... |
<p>I am trying to run Kubernetes and trying to use <code>sudo kubeadm init</code>.
Swap is off as recommended by official doc.</p>
<p>The issue is it displays the warning:</p>
<pre><code>[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localh... | <p>I faced similar issue recently. The problem was cgroup driver. Kubernetes cgroup driver was set to systems but docker was set to systemd. So I created <code>/etc/docker/daemon.json</code> and added below:</p>
<pre><code>{
"exec-opts": ["native.cgroupdriver=systemd"]
}
</code></pre>
<p>Then</p... |
<p>I have uploaded my image on ACR. When I try to deploy it using a <code>deployment.yaml</code> with <code>kubectl</code> commands, the <code>kubectl get pods</code> command shows <code>ErrImageNeverPull</code> in the pods.</p>
<p>Also, I am not using minikube. Is it necessary to use minikube for this?
I am a beginner... | <p>As <a href="https://stackoverflow.com/users/16077085/payal-jindal">Payal Jindal</a> mentioned in the comment:</p>
<blockquote>
<p>It worked fine. There was a problem with my docker installation.</p>
</blockquote>
<p>Problem is now resolved. The way forward is to set the image pull policy to <code>IfNotPresent</code>... |
<p>since a couple of days and without any change in the environment one of the clusters running kubernetes 1.19.9 on-prem showed some errors regarding kubelet certificates.</p>
<p>A node is in NON-READY state due to an expired certificate. Investigating a bit i've found out that the CSR are in pending state. I can appr... | <p>just in case anyone else face this situation. The issue was a legacy configuration for kubelet on the master nodes.</p>
<p><a href="https://serverfault.com/questions/1065444/how-can-i-find-which-kubernetes-certificate-has-expired">https://serverfault.com/questions/1065444/how-can-i-find-which-kubernetes-certificate-... |
<p>Currently struggling writing a Terraform module to deploy a Helm chart, I was getting:</p>
<pre><code>│ Error: YAML parse error on external-dns/templates/serviceaccount.yaml: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into Go struct field .metadata.annotations of type string
</code><... | <p>in <code>name = "serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"</code> you want to define 3 groups, that are separated by dots:</p>
<p><code>serviceAccount</code> -> <code>annotations</code> -> <code>eks.amazonaws.com/role-arn</code></p>
<p>Since your third group happens to contain dots,... |
<p>I'm seeing liveliness and readiness probes failing in the Kubernetes setup.</p>
<p>Below im attaching screenshots of Pod Events, Resource Limits of the pod, probe configurations.</p>
<p>Anyone can help he with this issue and some explanation why this can happen and when do we see status code 503 in probes.</p>
<p>th... | <p>Community wiki answer for better visibility. As <a href="https://stackoverflow.com/users/10753078/ni-kill12">ni_kill12</a> has mentioned in the comment, the issue is solved:</p>
<blockquote>
<p>I got the issue, what is happening is one of the component is going OUT_OF_STATE because of that readiness and liveliness p... |
<p>I have multiple applications that run using Node.js and pg (node-postgres).</p>
<p>The issue i have is that every app is getting the error "Connection terminated unexpectedly" every hour. Here is the error :</p>
<pre><code>> node ./dist/app.js
App Started
events.js:174
throw er; // Unhandled 'err... | <p>I found the problem :</p>
<p>In the Google Cloud SQL documentation : <code>WebSockets are always available to your application without any additional setup. Once a WebSockets connection is established, it will time out after one hour.</code></p>
<p>The error was generated by the usage of pg.Client() because i had a ... |
<ul>
<li>with istio 1.4.6</li>
</ul>
<p>I configured Kubernetes using resources such as <code>service</code>, <code>deployment</code>.
I also configured <code>gateway</code>, <code>virtual service</code>, and <code>destination rules</code> to implement circuit breakers.</p>
<p>The composition diagram is as follows. (<s... | <p>I guess the problem is not about Circuit Breaking, but about the usage of Virtual Services and Destination Rules.</p>
<p>For example, if using a Virtual Service with a Gateway, its host should probably be of public host, like <a href="http://amce.io" rel="nofollow noreferrer">http://amce.io</a></p>
<p>The host of th... |
<p>We have an Airflow (Celery executor) setup that can run tasks on our K8s cluster. The tasks that use KubernetesPodOperator can access K8s secrets <a href="https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/operators.html#how-to-use-cluster-configmaps-secrets-and-volumes-with-pod" rel="no... | <p>If you need to pass secrets between MWAA and K8s I would suggest using an external secrets manager.</p>
<p>AWS Secrets Manager can be used natively by MWAA and K8S.
<a href="https://docs.aws.amazon.com/mwaa/latest/userguide/connections-secrets-manager.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/mwaa/... |
<p>I am trying to use Persistent Volumes in AWS EKS.</p>
<p>I followed all the steps mentioned from the below link</p>
<p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-persistent-storage/" rel="noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/eks-persistent-storage/</a></p>
<p>Wh... | <p>From the error log, pick the id for search and i.e. <code>XXXXXXXXXXXX34FDCBXXXXX</code></p>
<pre><code>caused by: InvalidIdentityToken: No OpenIDConnect provider
found in your account for
https://oidc.eks.us-east-2.amazonaws.com/id
/XXXXXXXXXXXX34FDCBXXXXX
status code: 400, request id: 90b430ba-6999-41d8-ac15-13f... |
<p>I need to exclude specific host from the EnvoyFilter that looks like this:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: authn-filter
spec:
workloadLabels:
istio: ingressgateway
filters:
- filterConfig:
httpService:
serverUri:
uri: http... | <p>I found my answer <a href="https://stackoverflow.com/questions/63448933/istio-exclude-service-from-ext-auth">here</a>. The question asks to exclude some paths, but I was successful with hosts as well. This is what I used:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: byp... |
<p>I am doing my practice on <strong>Kubernetes</strong> through <strong>Minikube</strong> on my <strong>AWS EC2</strong>. As part of that, I have created <strong>deployment</strong> and exposed that through <strong>NodePort</strong> service, then checked with:</p>
<pre><code>curl http://<node-ip>:<service-por... | <p>I strongly recommend going through the official tutorial showing the <a href="https://minikube.sigs.k8s.io/docs/handbook/accessing/" rel="noreferrer">Accessing apps</a> options in Minikube:</p>
<blockquote>
<p>How to access applications running within minikube There are two major
categories of services in Kubernetes... |
<p>I get this log error for a pod like below but I updated kubernetes orchestrator, clusters, and nodes to kubernetes v1.21.2. Before updating it, they were v1.20.7. I found a reference that from v1.21, selfLink is completely removed. Why am I getting this error? How can I resolve this issue?</p>
<p><strong>error log f... | <p>Kubestone has had no releases since 2019, it needs to upgrade its copy of the Kubernetes Go client. That said, this appears to only impact the event recorder system so probably not a huge deal.</p>
|
<p>There are a few processes I'm struggling to wrap my brain around when it comes to multi-stage <code>Dockerfile</code>.</p>
<p>Using this as an example, I have a couple questions below it:</p>
<pre><code># Dockerfile
# Uses multi-stage builds requiring Docker 17.05 or higher
# See https://docs.docker.com/develop/deve... | <p>To answer from a less DevSpace-y persepctive and a more general Docker-y one (With no disrespect to Lukas!):</p>
<h2>Question 1</h2>
<h3>Breakdown</h3>
<blockquote>
<p>❌ Are you docker build ... this entire image and then just docker run ... --target= to run a specific stage</p>
</blockquote>
<p>You're close in your... |
<p>I am using Kustomize to manage my Kubernetes project with a StetefulSet that deploys a PostgreSQL cluster with three pods. I am working on Vagrant/VirtualBox so no dynamic provisioning of PV exists. For this reason, I have my own <code>pv.yaml</code> containing the manifest to deploy these 3 PVs.</p>
<p>Then I have ... | <p>You encountered an interesting problem regarding StatefulSet and PVC removal. There is a <a href="https://github.com/kubernetes/kubernetes/issues/55045" rel="nofollow noreferrer">discussion</a> whether PVCs created by the StatefulSet should be deleted when deleting the corresponding StatefulSet. We recently received... |
<p>I'm setting up Keyvault integration with k8s in Azure. I can mount a volume with secrets using the csi driver in Azure using Managed identities. I can verify the secret is mounted by exec-ing into the pod and cat-ing out the secrets. However, now I want to expose the secrets as environment variables, but I'm unclea... | <p>After more digging around, I found this bit to tickle in the helm chart to get the csi driver to create k8s secrets:</p>
<pre><code>secrets-store-csi-driver.syncSecret.enabled = true
</code></pre>
<p>Now I have k8s secrets. Figured I would share for anyone else wanting this functionality.</p>
|
<p>I have a node in Google Cloud Platform Kubernetes public cluster. When I make HTTP request from my application to external website, nginx in that website shows some IP address different than the IP address of my kubernetes cluster. I can't figure out where that IP address comes from. I'm not using NAT in GCP.</p>
| <p><strong>I will just add some official terminology to put some light on <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/network-overview" rel="nofollow noreferrer">GKE networking</a> before providing an answer;</strong></p>
<p>Let's have a look at some <a href="https://cloud.google.com/kubernetes-en... |
<p>When we fire command <code>Kubectl apply -f <file.yaml></code>, what happens in background?</p>
| <p>In a nutshell, Kubernetes works by having a bunch of "object" or "resource" definitions (like Deployments, ConfigMaps and such), and continuously trying to match the state of the system to these definitions.</p>
<p>For example, if there is a Deployment definition, but there is no pod running for ... |
<p>I have access to a cluster with a lot of nodes. I am running my Nextflow workflow using this command:</p>
<pre><code>./nextflow kuberun user/repo -c nextflow.config -profile kubernetes -v my_pvc:/mounted_path -with-report _report.html -with-trace _trace
</code></pre>
<p>I would like to run my nextflow workflow on a ... | <p>Use one or more <a href="https://www.nextflow.io/docs/latest/config.html#process-selectors" rel="nofollow noreferrer">process selectors</a> and the <a href="https://www.nextflow.io/docs/latest/process.html#pod" rel="nofollow noreferrer">pod directive</a> to select the nodes using a pod label. For example, the follow... |
<p>I want to run a docker container which uses GPU (it runs a cnn to detect objects on a video), and then run that container on Kubernetes.</p>
<p>I can run the container from docker alone without problems, but when I try to run the container from Kubernetes it fails to find the GPU.</p>
<p>I run it using this command:... | <p>Addressing two topics here:</p>
<ol>
<li>The error you saw at the beginning:</li>
</ol>
<hr />
<pre><code>kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
</code></pre>
<p>Means that you tried to use a deprecated version of the <code>kub... |
<p>Lets assume I have an existing GKE cluster that contains all my applications. They were all deployed using different methods. Now I want to deploy some resources to that cluster using Terraform. The trouble here is that terraform doesn't see it in his state file so it can't interact with it. Another problem is that ... | <p>You can use terraform <a href="https://www.terraform.io/docs/cli/commands/import.html" rel="nofollow noreferrer">import command</a> to import your existing GKE cluster to terraform state. Prior to run it, you need to have the adequate terraform configuration for your cluster.</p>
<p>example of import command :</p>
<... |
<p>I am using <code>@kubernetes/client-node</code> to access Kubernetes server API. I can get all the Pods from default using:</p>
<pre><code>const k8s = require('@kubernetes/client-node');
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const k8sApi = kc.makeApiClient(k8s.CoreV1Api);
k8sApi.listNamespace().t... | <p>As the problem has already been resolved in the comments section, I decided to provide a Community Wiki answer just for better visibility to other community members. I would also like to describe how to return all active Kubernetes Jobs using the <a href="https://github.com/kubernetes-client/javascript#javascript-ku... |
<p>I have a Kubernetes cluster set up using kubeadm.
I installed prometheus and node-exporter on top of it based on:</p>
<ul>
<li><a href="https://github.com/bibinwilson/kubernetes-prometheus" rel="nofollow noreferrer">https://github.com/bibinwilson/kubernetes-prometheus</a></li>
<li><a href="https://github.com/bibinwi... | <p>The issue is related to SDN not working properly.</p>
<p>As a general rule, troubleshooting this, we would check the SDN pods (calico, weave, or in this case flannel), are they healthy, any errors in their logs, ...</p>
<p>Check iptables (<code>iptables -nL</code>) and ipvs (<code>ipvsadm -l n</code>) configuration ... |
<p>I have a python program that runs an infinite loop, however, every once in a while the code freezes. No errors are raised or any other message that would alert me something's wrong. I was wondering if Kubernetes has any liveness probe that could possibly help catch when the code freezes so it can kill and restart th... | <p>A common approach to liveness probes in Kubernetes is to access an HTTP endpoint (if the application has it). Kubernetes checks whether response status code falls into 200-399 range (=success) or not (=failure). Running a HTTP server is not mandatory as you can run a command or sequence of commands instead. In this ... |
<p>I have a specific scenario where I'd like to have a deployment controlled by horizontal pod autoscaling. To handle database migrations in pods when pushing a new deployment, I followed this excellent tutorial by Andrew Lock <a href="https://andrewlock.net/deploying-asp-net-core-applications-to-kubernetes-part-8-runn... | <p>There is, unfortunately, no simple Kubernetes feature to resolve your issue.</p>
<p>I recommend extending your deployment tooling/scripts to separate the migration job and your deployment. During the deploy process, you first execute the migration job and then deploy your deployment. Without the job attached, the HP... |
<p>I am currently trying to setup Airflow to work in a Kubernetes like environment. For airflow to be useful, I need to be able to use the Git-Sync features so that the DAGs can be stored seperatly from the Pod, thus not being reset when the Pod downscales or restarts. I am trying to set it up with ssh.</p>
<p>I have ... | <p>Whats the error you're seeing on doing this ?</p>
<p>Couple of things you need to consider:</p>
<ul>
<li><p>Create an SSH key locally using this <a href="https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent" rel="nofollow nor... |
<p>Is it possible to aggregate 2 gauge metrics (i.e. <code>kube_pod_labels</code> and <code>kube_pod_container_resource_requests_cpu_cores</code>) so that by executing the query both resulting elements would be combined (i.e. all pod labels as resulting element and request_cpu_cores as value)?</p>
<p>Query for cpu requ... | <p>This can be achieved with a combination of the following:</p>
<ul>
<li><p><code>label_replace</code> query function: For each timeseries in v, label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string) matches the regular expression regex against the value of the label src_... |
<p>I'm deploying several services to my local cluster (<code>minikube</code>) using <a href="https://devspace.sh/" rel="nofollow noreferrer">DevSpace tool</a>. Once someone makes changes to one of the services and pushes the image to our private repo, I need these changes to be available on my local then. What I do now... | <p>DevSpace maintainer here. What you need is 2 things:</p>
<ol>
<li>Something that forces your pods to be recreated each time you run <code>devspace dev</code>. So, if you are using a Deployment or StatefulSet, you can add something like a label, e.g. containing the DevSpace built-in timestamp variable as value to you... |
<p>I'm trying to SSH into AKS windows node using this <a href="https://learn.microsoft.com/en-us/azure/aks/ssh" rel="nofollow noreferrer">reference</a> which created debugging Linux node, and ssh into the windows node from the debugging node. Once I enter the Linux node and try to SSH into the windows node, it asks me ... | <p>It looks like you're trying to login with your password, not your ssh key. Look for the <a href="https://www.thorntech.com/passwords-vs-ssh/" rel="nofollow noreferrer">explanation</a> between those methods. These are two different authentication methods. If you want to ssh to your node, you need to chose ssh with ke... |
<p>I have a Spring boot application running a Kafka consumer that consumes messages from a single Topic having two partitions(partition-0 and 1). The application is deployed as a single Kubernetes pod. I have scaled the application and now it's running in two pods. But the client Id prefix of the consumer running in b... | <p>Set kafka consumer client.id properties for change consumer client name
<a href="https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html#consumerconfigs_client.id" rel="nofollow noreferrer">https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html... |
<p>When I run:</p>
<pre><code>kubectl get pods --field-selector=status.phase=Running
</code></pre>
<p>I see:</p>
<pre><code>NAME READY STATUS RESTARTS AGE
k8s-fbd7b 2/2 Running 0 5m5s
testm-45gfg 1/2 Error 0 22h
</code></pre>
<p>I don't understand why this command g... | <p>Using the <code>kubectl get pods --field-selector=status.phase=Failed</code> command you can display all Pods in the <code>Failed</code> phase.</p>
<p><code>Failed</code> means that all containers in the Pod have terminated, and at least one container has terminated in failure (see: <a href="https://kubernetes.io/do... |
<p>I am doing a rolling upgrade of specififc container of deployment using the fabric8 java client API</p>
<pre class="lang-java prettyprint-override"><code>client.apps().deployments().inNamespace(..)
.withName(..)
.rolling()
.updateImage(...);
</code></pre>
<p>When observing k8s I can see the new ... | <p>To check what is happening with deployment you can use Watcher:</p>
<pre><code>client.apps().deployments().inNamespace("default").watch(new Watcher<Deployment>() {
@Override
public void eventReceived(Action action, Deployment resource) {
// Do stuff depending upon action
}
@Override
pu... |
<p>I have read through a bunch of guides showing how to monitor cpu and memory usage of pods in Kubernetes with Prometheus and most of them look something like this:</p>
<pre><code>rate(container_cpu_usage_seconds_total{pod=~"compute-.*", image!="", container!="POD"}[5m])
</code></pre>
<p>... | <p>Containers, as @Ali Sattari already mentioned right in the comment, are pause containers.</p>
<hr />
<p><strong>Pause containers</strong></p>
<p>Pause container starts first, before scheduling other pods. Purpose of the pause container (<code>container_name="POD"</code>) is to provide the network namespace... |
<p>I am blocked with k8s cron job yaml syntax errros</p>
<p>I try to do</p>
<p>kubectl apply -f cronjob.yaml</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: update-test
spec:
schedule: "0 /5 * * *"
jobTemplate:
spec:
template:
spec:
containers:
... | <p>Indentation of <code>configMapRef</code> name is incorrect, change this:</p>
<pre><code>envFrom:
- configMapRef:
name: test-config
</code></pre>
<p>to:</p>
<pre><code>envFrom:
- configMapRef:
name: test-config
</code></pre>
<p>Note: Also, your <code>cron</code> schedule is incorrect, you may need to fix <code>... |
<p>For a Kubernetes deployment, given a Kustomize Base like:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
...
images:
- name: developmentregistry.com/myimage:v1.0
</code></pre>
<p>Is there a way to change only the image registry and retain the o.g. tag with an Overlay <strong>without... | <p>Okay I figured it out — Kustomization Yamls are finnicky so you <em>must</em> have the right yaml structure.</p>
<p>This works:</p>
<p><strong>Base</strong></p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
...
images:
- name: developmentregistry.com/myimage
newTag: v1.0
</code></... |
<p>In the pods definition, we add the nodeSelector as a child of spec. But I'm not sure how to add this in deployment yaml file</p>
<p>are we supposed to add it in the template's spec-</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: first-deployment
labels:
app: first
spec:
replicas: 1
... | <p>It should be at the same level than your containers array:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: first-deployment
labels:
app: first
spec:
replicas: 1
template:
metadata:
name: first-deployment-pod
label:
app: first
spec:
containers:
... |
<p>I'd like to grant a service account the ability to access the metrics exposed by the <code>metrics-server</code> service (<code>https://metrics-server.kube-system/metrics</code>). If I create a serviceaccount...</p>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
name: metrics-reader
namespace: promethe... | <p>Interesting question. I've found some info for you, however i'm not sure that 100% helpful. It needs more research and reproduce.</p>
<ol>
<li>check <a href="https://github.com/kubernetes-sigs/metrics-server/issues/40#issuecomment-402395198" rel="nofollow noreferrer">RBAC Deny when requesting metrics</a>. Smth like ... |
<p>I have deployed pods using kubectl apply command and I can see pods running:</p>
<pre><code>$kubectl describe pod test-pod -n sample | grep -i container
Containers:
Container ID: containerd://ce6cd9XXXXXX69538XXX
ContainersReady True
</code></pre>
<p>Can I say that it's using contained runtime technolog... | <p>As i already mentioned in a comment the command is</p>
<pre><code>kubectl get nodes -o wide
</code></pre>
<p>It will returns the container runtime for each node.</p>
|
<p>I'm using ArgoCD and I want to track files under different subdirectories. I've setted the path as ./root_directory, but I would like to track also files in the subdirectories of root_directory. For instance /root_directory/dir1, /root_directory/dir2, but also /root_directory/dir1/dir1.1 ecc..
How can I do that?</p>... | <p>You can add the <code>spec.source.directory.recurse</code> attribute.</p>
<p>See an example below:</p>
<pre><code>apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd-app
namespace: argocd
spec:
project: default
source:
path: some/path/
repoURL: https://github.com/your-repo.git
... |
<p>I set up a (very) simple deployment with GKE on a GKE Autopilot cluster running the latest version of Kubernetes (<code>1.18.15-gke.1501</code>) and attached an ingress (external HTTP(s) load balancer) that links to a simple <code>ClusterIP</code> service.</p>
<p>Whenever I update the deployment with a new image, I ... | <p>I think this might be to do with the cloud sql auth proxy sidecar not terminating properly, leading to the load balancer getting in a twist.</p>
<p>Note this from the <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/container-native-load-balancing#traffic_does_not_reach_endpoints" rel="nofollow norefe... |
<p>I am surprised that nobody has yet asked this, but what exactly is <code>deployment.apps</code>?</p>
<p>I see it often in commands e.g</p>
<pre><code>kubectl rollout pause deployment.apps/nginx-deployment
</code></pre>
<p>or even used interchangably for the <code>deployments</code> keyword:
<code>kubectl get deploym... | <p>Kubernetes API has its different resources (e.g. Pods, Deployments, Ingress) grouped in what they call "<a href="https://kubernetes.io/docs/reference/using-api/#api-groups" rel="nofollow noreferrer">api groups</a>" and in the notation <code>deployment.apps</code> - "<a href="https://kubernetes.io/docs... |
<p>My deployment yaml file is bitbucket and CI/CD pipeline to build the image and deploy the container is in Azure DevOps. I am able to build and tag the image correctly i.e. with each pipeline run the image version is incremented by 1 e.g. 1.0.0, 1.0.1,1.0.2 ... There is no "latest" tag in this repository. H... | <ol>
<li><p>Use sed command</p>
<p><code>sed 's/\\<arc\\>/${ACR_REPO_URL}/g' deploy.yaml</code></p>
</li>
<li><p>Use yq</p>
</li>
</ol>
<pre><code> yq -i -y ".spec. template.spec.containers.image = \\"${ACR_REPO_URL}\\""
deploy.yaml
</code></pre>
|
<p>The command <code>kubectl describe pod</code> returns information about a specific pod. There is a section called <code>Events</code>, which contains events related to a selected pod.</p>
<p>In case of readiness probe (httpGet) failure there will be written something like this:</p>
<pre><code>Message
-------
Readin... | <p>To debug the response of <code>HTTP GET</code> of your program at <code>healthz</code> endpoint, you can <code>port-forward</code> your pod to the local machine, and check the response body by yourself.</p>
<ol>
<li>First of all, you need to increase the initial delay so that you have enough time to test:</li>
</ol>... |
<p>I checked this <a href="https://stackoverflow.com/questions/66557539/how-to-create-keycloak-with-operator-and-external-database">How to use</a> for Keycloak operator custom resource using external database connection. I am using CloudSQL from Google platform as the external database source.</p>
<p>My configurations ... | <p>This is what i am using for keycloak setup, also if you have read the question he has mention secret issue issue in update section</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: keycloak
labels:
app: keycloak
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: ... |
<p>After deploying Prometheus -operator according to the documentation, I find that <code>kubectl top Nodes</code> cannot run properly.</p>
<pre><code>$ kubectl get apiService v1beta1.metrics.k8s.io
v1beta1.metrics.k8s.io monitoring/prometheus-adapter False (FailedDiscoveryCheck) 44m
$ kubectl t... | <p>Your Pods are running with <code>hostNetwork</code>, so you should explicitly set its DNS policy "ClusterFirstWithHostNet" as described in the <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy" rel="nofollow noreferrer">Pod's DNS Policy</a> documentation:</p... |
<p>I have an Airflow 1.10.15 (a.k.a. Bridge Release) in my AWS Kubernetes cluster. It uses KubernetesExecutor.</p>
<p>I have a Hello World KubernetesExecutor DAG which should print Hello World. When triggering the DAG, it creates a pod but it never prints the Hello World.</p>
<p>Here are all the logs after the pod has ... | <p>You should check Task logs, not Kubernetes logs. Kubernetes logs keep information about "atempting to run" the task (and looks that it's all ok here).</p>
<p>Now, when you log anything in the running tasks, it does not go to the k8S logs - it goes to task logs. By default, when you configure Airflow, the l... |
<p>I would like to use kubectl cp to copy a file from a completed pod to my local host(local computer). I used <strong>kubectl cp /:/ </strong>, however, it gave me an <strong>error: cannot exec into a container in a completed pod; current phase is Succeeded</strong> error. Is there a way I can copy a file from a compl... | <p>Nope. If the pod is gone, it's gone for good. Only possibility would be if the data is stored in a <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="noreferrer">PV</a> or some other external resource. Pods are <a href="https://devops.stackexchange.com/questions/653/what-is-the-definition... |
<p>I am setting up Traefik in my CentOS VM. I tried to port-forward as specified here:</p>
<p><a href="https://github.com/jakubhajek/traefik-workshop/tree/3cbbb3b8d3dbafcb2a56f3bb715fee41ba8ffe8b/exercise-2" rel="nofollow noreferrer">https://github.com/jakubhajek/traefik-workshop/tree/3cbbb3b8d3dbafcb2a56f3bb715fee41ba... | <p>kubectl port-forward makes a specific Kubernetes API request. That means the system running it needs access to the API server, and any traffic will get tunneled over a single HTTP connection.</p>
<p>If it is saying 404 page not found, then probably there is something wrong with the deployment ( application ) as the ... |
<p>TL;DR - gke 1.20 preemptible nodes cause pods to zombie into Failed/Shutdown</p>
<p>We have been using GKE for a few years with clusters containing a mixture of both stable and preemptible node pools. Recently, since gke v1.20, we have started seeing preempted pods enter into a weird zombie state where they are desc... | <p>After poking around various posts I finally relented to running a cronjob every 9 minutes to avoid the alertManager trigger that occurs after pods have been stuck in shutdown for 10+ minutes. This still feels like a hack to me, but it works, and it forced me to dig in to k8s cronjob and RBAC.</p>
<p>This post starte... |
<p>How to define a network policy to prevent communication across pods in different namespaces within the same K8s cluster?</p>
| <p>Checkout the git repo at <a href="https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/04-deny-traffic-from-other-namespaces.md" rel="noreferrer">here</a> for many netpolicy usecases, following is one of it.</p>
<pre><code>kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
namespace:... |
<p>I'm preparing all the Ingress manifest files to keep the latest apiVersion (<strong>networking.k8s.io/v1</strong>) to upgrade my cluster from 1.19 to 1.22.</p>
<p>I'm deleting the previous Ingress rule and then recreating:</p>
<pre><code>k delete ingress/my-ingress
k create -f /tmp/ingress.yaml
</code></pre>
<p>Unfo... | <p><a href="https://github.com/kubernetes/kubernetes/issues/94761" rel="nofollow noreferrer">This is working as expected</a>, in particular check <a href="https://github.com/kubernetes/kubernetes/issues/94761#issuecomment-691982480" rel="nofollow noreferrer">github answer</a></p>
<p>When you create an ingress object, i... |
<p>I have a Kubernetes cluster that uses 1.17.17. I want to increase the CPU/RAM of a node using KOPS. When running <code>kops update cluster</code> command, I expect it would return the preview of my old instance type VS new instance type.</p>
<p>However, it returns a long line of will create resources/will modify res... | <p>After you will do that cluster update you are going to do rolling update on that cluster. The nodes will be terminated one by one and the new ones are going to show. Also while one node is going down to be replaced with the new one the services inside that node are going to be shifted on that one . Small tip remove ... |
<p>I have the strange problem that a Spark job ran on Kubernetes fails with a lot of "Missing an output location for shuffle X" in jobs where there is a lot of shuffling going on. Increasing executor memory does not help. The same job run on just a single node of the Kubernetes cluster in local[*] mode runs fine howeve... | <p><strong>If you're using the spark executor</strong>:
There is a <code>deleteOnTermination</code> setting in the spark application yaml. See <a href="https://github.com/mesosphere/spark-on-k8s-operator/blob/master/docs/api-docs.md#sparkoperator.k8s.io/v1beta2.ExecutorSpec" rel="nofollow noreferrer">the spark-on-kuber... |
<p>I have an application deployed to kubernetes (AKS) where I have a mix of gRPC and http services. I initially added the route for a new gRPC service to the existing ingress which was previously serving only http. That didn't work and digging into it, I read that we need to add the <code>nginx.ingress.kubernetes.io/... | <p>This wound up being resolved by creating a second host name that pointed to our k8s cluster. I changed the route for the grpc service to be the root path and pathType of ImplementationSpecific.</p>
<pre><code> - path: /
pathType: ImplementationSpecific
</code></pre>
<p>Both host names needed to be incl... |
<p>I deployed an aws eks cluster via terraform. I also deployed Consul following hasicorp’s tutorial and I see the nodes in consul’s UI.</p>
<p>Now I’m wondering how al the consul agents will know about the pods I deploy? I deploy something and it’s not shown anywhere on consul.</p>
<p>I can’t find any documentation as... | <blockquote>
<p>Consul knows where these services are located because each service
registers with its local Consul client. Operators can register
services manually, configuration management tools can register
services when they are deployed, or container orchestration platforms
can register services automatically via i... |
<p>My goal is to convert values in Values.yaml into the following:</p>
<pre><code>CUSTOM_VARIABLE: "TEST_ENV_1=devil,TEST_ENV_2=god,TEST_ENV_3=angel"
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>### Values.yaml
env:
TEST_ENV_1: devil
TEST_ENV_2: god
TEST_ENV_3: angel
</code></pre>
<p>... | <p>try something like</p>
<pre><code>{{range $i, $e := $}}
{{if $i}},{{end}}
{{$e}}{{end}}
</code></pre>
<p>If actually look for the index and if it's zero it's wont to add the <code>,</code> at last. here is if is not behave like normal it checks the <strong>index</strong> also.</p>
<pre><code>{{- range $i, $e := . -}... |
<p><a href="https://i.stack.imgur.com/8M0Qx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8M0Qx.png" alt="enter image description here" /></a></p>
<p>I created an EC2 instance and an EKS cluster in the same AWS account.
In order to use the EKS cluster from EC2, I have to grant necessary permissions... | <pre><code>- name: external-staging
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- exec
- test-dev
- --
- aws
- eks
- get-token
- --cluster-name
- eksCluster-1234
- --role-arn
- arn:aws:iam::3456789002:role/eks-cluster-... |
<p>Does pod running on a Kubernetes node gets rescheduled if the Kubernetes nodes gets killed due to power failure. And if gets rescheduled and if that nodes comes up what happens to the pod running on that node?</p>
| <p>Warning: this answer is based on the assumption you don't create an ad-hoc Pod, but instead manage your pods via a Deployment, StatefulSet, DaemonSet or any other controller. If it's an ad-hoc pod you created manually - it won't be rescheduled.</p>
<blockquote>
<p>Does pod running on a Kubernetes node gets reschedul... |
<p><strong>Bug description</strong></p>
<p>Installation gets timeout errors and in <code>kubectl get pods -n istio-system</code> shows <code>ImagePullBackOff</code>.</p>
<p><code>kubectl describe pod istiod-xxx-xxx -n istio-system</code></p>
<blockquote>
<p>Failed to pull image "our-registry:5000/pilot:1.10.3"... | <p>There are two ways to cirumvent this issue.</p>
<h3>If installing with <code>istioctl install</code></h3>
<p>Using <code>istioctl install</code> provide a <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">secret</a> with docker-registry auth details with <code>--set values... |
<p>i'm a newbie to k8s. I have a homework and this is my situation:<br>
There is an app with microservice-oriented, build with amount ten containers. It had a <code>docker-compose</code> file for easily set up. Now my mission is deploy it into Kubernetes. My idea: convert <code>docker-compose</code> file to k8s manifes... | <p>The Helm <code>values.yaml</code> file is the main point where you can configure the chart at deployment time. On the one hand, you can't configure anything that's not referenced in <code>.Values</code>; on the other hand, you usually don't want every individual line of the YAML file to be configurable.</p>
<p>If I... |
<p>Following <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html" rel="nofollow noreferrer">instructions</a> I am trying to deploy my pyspark app on Azure AKS free tier with <code>spark.executor.instances=5</code></p>
<pre><code>spark-submit \
--master k8s://https://xxxxxxx-xxxxxxx.hcp.westeuro... | <p>I have found a mistake in pyspark app itself.</p>
<pre><code> ...
SparkSession.builder.master("local")
...
</code></pre>
<p>Should be without master</p>
<pre><code> ...
SparkSession.builder
...
</code></pre>
<p>as simple as that :(</p>
|
<p>I have a Django app that uses the <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">official Kubernetes client for python</a> and works fine but it only deploys (rightly) public registries.</p>
<p>Is there a way to execute a login and then let Kubernetes client pull a private image free... | <p>Actually it's pretty easy to do using official Kubernetes Python Client. You need to do two steps:</p>
<ul>
<li>create a secret of type <code>dockerconfigjson</code> (could be done by command line or using Python client) - you are putting here your credentials</li>
<li>add this secret into your deployment / pod def... |
<p>In CKAD exam I have been asked to SSH to other node in cluster to do some kubectl operations like <code>kubectl get all</code>, though with that getting below:</p>
<blockquote>
<p>The connection to the server localhost:8080 was refused - did you specify the right host or port?</p>
</blockquote>
<p>Tried doing sudo, ... | <p>You need to list the available nodes in the cluster, but first, make sure you're using the correct context:</p>
<pre><code>k get nodes
</code></pre>
<p>You will get the available noted like:<br />
<code>node-0 node-1</code> (to see which one is the worker node, or if you were asked to ssh to a specific node then cop... |
<p>My goal is to convert values in Values.yaml into the following:</p>
<pre><code>CUSTOM_VARIABLE: "TEST_ENV_1=devil,TEST_ENV_2=god,TEST_ENV_3=angel"
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>### Values.yaml
env:
TEST_ENV_1: devil
TEST_ENV_2: god
TEST_ENV_3: angel
</code></pre>
<p>... | <p>If you write the <code>range</code> call into a helper template, Helm has an <a href="https://docs.helm.sh/docs/chart_template_guide/named_templates/#the-include-function" rel="nofollow noreferrer"><code>include</code> extension function</a> that calls a template and captures its output as a string.</p>
<pre class="... |
<p>I have a simple Flink streaming app. It runs well in a cluster created by <code>start-cluster.sh</code> command.</p>
<p>Now based on the <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#application-mode" rel="nofollow noreferrer">Flink tutori... | <h1>TL;DR</h1>
<p>Download latest version of <code>bcprov-jdk15on</code> and <code>bcpkix-jdk15on</code> jar files from</p>
<ul>
<li><a href="https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on" rel="nofollow noreferrer">https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on</a></li>
<li><a h... |
<p>I think I am misunderstanding Kubernetes CronJobs. On the CKAD exam there was a question to have a CronJob run every minute, but it should start after an arbitrary amount of time. I don't see any properties for CronJobs or Jobs to have them start after a specific time. Should that be part of the cron string or am I ... | <p>maybe you misunderstood the question, it was to terminate the job if it didn't complete in x seconds. you should use the <code>.spec.activeDeadlineSeconds</code> to satisfy the requirment.</p>
|
<p>Our organisation runs Databricks on Azure that is used by data scientists & analysts primarily for Notebooks in order to do ad-hoc analysis and exploration.</p>
<p>We also run Kubernetes clusters for non spark-requiring ETL workflows.</p>
<p>We would like to use Delta Lakes as our storage layer where both Databr... | <p>You can <em>usually</em> can write into the Delta table using <a href="https://delta.io/" rel="nofollow noreferrer">Delta connector for Spark</a>. Just start a Spark job with <a href="https://docs.delta.io/latest/quick-start.html#set-up-apache-spark-with-delta-lake" rel="nofollow noreferrer">necessary packages and ... |
<p>I have a docker deployment using Kubernetes. Out of the blue on a running AWS K8 "pod", I have started getting the following error:</p>
<pre><code>connect() failed (111: Connection refused) while connecting to upstream, client: X.0.XX.XX, server: _, request: "GET /api/endpoint& HTTP/1.1", ups... | <p>Looks like Nginx is getting the connection refuse from the stream.</p>
<p>i would suggest trying with simple Nginx config, store it inside the Kubernetes <code>configmap</code></p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: nginxthroughpass
namespace: development
data:
default.conf: |-
serve... |
<p>When using the Kubernetes <a href="https://pkg.go.dev/k8s.io/client-go/kubernetes/fake" rel="nofollow noreferrer">Fake Client</a> to write unit tests, I noticed that it fails to create two identical objects which have their <a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#ObjectMeta" rel="nofollow no... | <p>According to <a href="https://github.com/kubernetes/client-go/issues/439#issuecomment-403867107" rel="nofollow noreferrer">this</a> GitHub issue comment:</p>
<blockquote>
<p>the fake clientset doesn't attempt to duplicate server-side behavior
like validation, name generation, uid assignment, etc. if you want to
test... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.