Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>Say we have this in a deployment.yml</p> <pre><code>containers: - name: my_container imagePullPolicy: Always image: my_image:latest </code></pre> <p>and so redeployment might take the form of:</p> <pre><code>kubectl set image deployment/my-deployment my_container=my_image </code></pre> <p>which I stole...
Alexander Mills
<p>I don't expect this to be an accepted answer. But I wanted to make it for the future as there <em>is</em> a command to do this in Kubernetes 1.15.</p> <p>PR <a href="https://github.com/kubernetes/kubernetes/pull/76062" rel="noreferrer">https://github.com/kubernetes/kubernetes/pull/76062</a> added a command called <...
Andy Shinn
<h1>The situation</h1> <p>I have a kubernetes pod stuck in "Terminating" state that resists pod deletions</p> <pre><code>NAME READY STATUS RESTARTS AGE ... funny-turtle-myservice-xxx-yyy 1/1 Terminating 1 11d ... </code></pre> <p>Where <code>funny-turtle</code> is th...
Yann Pellegrini
<p>Try removing the finalizers from the pod:</p> <pre><code>kubectl patch pod funny-turtle-myservice-xxx-yyy -p '{"metadata":{"finalizers":null}}' </code></pre>
jaxxstorm
<p>I'm trying to get Let's Encrypt working on a K3s cluster of mine. I've been following the below tutorial but since it's more than a year old I'm using a later version of <code>cert-manager</code>.</p> <p><a href="https://pascalw.me/blog/2019/07/02/k3s-https-letsencrypt.html" rel="nofollow noreferrer">https://pascalw...
user672009
<p>The key to get this working was annotating my ingress resource correctly.</p> <pre><code>cert-manager.io/cluster-issuer: letsencrypt-staging </code></pre> <p>And NOT the following</p> <pre><code>certmanager.k8s.io/issuer: letsencrypt-staging </code></pre> <p>Version 1.0.1 of cert-manager was used.</p>
user672009
<p>I've created kubernetes cluster using kops</p> <pre><code>kops create cluster \ --dns-zone=vpc.abc.in \ --master-zones=ap-southeast-1a,ap-southeast-1b,ap-southeast-1c \ --zones=ap-southeast-1a,ap-southeast-1b,ap-southeast-1c \ --node-count 3 \ --topology private \ --networking flannel-vxlan ...
prranay
<p>Add the following annotation to your service definition:</p> <pre><code>service.beta.kubernetes.io/aws-load-balancer-internal: '"true"' </code></pre> <p>Full example:</p> <pre><code>kind: Service apiVersion: v1 metadata: name: my-service annotations: service.beta.kubernetes.io/aws-load-balancer-internal: ...
jaxxstorm
<p>I want to syslog from a container to the host Node - </p> <p>Targeting fluentd (@127.0.0.1:5140) which runs on the node - <a href="https://docs.fluentd.org/input/syslog" rel="nofollow noreferrer">https://docs.fluentd.org/input/syslog</a></p> <p>e.g syslog from hello-server to the node (which hosts all of these nam...
forestgreen
<p>What you are actually looking at is the <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/logging-stackdriver" rel="nofollow noreferrer">Stackdriver Logging Agent</a>. According to the documentation at <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/logging-stackdriver/#prerequi...
Andy Shinn
<p>I'm working on writing custom controller for our kubernetes cluster and that'll listen to node events and perform some operation on the node.I'm using kubernetes client-go library and able to capture kubernetes events whenever a node is attached or removed from the cluster. But is it possible to get AWS instance det...
Mathan Kumar
<p>On a Kubernetes node in AWS, you'll have some things populated as part of the node labels and various other parts of the node's metadata:</p> <pre><code>kubectl get nodes -o json | jq '.items[].metadata.labels' { "beta.kubernetes.io/arch": "amd64", "beta.kubernetes.io/instance-type": "c5.large", "beta.kubern...
jaxxstorm
<p>We need to access the kubelet logs on our Kubernetes node (which is in AWS) to investigate an issue we are facing regarding Kubernetes error (see <a href="https://stackoverflow.com/questions/51475561/even-after-adding-additional-kubernetes-node-i-see-new-node-unused-while-gettin">Even after adding additional Kuberne...
mi10
<p>You would need to update the kops cluster using <code>kops cluster update</code> first. However, this would not change the SSH key on any running nodes.</p> <p>By modifying a cluster using <code>kops cluster update</code> you are simply modifying the <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/La...
jaxxstorm
<p>I'm testing the latest version of the Elastic Stack (7.2.0) and i can't seem to connect Kibana to Elasticsearch, but when i rollback to 6.8.1 it works. Any ideas ?</p> <hr> <h2>Kibana Deploy &amp; Service</h2> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: kibana namespace: ************* la...
user11765676
<p>As of Kibana 7.0 <code>elasticsearch.url</code> is no longer valid and it is now <code>elasticsearch.hosts</code>: <a href="https://www.elastic.co/guide/en/kibana/7.x/breaking-changes-7.0.html#_literal_elasticsearch_url_literal_is_no_longer_valid" rel="nofollow noreferrer">https://www.elastic.co/guide/en/kibana/7.x/...
Andy Shinn
<p>I'm trying to connect one pod to another, but getting a connection refused error.</p> <p>I only run:</p> <ol> <li><p>RavenDB Server</p> <ul> <li>Deployment which has: <ul> <li>ports: <ul> <li>containerPort:8080, protocol: TCP</li> <li>containerPort:38888, protocol: TCP</li> </ul></li> </ul></li> <li>Service: ...
user2331234
<p>The issue appears to be your <code>PublicServerUrl</code> setting.</p> <pre><code>--PublicServerUrl=http://localhost:8080 --PublicServerUrl.Tcp=tcp://localhost:38888 </code></pre> <p>As per the RavenDB documentation:</p> <blockquote> <p>Set the URL to be accessible by clients and other nodes, regardless of whic...
jaxxstorm
<p>I have an Azure Kubernetes cluster with Velero installed. A Service Principal was created for Velero, per <a href="https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure/tree/master#option-1-create-service-principal" rel="nofollow noreferrer">option 1 of the instructions</a>.</p> <p>Velero was working fin...
Codebling
<h1>1. Update credentials file</h1> <p>First, update your credentials file (for most providers, this is <code>credentials-velero</code> and the contents are described in the plugin installation instructions: <a href="https://github.com/vmware-tanzu/velero-plugin-for-aws#set-permissions-for-velero" rel="nofollow norefer...
Codebling
<p>I have created a deployment and a service on Google Kubernetes Engine. These are running on Cloud Compute instances.</p> <p>I need to make my k8s application reachable from other Compute instances, but not from the outside world. That is because there are some legacy instances running outside the cluster and those ...
rubik
<p>In Google Kubernetes Engine this is accomplished with a <code>LoadBalancer</code> type Service that is annotated to be an internal load balancer. The documentation for it is at <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing" rel="noreferrer">https://cloud.google.com/kubernete...
Andy Shinn
<p>Question regarding AKS, each time release CD. The Kubernetes will give random IP Address to my services. <br/> I would like to know how to bind the domain to the IP?</p> <p>Can someone give me some link or article to read?</p>
Herman
<p>You have two options.</p> <p>You can either deploy a Service with <code>type=LoadBalancer</code> which will provision a cloud load balancer. You can then point your DNS entry to that provisioned LoadBalancer with (for example) a CNAME.</p> <p>More information on this can be found <a href="https://kubernetes.io/doc...
jaxxstorm
<p>Is there a simple <code>kubectl</code> command to take a <code>kubeconfig</code> file (that contains a cluster+context+user) and merge it into the ~/.kube/config file as an additional context?</p>
Chad
<p>Do this:</p> <pre><code>export KUBECONFIG=~/.kube/config:~/someotherconfig kubectl config view --flatten </code></pre> <p>You can then pipe that out to a new file if needed.</p>
jaxxstorm
<p>Say, I have two namespaces k8s-app1 and k8s-app2</p> <p>I can list all pods from specific namespace using the below command</p> <pre><code>kubectl get pods -n &lt;namespace&gt; </code></pre> <p>We need to append namespace to all commands to list objects from the respective namespaces. Is there a way to set specif...
P Ekambaram
<p>I like my answers short, to the point and with references to official documentation:</p> <p><strong>Answer</strong>:</p> <pre><code>kubectl config set-context --current --namespace=my-namespace </code></pre> <p><strong>From</strong>:</p> <p><a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nore...
PussInBoots
<p>Is it possible to use the Ingress Controller function in Kubernetes without a load balancer (in Digital Ocean). </p> <p>Is there any other mechanism to allow a domain name to map to a Kubernetes service; for instance if I host two WordPress sites on a Kubernetes cluster:</p> <p>==> WP Site 1: Node Port 80 ==> WP S...
Rutnet
<p>DNS doesn't support adding port numbers, you need an ingress controller (which essentially acts like a reverse proxy) to do this.</p> <p>If you install the <a href="https://github.com/digitalocean/digitalocean-cloud-controller-manager" rel="noreferrer">digital ocean cloud controller manager</a> you'll be able to pr...
jaxxstorm
<p>Workflow:</p> <pre><code>apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: my-workflow- spec: entrypoint: main arguments: parameters: - name: configmap value: my-configmap - name: secret value: my-secret templates: - name: main steps: - ...
Boon
<p>As mentioned in the comments, there are a couple issues with your manifests. They're valid YAML, but that YAML does not deserialize into valid Argo custom resources.</p> <ol> <li>In the Workflow, you have duplicated the <code>parameters</code> key in <code>spec.templates[0].inputs</code>.</li> <li>In the WorkflowTem...
crenshaw-dev
<p>I have Nginx-based service which configured to accept HTTPS-only. However GKE ingress answers HTTP requests in HTTP. I know that GKE Ingress doesn't know to enforce HTTP -> HTTPS redirect, but is it possible to learn it at least return HTTPS from service?</p> <pre><code>rules: - http: paths: - path: /* b...
Vitaly Karasik DevOps
<p>Yes, you can configure the GKE Kubernetes Ingress to both terminate HTTPS for external traffic, and also to use HTTPS internally between Google HTTP(S) Load Balancer and your service inside the GKE cluster.</p> <p>This is documented <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="nof...
Paul Annetts
<p>I came across an open source Kubernetes project <a href="https://github.com/kubernetes/kops" rel="noreferrer">KOPS</a> and AWS Kubernetes service EKS. Both these products allow installation of a Kubernetes cluster. However, I wonder why one would pick EKS over KOPS or vice versa if one has not run any of them earlie...
Débora
<p>The two are largely the same, at the time of writing, the following are the differences I'm aware of between the 2 offerings</p> <p>EKS:</p> <ul> <li>Fully managed control plane from AWS - you have no control over the masters</li> <li><a href="https://docs.aws.amazon.com/eks/latest/userguide/managing-auth.html" re...
jaxxstorm
<p>How can you run an akka streams application in argo and kubernetes, I found documentation about kubernetes and akka cluster, but I don't need an akka cluster, do I just need to run an ephemeral akka application with many actors; or is an akka cluster necessary?</p>
javier_orta
<p>You can run an Akka Stream app on Kubernetes in a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a> just like you can run it locally when testing.</p> <p>If you need your application to scale to many Pods and handle a lot of input, it may be help...
crenshaw-dev
<p>I have created the single master kubernetes <code>v1.9.0</code> cluster using kubeadm command in bare metal server. Now I want to add two more master and make it multi master. </p> <p>Is it possible to convert to multi master configuration? Is there a document available for this type of conversation? </p> <p>I ...
sfgroups
<p>Yes, it's possible, but you may need to break your master setup temporarily. You'll need to follow the instructions <a href="https://kubernetes.io/docs/setup/independent/high-availability/" rel="noreferrer">here</a></p> <p>In a nutshell:</p> <p>Create a kubeadm config file. In that kubeadm config file you'll need ...
jaxxstorm
<p>I've launched kubernetes cluster using kops. It was working find and I started facing the following problem:</p> <pre><code>kubectl get pods The connection to the server localhost:8080 was refused - did you specify the right host or port? </code></pre> <p>How do i solve this? It looks like kubernetes-apiserver is ...
prranay
<p>Kubernetes uses a <code>$KUBECONFIG</code> file for connecting to clusters. It may be when provisioning your kops cluster, it didn't write the file correctly. I can't be sure as you haven't provided enough info.</p> <p>Assuming this is the issue, and you only have a single cluster, it can be resolved like so:</p> ...
jaxxstorm
<p>I am learning Kubernetes and have deployed a headless service on Kubernetes(on AWS) which is exposed to the external world via nginx ingress.</p> <p>I want <code>nslookup &lt;ingress_url&gt;</code> to directly return IP address of PODs. How to achieve that?</p>
Saurav Prakash
<p>If you declare a “headless” service with selectors, then the internal DNS for the service will be configured to return the IP addresses of its pods directly. This is a somewhat unusual configuration and you should also expect an effect on other, cluster internal, users of that service.</p> <p>This is documented <a ...
Paul Annetts
<p>I tried to convert the below working kubernetes manifest from</p> <pre class="lang-yaml prettyprint-override"><code>##namespace --- apiVersion: v1 kind: Namespace metadata: name: poc ##postgress --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: db name: db namespace: poc spec: replicas: ...
Samit Kumar Patel
<p>Pulumi automatically adds random strings to your resources to help with replacing resource. You can find more information about this in the <a href="https://www.pulumi.com/docs/troubleshooting/faq/#why-do-resource-names-have-random-hex-character-suffixes" rel="nofollow noreferrer">FAQ</a></p> <p>If you'd like to dis...
jaxxstorm
<p>I created a Kubernetes cluster on Google Cloud using:</p> <pre><code>gcloud container clusters create my-app-cluster --num-nodes=1 </code></pre> <p>Then I deployed my 3 apps (backend, frontend and a scraper) and created a load balancer. I used the following configuration file:</p> <pre><code>apiVersion: apps/v1 k...
Naor
<p>Every container has a default CPU request (in GKE I’ve noticed it’s 0.1 CPU or 100m). Assuming these defaults you have three containers in that pod so you’re requesting another 0.3 CPU.</p> <p>The node has 0.68 CPU (680m) requested by other workloads and a total limit (allocatable) on that node of 0.94 CPU (940m).<...
Paul Annetts
<p>I have 3 services in my ingress, the first 2 use <code>default</code> namespace. The third service is <strong>prometheus-server</strong> service which has namespace <code>ingress-nginx</code>. Now, I want to map my prometheus DNS to the service, but getting error because ingress can't find the prometheus service in ...
Justinus Hermawan
<p>You will need to refer to your service in the other namespace with its full path, that is <code>prometheus-server.ingress-nginx.svc.cluster.local</code>.</p> <p>You shouldn’t need a second Ingress to do this.</p>
Paul Annetts
<p>I have a private Docker image registry running on a Linux VM (10.78.0.228:5000) and a Kubernetes master running on a different VM running Centos Linux 7.</p> <p>I used the below command to create a POD:<br> <code>kubectl create --insecure-skip-tls-verify -f monitorms-rc.yml</code></p> <p>I get this:</p> <blockquo...
Rushil Paul
<p>The issue you're seeing is actually a docker issue. Using <code>--insecure-skip-tls-verify</code> is a valid arg to <code>kubectl</code>, but it only deals with the connecition between <code>kubectl</code> and the kubernetes API server. The error you're seeing is actually because the docker daemon cannot login to th...
jaxxstorm
<p>I would like to be able to deploy the AWS EFS CSI Driver Helm chart hosted at <a href="https://kubernetes-sigs.github.io/aws-efs-csi-driver/" rel="nofollow noreferrer">AWS EFS SIG Repo</a> using Pulumi. With Source from <a href="https://github.com/kubernetes-sigs/aws-efs-csi-driver" rel="nofollow noreferrer">AWS EFS...
Gary
<p>You're using the wrong version in your chart invocation.</p> <p>The version you're selecting is the application version, ie the release version of the underlying application. You need to set the Chart version, see <a href="https://helm.sh/docs/topics/charts/#charts-and-versioning" rel="nofollow noreferrer">here</a> ...
jaxxstorm
<p>I have an argocd ApplicationSet created. I have the following merge keys setup:</p> <pre><code> generators: - merge: mergeKeys: - path generators: - matrix: generators: - git: directories: ...
sebastian
<p>The matrix generator is producing one set of parameters for each combination of directory and cluster.</p> <p>If there is more than one cluster, then there will be one parameter set with <code>path: aws-ebs-csi-driver</code> for each cluster.</p> <p>The merge generator requires that each parameter used as a merge ke...
crenshaw-dev
<p>I want to reference the label's value in VirtualService's spec section inside k8s yaml file. I use ${metadata.labels[component]} to indicate the positions below. Is there a way to implement my idea?</p> <pre><code>apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: istio-ingress-version ...
Jeffrey
<p>This isn't a capability of Kubernetes itself, however other tools exist that can help you with this scenario.</p> <p>The main one of these is <a href="https://docs.helm.sh" rel="nofollow noreferrer">Helm</a>. It allows you to create variables that can be shared across several different YAML files, allowing you to s...
Paul Annetts
<p>I want to create Security Policy in my Google Kubernetes such that there is Adaptive Protection enabled for the DDoS attacks, on my application layer.</p> <p>Reading pulumi documents, this is what I came up with:</p> <pre><code>ddos_layer7_defense_policy_name = &quot;ddos-layer7-defense-policy&quot; ddos_layer7_defe...
Aviral Srivastava
<p>The pulumi-gcp provider is derived from the Google Terraform provider.</p> <p>There was a <a href="https://github.com/hashicorp/terraform-provider-google/issues/12554" rel="nofollow noreferrer">bug in this resource</a> in the Terraform provider which meant that it wasn't possible to manage these resources properly b...
jaxxstorm
<p>I need to supply a Configgroup with yaml. The yaml needs to be populated with values from Pulumi Outputs. My problem is that the yaml field in the code below only take strings and I cannot figure a way to create this string from Outputs.</p> <p>For example, imagine taking an Id of sorts from an Output and replacing ...
TomHells
<p>Any time you're needing to use an output value inside a string, you'll need to make sure the output is resolved using an <code>apply</code>.</p> <p>In your case, it'd look a little bit like this:</p> <pre class="lang-js prettyprint-override"><code>import * as k8s from &quot;@pulumi/kubernetes&quot;; import * as pulu...
jaxxstorm
<p>I am exploring Argo to orchestrate processing big data. I wish to kick off a workflow via REST call that divides a large data set among a number of machines with desired resources for processing. From an architectural perspective, how would I accomplish this? Is there an REST api or maybe some libraries for Node.js ...
afriedman111
<p>Argo 2.5 <a href="https://blog.argoproj.io/argo-workflows-v2-5-released-ce7553bfd84c" rel="nofollow noreferrer">introduces its own API</a>.</p> <p>There are currently officially-supported <a href="https://github.com/argoproj/argo-workflows/blob/master/pkg/apiclient/apiclient.go" rel="nofollow noreferrer">Golang</a> ...
crenshaw-dev
<p>I want to create a secret with Pulumi in Typescript it should contain the following data:</p> <pre><code> remote_write: - url: &quot;example.com&quot; basic_auth: username: &quot;user&quot; password: &quot;XXX&quot; </code></pre> <p>the code looks like:</p> <pre><code> const databas...
robolott
<p>There are a couple of problems here.</p> <p>Firstly: A Kubernetes secret takes an input with a key name, and then some string data. You're passing the key name as <code>remote_write</code> and then trying to pass a TypeScript object - you need to stringify it first. You can do take advantage of YAML being a superset...
jaxxstorm
<p>I get the following error message whenever I run a pulumi command. I verified and my kubeconfig file is <code>apiVersion: v1</code> I updated <code>client.authentication.k8s.io/v1alpha1</code> to <code>client.authentication.k8s.io/v1beta1</code> and still have the issue, what could be the reason for this error messa...
Kaizendae
<p>The bug report for this issue is <a href="https://github.com/pulumi/pulumi-eks/issues/599" rel="noreferrer">here</a></p> <p>The underlying cause is that the AWS cli shipped a breaking change in a minor version release. You can see this <a href="https://github.com/aws/aws-cli/issues/6920" rel="noreferrer">here</a></p...
jaxxstorm
<p>I deployed prometheus server (+ kube state metrics + node exporter + alertmanager) through the <a href="https://github.com/helm/charts/tree/master/stable/prometheus" rel="nofollow noreferrer">prometheus helm chart</a> using the chart's default values, including the chart's default <a href="https://github.com/helm/ch...
ravishi
<p>I was able to figure out how to add the "missing" labels by navigating to the prometheus service-discovery status UI page. This page shows all the "Discovered Labels" that can be processed and kept through relabel_configs. What is processed/kept shows next to "Discovered Labels" under "Target Labels". So then it ...
ravishi
<p>I want to manage different clusters of k8s,<br> one called <code>production</code> for prod deployments,<br> and another one called <code>staging</code> other deployments and configurations.</p> <p>How can I connect <code>helm</code> to the tiller in those 2 different clusters?<br> Assume that I already have <code>...
itaied
<p>Helm will connect to the same cluster that <code>kubectl</code> is pointing to.</p> <p>By setting multiple <code>kubectl</code> contexts and changing them with <code>kubectl config use-context [environment]</code> you can achieve what you want.</p> <p>Of course you will need to set appropriate HELM_ environment v...
Paul Annetts
<p>I want, in one command with <strong>args</strong> to config <code>kubeconfig</code>, that is able to connect to k8s cluster.</p> <p>I tried the following which does not work.</p> <pre><code>cfg: mkdir ~/.kube kube: cfg touch config $(ARGS) </code></pre> <p>In the <strong>args the user</strong> should pas...
NSS
<p>I assume the user input is the pathname of a file. The <code>make</code> utility can take variable assignments as arguments, in the form of <code>make NAME=VALUE</code>. You refer to these in your <code>Makefile</code> as usual, with <code>$(NAME)</code>. So something like</p> <pre><code>kube: cfg case "$(ARGS)...
Jens
<p>We are using 3 master - 4 worker setup cluster. Recently due to disk pressure we had to add another worker to our cluster and we would like to redistribute some of the existing persistent volume claims to new worker.</p> <p>Right now,</p> <p>2 out of 4 Longhorn nodes are not schedulable due to not enough disk space....
Çağdaş Özgür
<p>I think it’s better for you to just create a new replica. Instead of deleting your pv/pvc. Click on the longhorn volume that you want to move around to a different node (using longhorn dashboard, in volume menu).</p> <p>In the context menu there should be option to <em>Update Replicas Count</em> if your volume is at...
lucernae
<p>I'm developing an application in ASP.NET Core 2.1, and running it on a Kubernetes cluster. I've implemented authentication using OpenIDConnect, using Auth0 as my provider.</p> <p>This all works fine. Actions or controllers marked with the <code>[Authorize]</code> attribute redirect anonymous user to the identity pr...
aevitas
<p>The cookie issued by authentication is encrypted via Data Protection. Data Protection by default is scoped to a particular application, or instance thereof. If you need to share an auth cookie between instances, you need to ensure that the data protection keys are persisted to a common location and that the applicat...
Chris Pratt
<p>I'm looking to configure Redis for Sidekiq and Rails in k8s. Using Google Cloud Memory Store with an IP address. </p> <p>I have a helm template like the following (with gcpRedisMemorystore specified separately) - My question is what does the Service object add to the system? Is it necessary or does the Endpoint pro...
stujo
<p>Yes, you still need it.</p> <p>Generally speaking, the Service is the name which is consumed by applications to connect to an Endpoint. Usually, a Service with a selector will automatically create a corresponding endpoint with the IP addresses of the Pods found by the selector.</p> <p>When you define a Service wit...
Andy Shinn
<p>I am creating a kube cluster with GKE in terraform. I am creating the cluster from two modules, a cluster module and a nodepool module. I'd like to create a module for the master_authorized_networks_config so that each time a new cidr is added to it terraform doesn't destroy the original cluster. Is this possible. T...
TeeTee
<p>You can use <a href="https://developer.hashicorp.com/terraform/language/expressions/dynamic-blocks" rel="nofollow noreferrer">dynamic blocks</a> to achieve this. In your terraform template, write:</p> <pre><code>master_authorized_networks_config { dynamic &quot;cidr_blocks&quot; { for_each = var.authorized_network...
Kristiaan
<p>I followed this tutorial <a href="https://kubernetes.io/docs/tutorials/configuration/configure-redis-using-configmap/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/configuration/configure-redis-using-configmap/</a></p> <p>I got the error as bellow when I try to create the pods</p> <pre><code>kube...
wanghaoming
<p>I think you misinterpreted the <code>kustomization.yaml</code> instructions (which are confusing). You don't add the contents of <code>pods/config/redis-pod.yaml</code> to <code>kustomization.yaml</code>. You just download that file and add the <code>resources</code> snippet.</p> <p>The resulting <code>kustomizatio...
Andy Shinn
<p>Is it possible to send a http Rest request to another K8 Pod that belongs to the same Service in Kubernetes when Envoy is configured? </p> <p><strong>Important</strong> : I have another question <a href="https://stackoverflow.com/questions/54410515/pod-to-pod-communication-within-a-service?r=SearchResults">here</a>...
M_K
<p>What I posted on another question was , I disabled Istio injection before installing the service and then re enabled it after installing the service and now its all working fine, so the commands that worked for me were:</p> <p><a href="https://i.stack.imgur.com/T8Wvm.png" rel="nofollow noreferrer"><img src="https:/...
M_K
<p>I deploy asp.net core application docker image to Kubernetes cluster. My application is using NAudio to get microphone stream from the user and send to Google Speech-To-Text.</p> <p>But after I deployed, getting the error below in Kubernetes logging:</p> <blockquote> <p>System.DllNotFoundException: Unable to loa...
Vo Dinh Duy
<p>Considering that Kubernetes only very recently began to support Windows containers, and that support is still so sketchy as to virtually make Windows containers still unsupported, I'd imagine you're running linux containers.</p> <p>Something like an audio library is very often going to be platform-specific, using A...
Chris Pratt
<p>For a .net core application, I need the internal IP address of the nginx ingress to trust the proxy and process its forwarded headers.</p> <p>This is done with the following code in my application:</p> <pre><code>forwardedHeadersOptions.KnownProxies.Add(IPAddress.Parse("10.244.0.16")); </code></pre> <p>Now it is ...
Sander Declerck
<p>I found the solution to this, specific for Asp.net core. </p> <p>First of all, you MUST whitelist the proxy, otherwise the forwarded headers middleware will not work.</p> <p>I found out, you can actually whitelist an entire network. That way, you are trusting everything inside your cluster. Kubernetes uses the 10....
Sander Declerck
<p>I have a flask app with uwsgi and gevent.<br> Here is my <code>app.ini</code> How could I write readinessProbe and livenessProbe on kubernetes to check to flask app?</p> <pre><code>[uwsgi] socket = /tmp/uwsgi.sock chdir = /usr/src/app/ chmod-socket = 666 module = flasky callable = app master = false processes = 1 v...
Rukeith
<p>I think what you are really asking is "How to health check a uWSGI application". There are some example tools to do this. Particularly:</p> <ul> <li><a href="https://github.com/andreif/uwsgi-tools" rel="nofollow noreferrer">https://github.com/andreif/uwsgi-tools</a></li> <li><a href="https://github.com/che0/uwping"...
Andy Shinn
<p>I have a very simple asp.net core app (C# Web Application with Docker Support for Linux) and when i build the docker image and try to run it on my local PC the following happens; In docker with my image called test, i type docker run test, at which point it states "Content root path: /app Now listening on: <a href="...
Tom Baker
<p>When it says listening on <code>http://[::]:80</code>, it's talking about localhost <em>in the container</em>. When you try to access it via <code>http://localhost</code> in your web browser running on your computer, <code>localhost</code> is your computer, <em>not</em> the container. You need to use the container's...
Chris Pratt
<p>I have a multiplayer game based on microservices architecture which I am trying to figure how to <strong>scale horizontally</strong>. It is currently orchestrated in Docker Swarm but I am considering moving to Kubernetes.</p> <p>Here are the details about the game:</p> <ul> <li>It is a table game with cards</li> <...
BabbevDan
<p>This can be achieved with help of 3rd party libraries, like Istio. </p> <p><a href="https://istio.io/docs/tasks/traffic-management/request-routing/" rel="nofollow noreferrer">https://istio.io/docs/tasks/traffic-management/request-routing/</a></p> <p>You will have to define VirtualServices depending on your config....
YoK
<p>I am trying to check the status of a pod using kubectl wait command through this <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait" rel="nofollow noreferrer">documentation</a>. Following is the command that i am trying</p> <pre><code>kubectl wait --for=condition=complete --timeout...
Auto-learner
<p>To wait until your pod is running, check for &quot;condition=ready&quot;. In addition, prefer to filter by label, rather than specifying pod id. For example:</p> <pre><code>$ kubectl wait --for=condition=ready pod -l app=netshoot pod/netshoot-58785d5fc7-xt6fg condition met </code></pre> <p>Another option is <a href...
Noam Manos
<p>I am trying to create a module in Terraform to create the basic resources in a Kubernetes cluster, this means a <code>cert-manager</code>, <code>ingress-nginx</code> (as the ingress controller) and a <code>ClusterIssuer</code> for the certificates. In this exact order.</p> <p>The first two I am installing with a <co...
everspader
<p><a href="https://cert-manager.io/docs/installation/helm/#option-1-installing-crds-with-kubectl" rel="nofollow noreferrer">Official documentation</a> says to use <code>kubectl apply</code> before installing this with a helm chart, making it a two step process. Using Terraform, this would make it a 3 step process in ...
user658182
<p>I have an API that recently started receiving more traffic, about 1.5x. That also lead to a doubling in the latency:</p> <p><a href="https://i.stack.imgur.com/clJmx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/clJmx.png" alt="latency" /></a></p> <p>This surprised me since I had setup autoscaling of both...
Johan Wikström
<p>Turns out the answer is that you <strong>cannot loadbalance gRPC requests using a GKE loadbalancer</strong>.</p> <p>A GKE loadbalancer (as well as Kubernetes' default loadbalancer) picks a new backend every time a new TCP connection is formed. For regular HTTP 1.1 requests each request gets a new TCP connection and ...
Johan Wikström
<p>I need to inject container port from an environment variable inside my pod. How to do that? </p> <p>Have been through the documentation, Links:- 1. <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/in...
Kunal Malhotra
<p>A way to accomplish this would be to use a templating tool such as <a href="https://get-ytt.io/" rel="nofollow noreferrer">ytt</a>. With ytt you would turn your manifest into a template like:</p> <pre><code>#@ load(&quot;@ytt:data&quot;, &quot;data&quot;) apiVersion: v1 kind: Pod metadata: name: nginx-pod namesp...
Andy Shinn
<p>I am trying to run a test pod with OpenShift CLI:</p> <pre><code>$oc run nginx --image=nginx --limits=cpu=2,memory=4Gi deploymentconfig.apps.openshift.io/nginx created $oc describe deploymentconfig.apps.openshift.io/nginx Name: nginx Namespace: myproject Created: 12 seconds ago Labels: run=nginx Annot...
Hohol
<p>I found a solution!</p> <p>Part of the error message was &quot;Error creating deployer pod&quot;. It means that the problem is not with my pod, but with the <strong>deployer pod</strong> which performs my pod deployment. It seems the quota in my project affects deployer pods as well. I couldn't find a way to set dep...
Hohol
<p>I just lost access to my k3s.</p> <p>I had the certs check this week to if if they had been auto-updated... and it seen so:</p> <pre><code>[root@vmpkube001 tls]# for crt in *.crt; do printf '%s: %s\n' &quot;$(date --date=&quot;$(openssl x509 -enddate -noout -in &quot;$crt&quot;|cut -d= -f 2)&quot; --iso-86...
Techmago
<p>To ignore this error, follow these steps:</p> <p><strong>Step 1. Stop k3s</strong></p> <pre><code>systemctl stop k3s.service </code></pre> <p><strong>Step 2. Stop time sync</strong></p> <pre><code>hwclock --debug timedatectl set-ntp 0 systemctl stop ntp.service systemctl status systemd-timesyncd.servi...
Mohsen Abasi
<p>I have a question about following architecture, I could not find a clear cut answer in the Kubernetes documentation may be you can help me.</p> <p>I have a service called 'OrchestrationService' this service is dependant to 3 other services 'ServiceA', 'ServiceB', 'ServiceC' to be able to do its job.</p> <p>All the...
posthumecaver
<p>No, you only expose OrchestrationService to public and other service A/B/C need to be cluster services. You create <code>selector</code> services for A/B/C so OrchestrationService can connect to A/B/C services. OrchestrationService can be defined as <code>NodePort</code> with fixed port or you can use ingress to ro...
Akash Sharma
<p>I am running an application with GKE. It works fine but I can not figure out how to get the external IP of the service in a machine readable format. So i am searching a gcloud or kubectl command that gives me only the external IP or a url of the format <code>http://192.168.0.2:80</code> so that I can cut out the IP....
stm
<p>You can use the <a href="https://kubernetes.io/docs/reference/kubectl/jsonpath/" rel="nofollow noreferrer">jsonpath</a> output type to get the data directly without needing the additional <code>jq</code> to process the json:</p> <pre class="lang-bash prettyprint-override"><code>kubectl get services \ --namespace ...
kenny
<p>I'm sorry if this is a very ignorant question but is it possible for Ambassador to truly handle CORS headers and pre-flight OPTION responses? </p> <p>The docs (<a href="https://www.getambassador.io/reference/cors" rel="noreferrer">https://www.getambassador.io/reference/cors</a>) seem kind of ambiguous to me, if th...
xbakesx
<p>Turns out, by specifying <code>headers: "Content-Type"</code> in the <code>cors</code> configuration, things just started to work. Apparently that's not as optional as I thought.</p> <p>So this is now my module:</p> <pre><code>getambassador.io/config: | --- apiVersion: ambassador/v1 kind: Module name: ambassad...
xbakesx
<p>From the <a href="https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/" rel="nofollow noreferrer">official example</a> of <code>Kubernetes</code> documentation site on deploying a <code>Wordpress</code> application with mysql:</p> <p>The service definition of <code>mysql</cod...
pkaramol
<p>The <code>Service</code> is a concept that makes your container (in this case hosting wordpress) available on a given port. It maps an external port (the <code>Node's</code> port) to and internal port (the container/pod's port). It does this by using the <code>Pod's</code> networking capabilities. The selector is a ...
Kyle
<p>I created a single-node kubeadm cluster on bare-metal and after some research I would go for a host network approach (<a href="https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#via-the-host-network" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#via-the-host-network</a>), si...
staticdev
<p>@ijaz-ahmad-khan @vkr gave good ideas for solving the problem but the complete steps for setup are:</p> <p>1) Install nginx-ingress with: </p> <pre><code>helm install stable/nginx-ingress --set controller.hostNetwork=true,controller.service.type="",controller.kind=DaemonSet </code></pre> <p>2) In your deployments...
staticdev
<p>On Macbook Pro, tried installing from binary with curl and then with brew.</p> <p>Both installs generate an error at the end of output:</p> <pre><code>~ via 🐘 v7.1.23 ➜ kubectl version --output=yaml clientVersion: buildDate: "2019-04-19T22:12:47Z" compiler: gc gitCommit: b7394102d6ef778017f2ca4046abbaa23b88...
Stephane Gosselin
<p>I think there is another application listening on 8080 port. By default, <code>kubectl</code> will try to connect on localhost:8080 if no <code>server</code> is passed.</p> <p>If you have deployed kubernetes <code>apiserver</code> on some other machine or port, pass <code>--server=IP:PORT</code> to <code>kubectl</c...
Akash Sharma
<p>After learning about arguments that can be passed to a Java 8 Virtual Machine to make it container-aware (i.e. -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap), I am trying to add these arguments to my Kubernetes deployment for a Spring Boot service.</p> <p>In containers section of my deployment Y...
JJ_Mind
<p>When running <code>java -XshowSettings:vm -version</code> in container, <code>JVM_OPTS</code> is not include in your command.</p> <p>Try with this one</p> <pre><code>kubectl exec test-service-deployment-79c9d4bd54-trxgj -c test-service \ -- sh -c 'java $JVM_OPTS -XshowSettings:vm -version' </code></pre>
silverfox
<p>I am trying Seldon Core example.</p> <p>Here's SeldonExampleDeployment.yaml.</p> <pre><code>apiVersion: machinelearning.seldon.io/v1 kind: SeldonDeployment metadata: name: seldon-model spec: name: test-deployment predictors: - componentSpecs: - spec: containers: - image: seldonio/mock_cla...
Anderson
<p>Old case, but to help at least other Googlers...</p> <p>To avoid that webhook to fail deployment,</p> <ul> <li>first create SeldonDeployment</li> <li>then enable interferenceservice on namespace,</li> <li>lastly add Gateway</li> </ul> <pre><code># Create namespace and add a mock classifier REST service MY_NS=a-names...
Jens X Augustsson
<p>I have the following service:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: downstream-service spec: type: ClusterIP selector: app: downstream ports: - protocol: TCP port: 80 targetPort: 80 </code></pre> <p>which I'd like to load balance based on app version which I've def...
Patryk
<p>Ok, so it seems I've missed one big "typo" on my part which was the fact that it's the <code>routes</code> that have many <code>destination</code>s which are weighted not the <code>http</code> that has many weighted <code>route</code>s.</p> <p>So the correct version of my <code>VirtualService</code> is as follows:<...
Patryk
<p>I am able to login to the container running in a pod using <code>kubectl exec -t ${POD } /bin/bash --all-namespaces</code> (POD is the text parameter value in my Jenkins job, In which user would have entered the pod name before running the job), Now my question is : I am able to login into the container , I want to ...
Suresh Ravi
<p>There is no need to have two steps one step is sufficient. I believe below should get the job done</p> <p>kubectl exec ${POD} /path/to/script/test.sh --all-namespaces</p> <p>Below is the reference form Kubernetes <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">documenta...
asolanki
<p>I have several Persistent Volume Claims in Google Kubernetes Engine that I am not sure if they are still used or not. How can I find out which pod they are attached to or is safe to delete them?</p> <p>Google Kubernetes UI tells me they are bound but not to which container. Or maybe it means they are bound to a Volu...
David Dehghan
<p>this gives you the PVC for each pod</p> <pre><code>kubectl get pods --all-namespaces -o=json | jq -c '.items[] | {name: .metadata.name, namespace: .metadata.namespace, claimName: .spec | select( has (&quot;volumes&quot;) ).volumes[] | select( has (&quot;persistentVolumeClaim&quot;) ).persistentVolumeClaim.claimName...
David Dehghan
<p>I am tasked with migrating AWS lambda microservices to Kubernetes. For simplicity, there are two service endpoints: <code>/admin</code> and <code>/user</code> where you can GET or POST a request to get something done.</p> <p>You have to be in <code>admin</code> group (defined in an external authZ provider) to hit <...
Andrey
<blockquote> <p>check if there is a built-in solution in Kubernetes</p> </blockquote> <p>Nope, there's no built-in solution for L7 network policies. <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="nofollow noreferrer">Network Policies</a> in Kubernetes are at L4 level, so thi...
mr-karan
<p>I have been attempting to get GRPC's load balancing working in my Java application deployed to a Kubernetes cluster but I have not been having too much success. There does not seem to be too much documentation around this, but from examples online I can see that I should now be able to use '.defaultLoadBalancingPoli...
Daniel Western
<p>ManagedChannelBuilder.enableRetry().maxRetryAttempts(10) is not sufficient to make retry happen. The retry needs a service config with RetryPolicy defined. One way is set a default service config with RetryPolicy, please see the retry example in <a href="https://github.com/grpc/grpc-java/tree/v1.35.0/examples" rel="...
user675693
<p>I just tested Ranche RKE , upgrading kubernetes 13.xx to 14.xx , during upgrade , an already running nginx Pod got restarted during upgrade. Is this expected behavior? </p> <p>Can we have Kubernetes cluster upgrades without user pods restarting? </p> <p>Which tool supports un-intruppted upgrades?</p> <p>What are ...
Ijaz Ahmad
<p>The default way Kubernetes upgrades is by doing a rolling upgrade of the nodes, one at a time.</p> <p>This works by draining and cordoning (marking the node as unavailable for new deployments) each node that is being upgraded so that there no pods running on that node.</p> <p>It does that by creating a new revisio...
jonathancardoso
<p>In official document, the default replicas of argo-server and workflow-controller is set to 1. Should it be set to 3 in the production environment for high availability?</p>
zheng cy
<p><a href="https://github.com/argoproj/argo/blob/master/docs/scaling.md" rel="nofollow noreferrer">According to Argo's scaling documentation</a>, the Argo Workflows controller cannot be horizontally scaled. In other words, you should only have one replica.</p> <p>You can have multiple Argo installations (called &quot;...
crenshaw-dev
<p>I'm exploring an easy way to read K8S resources in the Argo workflow. The current documentation is focusing mainly on create/patch with conditions (<a href="https://argoproj.github.io/argo/examples/#kubernetes-resources" rel="nofollow noreferrer">https://argoproj.github.io/argo/examples/#kubernetes-resources</a>), w...
Oleksandr
<p><strong>Update:</strong></p> <p><code>action: get</code> is now supported: <a href="https://github.com/argoproj/argo-workflows/blob/246d4f44013b545e963106a9c43e9cee397c55f7/examples/k8s-wait-wf.yaml#L46" rel="nofollow noreferrer">https://github.com/argoproj/argo-workflows/blob/246d4f44013b545e963106a9c43e9cee397c55f...
crenshaw-dev
<p>Is there a way to identify the url from where container executing in Kubernetes POD was pulled from ?</p> <p>The Kubernetes Image <a href="https://kubernetes.io/docs/concepts/containers/images/" rel="nofollow noreferrer">doc</a> indicate only image name is provided as part of Pod specification.</p> <p>I would like...
alwaysAStudent
<p>You can use the image id to understand that. Something like</p> <pre><code>kubectl get pod pod-name-123 -o json | jq '.status.containerStatuses[] | .imageID' </code></pre> <p>will return something like:</p> <pre><code>"docker-pullable://redacted.dkr.ecr.eu-west-2.amazonaws.com/docker-image-name@sha256:redacted" <...
Federkun
<p>I want to restart deployment pod by patching ENV variable in deployment. Here is my code:</p> <pre><code>String PATCH_STR = &quot;[{\&quot;op\&quot;:\&quot;replace\&quot;,\&quot;path\&quot;:\&quot;/spec/template/spec/containers/0/env/8/UPDATEDON\&quot;,\&quot;value\&quot;: \&quot;%d\&quot;}]&quot;; final String pa...
Pushpendra
<p>There are a couple of issues with your example. In general, if you <em>successfully update</em> the environment variables in the pod template of your deployment, the Kubernetes operator will recognize the change and start a new pod to reflect the change.</p> <p>When you perform the update with a JSON patch by specif...
sauerburger
<p>I installed the default helm chart of Argo Workflow with only configuring init.serviceAccount as argo-sa, which I have created. (ServiceAccount with enough authorization) However, running every Workflow runs as serviceaccount Default, which I can’t figure out where the setting is configured. According to the README ...
Piljae Chae
<p>The Argo installation does not control which ServiceAccount Workflows use. According to the <a href="https://github.com/argoproj/argo/blob/3507c3e6e8e9c420a6028a43b930a3ef6b221705/docs/service-accounts.md" rel="noreferrer">Argo docs</a>,</p> <blockquote> <p>When no ServiceAccount is provided [when the Workflow is su...
crenshaw-dev
<p>I would like to deploy <a href="https://www.keycloak.org/" rel="nofollow noreferrer">Keycloak</a> on my K8S cluster. In addition, the prerequisite for using Keycloack is a database, so I am going to use postgresql. </p> <p>Before deploying Keycloak, the database has to be up and running. For such as scenario, I th...
softshipper
<p>This should be possible without using Argo Workflow to spin up a Postgres server. ArgoCD supports multiple ways to deploy a "package" of resources that includes both Keycloack and Postgres.</p> <p>For example, you could use <a href="https://github.com/codecentric/helm-charts/tree/master/charts/keycloak#prerequisite...
crenshaw-dev
<p>In <a href="https://kubernetes.github.io/ingress-nginx/deploy/baremetal/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/baremetal/</a> In metalLB mode, one node attracts all the traffic for the ingress-nginx By node port we can gather all traffic and loadbalance it podes by service</p> ...
yasin lachini
<p>A Nodeport offers access to a service through a port on the node (hence node+port). A port is allocated that you can access the service through on any node in the cluster.</p> <p>MetalLB is a load balancer for on-prem clusters. It allocates services with separate dedicated IP addresses allocated from a pool. So, if ...
starfry
<p>I'm currently investigating using dynamically provisioned persistent disks in the GCE application: In my application I have 1-n pods, where each pod contains a single container that needs rw access to a persistent volume. The volume needs to be pre-populated with some data which is copied from a bucket.</p> <p>Wh...
Andy
<p>Looks like the copy is a good candidate to be done as an <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">"init container"</a>.</p> <p>That way on every pod start, the "init container" would connect to the GCS bucket and check the status of the data, and if req...
Paul Annetts
<p>I have a fluentbit deployed as a sidecar. This fluentbit has an output of type Forward that is suppose to send the logs to a FluentD deployed as a DaemonSet.</p> <p>The implementation works when using the PodIP of FluentD as host, but I get Connection refused when using the Service hostname from Kubernetes.</p> <p>T...
codiaf
<p>Ok, stupid stupid mistake, there was a typo when writing the number port so the one configured in FluentBit didn't match the one defined in the Kubernetes Service -.-</p>
codiaf
<p>I've one workflow in which I'm using <code>jsonpath</code> function for a output parameter to extract a specific value from json string, but it is failing with this error <code>Error (exit code 255)</code></p> <p>Here is my workflow</p> <pre><code>apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateN...
Biru
<p>When an expression fails to evaluate, Argo Workflows simply does not substitute the expression with its evaluated value. Argo Workflows passes the expression <em>as if it were the parameter</em>.</p> <p><code>{{=}}</code> &quot;expression tag templates&quot; in Argo Workflows must be written according to the <a href...
crenshaw-dev
<p>I've recently started working with Kubernetes clusters. The flow of network calls for a given Kubernetes service in our cluster is something like the following:</p> <p>External Non-K8S Load Balancer -> Ingress Controller -> Ingress Resource -> Service -> Pod</p> <p>For a given service, there are two replicas. By l...
Danny Noam 父
<p>The "internal load balancing" between Pods of a Service has already been covered in <a href="https://stackoverflow.com/questions/48789227/does-clusterip-service-distributes-requests-between-replica-pods">this question from a few days ago</a>.</p> <p>Ingress isn't really doing anything special (unless you've been ha...
Paul Annetts
<p>I've Two workflowTemplates <code>generate-output</code>, <code>lib-read-outputs</code> and One workflow <code>output-paramter</code> as follows</p> <ol> <li><code>generate-output.yaml</code></li> </ol> <pre><code>apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: generate-output spec: entryp...
Biru
<h1>DAG and steps templates don't produce outputs by default</h1> <p>DAG and steps templates do not automatically produce their child templates' outputs, even if there is only one child template.</p> <p>For example, the <code>no-parameters</code> template here does not produce an output, even though it invokes a templa...
crenshaw-dev
<p>I have deployed <strong>Influxdb 2.0.0</strong> as Statefulset with EBS volume persistence. I've noticed that, if for some reason, pod gets rescheduled to other node or even if we scale down statefulset pod replicas = 0 and then scale up, the effect would be the same on persisted data: they will be lost.</p> <p>Ini...
Bakir Jusufbegovic
<p>Fortunately, the problem was due to the big changes that happened between influxdb 1.x and 2.0.0 beta version in terms on where the actual data is persisted.</p> <p>In 1.x version, data was persisted in:</p> <pre><code>/var/lib/influxdb </code></pre> <p>while on the 2.x version, data is persisted, by default, on:...
Bakir Jusufbegovic
<p>I am using Rancher to manage Kubernetes which orchestrates my Docker containers.</p> <p>Each of our microservices (running in a container) that requires persistence has a corresponding MySQL container. E.g. MyApp is running in a container called MyApp and persists to a MySQL container called MySQL-MyApp.</p> <p>We...
dleerob
<p>If the users have access to <code>kubectl</code> command-line for the cluster, they can set-up a temporary <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="noreferrer">port-forward</a> between a local development machine and the pod that contains you...
Paul Annetts
<p>I have multi-environment k8s cluster (<strong>EKS</strong>) and I'm trying to setup accurate values for ResourceQuotas. </p> <p>One interesting thing that I've noticed is that specified request/limit for CPU/memory stay <strong>"occupied"</strong> in k8s cluster when job is completed successfully and effectively po...
Bakir Jusufbegovic
<p>I've done "load" test on my environment to test if requests/limits that are left assigned on the completed job (pod) will indeed have influence on the ResourceQuota that I've set. </p> <p>This is how my ResourceQuota looks like:</p> <pre><code>apiVersion: v1 kind: ResourceQuota metadata: name: mem-cpu-quota spec...
Bakir Jusufbegovic
<p>I have the following Argo Workflow using a Secret from Kubernetes:</p> <pre><code>args: - | export TEST_FILENAME=&quot;./test.txt&quot; echo &quot;$TEST_DATA&quot; &gt; $TEST_FILENAME chmod 400 $TEST_FILENAME env: - name: TEST_DATA valueFrom: secretKeyRef: ...
ratzip
<p><code>echo</code> shouldn't be writing <code>$TEST_DATA</code> to logs the way your code is written. So I'm not sure what's going wrong.</p> <p>However, I think there's an easier way to <a href="https://kubernetes.io/docs/concepts/configuration/secret/#projection-of-secret-keys-to-specific-paths" rel="nofollow noref...
crenshaw-dev
<p>I have a .Net Core Console Application which I have containerized. The purpose of my application is to accept a file url and return the text. Below is my Dockerfile.</p> <pre class="lang-sh prettyprint-override"><code>FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:5...
Manan Kapoor
<p>The <code>read-all-data</code> template looks to me like invalid YAML. I think you're missing the <code>command</code> field name. I think the path also needs either a leading <code>/</code> (for an absolute path), or to start with <code>bin/</code> (for a relative path with <code>/app</code> as the working director...
crenshaw-dev
<p>I'm using standard procedure for enabling HTTPS termination for my application that is running on Kubernetes using: - Ingress nginx - AWS ELB classic - Cert Manager for Let's encrypt</p> <p>I've used procedure described here: <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-w...
Bakir Jusufbegovic
<p>After all, it seems that problem was related with the fact on how I've done setup of listeners on ELB classic on AWS.</p> <p>I've done following:</p> <pre><code>HTTP 80 -&gt; HTTP &lt;INGRESS_SVC_NODE_PORT_1&gt; HTTP 443 -&gt; HTTP &lt;INGRESS_SVC_NODE_PORT_2&gt; </code></pre> <p>First mistake was that I've used ...
Bakir Jusufbegovic
<p>I have a Kubernetes pod which downloading several types of files (let’s say <code>X</code>, <code>Y</code> and <code>Z</code>), and I have some processing scripts (each one is in a docker image) which are interested in one or more files (let's say <code>processor_X_and_Y</code>, <code>processor_X_and_Z</code> and <c...
Hussein Awala
<p>As mentioned in another answer, you can give your pod access to the Kubernetes API and then apply a Pod resource via kubectl.</p> <p>If you want to start an Argo Workflow, you could use kubectl to apply a Workflow resource, or you could use the <a href="https://argoproj.github.io/docs/argo/examples/readme.html#argo...
crenshaw-dev
<p>We have a Kubernetes cluster with 1 master and 3 nodes managed by kops that we use for our application deployment. We have minimal pod-to-pod connectivity but like the autoscaling features in Kubernetes. We've been using this for the past few months but recently have started having issue where our pods randomly cann...
Ruby
<p>We also encounter this issue, but issue was with query timeout.</p> <p>The best way after testing was to run dns on all nodes and all PODs referring to their own node DNS. It will save round trips to other node pods because you may run multiple pods for DNS but dns service will distribute traffic some how and PODs ...
Akash Sharma
<p>We are using argo cd and kubernetes.</p> <p>And I want to use environmental variables in the yaml file.</p> <p>For example,</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Service metadata: name: guestbook-ui annotations: spec: ports: - port: $PORT targetPort: $TARGET_PORT ...
Junseok Lee
<p>I'd recommend converting your raw YAML to a Helm chart and templating the relevant fields.</p> <p>Argo CD has an <a href="https://github.com/argoproj/argocd-example-apps/tree/master/helm-guestbook" rel="nofollow noreferrer">example Helm app</a> with a service similar to yours.</p> <p>You could define a service like ...
crenshaw-dev
<p>I am trying to create fargate profiles for EKS using terraform, the requirement is to create multiple fargate profiles bound to single namespace but different label.</p> <p>I have defined the selector variable as below :</p> <pre><code>variable &quot;selectors&quot; { description = &quot;description&quot; type =...
sandeepdosapati
<p>In Terraform, when using <code>for_each</code>, the keys must be unique. If you do not have unique keys, then use <code>count</code>:</p> <pre><code>resource &quot;aws_eks_fargate_profile&quot; &quot;eks_fargate_profile&quot; { count = length(var.selectors) selector { namespace = var.selectors[count.i...
Old Pro
<p>I'm trying to automate the process of simultaneously deploying an app onto multiple machines with kubernetes clusters. I'm new to kubernetes.</p> <p>Which tool/technology should I use for this?</p>
Queilyd
<p>In kubernetes, you can control the nodes no which service to deploy or if multiple pods of same application should not be deployed on same node. Use <code>node-selector</code> or <code>node-affinity</code> or <code>node-anti-affinity</code>. For details check <a href="https://kubernetes.io/docs/concepts/configuratio...
Akash Sharma
<p>I am trying to set up ArgoCD, and am unclear on some of its directions. I am a Kubernetes beginner and am experimenting to learn. I've set up my own Kubernetes master and two workers on VMs, and so far so good. (VMs and real k8s because I want to dig in...) Next I've installed ArgoCD and got it to run, according to ...
jws
<p>I'm not sure that what you're actually seeing is ArgoCD running as a &quot;foreground process.&quot; The API server is running in a pod. I think what you're seeing in the foreground is <code>kubectl</code> forwarding a port so you can access the ArgoCD API/UI.</p> <p>In order to avoid running the <code>kubectl</code...
crenshaw-dev
<p>We have Prometheus running on k8s but it won't start anymore because RAM requirements are insufficient (and CPU close to the limit as well). Since this is all new to me I'm not sure about which approach to take. I tried deploying the container with a bit increased RAM limit (node has 16Gi, I increased from 145xxMi t...
aardbol
<p>The message from cluster autoscaler reveals the problem:</p> <p><code>cluster-autoscaler pod didn't trigger scale-up</code></p> <p>Even if the cluster autoscaler would add a new node to the cluster, the Prometheus still would not fit to the node.</p> <p>This is likely due to the EKS nodes having some capacity from ...
Lauri Koskela
<p>I am trying to achieve 0 downtime during rolling update with EKS (AWS K8s service).</p> <p>I have one WebSocket server and I want to ensure during the rolling update of this server, existing connections will be kept until the WebSockets are closed after the work is done.</p> <p>I thought K8s rolling update feature...
Tran Triet
<p>For mission critical application, go for customised blue-green deployments.</p> <p>First deploy new version deployment with new selector and when all POD replicas are UP and ready to serve traffic, switch the service selector to point to new version deployment. </p> <p>After this send the kill switch to older vers...
Akash Sharma
<p>I am working in a setup where I have an Argo CD portal to view the Kubernetes deployments etc. But do not have access to a kubeconfig file (hence cannot use kubectl).</p> <p>I can see the logs for the pods in the web UI, but is there a way to export the logs as a text file?</p>
Prabal Rakshit
<p>ArgoCD's logging interface in &gt;2.0 includes a Download button.</p> <p>For earlier versions, open your browser's dev tools to the Network tab. Click the Logs tag in the ArgoCD interface. Find the network request to the <code>logs</code> endpoint and open the URL in a new tab. From there you can download the logs a...
crenshaw-dev
<h3>Summary:</h3> <p>We have a golang application that submits Argo workflows to a kubernetes cluster upon requests. I'd like to pass a yaml file to one of the steps and I'm wondering what are the options for doing this.</p> <h3>Environment:</h3> <ul> <li>Argo: v2.4.2</li> <li>K8s: 1.13.12-gke.25</li> </ul> <h3>Additio...
Ash
<h1>Option 1: pass the file as a parameter</h1> <p><a href="https://github.com/argoproj/argo-workflows/tree/master/examples#parameters" rel="nofollow noreferrer">Workflow parameters</a> are usually small bits of text or numbers. But if your yaml file is reasonably small, you could string-encode it and pass it as a para...
crenshaw-dev
<p>Here's a simplified version of a kubernetes job YAML config I use commonly:</p> <pre><code>apiVersion: batch/v1 kind: Job metadata: name: myjob spec: template: spec: containers: - name: mycontainer image: me/mycontainer:latest command: [&quot;bash&quot;, &quot;-c&quot;] ar...
David Parks
<p>If the minified yaml (or the args string in general) does not include single quotes, you can wrap the whole command line in them:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1 kind: Job metadata: name: myjob spec: template: spec: containers: - name: mycontainer ...
Lauri Koskela
<p>I've stumbled upon a problem when using some more complex argo workflows with initialization and clean-up logic. We are running some initialization in one of the initial steps of the workflow (e.g. creation of some resources) and we'd like to perform a clean-up regardless of the status of the workflow. <code>onExit<...
Andrzej Igielski
<p>You can mark output parameters as global using the <code>globalName</code> field. A global output parameter, assuming it has been set, can be accessed from anywhere in the Workflow, including in an exit handler.</p> <p>The example file for writing and consuming global output parameters should contain all the informa...
crenshaw-dev
<p>I want to execute a task in Argo workflow if a string starts with a particular substring. For example, my string is <code>tests/dev-or.yaml</code> and I want to execute task if my string starts with <code>tasks/</code></p> <p>Here is my workflow but the condition is not being validated properly</p> <pre><code>apiVer...
Biru
<p>tl;dr - use this: <code>when: &quot;'{{inputs.parameters.should-print}}' =~ '^tests/'&quot;</code></p> <p>Parameter substitution happens before the <code>when</code> expression is evaluated. So the when expression is actually <code>tests/dev-or.yaml startsWith 'tests/'</code>. As you can see, the first string needs ...
crenshaw-dev
<p><strong>UDPDATED</strong><br /> I am trying to get resources via curl inside a pod deployed on K8s.<br /> While I am able to fetch the list of pods via curl request, I can't on configmaps and nodes.</p> <p>Here the Role Binding I am using (working for pods)</p> <pre><code>apiVersion: rbac.authorization.k8s.io/v1 kin...
user1971444
<p>To give the <code>test-ro</code> Role access to list ConfigMaps, the resource name must be specified in its plural form. This is likely why listing Pods works, but listing ConfigMaps does not. So the Role should be specified like this:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: rbac.authorizat...
Lauri Koskela