Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I'm currently running Sentry in Kubernetes with auto certificate generation using let's encrypt and cert-manager. When Sentry attempts to send an error to the sentry server, the following error is thrown: </p> <pre><code>urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)&gt; (url:...
Norman Shipman
<p>It has been my experience that even the most up-to-date <code>ca-certificates</code> packages sometimes don't contain all <a href="https://letsencrypt.org/certificates/" rel="nofollow noreferrer">3 Let's Encrypt certificates</a>. The solution(?) is to download them into the "user-controlled" certificate directory (o...
mdaniel
<p>I am using auditSink object in order to get the audit logs. I didn't find any documentation/api regarding retry option for audit logs. What happens in case the web server / service is not available?</p> <p><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#auditsink-v1alpha1-auditregistrat...
inza
<p><a href="https://github.com/kubernetes/kubernetes/blob/v1.18.3/staging/src/k8s.io/apiserver/plugin/pkg/audit/dynamic/factory.go#L34" rel="nofollow noreferrer">The fine source</a> implies there is a retry mechanism, and thus the need for configuring its backoff, but aside from whatever you can find by surfing around ...
mdaniel
<p>I was trying to use prometheus to do monitoring in kubernetes. We have some metrics stored in an external postgres database, so first I would like to install a postgres exporter. I used this helm chart to install it: <a href="https://github.com/helm/charts/tree/master/stable/prometheus-postgres-exporter" rel="nofoll...
Lavender
<blockquote> <p>time="2018-08-02T01:08:46Z" level=info msg="Starting Server: :9187" source="postgres_exporter.go:1137"</p> </blockquote> <p>It looks like the <a href="https://github.com/helm/charts/blob/master/stable/prometheus-postgres-exporter/templates/NOTES.txt#L13" rel="nofollow noreferrer">chart notes text</a>...
mdaniel
<p>I am looking to have a dynamic <code>etcd</code> cluster running inside my k8s cluster. The best way I can think of doing it dynamically (no hardcoded addresses, names, etc.) is to use DNS discovery, with the internal k8s DNS (CoreDNS).</p> <p>I find detached information about <code>SRV</code> records created for s...
Ehud Kaldor
<blockquote> <p>how does k8s name SRV entries?</p> </blockquote> <p>via the <code>Service.port[].name</code>, which is why almost everything in kubernetes has to be a DNS-friendly name: because a lot of times, it does put them in DNS for you.</p> <p>A Pod that has <code>dig</code> or a new enough <code>nslookup</co...
mdaniel
<pre><code>from os import getenv, listdir, path from kubernetes import client, config from kubernetes.stream import stream import constants, logging from pprint import pprint def listdir_fullpath(directory): return [path.join(directory, file) for file in listdir(directory)] def active_context(kubeConfig, cluster)...
ConscriptMR
<blockquote> <p>some of them default to root, would still like to be able to choose my user when I run a command so question is still relevant</p> </blockquote> <p>You have influence over the UID (not the user directly, as far as I know) when you <em>launch</em> the Pod, but from that point forward, there is no equival...
mdaniel
<p>Kubernetes documentation is saying that multi-zone clusters are supported, but not the multi-region ones. At the same time Kubernetes has support for both <code>failure-domain/zone</code> and <code>failure-domain/region</code>.</p> <p>What are the downsides of having my Kubernetes clusters to be multi-zone and mult...
Maklaus
<p>This is speculative, but it's <em>informed</em> speculation, so hopefully that means it'll still be helpful</p> <p>Let's take two things that kubernetes does and extrapolate them into a multi-region cluster:</p> <ul> <li>load balancer membership -- at least on AWS, there is no mechanism for adding members of a dif...
mdaniel
<p>Please find the GitLab repo for the terraform scripts which we are using. <a href="https://gitlab.com/komati.udaykiran/gkewithterraform" rel="nofollow noreferrer">enter link description here</a> Run in terraform plan gives the below error in an all-in-one.YAML file for the elastic search.</p> <pre><code>Error: Error...
udaykiran komati
<p>As is describe in <a href="https://www.terraform.io/docs/configuration/functions/yamldecode.html" rel="nofollow noreferrer">the fine manual</a>:</p> <blockquote> <p>Only one YAML document is permitted. If multiple documents are present in the given string then this function will return an error.</p> </blockquote> <p...
mdaniel
<p>I'm trying to enable efk in my kubernetes cluster. I find a file about fluentd's config: <a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/fluentd-elasticsearch/fluentd-es-configmap.yaml" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/fluentd-...
user9345277
<p>It isn't related to kubernetes, or to deployments; it is <code>fluentd</code> syntax that represents the top-level <code>kubernetes</code> "tag" and all its subkeys that are published as an event, as one can see <a href="https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter#example-inputoutput" rel="...
mdaniel
<p>I have a cluster provisioned using KubeSpray on AWS. It has two bastions, one controller, one worker, and one etcd server.</p> <p>I am seeing endless messages in the APISERVER logs:</p> <pre><code>http: TLS handshake error from 10.250.227.53:47302: EOF </code></pre> <p>They come from two IP addresses, <code>10.250.2...
David Medinets
<p>They're from the health check configured on the AWS ELB; you can stop those messages by <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html#update-health-check-config" rel="nofollow noreferrer">changing the health check configuration</a> to be <code>HTTPS:6443/healthz</code...
mdaniel
<p>I'm trying to find a quick command to redeploy a pod in Kubernetes.</p> <ol> <li>Currently, I pushed my docker image to google cloud.</li> <li>Then I list my pods</li> </ol> <pre><code>kubectl -n pringadi get pods NAME READY STATUS RESTARTS AG...
RonPringadi
<p>It's wholly unclear what you're trying to do, but taking a guess:</p> <p><code>kubectl set image deploy audit-server "*=us.gcr.io/whatever/whateverelse:12345"</code> will bump the image in your deployment without having to invoke your editor</p> <p>Alternatively, use something like <a href="https://github.com/Goog...
mdaniel
<p>I want to have 2 apps running on kubernetes, I wonder if I can do 2 subdomains using nginx ingress controller.</p> <p>For example: <code>app1.localhost:8181/cxf</code> and <code>app2.localhost:8181/cxf</code> each one of those will have diferent services.</p> <p>How can I do that?</p> <p>Some more context here:</p> ...
Tiago Machado
<blockquote> <p>I want to have 2 apps running on kubernetes, I wonder if I can do 2 subdomains using nginx ingress controller.</p> </blockquote> <p>Yes, you just need any number of DNS records which point to your Ingress controller's IP (you used 127.0.0.1, so that's what I'll use for these examples, but you can substi...
mdaniel
<p>When I run <code>kubectl get svc -n kube-system</code> it tells me:</p> <pre><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kube-dns ClusterIP xx.xx.xx.xx &lt;none&gt; 53/UDP,53/TCP 13h </code></pre> <p>But when I try to <code>kubectl edit svc/kube-dns -n kube-system</cod...
Srinivasa Reddy
<p>So, two things here:</p> <ol> <li>As they advised you in the yaml validation errors that you chose not to share with us, one cannot change the <code>type:</code> of an existing <code>Service</code>; you have to create a new one, or delete the existing one and recreate it.</li> <li>However, I would strongly, strongl...
mdaniel
<p>I am deploying a EKS cluster to AWS and using alb ingress controller points to my K8S service. The ingress spec is shown as below.</p> <p>There are two targets <code>path: /*</code> and <code>path: /es/*</code>. And I also configured <code>alb.ingress.kubernetes.io/auth-type</code> to use <code>cognito</code> as aut...
Joey Yi Zhao
<p>This question comes up a lot, so I guess it needs to be PR-ed into their documentation.</p> <p>Ingress resources are cumulative, so you can separate your paths into two separate Ingress resources in order to annotate each one differently. They will be combined with all other Ingress resources across the entire clust...
mdaniel
<p>I am trying to execute a query on postgres pod in k8s via bash script but cannot get results when i select a large number of columns. Here is my query:</p> <pre><code>kubectl exec -it postgres-pod-dcd-wvd -- bash -c &quot;psql -U postgres -c \&quot;Select json_build_object('f_name',json_agg(f_name),'l_name',json_agg...
devcloud
<blockquote> <p>When i try from inside the pod, It works but i need to execute it via bash script</p> </blockquote> <p>Means it is almost certainly the results pagination; when you run <code>exec -t</code> it sets up a TTY in the Pod, just like you were connected interactively, so it is likely waiting for you to press ...
mdaniel
<p>I need to be able to assign custom environment variables to each replica of a pod. One variable should be some random uuid, another unique number. How is it possible to achieve? I'd prefer continue using "Deployment"s with replicas. If this is not feasible out of the box, how can it be achieved by customizing replic...
rubenhak
<blockquote> <p>If this is not feasible out of the box, how can it be achieved by customizing replication controller/controller manager? Are there hooks available to achieve this?</p> </blockquote> <p>Your best bet is a mixture of an <code>initContainer:</code> and/or a custom -- possibly overridden -- entrypoint <c...
mdaniel
<p>I’m packaging a Python app for use within a Kubernetes cluster. In the code base this method exists :</p> <pre><code> def get_pymongo_client(self): username = test; password = 'test'; url = ‘test conn_str = &quot;mongodb+srv://&quot; + username + &quot;:&quot; + password + “/”+ url ...
blue-sky
<p>The traditional way is via environment variable</p> <pre class="lang-yaml prettyprint-override"><code>spec: containers: - name: your-app # ... env: - name: PYMONGO_USERNAME valueFrom: secretKeyRef: name: your-secret-name-here key: PYMONGO_USERNAME </code></pre> <p>...
mdaniel
<p>Can we apply/delete kubernetes YAML files in IntelliJ IDEA/Visual Studio Code by right clicking on the YAML file and then choosing apply/delete/..?</p>
user674669
<p>The <a href="https://www.jetbrains.com/help/idea/settings-tools-external-tools.html" rel="nofollow noreferrer">External Tools</a> feature will do what you're asking; you can create an "external tool" named <code>kubectl-apply</code> with any of the variables they support, and then invoke it via any number of built-i...
mdaniel
<p>I am bit confused with commands in kubectl. I am not sure when I can use the commands directly like</p> <p><code>command: [&quot;command&quot;] or -- some_command</code></p> <p>vs</p> <p><code>command: [/bin/sh, -c, &quot;command&quot;] or -- /bin/sh -c some_command</code></p>
BrownTownCoder
<blockquote> <p>I am bit confused with commands in kubectl. I am not sure when I can use the commands directly</p> </blockquote> <p>Thankfully the distinction is easy(?): every <code>command:</code> is fed into the <a href="https://en.wikipedia.org/wiki/Exec_(system_call)" rel="nofollow noreferrer"><code>exec</code> sy...
mdaniel
<p>Is it possible to send a http Rest request to another K8 Pod that belongs to the same Service in Kubernetes? </p> <p>E. G. Service name = UserService , 2 Pods (replica = 2)</p> <pre><code>Pod 1 --&gt; Pod 2 //using pod ip not load balanced hostname Pod 2 --&gt; Pod 1 </code></pre> <p>The connection is over Rest ...
M_K
<blockquote> <p>Is it possible to send a http Rest request to another K8 Pod that belongs to the same Service in Kubernetes?</p> </blockquote> <p>For sure, yes, that's actually exactly why every Pod in the cluster has a cluster-wide routable address. You can programmatically ask kubernetes for the list of the Pod's ...
mdaniel
<p>Hello I've been learning about Kubernetes but in a YAML file I found k8s-app as a label but when looking for an answer I really didn't find an accurate answer. Please if someone has what does k8s-app stands for in YAML file help.</p>
nessHaf
<p>It doesn't stand for anything; it's just an older convention that has been superseded by the <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels" rel="noreferrer">new <code>app.kubernetes.io/</code> nomenclature</a></p> <p>The old style was likely replaced by the new &quo...
mdaniel
<p>I am getting the below error in my deployment pipeline</p> <pre><code>Error: YAML parse error on cnhsst/templates/deployment.yaml: error converting YAML to JSON: yaml: line 38: did not find expected key </code></pre> <p>The yml file corresponding to this error is below:</p> <pre><code>apiVersion: apps/v1 kind: Deplo...
user264953
<p>You can see the mismatched indentation under <code>regcred</code>:</p> <pre class="lang-yaml prettyprint-override"><code> imagePullSecrets: - name: regcred # &lt;-- indented &quot;-&quot; #VVV not indented securityContext: runAsNonRoot: true </code></pre> <p>which, as luck would...
mdaniel
<p>I have a Docker Enterprise k8 bare metal cluster running on Centos8, and following the official docs to install NGINX using manifest files from GIT: <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">https://docs.nginx.com/nginx-ingress-contr...
gmate2008
<p>The thing you are likely looking for is <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#podspec-v1-core" rel="nofollow noreferrer"><code>hostNetwork: true</code></a>, which:</p> <blockquote> <p>Use the host's network namespace. If this option is set, the ports that will be used must be ...
mdaniel
<p>Kubectl provides a nice way to convert environment variable files into secrets using:</p> <pre><code>$ kubectl create secret generic my-env-list --from-env-file=envfile </code></pre> <p>Is there any way to achieve this in Helm? I tried the below snippet but the result was quite different:</p> <pre><code>kind: Secret...
Sayon Roy Choudhury
<p>It appears kubectl just does the simple thing and only <a href="https://github.com/kubernetes/kubernetes/blob/v1.22.0/staging/src/k8s.io/kubectl/pkg/cmd/util/env_file.go#L56" rel="nofollow noreferrer">splits on a single <code>=</code> character</a> so the Helm way would be to replicate that behavior (helm has <code>...
mdaniel
<p>I'm setting up Airflow in Kubernetes Engine, and I now have the following (running) pods:</p> <ul> <li>postgres (with a mounted <code>PersistentVolumeClaim</code>)</li> <li>flower</li> <li>web (airflow dashboard)</li> <li>rabbitmq</li> <li>scheduler</li> <li>worker</li> </ul> <p>From Airflow, I'd like to run a tas...
bartcode
<p>As is described in <a href="https://airflow.apache.org/kubernetes.html#airflow.contrib.operators.kubernetes_pod_operator.KubernetesPodOperator" rel="nofollow noreferrer">The Fine Manual</a>, you will want <code>in_cluster=True</code> to advise KPO that it is, in fact, in-cluster.</p> <p>I would actually recommend f...
mdaniel
<p>I am using skywalking 6.5.0 to monitor my apps in kubernetes cluster, this is my skywalking ui yaml config:</p> <pre><code>{ &quot;kind&quot;: &quot;Deployment&quot;, &quot;apiVersion&quot;: &quot;extensions/v1beta1&quot;, &quot;metadata&quot;: { &quot;name&quot;: &quot;oap&quot;, &quot;namespace&quot;...
Dolphin
<blockquote> <p>how to add the jdbc driver jar into the image file?</p> </blockquote> <p>One way would be an <code>initContainer:</code> and then artificially inject the jdbc driver via <a href="https://wiki.openjdk.java.net/display/mlvm/BootClassPath" rel="nofollow noreferrer"><code>-Xbootclasspath</code></a></p> <pre...
mdaniel
<p>My code is below along with all the logs. In short my init pod seems to be attempting to run my setup.sh file, which is in a configmap, before it's mounted into the init pod. Does anyone have any guidance as to what the issue could be?</p> <p>deployment:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: ...
user3625941
<p><code>command:</code> does not work like <code>docker run</code>, it is the kubernetes equivalent of the <code>CMD [&quot;&quot;, &quot;&quot;]</code> in a Dockerfile and is fed to <strong>exec</strong>, not to <strong>sh</strong>; thus what you want is:</p> <pre class="lang-yaml prettyprint-override"><code> ...
mdaniel
<p>Created a local cluster using <strong>Vagrant</strong> + <strong>Ansible</strong> + <strong>VirtualBox</strong>. Manually deploying works fine, but when using <strong>Helm</strong>:</p> <pre><code>:~$helm install stable/nginx-ingress --name nginx-ingress-controller --set rbac.create=true Error: forwarding ports: er...
EnjoyLife
<blockquote> <p><code>Error: forwarding ports: error upgrading connection: error dialing backend: dial tcp 10.0.52.15:10250: i/o timeout</code></p> </blockquote> <p>You're getting bitten by a very common kubernetes-on-Vagrant bug: the kubelet believes its IP address is <code>eth0</code>, which is the <strong>NAT</st...
mdaniel
<p>I have a Kubernetes question.</p> <p>We have a master pod that can deploy other pods depending on the REST endpoint called. For example, if someone calls "/start_work" endpoint, it can deploy a worker pod to do the work related with this request.</p> <p>This master pod is deployed with default ServiceAccount, and ...
Sunny Patel
<blockquote> <p>However, we have a more challenging problem now where our master pod is running in one cluster, but the worker pod needs to be deployed in another cluster. Does this sound achievable ?</p> </blockquote> <p>Certainly, yes; you are free to provide credentials via any number of supported mechanisms that...
mdaniel
<p>I'm trying to achieve a header routing ingress rule with nginx. Why ? Because <em>the same path</em> should go to <em>different backend</em> based on <em>headers</em>. Here what i've tried:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: api-mutli...
Kelindil
<p>You got bitten by a YAML-ism:</p> <p>The indentation of your 2nd <code>if</code> block isn't the same as the indentation of the others, and thus YAML thinks you are starting a new key under <code>annotations:</code></p> <p>You have</p> <pre class="lang-yaml prettyprint-override"><code>metadata: name: api-mutli-...
mdaniel
<p>I have setup a local kubernetes cluster, using vagrant. Have assigned 2 nw interfaces for each vagrant box public and private.</p> <p>kubectl get nodes -o wide</p> <pre><code>NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME kub...
batman
<p>It's because vagrant, in its default configuration, will have a NAT <code>public_network</code>, usually eth0, and then any additional network interfaces -- such as what is likely a host-only interface on 192.168.33.10</p> <p>You need to change the kubelet configuration -- and possibly your CNI provider -- to bind ...
mdaniel
<p>I have 2 services, one serves up a rest API and the other serves up static content via nginx web server. I can retrieve the static content from the pod running an nginx web server via the ingress controller using https provided that I <strong>don't</strong> use the following annotation within the ingress yaml</p> <p...
Jay Steven Hamilton
<p>If your problem is that adding <code>nginx.ingress.kubernetes.io/backend-protocol: HTTPS</code> makes service-A work but fails service-B, and removing it makes service-A fail but works for service-B, then the solution is to create two different Ingress objects so they can be annotated independently</p> <pre class="l...
mdaniel
<p>I wish to run a <a href="https://www.drone.io/" rel="nofollow noreferrer">Drone</a> CI/CD pipeline on a Raspberry Pi, including a stage to update a Kubernetes Deployment. Unfortunately, all the pre-built solutions that I've found for doing so (<a href="https://github.com/sinlead/drone-kubectl" rel="nofollow noreferr...
scubbo
<p>It appears you have used <code>| base64</code> instead of <code>| base64 --decode</code></p>
mdaniel
<p>When attempting to install ElasticSearch for Kubernetes on a PKS instance I am running into an issue where after running <code>kubectl get events --all-namespaces</code> I see <code>create Pod logging-es-default-0 in StatefulSet logging-es-default failed error: pods "logging-es-default-0" is forbidden: SecurityConte...
nfickas
<blockquote> <p>is forbidden: <code>SecurityContext.RunAsUser</code> is forbidden. Does this have something to do with a pod security policy?</p> </blockquote> <p>Yes, that's exactly what it has to do with</p> <p>Evidently the <code>StatefulSet</code> has included a <code>securityContext:</code> stanza, but your cl...
mdaniel
<p>I have setup a kubernetes cluster using kubeadm.</p> <p><strong>Environment</strong></p> <ol> <li>Master node installed in a PC with public IP.</li> <li>Worker node behind NAT address (the interface has local internal IP, but needs to be accessed using the public IP)</li> </ol> <p><strong>Status</strong></p> <p>...
Davide
<p><em>there were a metric boatload of Related questions in the sidebar, and I'm about 90% certain this is a FAQ, but can't be bothered to triage the Duplicate</em></p> <blockquote> <p>Is there something else that I have to setup in the worker node or in the cluster configuration?</p> </blockquote> <p>No, that situ...
mdaniel
<p>I have a repetitive task that I do while testing which entails connecting to a cassandra pod and running a couple of CQL queries.</p> <p>Here's the &quot;manual&quot; approach:</p> <ol> <li><p>On cluster controller node, I exec a shell on the pod using kubectl:<br /> <code>kubectl exec pod/my-app-cassandra-pod-name ...
James
<p>This is a very, very FAQ: the <code>kubectl exec</code> is, as its name says, using <code>exec(3)</code> versus <code>system(3)</code> -- which in your case wouldn't work anyway because the <code>$</code> in your <code>kubectl exec</code> would be interpreted by <strong>your</strong> shell not the <strong>pod's</str...
mdaniel
<p>We have application deployed in K8S pod and all logs are being monitored in ELK stack. Now we have one application which is using external *.jar which is writing logs in one file local to container path. How I can send this logs to kubernetes console so that it will come to elastic search monitoring.</p> <p>Any hel...
Baharul
<blockquote> <p>Now we have one application which is using external *.jar which is writing logs in one file local to container path. How I can send this logs to kubernetes console so that it will come to elastic search monitoring.</p> </blockquote> <p>There are three ways, in increasing order of complexity:</p> <ol...
mdaniel
<p>I need to find the certificate validation for K8S cluster , e.g. to use the alert manager to notify when the certificate is about to expire and send sutible notification.</p> <p>I found this <a href="https://github.com/ribbybibby/ssl_exporter" rel="nofollow noreferrer">repo</a> but not I’m not sure how configure i...
JME
<blockquote> <p>What should I put there inside the target to make it work? </p> </blockquote> <p>I think the <a href="https://github.com/ribbybibby/ssl_exporter/tree/v0.6.0#targets" rel="nofollow noreferrer">"Targets" section of the readme</a> is clear: it contains the endpoints that you wish the monitor to report o...
mdaniel
<pre><code>kubectl get -n istio-system secret istio-ca -ogo-template='{{index .data &quot;tls.crt&quot;}}' | base64 -d &gt; ca.pem </code></pre> <p>how to run the above command in an ansible playbook?</p> <p>I am trying to use it as follows:</p> <pre><code>- name: Apply secret istio-ca shell: kubectl get -n istio-sys...
Dhananjay Gahiwade
<p>I swear this has been answered a thousand times, but I can't immediately find the golang/helm/kubectl specific one in the <a href="https://stackoverflow.com/search?q=%5Bansible%5D+end+of+print+statement">thousands of this same error</a></p> <p>The problem is that jinja2 uses <code>{{</code> as its escape syntax, but...
mdaniel
<p>I have a Helm chart with <code>values.yaml</code> containing:</p> <pre class="lang-yaml prettyprint-override"><code># Elided tolerations: [] </code></pre> <p>I'm trying to pass the tolerations via the command line but it always removes the quotes (or adds double quotes inside single quotes) despite all the below att...
Don Rhummy
<p>There appears to be two answers: the exceptionally verbose one that you're trying has a solution, or the more succinct one which doesn't prompt stack overflow questions for future readers to understand:</p> <p>Helm offers <a href="https://helm.sh/docs/helm/helm_install/#synopsis" rel="noreferrer"><code>--set-string<...
mdaniel
<p>I was trying out spring boot microservice deployment on kubernetes cluster using Helm Chart. But I noticed a strange issue that <strong>my spring boot application start but it shutdown immediately after</strong></p> <p>Here are the logs</p> <pre><code>Started JhooqK8sApplication in 3.431 seconds (JVM running for 4.1...
Rahul Wagh
<blockquote> <p>2020-06-25 20:57:24.469 INFO 1 --- [extShutdownHook] o.e.jetty.server.AbstractConnector : Stopped ServerConnector@548a102f{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}</p> </blockquote> <pre class="lang-yaml prettyprint-override"><code> ports: - name: http containerPort: 80...
mdaniel
<p>im trying to run flyway <code>docker image 7.3.2</code> against a postgres db on kubernetes:</p> <p>When i run the job my output is:</p> <pre><code>Flyway Community Edition 7.3.2 by Redgate ERROR: Unable to obtain connection from database (jdbc:postgresql://xxx.eu-west-2.rds.amazonaws.com:5432/xxx flyway.user=postgr...
Staggerlee011
<p>If that is literally your <code>ConfigMap</code>, then it is missing the <code>|</code> character after the <code>:</code> which would make that yaml key into <a href="https://yaml.org/spec/1.2/spec.html#style/block/literal" rel="nofollow noreferrer">a newline delimited scalar</a>. That theory also squares up with y...
mdaniel
<p>I know there are many questions around this but I didn't find any with a real answer.</p> <p>My helm chart have dependencies from another helm charts and I need to override their values with my <code>.Release.Name</code> and <code>.Release.Namespace</code>.</p> <p><strong>My requeriments.yaml</strong></p> <pre><c...
Ninita
<p>While it does not appear that helm, itself, can do that, <a href="https://github.com/roboll/helmfile#readme" rel="nofollow noreferrer">helmfile</a> can via either its <a href="https://github.com/roboll/helmfile#helmfile--kustomize" rel="nofollow noreferrer">integration with kustomize</a> or with its <a href="https:/...
mdaniel
<ol> <li>Figure out what is the correct way to scale up the remote function.</li> <li>Figure out scaling relations between replicas of the remote function, Flink <code>parallelism.default</code> configuration, ingress topic partition counts together with message partition keys. What is the design intentions behind this...
joeyinso
<p>There are two things happening here...</p> <ol> <li>Each partition in your topic is assigned to a sub-task. This is done round-robin, so if you have 5 topic partitions and 5 sub-tasks (your parallelism) then every sub-task is reading from a single different topic partition.</li> <li>Records being read from the topic...
kkrugler
<p>I am trying to get the status of pods running on k8 cluster. I went through this document which <a href="https://docs.ansible.com/ansible/latest/modules/k8s_module.html" rel="nofollow noreferrer">states</a> that - &quot;<code>Use the OpenShift Python client</code>&quot;</p> <p>Does that mean Openshift python client ...
pythondev
<blockquote> <p>I have installed openshift client on the ansible server- however, still getting error that openshift client is not installed</p> </blockquote> <p>The answer is the same for every ansible module's dependency: it must be in the python that is configured as <code>ansible_python_interpreter</code> for the h...
mdaniel
<p>I'm struggling to expose my app over the Internet when deployed to AWS EKS.</p> <p>I have created a deployment and a service, I can see both of these running when using kubectl. I can see that the app has successfully connected to an external database as it runs a script on startup that initialises said database.</...
SteveJDB
<blockquote> <p>I've tried accessing the Load Balancer endpoint</p> </blockquote> <p>You are accessing the <strong>EKS</strong> URL, which is the kubernetes apiserver endpoint, and not the LoadBalancer that was (hopefully) created for your <code>client</code> <code>Service</code></p> <p>You will want to <code>kubec...
mdaniel
<p>I have databases delpoyed as StatefullSet on my kubernetes cluster, i would like to know how can i make alerts (send email) when Persistent Volumes are 80% full?</p> <p>P.S: This k8s cluster is deployed using Rancher v2.4</p>
Mohamed
<p>You will need to monitor your volumes from Prometheus, the link above from Manoj is a good start or visit <a href="https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubepersistentvolumefillingup" rel="nofollow noreferrer">kubepersistentvolumefillingup</a></p> <p>After promet...
guycole
<p>I created a small cluster with GPU nodes on GKE like so:</p> <pre class="lang-sh prettyprint-override"><code># create cluster and CPU nodes gcloud container clusters create clic-cluster \ --zone us-west1-b \ --machine-type n1-standard-1 \ --enable-autoscaling \ --min-nodes 1 \ --max-nodes 3 \ ...
Lucas
<p>The resource constraint needs to be added to the <code>containers</code> spec as well:</p> <pre><code>piVersion: batch/v1 kind: Job metadata: name: &lt;job_name&gt; spec: template: spec: initContainers: - name: decode image: "&lt;decoder_image&gt;" resources: limits: ...
Lucas
<p>I'm quite new to Kubernetes. But so far was able to configure an AKS (Azure Kubernetes Services) cluster. I have multiple namespaces for my services (Dev, stage, prod). And configured an Ingress service using nginx (<strong>into it's own namespace 'ingress-nginx'</strong>). The setup works perfectly with HTTP. </p> ...
Major
<p>The <a href="https://whois.domaintools.com/8b3s.org" rel="nofollow noreferrer">whois record</a> for your domain shows that it is still pointed at <code>NS57.DOMAINCONTROL.COM</code> and not the 4 Azure DNS resolvers you show in your screenshot. Thus, Let's Encrypt has no way of knowing they should use Azure to look ...
mdaniel
<p>I have this yaml for an Ingress:</p> <pre><code>kind: Ingress apiVersion: extensions/v1beta1 metadata: name: app namespace: ingress-controller ... omitted for brevity ... spec: rules: - host: ifs-alpha-kube-001.example.com http: paths: - path: / pathType: Implementation...
Red Cricket
<blockquote> <p>What should I set host if I want a high availability cluster?</p> </blockquote> <p>The idea behind the Ingress resource is using the <em>brower's</em> <code>host:</code> HTTP header (which is sent for every request HTTP/1.1 and newer) for virtual hosting, so you can create <em>one</em> load balancer,...
mdaniel
<p>I use <code>configMap</code> to feed the <code>init.sql</code> script to initialise my Mysql container in the Kubernetes pod. While that works for most cases I am struggling to convert a larger <code>init.sql</code> file which is 12.2 MB. I use the following in <code>deployment.yaml</code> to mount the configMap.</...
Vishakha Lall
<blockquote> <p>How can I increase this limit/or any other alternate to initialise my database?</p> </blockquote> <p>The <code>.d</code> nomenclature in that path means it will load <strong>all</strong> files found therein, so the solution is to chop up the <code>init.sql</code> into smaller chunks, name them so tha...
mdaniel
<p>It is possible to get all the pods on the cluster:</p> <pre><code>kubectl get pod --all-namespaces -o wide </code></pre> <p>It is also possible to get all pods on the cluster with a specific label:</p> <pre><code>kubectl get pod --all-namespaces -o wide --selector some.specific.pod.label </code></pre> <p>It is e...
Ilya Buziuk
<p>One cannot do that operation in one shot, because labels on <code>Namespace</code> objects are not propagated down upon their child objects. Since <code>kubectl</code> is merely doing a <code>GET</code> on <code>/api/v1/whatevers</code> there is no obvious way to make a REST request to two endpoints at once and join...
mdaniel
<p>We have set logger as STDOUT in the rails configuration.</p> <pre><code> config.log_level = :info config.logger = Logger.new(STDOUT) </code></pre> <p>We are expecting these logs in kubectl logs as well as datadog logs but STDOUT is not showing up there. We tried below code to test it.</p> <pre><code>def method_na...
Priya
<p>Try to use the default config and make sure to set the environment variable <code>RAILS_LOG_TO_STDOUT=true</code>, for your deployment/replica set, and in production mode (<code>RAILS_ENV=production</code>). (In dev mode it always logs to console per default).</p> <p>Actually, the official rails docker images used t...
Michael W.
<p>I have configMap that are loading properties files for my spring boot application. My configMap is mounted as a volume and my springboot app is reading from that volume.</p> <p>my typical property files are:</p> <pre><code>application-dev1.yml has integrations-queue-name=integration-dev1 search-queue-name=searchin...
Praveen Kumar
<p>If it's just those two, then likely you will get more mileage out of using the <code>SPRING_APPLICATION_JSON</code> environment variable, which should supersede anything in the configmap:</p> <pre class="lang-yaml prettyprint-override"><code>containers: - name: my-spring-app image: whatever env: - name: ENV_N...
mdaniel
<p>HACMP cluster provides high availability feature with IBM lpar's or within AIX physical boxes</p> <p>Similarly, </p> <p>MSCS cluster service in windows Virtual machine</p> <p>Veritas cluster for Linux/Windows Virtual machine</p> <hr> <p>How kubernetes cluster service different from these cluster service?</p>
overexchange
<p><strong>Key Differences</strong></p> <p><img src="https://i.stack.imgur.com/EyQsk.png" width="500"></p> <p><strong>The TL;DR Backstory</strong></p> <p>Clustering = teaming up multiple cooperating servers to accomplish something that none of the individual servers ("nodes") could accomplish on their own.</p> <p>T...
Jonathan Eunice
<p>I'm new to Kubernetes and as a tutorial for myself I've been working on deploying a basic project to Kubernetes with helm (v3). I have an image in AWS's ECR as well as a local helm chart for this project. However, I am struggling to run my image with Kubernetes.</p> <p>My image is set up correctly. If I try somethi...
Thomas Scruggs
<blockquote> <p>How can I properly set up credentials (such as imagePullSecrets) to authorize pulling the image from ecr?</p> </blockquote> <p>The traditional way is to grant the Node an <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html" rel="nofollow noreferrer">instance rol...
mdaniel
<p>I would like to template values in my Chart.yaml file. For example, <code>version: {{ .Values.version }}</code> instead of <code>version: 0.1.0</code></p> <p>For other yaml files, the above would work. However, it's my understanding that Helm treats the Chart.yaml differently and <strong>the Chart.yaml file is not ...
Thomas Scruggs
<p>You are thinking of the problem backward: specify the version in <code>Chart.yaml</code> and <em>derive</em> the version in wherever you are using it in the templates; you can't have a dynamic version in the <code>Chart.yaml</code> because <code>helm repo index .</code> does not accept <code>--set</code> or any such...
mdaniel
<p>I'm trying to write simple ansible playbook that would be able to execute some arbitrary command against the pod (container) running in kubernetes cluster.</p> <p>I would like to utilise kubectl connection plugin: <a href="https://docs.ansible.com/ansible/latest/plugins/connection/kubectl.html" rel="nofollow norefe...
Bakir Jusufbegovic
<blockquote> <p>I would like to utilise kubectl connection plugin: <a href="https://docs.ansible.com/ansible/latest/plugins/connection/kubectl.html" rel="nofollow noreferrer">https://docs.ansible.com/ansible/latest/plugins/connection/kubectl.html</a> but having struggle to figure out how to actually do that.</p> </bl...
mdaniel
<p>I have a nginx server outside kubernetes. <code>nginx -&gt; nginx ingress</code>. I want know how add a custom health check path <code>/health/status</code> to nginx ingress. </p>
quanwei li
<p><em>This question is almost certainly solving the wrong problem, but in the spirit of answering what was asked:</em></p> <p>You can expose the Ingress <code>/healthz</code> to the outside world:</p> <pre><code>kind: Service metadata: name: ingress-nginx-health spec: type: ClusterIP selector: # whatever por...
mdaniel
<p>I'm using helm and given a yaml object I want to flatten it while applying some recursive formatting.</p> <p>Given this:</p> <pre class="lang-yaml prettyprint-override"><code>some_map: with: different indentation: levels: and nested: sub: maps: &quot;42&quot; and_more: maps: 42 </code>...
Roberto P. Romero
<p>Yes, it seems that <code>{{ define</code> supports recursive use of <code>{{ include</code>, although unknown to what depth</p> <p>The PoC I whipped up to see if it could work</p> <pre><code>{{- define &quot;bob&quot; -}} {{- $it := . -}} {{- $knd := kindOf . -}} {{- if eq $knd &quot;map&quot; }} {{- range (keys .) ...
mdaniel
<p>I'm pretty new to Kubernetes and I have to create a pod using Kubernetes <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">python-client</a>. So to experiment around I'm trying to run <a href="https://github.com/kubernetes-client/python/tree/master/examples/notebooks" rel="nofollow nore...
FooBar
<p>It's because they changed the validation to happen in the constructor, rather that later -- which is not what the notebook was expecting. <s>They</s> You just need to move those inner assignments up to be valid before constructing the <code>Deployment</code>:</p> <pre class="lang-py prettyprint-override"><code>name ...
mdaniel
<p>I deployed a mysql monitor application image in kubernetes cluster which run as non root user. When I tried to mount a path to make the data persistent,its overriding the directory(creates a new directory by deleting everything inside that path) in which my application configuration files has to be present.Even I tr...
Sowmiya
<p>This doesn't seem related to mounting as a non-root user, but more so that mounting a volume over an existing directory will result in that directory looking as if it is empty (or containing whatever happens to be on the volume already). If you have configuration stored on a non-volume that you would like to be on t...
snormore
<p>We have an AKS test cluster with <em>four</em> Windows worker nodes and a Deployment with a replica count of <em>two</em>. The corresponding Pod spec does not specify any resource requests and limits (thus, the resulting Pods are in the BestEffort QoS class).</p> <p>In order to conduct a performance test, we scaled ...
Fabian Schmied
<p>I <em>believe</em> that the scheduler is aware of which Nodes already have the container images pulled down, and will give them preference to avoid the image pull (and thus faster start time)</p> <p>Short of digging up the source code as proof, I would guess one could create a separate Pod (for this purpose, I liter...
mdaniel
<p>We have 8 java microservices talking to each other in kubeneters cluster. Each microservice is bundled with auth library which intercepts and validates/renews JWT token for each REST request to controllers. </p> <p>Scenario: From Frontend, we get access token for the first time, Authentication gets successful. Lets...
Roobal Jindal
<p>It looks like you're using Spring (and Spring Security), so I believe the relevant part of the docs is the part on <a href="https://docs.spring.io/spring-security/site/docs/current/reference/html5/#bearer-token-propagation" rel="nofollow noreferrer">Bearer Token Propagation</a>.</p> <p>Its recommendation is to use ...
Graham Lea
<p>Given a bash function in .bashrc such as</p> <pre><code>kgp () { kubectl get po -n $1 $2 } </code></pre> <p>Is it possible to have kubectl auto complete work for k8s resources such as namespaces/pods? As an example if I use</p> <pre><code>kubectl get po -n nsprefix podprefix </code></pre> <p>I can tab auto complet...
Kelvin Baumgart
<p>Yes, that's because bash-completion only understands <em>known commands</em>, not aliases or new functions that you have made up. You will experience the same thing with a trivial example of <code>alias whee=/bin/ls</code> and then <code>whee &lt;TAB&gt;</code> will do nothing because it doesn't &quot;recurse&quot; ...
mdaniel
<p>I'm trying to run a query with Kubectl , as follows:</p> <pre><code>kubectl -n employeesns exec -ti employeedpoddb-0 -- psql -d db_people -U postgres -c 'create extension if not exists dblink;' -c 'SELECT dbemployees.&quot;empId&quot; , dbemployees.&quot;createdAt&quot; , dbemployees.&quot;updatedAt&quot; from &qu...
JAN
<p>It's because your inner <code>'</code> is not escaped; you'll see the same thing locally</p> <pre><code>$ echo 'hello 'world' from shell' </code></pre> <p>you just need to escape those inner quotes, or change the outer to <code>&quot;</code> and then escape those usages, based on your needs</p> <pre class="lang-sh p...
mdaniel
<p>I'm dockerizing a laravel application, my image is based on an apache image, this is being hosted in AKS, where I'm mounting azure files with images share inside /public/images, the problem is apache would add header inside the image resulting in corrupting the images</p> <p><a href="https://i.stack.imgur.com/vHkrz....
Stacker
<p>We fixed the issue, simply in the vhost.conf, we needed to turn off EnableMMAP</p> <pre><code>EnableMMAP off </code></pre>
Stacker
<p>I need deploy daemonset in Kubernetes, but each pod in different nodes requires different memory and cpu requests for different hardware types.</p>
che yang
<p><em>Since you have asked such an imprecise question, you're going to get an imprecise answer -- update your question with more specifics and you'll get a better answer</em></p> <p>Using helm can help you with that problem, since the manifests are subject to golang template evaluation; thus:</p> <pre><code># values...
mdaniel
<p>In a multi-master kubernetes cluster, do only one master schedule and are the other masters in a standby mode? Does all the masters coordinate and schedule pods and etc?</p>
jarge
<p>That's mostly correct; one can see that process by looking at the logs of all the <code>controller-manager</code> Pods and observing:</p> <blockquote> <p>I1021 00:09:49.283273 1 leaderelection.go:243] attempting to acquire leader lease kube-system/kube-controller-manager...</p> </blockquote> <p>in some of the...
mdaniel
<p>Whenever i do a &quot;docker ps -a&quot;, i see two containers corresponding to pod, here the pod has only container. Typically, the two containers listed under &quot;docker ps&quot; has the following prefixes:- <strong>k8s_POD_kubernetes-&lt;POD_NAME&gt; and k8s_kubernetes-&lt;POD_NAME&gt;</strong></p> <p>Can someo...
Hemanth
<p>The <code>_POD_</code> one is the only one with the Pod's IP address, the others are every <em>workload</em> container from the PodSpec's <code>container:</code> and <code>initContainer:</code> arrays, since one of the contracts of Kubernetes is that <a href="https://kubernetes.io/docs/concepts/workloads/pods/#workl...
mdaniel
<p>I am looking for a recipe using Terraform to create a Kubernetes cluster on AWS using Fargate. I cannot find any end-to-end documentation to do this.</p> <p>I am using SSO, and so terraform needs to use my AWS credentials to do this.</p> <p>No example I can find addresses using AWS credentials and Fargate.</p> <p>I...
user10664542
<p>You can use popular module for that <a href="https://github.com/terraform-aws-modules/terraform-aws-eks" rel="nofollow noreferrer"> terraform-aws-eks</a>. It supports Fargate EKS as well. Since its open sourced, you can also have a look at exactly how to create such clusters if you want to fork and customize the mod...
Marcin
<p>I try to run this command with a service account from Jenkins: <code>kubectl rollout history deployment.v1.apps/config-service-deployment</code> The command fails with the following error:</p> <pre><code>Error from server (NotFound): namespaces "build" not found </code></pre> <p>I would like to mention, we have on...
Zsolt Tolvaly
<p>You can side-step all doubt about what namespace is in the global <code>$KUBECONFIG</code> by being explicit about the namespace in which the deployment is happening:</p> <p><code>kubectl -n default rollout history deploy/config-service-deployment</code></p>
mdaniel
<p>I want to set <code>slave.extraVolumes</code> as below. </p> <pre><code>helm install my-db --set replication.enabled=true,slave.extraVolumes={"db-disk-1","db-disk-2"} bitnami/postgresql -n development </code></pre> <p>But it says a error</p> <pre><code>Error: expected at most two arguments, unexpected arguments: ...
Padmasankha
<p>There are (at least) three things going on:</p> <ul> <li>the <a href="https://github.com/bitnami/charts/blob/master/bitnami/postgresql/templates/statefulset-slaves.yaml#L271-L273" rel="nofollow noreferrer"><code>slave.extraVolumes</code> is a <strong>list</strong> of <code>Volume</code> structures</a>, so just prov...
mdaniel
<p>I run a LoadBalance on aws and when I tried to get an external ip i got like this:</p> <pre><code>a86a863a4bea9807-1478376474.us-west-2.elb.amazonaws.com </code></pre> <p>Is it possible to get a normal IP?</p>
AlexWhite
<p>Yes you can get the IP, e.g. using <code>dig</code> or <code>drill</code> commands:</p> <pre><code>drill a86a863a4bea9807-1478376474.us-west-2.elb.amazonaws.com </code></pre> <p>But the IP returned are <strong>not static IP</strong> addresses. If you require to have static IP addresses for your load balancer, you sh...
Marcin
<p>Here's what my Dockerfile looks like for an image I'm creating.</p> <pre><code>FROM python:3.7-alpine COPY requirements.txt / RUN pip install -r /requirements.txt ENV U_PATH="a" WORKDIR $U_PATH </code></pre> <p>I override the env variable <code>U_PATH</code> when I call it using <code>docker run -it -e U_PATH=/mnt...
him229
<p>While not an environment variable, don't forget you can alter the working directory of a Pod's container via the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#container-v1-core" rel="nofollow noreferrer"><code>workingDir:</code> PodSpec field</a></p> <pre><code>containers: - name: fo...
mdaniel
<p>Hey I'm new to CI/CD with gitlab and I am a bit confused.</p> <p>I got a Kubernetes cluster connected to a Gitlab instance to run CI/CD pipelines. There is a gitlab runner with kubernetes executor, from what I understand it means there is a pod which runs the pipelines.</p> <p>A look with <code>kubectl get pods -n g...
iaquobe
<blockquote> <p>I thought the whole point of containerization is that guests can't modify the host.</p> </blockquote> <p>You are overlooking <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="nofollow noreferrer">the <code>serviceAccount</code></a> that is <em>optionally<...
mdaniel
<p>I went through the steps listed here: <a href="https://kubernetes.io/docs/setup/production-environment/tools/kops/" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/production-environment/tools/kops/</a></p> <p>After moving the kops file to /usr/local/bin/ and renaming to kops, I tried to confirm if it was...
codestein
<p>I think its because you are using <code>kops-darwin-amd64</code>. This is for mac. I think you should be using <code>kops-linux-amd64</code> instead for linux.</p>
Marcin
<p>I want to delete all the files under the volume directory. The directory is inside the Kubernetes pod. So I am using the exec command.</p> <p>My command - </p> <pre><code>kubectl exec $POD -- rm -rf /usr/local/my-app/volume/* </code></pre> <p>The above command is not working. No output of the above command on ter...
lucy
<p>That's because the wildcard expansion is happening on <strong>your machine</strong> and not the Pod; what you want is to have the shell glob expand on the Pod, which one can accomplish via</p> <pre class="lang-shell prettyprint-override"><code>kubectl exec $POD -- sh -c 'rm -rf /usr/local/my-app/volume/*' </code></...
mdaniel
<p>I am trying to create an Centralized file based repository where I can upload all the configuration files needed for an application to run which is deployed as a pod inside the Kubernetes. Any suggestion on achieving this functionality ? Can the file based repository version the files uploaded ?</p> <p>I see that s3...
babs84
<p>You could use <a href="https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html" rel="nofollow noreferrer">elastic file system</a> which is <a href="http://Amazon%20EKS%20Announces%20Support%20for%20the%20Amazon%20EFS%20CSI%20Driver" rel="nofollow noreferrer">supported</a> by EKS:</p> <blockquote> <p>Applications ru...
Marcin
<p>In my application, I have a control plane component which spawns Jobs on my k8s cluster. I'd like to be able to pass in a dynamically generated (but read-only) config file to each Job. The config file will be different for each Job.</p> <p>One way to do that would be to create, for each new Job, a ConfigMap conta...
kini
<p>The way that is traditionally done is via an <code>initContainer</code> and an <code>emptyDir</code> <code>volumeMount</code> that allows the two containers to "communicate" over a private shared piece of disk:</p> <pre class="lang-yaml prettyprint-override"><code>spec: initContainers: - name: config-gen im...
mdaniel
<p>I have a pod up and running and we have fluentd configurated in the cluster to scrap the pod logs and push it to Elastic via Logstash.</p> <p>I need to do some testing where I am executing a process (<code>spark-submit</code>) manually on this pod and test that the logs are being parsed correctly. Since I am running...
adesai
<p>The &quot;pod logs&quot; are whatever gets written to <code>/proc/self/fd/1</code> and <code>/proc/self/fd/2</code> of the <em>container's</em> process-id (which is often <code>1</code> but not mandatory); if you have used <code>kubectl exec</code> to get into the pod, you'll want to redirect the process's output to...
mdaniel
<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...
Lucas Scheepers
<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...
mdaniel
<p>According to the [documentation][1] Kubernetes variables are expanded using the previous defined environment variables in the container using the syntax $(VAR_NAME). The variable can be used in the container's entrypoint.</p> <p>For example:</p> <pre class="lang-yaml prettyprint-override"><code>env: - name: MESSAGE ...
alixander
<blockquote> <p>Is this possible though to use bash expansion aka <code>${Var1:-${Var2}}</code> inside the container's entrypoint ?</p> </blockquote> <p>Yes, by using</p> <pre><code>command: - /bin/bash - &quot;-c&quot; - &quot;echo ${Var1:-${Var2}}&quot; </code></pre> <p>but not otherwise -- kubernetes is not a wrapp...
mdaniel
<p>In jenkins jobs A and B both the jobs are executed on the same machine to two different clusters. When the &quot;kubectl config use-context&quot; command is entered in both the jobs. They error out with following error. How can this be handled.</p> <p>looks like use-context changes the file and doing it at the same ...
harishb
<p>You don't need to issue a &quot;use-context&quot; (which yes, does write to the <code>$KUBECONFIG</code>) -- kubectl has the <code>--context</code> argument that allows you to specify the context to use per invocation:</p> <pre><code># job A $ kubectl --context &quot;arn:aws:eks:us-west-2:XYZXYZXYZ:cluster/ABC&quot;...
mdaniel
<p>Why is default load balancer port 80 and 443 is considered as TCP ports? I want to test stickiness as shown in the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#sticky-sessions" rel="nofollow noreferrer">aws docs</a> either through yaml file or through ...
user630702
<p>Stickiness requires listener which operates in <strong>layer 7</strong> of <a href="https://en.wikipedia.org/wiki/OSI_model" rel="nofollow noreferrer">OSI model</a>, which in case of CLB, is provided by <code>http</code> and <code>https</code> listeners.</p> <p>Since you are using <code>TCP</code> listener which ope...
Marcin
<p>I have 2 services. Service A and Service B. They correspond to deployments dA and dB. </p> <p>I set up my cluster and start both services/deployments. Service A is reachable from the external world. External World --> Service A &lt;--> Service B.</p> <p>How can I scale dB (change replicaCount and run kubectl apply...
crossvalidator
<p>Every <code>Pod</code>, unless it opts out, has a <code>ServiceAccount</code> token injected into it, which enables it to interact with the kubernetes API according to the <code>Role</code> associated with the <code>ServiceAccount</code></p> <p>Thus, one can use any number of kubernetes libraries -- most of which a...
mdaniel
<p>I am trying to implement liveliness probe through C# code (.Net core framework). I simply want to run a curl command inside container <a href="https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/pods/probe/exec-liveness.yaml" rel="nofollow noreferrer">like this</a> . Below is the code sn...
solveit
<p>You have confused the Exec form with the Shell form; you can either change your <code>command</code> to use a shell explicitly, or fix the invocation to be compatible with exec. That's what the <code>stat</code> response was trying to tell you: there is no such <em>file</em> named <code>curl http...</code></p> <h2>U...
mdaniel
<p>I am trying to delete multiple ConfigMaps at once using a label. With <code>kubectl</code>, I would do it as follow:</p> <pre class="lang-sh prettyprint-override"><code>kubectl delete cm -l application=my-app </code></pre> <p>Kubeclient offers the <code>delete_config_map</code> method, but it requires a name.</p> <p...
Richard-Degenne
<p>The way <code>kubectl</code> does operations upon labeled, versus named, resources is that it actually does that in two phases: <code>get -o name $resourceType -l ...</code> and then the actual requested operation upon <code>${those_resource_names}</code></p> <p>One can run <code>kubectl --v=10</code> (or the <code>...
mdaniel
<p>LetsEncrypt not verifying via Kubernetes ingress and loadbalancer in AWS EKS</p> <p>ClientIssuer</p> <pre><code>apiVersion: cert-manager.io/v1alpha2 kind: ClusterIssuer metadata: name: letsencrypt-staging namespace: cert-manager spec: acme: # The ACME server URL server: https://acme-staging-v02.api.l...
teej2542
<p>Usually with golang applications the error <code>context deadline exceeded</code> means the connection timed out. That sounds like the <code>cert-manager</code> pod was not able to reach the ACME API, which can happen if your cluster has an outbound firewalls, and/or does not have a NAT or Internet Gateway attached ...
mdaniel
<p>We're moving a legacy app to Kubernetes. We will have many instances of it running (a Kubernetes namespace per customer), so we want to automate our application upgrade process.</p> <p>Kubernetes has well established patterns for rolling upgrades, but I can't use them (yet). My application requires the following pro...
Jesse McDowell
<p>Yes, there is an existing process for that:</p> <ol> <li><p>Use the <code>kubectl scale</code> command to scale down the existing Deployment to zero replicas: <code>kubectl scale --replicas=0 deploy/my-legacy-deployment</code></p> </li> <li><p>Wait for that to stabilize (there's your requested downtime ;-)</p> <p>Us...
mdaniel
<p>I'm working with Airflow DAG and Kubernetes for the first time. I have a Python script that connects to AWS S3 and reads some files. This works fine if I run it in a Docker container/image using bash. But when I try to run this docker from an airflow task using a K8s pod, I get the following error (I replaced some s...
Alain
<p>Your <code>env:</code> is malformed; one can see this in two different ways: (1) <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#container-v1-core" rel="nofollow noreferrer"><code>env:</code> in the <code>PodSpec</code></a> is a <strong>list</strong> of <code>{name: &quot;&quot;, value:...
mdaniel
<p>I'm interested if I can run k8s with publicly available control plane and worker nodes in network behind firewall (which is edge/iot deployment use-case). The main concern as I believe is communication between apiserver and kubelet/ kube-proxy. Can it be configured as only node -> master communication? How can I ach...
Piotr Kozimor
<blockquote> <p>Can it be configured as only node -> master communication? How can I achieve this?</p> </blockquote> <p>I would guess only trying it will prove for sure that the apiserver doesn't need to contact <code>kubelet</code>. However, related to that: be aware that in such a setup, <code>kubectl exec</code> ...
mdaniel
<p>I was playing around in minikube and installed the wrong version of istio. I ran:</p> <pre><code>kubectl apply -f install/kubernetes/istio-demo-auth.yaml </code></pre> <p>instead of:</p> <pre><code>kubectl apply -f install/kubernetes/istio-demo.yaml </code></pre> <p>I figured I would just undo it and install th...
Vaccano
<p>One way would be <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#delete" rel="noreferrer"><code>kubectl delete -f &lt;filename&gt;</code></a> but it implies few things:</p> <ol> <li><p>The resources were first created. It simply removes all of those, if you really want to "revert to...
zerkms
<p>I have a Kubernetes cluster that is making use of an Ingress to forward on traffic to a frontend React app and a backend Flask app. My problem is that the React app only works if rewrite-target annotation is not set and the flask app only works if it is.</p> <p>How can I get my flask app accessible without setting t...
EoinHanan
<p>Your question didn't specify, but I'm guessing your capture group was to rewrite <code>/backend/(.+)</code> to <code>/$1</code>; on that assumption:</p> <p>Be aware that annotations are per-Ingress, but all Ingress resources are unioned across the cluster to comprise the whole of the configuration. Thus, if you need...
mdaniel
<p>I'm new in Kubernetes and I was tring to deploy a nodejs service to kubernetes. For that I created a docker image and upload it to dockerhub and finally I created a deployment file that contains all required configurations in order to accomplish the deployment. The deployment file is shown above. I then executed the...
Lucas Seabra
<p>As the error message was trying to tell you, there are two <a href="https://en.wikipedia.org/wiki/Non-breaking_space#Encodings" rel="nofollow noreferrer">&quot;non-breaking space&quot; characters</a> after <code>nodejs</code>: <code>map[string]string{&quot;app&quot;:&quot;nodejs\u00a0\u00a0&quot;}</code></p> <p>I wo...
mdaniel
<p>When deploying Spinnaker to EKS via <code>hal deploy apply</code>, Spinnaker Clouddriver pod goes to <code>CrashLoopBackOff</code> with the following error,</p> <blockquote> <p>Factory method 'awsProvider' threw exception; nested exception is java.lang.NullPointerException: Cannot get property 'name' on null obje...
Milindu Sanoj Kumarage
<p><em>This is more or less a guess, since you didn't include one iota of version information about your spinnaker setup, but...</em></p> <p>According to <a href="https://gist.github.com/agentmilindu/cfbebffe46b93458df8158f9355e4041#file-spinnaker-error-log-L128" rel="nofollow noreferrer"><code>at com.netflix.spinnake...
mdaniel
<p>For example</p> <pre><code>- host: &quot;domain.com&quot; http: paths: - path: /?(.*) # want to rewrite this with /$1 backend: serviceName: RELEASE-NAME-svcname1 servicePort: 80 - path: /test/?(.*) # want to skip rewrite ...
Wakeupcolumn
<blockquote> <p>Any way to handle this in a single ingress?</p> </blockquote> <p>Not in a single Ingress resource, no, but it will work fine with a single ingress controller.</p> <p>The reason you need to create two separate Ingress resources is so that you can apply the annotation to one but not the other; all Ingress...
mdaniel
<p>Is it possible to configure k8s in a way that empty secrets are not possible?</p> <p>I had a problem in a service that somewhat the secret got overwritten with an empty one (zero bytes) and thereby my service malfunctioned. I see no advantage of having an secret empty at any time and would like to prevent empty secr...
Simon Frey
<p>While it's not a simple answer to implement, as best I can tell what you are looking for is an <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/" rel="nofollow noreferrer">Admission Controller</a>, with a very popular one being <a href="https://open-policy-agent.github.io/gateke...
mdaniel
<p>As per kubectl documentation, kubectl apply is possible by using a file or stdin. My usecase is that there would be service/deployment json strings in runtime and I have to deploy those in clusters using nodejs. Of course, I can create files and just do kubectl apply -f thefilename. But, I don't want to create files...
CuteBoy
<pre><code>echo 'your manifest' | kubectl create -f - </code></pre> <p>Reference:</p> <ul> <li><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply</a></li> </ul>
zerkms
<p>There is an official manifest for the deployment of the daemonset <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-ds.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearc...
Maksim
<blockquote> <p>I don't understand why the Fluent-bit needs to read data from the folder <code>/var/lib/docker/containers</code>.</p> </blockquote> <p>Because that is where docker stores its <code>${container_id}-json.log</code> file when using the <a href="https://docs.docker.com/config/containers/logging/json-file/" ...
mdaniel
<p>Is it possible to use pipe output as input for grep or git grep? The data im trying to pass to grep/git grep is the following</p> <pre><code> kubectl get namespace -o name -l app.kubernetes.io/instance!=applications | cut -f2 -d &quot;/&quot; argocd default kube-node-lease kube-public kube-system nsx-system pks-...
MikeK
<p>The problem is that (as your screenshot shows) the result is multiple terms which I'm guessing you want to be <em>OR</em>-ed together, and not searching for the first term in the files identified by the last terms (which is what the current xargs command does)</p> <p>Since OR in regex is via the <code>|</code> chara...
mdaniel