Question stringlengths 65 39.6k | QuestionAuthor stringlengths 3 30 ⌀ | Answer stringlengths 38 29.1k | AnswerAuthor stringlengths 3 30 ⌀ |
|---|---|---|---|
<p>I'm using a GKE. For single zone it is free of charge(only instance cost). For DEV we are using it but for another environment like QA/DEV/Production do we need separate GKE Cluster or inside the current GKE a different namespace will work ? which is the best way in cost and security</p>
| Jithin Kumar S | <p>This depends on your requirements. Both options are viable.</p>
<blockquote>
<p>environment like QA/DEV/Production do we need separate GKE Cluster</p>
</blockquote>
<p>In a professional environment for a large enterprise, this would be different clusters in different <a href="https://cloud.google.com/vpc" rel="nofol... | Jonas |
<p>What is the best approach to create the ingress resource that interact with ELB into target deployment environment that runs on Kubernetes?</p>
<p>As we all know there are different cloud provider and many types of settings that are related to the deployment of your ingress resource which depends on your target envi... | Tal Avissar | <blockquote>
<p>What is the best approach to create the ingress resource that interact with ELB into target deployment environment that runs on Kubernetes?</p>
</blockquote>
<p>On AWS the common approach is to use ALB, and the <a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller" rel="nofollow norefer... | Jonas |
<p>I am planning to deploy the Asp.net application that uses session on Azure kubernetes. How do I make sure that the incoming request goes to the same pod where session is created.</p>
| One Developer | <p>It is recommended that apps deployed on Kubernetes has a design following the <a href="https://12factor.net/" rel="nofollow noreferrer">The Twelve Factor App</a>.</p>
<p>Everything will be easier if the app is <em>stateless</em> and <em>share nothing</em> with other instances. See <a href="https://12factor.net/proce... | Jonas |
<p>I'm working with microservice architecture using Azure AKS with Istio.</p>
<p>I configure all, and developers work with microservices to create the web platform, apis, etc.</p>
<p>But with this, I have a doubt. There is much yaml to configure for Istio and Kubernetes, e.g. <code>Ingress</code>, <code>VirtualService<... | mpanichella | <p>This is a good but difficult question.</p>
<p>Kubernetes has changed what the DevOps role means, as described in the article <a href="https://thenewstack.io/devops-before-and-after-kubernetes/" rel="nofollow noreferrer">DevOps Before and After Kubernetes</a>.</p>
<p>As you say, there are much Yaml to handle with Kub... | Jonas |
<p>I am learning Kubernetes and quite new to it.</p>
<p>let us say a pod A needs to use some persistent volume in node A (i.e. meaning the container in the pod A will write some data into some path in node A). Then after some time, the pod A dies and a new pod B is scheduled to node B. Then, can pod B somehow remotely ... | laventy | <p>It is recommended to use <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">Persistent Volumes</a> and <code>Persistent Volume Claims</code> when an application deployed on Kubernetes needs storage.</p>
<p>PV and PVC are abstractions and can be backed by several diffe... | Jonas |
<p>We have defined K8s liveness and readiness probes in our <strong>deployment</strong> resource (we have defied there liveness...), we need with <code>client-go</code> lib to access this liveness probe, how can we do that?</p>
<p>I've tried it with the <code>client-go</code> lib</p>
<p><a href="https://github.com/kube... | PJEM | <p>How to do this depends on what you want to do.</p>
<h2>Deployment</h2>
<p>The <code>Deployment</code> contains a PodTemplate, that is used for creating each replica.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: myapp
name: myapp
spec:
rep... | Jonas |
<p>I have 2 pods running. They are;</p>
<ol>
<li>mail-services-pod</li>
<li>redis-pod</li>
</ol>
<p>I need to make sure that the redis server is (via redis-pod) up and running before creating the mail-services-pod as its is dependant on redis-pod.</p>
<p>I am new to kubernetes and would like to know what are the best w... | Shanka Somasiri | <blockquote>
<p>I am new to kubernetes and would like to know what are the best ways to implement this check</p>
</blockquote>
<p>Kubernetes is a distributed environment and instances will change e.g. address on deployment on new versions of your apps.</p>
<p>It is important that your app is <em>recilient</em> e.g. to ... | Jonas |
<p>I am trying to implement Prometheus for my application hosted on Azure kubernetes. Currently the application does not have any authentication enabled, Prometheus is working fine.</p>
<p>However I would be enabling the Azure AD authentication to protect the application. In this case, would it break the Prometheus met... | One Developer | <blockquote>
<p>However I would be enabling the Azure AD authentication to protect the application. In this case, would it break the Prometheus metric collection?</p>
</blockquote>
<p>This depends on how the application is implemented.</p>
<p>It is not common to add authentication also to the metrics endpoint. But some... | Jonas |
<p>I've got my K8 cluster which I need to update with new deployments. If I had my jenkins container inside the kluster itself, is this bad practice? The other option is to have a seperate server that ssh's inside my remote K8 cluster and handles new deployments then.</p>
<p>I've looked at this jenkins plugin <a href="... | thatguyjono | <p>It is a good practice to use CI/CD - good start. I wouldn't say it is a "bad practice" to run Jenkins as a container on Kubernetes - but my experience is that it does not work very well, mostly because Jenkins is not designed for being run as a container on Kubernetes.</p>
<p>There are more modern alternat... | Jonas |
<p>I am learning concepts in kubernetes, when i am going through deployments and replicaset concepts i got one doubt that <code>can replicasets and deployment be independent to each other</code></p>
| vishwa | <p>You <em>can</em> create a <code>ReplicaSet</code> without creating a <code>Deployment</code>, but nowadays it does not make much sense. You will almost always use only <code>Deployment</code> for deploying an application, and for every change, e.g. updating the <code>image:</code>, it will manage the creation of a n... | Jonas |
<p>I have written a custom resource as part of the deployment. As part of this in the reconcileKind function, I have written the logic to create pod as shown below using the Kubernetes APIs in Go itself.</p>
<p><a href="https://i.stack.imgur.com/bEQUu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b... | coders | <blockquote>
<p>How to create the knative serving using golang?</p>
</blockquote>
<p>You need to use the Go-client for Knative Serving, e.g. the client type - corresponding to the <code>corev1.Pod</code> that you used in your code.</p>
<p>The Go client for <a href="https://github.com/knative/serving/blob/master/pkg/cli... | Jonas |
<h3>Scenario</h3>
<p>I have a PersistentVolume with <code>volumeMode</code>as <code>Block</code>. It is defined as:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: block-vol
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
local:
pat... | S.Au.Ra.B.H | <p>Kubernetes can't do much about the storage size for <a href="https://kubernetes.io/docs/concepts/storage/volumes/#local" rel="nofollow noreferrer">local volumes</a>. The admin that created the <code>PersistentVolume</code> must set a proper size, for granular sizing he/she should probably create its own partition in... | Jonas |
<p>I am new to YAML and I would like to understand the following piece of a .yaml file:</p>
<pre><code>version: "3.7"
services:
influxdb:
image: influxdb:alpine
environment:
INFLUXDB_DB: ft_services
INFLUXDB_ADMIN_USER: admin
INFLUXDB_ADMIN_PASSWORD: adm... | kubo | <h2>Lists</h2>
<p>example</p>
<pre><code>volumes:
- data: /var/lib
other-field: "example"
- data: /etc
</code></pre>
<p>Each indented line beginning with an <code>-</code> above is the beginning of a <em>List Item</em>. There is two items in the list in the example and the whole list is named <code... | Jonas |
<p>I have the following scenario,</p>
<p>I have two deployments on Kubernetes, my first deployment needs to be shut down due to some issue
and user requests need to route to the second deployment and then the first deployment will shut
down, once the second is up and running.</p>
<p>How would I route user requests from... | abaair davis | <p>With a "second deployment", I assume that you mean a new version of your app, in Kubernetes this would be a change of the <code>Deployment</code> resource to use a different <code>image:</code>.</p>
<p>In Kubernetes, you usually have a few instances ("replicas") of your app running. And when a <a... | Jonas |
<p>I'm at the finish line of this tutorial on my Linux machine with minikube: <a href="https://tekton.dev/docs/getting-started/" rel="nofollow noreferrer">https://tekton.dev/docs/getting-started/</a>. But something went wrong and I don't get the expected <code>echo</code> result.</p>
<p>In order to track the TaskRun pr... | Vassily | <p>This listing of the TaskRuns:</p>
<pre><code>NAME STARTED DURATION STATUS
hello-run-5f4qc --- --- ---
hello-run-5zck9 --- --- ---
hello-run-8sdmx --- --- ---
</code></pre>
<p>and no corresponding created Pods indicate that your Pipeline Controller does no... | Jonas |
<p>The <a href="https://helm.sh/docs/howto/charts_tips_and_tricks/" rel="nofollow noreferrer">helm documentation</a> suggests to <strong>recreate a pod</strong> by setting variable metadata values.</p>
<p>For example:</p>
<pre><code>kind: Deployment
spec:
template:
metadata:
annotations:
checksum/co... | Matthias M | <p>The <em>template</em> in a <code>Deployment</code> is a <code>PodTemplate</code>. Every time the PodTemplate is changed, a new ReplicaSet is created, and it creates new Pods according to the number of replicas using the PodTemplate.</p>
<pre><code>kind: Deployment
spec:
template:
# any change here will lead to... | Jonas |
<p>I had a broken mongo container that was not initializing, and I suspected that I could fix it by cleaning all the storage. So, I deleted the persistent storage being used, but now, every new storage that I create is in the "Lost" phase, and it's not found by in the mongo's POD creation.</p>
<p>This is the ... | Hugo Sartori | <blockquote>
<p>This is the .yml file that I'm using to create the PV</p>
</blockquote>
<p>It looks like you use a manifest that binds to a specific PV.</p>
<p>How about if you remove the unique fields and let the cluster dynamically provision a new PV for you?</p>
<p>Example:</p>
<pre><code>apiVersion: v1
kind: Persis... | Jonas |
<p>Hello Kubernetes Experts,</p>
<p>Trying to get a better understanding here.</p>
<p>I have created a deployment with a regular deployment yaml and service yaml
The service is node port, I then created a ingress and pointed the service</p>
<p>Tried to access the service and it works as expected on the default port of ... | anish anil | <p>First, the <code>Service</code> and <code>Ingress</code> resources works a bit different across cloud providers. E.g. on Google Cloud Platform and <a href="https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html" rel="nofollow noreferrer">AWS</a>, you need to use a <code>NodePort</code> service when using ... | Jonas |
<p>I try to mount a local folder as PersistentVolume and use it in one of the pods, but seems there is problem with the process and the pod stays on the status "pending".</p>
<p>The following is my pv yaml file:</p>
<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-web
labels:
type: ... | Ken Tsoi | <p>You doesn't seem to have a Node that match your affinity requirement.</p>
<p>Remove the affinity requirement on your <code>PersistentVolume</code>:</p>
<p>Remove this part:</p>
<pre><code> nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
... | Jonas |
<p>I want to set a boolean variable in configMap (or secret):</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: env-config
namespace: mlo-stage
data:
webpack_dev_server: false
</code></pre>
<p>But when I apply it, I get the following error:</p>
<pre><code>The request is invalid: patch: Invalid value: ... | Ken Tsoi | <p>Values in a <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="noreferrer">ConfigMap</a> must be key-value string values or files.</p>
<p>Change:</p>
<pre><code>data:
webpack_dev_server: false
</code></pre>
<p>To:</p>
<pre><code>data:
webpack_dev_server: "false"
</code></pre>
<... | Jonas |
<p>Assume I have a Python application/JBoss application.
I can setup my SSL certificate at server level</p>
<p>For instance in Python 3 using <code>SimpleHTTPServer</code>:</p>
<pre class="lang-py prettyprint-override"><code>def main():
key_file = "/etc/letsencrypt/live/mydomain.fr/privkey.pem"
cert_f... | scoulomb | <p>Kubernetes is often used for apps that is composed of multiple services, e.g. <em>microservice architecture</em>. In such architecture, the https-connection to the "app" is terminated at the gateway, typically Kubernetes Ingress load balancer, and then depending on what url the request has, it is forwarded... | Jonas |
<p>I want to pass a list object in the data section of configMap in application YAML file.</p>
<p>I have the following list in the properties file:</p>
<pre><code>abc.management.provider[0].url=https://example.com
abc.management.provider[0].username=John
abc.management.provider[1].url=https://example2.com
abc.manage... | Manoj Singh | <blockquote>
<p>what should I do?</p>
</blockquote>
<p>This mostly depends on how your application reads the configuration.</p>
<p>If it works for you, you an <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-files" rel="nofollow noreferrer">create the <co... | Jonas |
<p>I was using AWS ECS fargate for running my application. I am migrating to AWS EKS. When I use ECS, I deployed a ALB to route request to my service in ECS cluster.</p>
<p>In kubernete, I read this doc <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">htt... | Joey Yi Zhao | <p>You don't strictly need an AWS ALB for apps in your EKS cluster, but you probably want it.</p>
<p>When adopting Kubernetes, it is handy to manage some infrastructure parts from the Kubernetes cluster in a similar way to how you mange apps and in some cases there are a tight coupling between the app and configuration... | Jonas |
<p>A Kubernetes cluster should not contain stateful services like databases because of scalability, recovery and operation of the storage. Would be the use of ceph be an alternative to this problem?</p>
| moinster | <p>A Kubernetes can contain stateful services. Some examples are Redis cache or <a href="https://www.cockroachlabs.com/product/" rel="nofollow noreferrer">CockroachDB</a> - but they should be a <em>distributed service</em>.</p>
<p>Ceph is a storage solution alternative.</p>
| Jonas |
<p>I am new to kubernetes just doing little R&D on k8s.
was checking out different deployment strategies like rolling update, recreate, blue-green and canary. if am correct the idea behind canary deployment is rolling out new version to set of users. here my questions lets my team has developers and testing team. w... | Sugatur Deekshith S N | <h2>Canary Deployment</h2>
<blockquote>
<p>if am correct the idea behind canary deployment is rolling out new version to set of users. here my questions lets my team has developers and testing team.</p>
</blockquote>
<p>The term <em>Canary Deployment</em> does not have a precise definition as what I know. But it usuall... | Jonas |
<p>If desperate, one can consider Argo Workflows as a programming language implemented in YAML and using Kubernetes as a back-end.</p>
<ul>
<li>A procedure can be defined using <code>steps:</code></li>
<li>Functions are Templates with arguments coming in two flavours:
<ul>
<li>Parameters, which are strings</li>
<li>Art... | Seanny123 | <p>Argo Workflows is implemented with custom <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/" rel="nofollow noreferrer">Kubernetes Custom Resources</a>, e.g. its own yaml manifest types. For every <em>custom resource</em> there is an associated custom pod that acts as a <a... | Jonas |
<p>Within same stateful set afaik you can interact between particular pods just by referencing it directly, like this - <code>pod-{0..N-1}.my_service.my_namespace.svc.cluster.local</code>.
(some more info here: <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id" rel="nofol... | Ruslan Akhundov | <blockquote>
<p>However in my case I have 2 different stateful sets, and I want to be able statefullset1-pod-0 from 1st stateful set to interact with statefullset2-pod-0 from 2nd stateful set(and also statefullset1-pod-1 with statefullset2-pod-1, and so on). Is it possible? If yes, can you please provide example config... | Jonas |
<p>I've investigated a couple of helm charts for apache spark deployment and found that most of them use statefulset for deployment instead of normal k8s deployment resource. </p>
<p>E.g. the <a href="https://hub.helm.sh/charts/microsoft/spark" rel="nofollow noreferrer">microsoft/spark</a> uses normal deployment while... | Russell Bie | <p>Apache Spark is a <em>stateful</em> service, those should be deployed as <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a>.</p>
<p>Only <em>stateless</em> services should be deployed as <a href="https://kubernetes.io/docs/concepts/workloads/co... | Jonas |
<p>I have one pod which requires a persistent disk. I have 1 pod running on us-central1-a and if that zone goes down I want to migrate to another zone without data loss to another zone (us-central1-*).</p>
<p>Is it possible to migrate a pod to another zone(where i know the disks exists) and use the regional disk for th... | rubio | <p>A regional Persistent Disk on Google Cloud is only available in <strong>two zones</strong>, so you must change your <code>StorageClass</code> to only two zones.</p>
<p>See example StorageClass on <a href="https://cloud.google.com/solutions/using-kubernetes-engine-to-deploy-apps-with-regional-persistent-disks" rel="n... | Jonas |
<p>I have a PHP container, I am getting my media from an S3 bucket but resizing them locally and then the container uses them from local. I don't care about persistence or about sharing between containers, but there is a fair amount of I/O. Do I need an emptydir volume or am I ok just creating the files inside the cont... | Wayne Theisinger | <p>A Persistent Volume is a way to have data persisted even when the container is disposed, e.g. terminated and replaced by a new version.</p>
<p>An EmptyDir volume might work for you, in some configurations it is using the memory of the Pod instead of disk.</p>
<p>What choice you do, depend on your requirements.</p>
| Jonas |
<p>I'm planning to deploy RabbitMQ on Kubernetes Engine Cluster. I see there are two kinds of location types i.e. 1. Region 2. Zone
Could someone help me understand what kind of benefits I can think of respective to each location types? I believe having multi-zone set up
could help enhancing the network throughout. Wh... | Balajee Venkatesh | <blockquote>
<p>I'm planning to deploy RabbitMQ on Kubernetes Engine Cluster. I see there are two kinds of location types:</p>
<ol>
<li>Region </li>
<li>Zone </li>
</ol>
<p>Could someone help me understand what kind of benefits I can think of respective to each location types?</p>
</blockquote>
<p>A ... | Jonas |
<p>Sometimes k8s nodes are labelled as <code>k8s.infra/postgres=</code> . Is this a valid label for a node ?</p>
<p>How do we use this kind of label whilst adding node affinities in our Deployment manifests ?</p>
<pre><code> spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringE... | nevosial | <blockquote>
<p>Sometimes k8s nodes are labelled as k8s.infra/postgres= . Is this a valid label for a node?</p>
</blockquote>
<p>Yes, it is a valid label. The type the key is a <code>string</code> and the value is also a <code>string</code> but the value can be empty <code>string</code>: <code>""</code>.</p>
... | Jonas |
<p>I have created a <strong>Django-Python application with a postgres database</strong>. Its working fine in my PC as well as in any other windows based systems.
I am trying to use K8s to host the application.
I have setup the postgres container successfully.</p>
<p><em><strong>But when I am trying to create the Django... | arjunbnair | <pre><code>kind: Service
metadata:
name: postgresql
namespace: trojanwall
labels:
app: postgres-db
spec:
type: ClusterIP
</code></pre>
<p>You service for the PostreSQL instance will allocate a new IP address from the Kubernetes cluster, since your service has type <code>ClusterIP</code>. This is well.</p>... | Jonas |
<p>(using kubernetes v1.15.7 in minikube and matching client version and minikube 1.9.0)</p>
<p>If I <code>kubectl apply</code> a secret like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
data:
MY_KEY: dmFsdWUK
MY_SECRET: c3VwZXJzZWNyZXQK
kind: Secret
metadata:
name: my-secret
type:... | Andrew DiNunzio | <p>kubectl apply need to merge / patch the changes here. How this works is described in <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-apply-calculates-differences-and-merges-changes" rel="nofollow noreferrer">How apply calculates differences and merges changes</a></p>
<p>I... | Jonas |
<p>We have a service which queries database records periodically. For HA we want to have replicas. But with replicas all of then queries the database records.</p>
<p>Following <code>Deployment</code> manifest is used to deploy. But in this configuration one pod is receiving the traffic. But all of them queries db and p... | Sachith Muhandiram | <h1>Availability</h1>
<p>Different levels of availability can be achieved in Kubernetes, it all depends on your requirements.</p>
<p>Your use case seem to be that only one replica should be active at the time to the database.</p>
<h2>Single Replica</h2>
<p>Even if you use a single replica in a Kubernetes Deployment or ... | Jonas |
<p>I have a kubernetes cluster of 3 worker nodes where I need to deploy a <code>statefulset</code> app having 6 replicas.
My requirement is to make sure in every case, each node should get exactly 2 pods out of 6 replicas. Basically,</p>
<pre><code>node1 - 2 pods of app
node2 - 2 pods of app
node3 - 2 pods of app
====... | Nish | <p>You should use <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity" rel="nofollow noreferrer">Pod Anti-Affinity</a> to make sure that the pods are <strong>spread to different nodes</strong>.</p>
<p>Since you will have more than one pod on the nodes, ... | Jonas |
<p>Recently we were getting the following exception in one of our Containers which was running a Java application in Openshift 4.2. This container used to run perfectly on Openshift 3.11.</p>
<pre><code>Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Threa... | ycr | <p>By default, OpenShift 3 uses <em>docker</em> as container runtime whereas OpenShift 4 uses <a href="https://cri-o.io/" rel="nofollow noreferrer">cri-o</a> as container runtime.</p>
<p>According to <a href="https://github.com/cri-o/cri-o/issues/1921" rel="nofollow noreferrer">Default pids_limit too low</a> - by defa... | Jonas |
<p>I'm looking for a lightweight way to access the Kubernetes API from a Pod in a C# app.</p>
<p>Kubernetes docs mention two ways of <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod" rel="nofollow noreferrer">accessing the API from a Pod</a>:</p>
<blockqu... | Max | <blockquote>
<p>Ideally, I'd like to just use WebClient</p>
</blockquote>
<p>The Kubernetes is a REST API, so this would work. As shown on <a href="https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#using-kubectl-proxy" rel="nofollow noreferrer">Directly accessing the REST API using kubectl proxy</... | Jonas |
<p>I am new to Kubernetes, and I struggle to understand whol idea behind Persistent Storage in Kubernetes.</p>
<p>So is this enough or I have to create Persistent Volume and what will happen if I deploy only these two object without creating PV?</p>
<p>Storage should be on local machine.</p>
<pre><code>apiVersion: v1
k... | Most31 | <blockquote>
<p>I struggle to understand whole idea behind Persistent Storage in Kubernetes</p>
</blockquote>
<p>The idea is to separate the <em>storage request</em> that the app needs, and the physical storage - such that an app can be moved to e.g. other cloud provider that has a different storage system - but withou... | Jonas |
<p>I'm using kubernetes, and I want to get podname from the app name. Here is the command I use.</p>
<pre><code>POD=$(kubectl get pods -l app=influxdb-local -o custom-columns=:metadata.name -n influx)
</code></pre>
<p>Then I would like to use the result in:</p>
<pre><code>kubectl exec -it -n influx $POD -- influx -u... | Juliatzin | <p>Add <code>--no-headers</code> to skip the header line</p>
<pre><code>kubectl get pods -l app=influxdb-local -o custom-columns=:metadata.name -n influx --no-headers
</code></pre>
<h1>Custom Columns</h1>
<p>Using the flag <code>-o custom-columns=<header-name>:<field></code> will let you customize the ou... | Jonas |
<p>I need my Go app to <strong>monitor some resources</strong> in a Kubernetes cluster and react to their changes. Based on numerous articles and examples, I seem to have found a few ways to do it; however, I'm relatively new to Kubernetes, and they're described in terms much too complex to me, such that I'm still <str... | akavel | <p>These methods differ in the <strong>level of abstraction</strong>. If a higher level abstraction fits your need, you should use it, as many lower level problems is solved for you.</p>
<p><strong>Informers</strong> is a higher level of abstraction than <em>watch</em> that also include <em>listers</em>. In most use c... | Jonas |
<p>I have a Kubernetes EKS cluster on AWS, an my goal is to be able to watch particular config maps in my Spring Boot application.
On my local environment everything works correctly, but when I use this setup inside AWS I get forbidden state and my application fails to run.
I've created a Service Account but don't unde... | xeLL | <p>This depends on several things.</p>
<p>An AWS IAM Role can be provided to Pods in different ways, but the recommended way now is to use <a href="https://aws.amazon.com/blogs/opensource/introducing-fine-grained-iam-roles-service-accounts/" rel="noreferrer">IAM Roles for Service Accounts, IRSA</a>.</p>
<p>Depending on... | Jonas |
<p>Im new to Kubernetes and i try to run Laravel application from persistent volume. I got it working and i will have now the code running from persistent volume and i can scale it.</p>
<p>I have nginx running in own pods and share the same persistent volume.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata... | Janiko | <p><em>I understand from where these practices come. But you should do differently on Kubernetes.</em></p>
<h2>Code in Docker images</h2>
<p>When you updated your PHP code, don't put it on a PersistentVolume, instead, build a new Docker image, with e.g. <code>docker build -t <myapp>:<new version> .</code> a... | Jonas |
<p>I want to get a list of just the pod names and the Result should not include the status, number of instances etc. </p>
<p>I am using the command </p>
<p><code>oc get pods</code></p>
<p>It prints</p>
<pre><code>Pod1-qawer Running 1/1 2d
Pod2g-bvch Running 1/1 ... | lr-pal | <p>You can omit the headers with <code>--no-headers</code> and you can use <code>-o custom-columns=</code> to customize the output.</p>
<pre><code>oc get pods -o custom-columns=POD:.metadata.name --no-headers
</code></pre>
<p>Example output</p>
<pre><code>$ oc get pods -o custom-columns=POD:.metadata.name --no-heade... | Jonas |
<p>I'm looking to see if it's currently possible to run Kubernetes locally on a 2020 M1 MacBook air.</p>
<p>The environment I need is relatively simple, just for going through some tutorials. As an example, this <a href="https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/" rel="noreferrer">operato... | James Cockbain | <p>First, it is usually good to have Docker when working with containers. Docker now has a <a href="https://www.docker.com/blog/download-and-try-the-tech-preview-of-docker-desktop-for-m1/" rel="noreferrer">Tech Preview of Docker for Apple M1 based macs</a>.</p>
<p>When you have a workin Docker on your machine, it shoul... | Jonas |
<p>I'm migrating <code>helm2</code> releases to <code>helm3</code>. One of my resources is <code>redis</code> and it's protected from migration. I have to remove it using</p>
<pre class="lang-sh prettyprint-override"><code>kubectl delete statefulsets.apps --cascade=false -nkube-system testme-redis-master
</code></pre>
... | OLS | <blockquote>
<p>I wanna use the Kubernetes python lib, only that I cannot find the matching function.</p>
</blockquote>
<p>You must look in the right API Group.</p>
<blockquote>
<p>I'm using CoreV1API.</p>
</blockquote>
<p><code>StatefulSets</code> is in <code>AppsV1</code> and not in <code>CoreV1</code>, so check that... | Jonas |
<p>I have been studying how kubernetes pod communication works across nodes and here is my intake so far:</p>
<p>Basically, the following figure describes. how each pod has network interface eth0 that is linked to the veth and than bridged to the hosts eth0 interface.</p>
<p>One way to make cross node communication bet... | Ezwig | <blockquote>
<p>How do those daemon sets replace the routing tables modifications and make sure pods can communicate across nodes?</p>
</blockquote>
<p>Networking can be customized with a <em>kubenet-plugin</em> or a <em>CNI-plugin</em> as described in <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/c... | Jonas |
<p>I’m proposing a project to my school supervisor, which is to improve our current server to be more fault tolerant, easily scaling and able to handle high traffic.
I have a plan to build a distributed system starting from deploying our server to different PCs and implement caching and load balancing, etc.
But I want ... | NYL | <blockquote>
<p>I’m proposing a project to my school supervisor, which is to improve our current server to be more fault tolerant, easily scaling and able to handle high traffic.</p>
</blockquote>
<p>This is a great idea. What you really want to do here is to use as many existing tools as you can, to let you <strong>fo... | Jonas |
<h2>Objective</h2>
<p>I am have deployed <a href="https://airflow.apache.org/" rel="nofollow noreferrer">Apache Airflow</a> on AWS' <a href="https://aws.amazon.com/ek" rel="nofollow noreferrer">Elastic Kubernetes Service</a> using Airflow's Stable Helm chart. My goal is to create an Ingress to allow others to access th... | alt-f4 | <p>It sound like you have created <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="noreferrer">Ingress</a> resources. That is a good step. But for those Ingress resources to have any effect, you also need an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controll... | Jonas |
<p>I want to create PV using the <code>kubectl</code> command line, Is it possible in Kubernetes or not. If it is possible then how?</p>
| user15003460 | <p>For infrastructure, it has become a good practice to use <em>declarative</em> files to provision new infrastructure. Therefore an imperative variant only using <code>kubectl</code> commands for creating <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="noreferrer">Persistent Volumes</a> ... | Jonas |
<p>What is the difference between using <a href="https://kustomize.io/" rel="nofollow noreferrer">Kustomize</a> and <a href="https://cloud.google.com/tekton/" rel="nofollow noreferrer">Tekton</a> for deployment?</p>
<p>To me it looks like Kustomize is a lightweight CI/CD client developer tool where you manually go in ... | Chris G. | <p>Kustomize is a tool for overriding (instead of templating) your Kubernetes manifest files. It it now built-in in kubectl with <code>kubectl apply -k</code>.</p>
<p>Tekton is a project for creating Kubernetes Custom Resources for building CICD pipelines of tasks on Kubernetes. One of the tasks in a pipeline can be a... | Jonas |
<p>Let's say we're using EKS on AWS, would we need to manually manage the underlying Node's OS, installing patches and updates? </p>
<p>I would imagine that the pods and containers running inside the Node could be updated by simply version bumping the containers OS in your Dockerfile, but I'm unsure about how that wou... | alejandro | <p>Yes, you need to keep the nodes updated. But this has recently became easier with the new <a href="https://aws.amazon.com/bottlerocket/" rel="noreferrer">Bottlerocket</a> - container optimized OS for nodes in EKS.</p>
<blockquote>
<p>Updates to Bottlerocket can be automated using container orchestration services ... | Jonas |
<p>Following the GoQuorum Official documentation, I was able to setup quorum nodes using Kubernetes and also bare metal raft setup with the help of the following links respectively <a href="https://docs.goquorum.consensys.net/en/stable/HowTo/GetStarted/Getting-Started-Qubernetes/" rel="nofollow noreferrer">Qubernetes S... | Aryama I | <p>If you want to deploy a Raft-based application on Kubernetes, you want your instances to talk to the other instances.</p>
<p>In this case, you want "Stable, unique network identifiers." so that your instances effectively can address requests to the other instances using a known instance-address.</p>
<p>Dep... | Jonas |
<p>I would like to deploy a RESTService in kubernetes behind a gateway and a service discovery. There is a moment where I will have my RestService version 1 and my RestService version 2. </p>
<p>Both will have the exact same URLs, but I might deploy them in pods where I label the version. When I make a call to the RES... | Elena | <p>Yes, you can have <strong>two</strong> <code>Deployment</code>, with different labels, e.g.</p>
<pre><code>kind: Deployment
metadata:
name: rest-service-v1
labels:
app: rest-service
spec:
selector:
matchLabels:
app: rest-service
version: v1
template:
metadata:
labels:
a... | Jonas |
<br>
Maybe this question is very wrong but my research so far hasn't been very helpful.
<br> My plan is to deploy a server app to multiple pods , as replicas (same code running in multiple pods) and I want each pod to be able to communicate with the rest pods. <br>
More specifically I need to broadcast a message to al... | Flora Biletsiou | <p>Applications is typically deployed as <code>Deployment</code> to Kubernets, however in use-cases where you want <strong>stable network identity</strong> for your Pods, it is easier to deploy your app as <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">Statefu... | Jonas |
<p>We are migrating our infrastructure to kubernetes. I am talking about a part of it, that contains of an api for let's say customers (we have this case for many other resources). Let's consider we have a billion customers, each with some data etc. and we decided they deserve a specialized api just for them, with its ... | zozo | <blockquote>
<p>Why would I used multiple pods each of them containing the same nginx + fpm and code, and limit it to a part of traffic and resources, and add an internal lb, autoscale, etc., instead of having a single pod, with all node resources?</p>
</blockquote>
<blockquote>
<p>Since each pod adds a bit of extra me... | Jonas |
<p>So, I am very new to using EKS with NLB ingress and managing my own worker nodes using nodegroup (ASG).
If I create a NLB ingress for the cluster and deploy multiple services inside the node group, how does NLB know that it has to load balance across service separately?
Generally, when I have not used EKS and create... | Hary | <blockquote>
<p>when I have not used EKS and created by own k8s cluster, I have spun one NLB per service</p>
</blockquote>
<p>AWS EKS is no different on this point. For a Network Load Balancer, NLB, e.g. on TCP/UDP level, you use a Kubernetes <code>Service</code> of <code>type: LoadBalancer</code>. But there are option... | Jonas |
<p>I have a pod that uses 2 persistent volumes. The persistent volumes are in different zones. While deploying I get the following error:</p>
<pre><code>node(s) had volume node affinity conflict
</code></pre>
<p>Any solution to the above problem?</p>
| lokesh mani deep | <blockquote>
<p>I have a pod that uses 2 persistent volumes. The persistent volumes are in different zones.</p>
</blockquote>
<p>The volumes that your Pod mount must be in the same Availability Zone, so that they can be mounted on the Node where the Pod is scheduled.</p>
<p>You <em>can</em> also use a <a href="https://... | Jonas |
<h1>Motive</h1>
<p>I want to fully automate the deployment of many <strong>services</strong> with the help of <a href="https://cloud.google.com/cloud-build/" rel="noreferrer">Google Cloud Build</a> and <a href="https://cloud.google.com/kubernetes-engine/" rel="noreferrer">Google Kubernetes Engine</a>. Those services a... | Florian Ludewig | <p>To build from a <strong>monorepo</strong> you really want to build incrementally (what is changed and parts that depends on changed parts). To achieve this, your build tool need to handle a dependency graph in some way.</p>
<p>Lerna that you describe is designed for monorepos. But so is also <a href="https://bazel.... | Jonas |
<p>I am using a GCE cluster with 2 nodes, which I set up using kubeadm. Now I want to set up a persistent volume for postgresql to be deployed. I created a PVC and PV with a storageClass and also created a disk space with 10G in name <strong>postgres</strong> in the same project.Iam attaching the scripts for the PVC,PV... | Shilpa | <p>Your <code>PersistentVolumeClaim</code> does not specify a <code>storageClassName</code>, so I suppose you may want to use the default <em>StorageClass</em>. When using a default StorageClass, you don't need to create a <code>PersistentVolume</code> resource, that will be provided dynamically from the Google Cloud P... | Jonas |
<p>Each <code>t2.micro</code> node should be able to run 4 pods according to this <a href="https://dev.to/wingkwong/how-to-fix-insufficient-pods-issue-when-deploying-to-amazon-eks-d35" rel="noreferrer">article</a> and the command <code>kubectl get nodes -o yaml | grep pods</code> output.</p>
<p>But I have two nodes and... | user630702 | <p>According to the AWS documentation <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI" rel="noreferrer">IP addresses per network interface per instance type</a> the <code>t2.micro</code> only has <code>2</code> Network Interfaces and <code>2</code> IPv4 addresses <strong>pe... | Jonas |
<p>We are currently using 2 Nodes, but we may need more in the future.</p>
<p>The StatefulSets is a <a href="https://hub.kubeapps.com/charts/bitnami/mariadb-galera" rel="nofollow noreferrer">mariadb-galera</a> is current replica is at 2.</p>
<p>When we'll had a new Nodes we want the replica to be a 3, f we don't need i... | destroyed | <blockquote>
<p>When we'll had a new Nodes we want the replica to be a 3, f we don't need it anymore and we delete it or a other Node we want it to be a 2.</p>
</blockquote>
<p>I would recommend to do it the other way around. Manage the replicas of your <em>container workload</em> and let the number of nodes be adjuste... | Jonas |
<p>I have a local Docker setup consisting of four containers: a flask web app, MySQL, Redis, and an RQ worker.</p>
<p>The setup is essentially the same as Miguel Grinberg's Flask Mega-Tutorial. Here are links for his <a href="https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xxii-background-jobs" rel="... | Scott Guthart | <p>Since you tag the question with Kubernetes and Google Cloud Platform, I expect that is the direction that you want.</p>
<p>When deploying to a cloud platform, consider to use a cloud ready storage / database solution. A single-node MySQL is not a cloud ready storage out of the box. Consider using e.g. <a href="http... | Jonas |
<p>I am learning Kubernetes at the moment. I have built a simple python application that uses Flask to expose rest APIs. Flask by default uses port 5000 to run the server. My API look like -</p>
<pre><code>http://0.0.0.0:5000/api
</code></pre>
<p>Application is built into a docker image</p>
<pre><code>FROM python:3.8.6... | Jaspreet | <blockquote>
<p>I am boggled how does the POD know that the application in the container is running on port 5000?</p>
</blockquote>
<p>The pod does not know that. The app in the container, in the pod can respond to any request on any port.</p>
<p>But to expose this to outside the cluster, you likely will forward traffi... | Jonas |
<p>I have an AWS EKS Kubernetes cluster. I have a set of EC2 nodes and also have configured a Fargate profile to launch pods in Fargate compute. Say I am running an App in namespace <code>alex-ns</code>. Can I somehow deploy 1 set of pods in Fargate and 1 set of different pods in my other EC2 nodegroup if they all resi... | alex | <blockquote>
<p>Can I somehow deploy 1 set of pods in Fargate and 1 set of different pods in my other EC2 nodegroup if they all reside in alex-ns?</p>
</blockquote>
<p>Yes, you can also add <strong>labels</strong> to the <a href="https://www.eksworkshop.com/beginner/180_fargate/creating-profile/" rel="nofollow noreferr... | Jonas |
<p>I am trying to understand Kubernetes and how it works under the hood. As I understand it each pod gets its own IP address. What I am not sure about is what kind of IP address that is. </p>
<p>Is it something that the network admins at my company need to pass out? Or is an internal kind of IP address that is not... | Vaccano | <h2>Kubernetes clusters</h2>
<blockquote>
<p>Is the IP address of a Pod a full IP address on my network (just like a Virtual Machine would have)?</p>
</blockquote>
<p>The thing with Kubernetes is that it is not a <em>service</em> like e.g. a Virtual Machine, but a <strong>cluster</strong> that has it's own networking f... | Jonas |
<p>I am building a CI/CD pipeline using <strong>Tekton</strong> on a bare metal Kubernetes Cluster. I have managed to cache the necessary images (Node & Nginx) and the layers, but how can I cache the .cache / public folders created by <strong>Gatsby build</strong>? These folders are not present in the repo. If the ... | Espen Finnesand | <blockquote>
<p>how can I cache the .cache / public folders created by Gatsby build? These folders are not present in the repo.</p>
</blockquote>
<p>If Persistent Volumes is available on your cluster and these volumes is available from all nodes, you can use a PVC-backed workspace for cache.</p>
<p>A more generic solut... | Jonas |
<p>How can I mount a hostPath into each pod in a statefulset when I don't know the names of the nodes in advance (so can't pre-create a PV on each node)?</p>
<p>I want to set up an elasticsearch cluster on a number of nodes, mounting each elasticsearch data directory onto the SSD of the host node...</p>
<p>How can I ac... | GDev | <p>Instead of a <em>HostPath Volume</em>, you should use a <a href="https://kubernetes.io/blog/2019/04/04/kubernetes-1.14-local-persistent-volumes-ga/" rel="nofollow noreferrer">Local Persistent Volume</a> for this kind of use cases.</p>
<blockquote>
<p>The biggest difference is that the Kubernetes scheduler understand... | Jonas |
<p>Im looking for an inter-service communication solution.</p>
<p>I have 1 service and multiple pods with an incoming gRPC stream. The initial request calls out to an external resource which eventually triggers a request back to this service with a status message. This is on a separate thread and for this example ends... | Christo | <p>Pub-Sub communication between two microservices is a good communication pattern. The book <a href="https://www.manning.com/books/cloud-native-patterns" rel="nofollow noreferrer">Cloud Native Patterns</a> describes exactly this, and the advantage using this pattern over request-response in some cases. See chapter 12.... | Jonas |
<p>Anyone has aware of this issue, I have a cluster of 3 nodes and Am running pods in statefulset. totally 3 pods are running in the order, assume pod-0 running on node-1, pod-2 running on node-2, and pod-3 running on node-3. now, the traffic is going properly and getting the response immediately, when we stop one no... | Raja | <blockquote>
<p>when we stop one node(eg: node-2), then the response is intermittent and the traffic is <strong>routing to stopped pod as well</strong>, is there any solution/workaround for this issue.</p>
</blockquote>
<p>This seem to be a <a href="https://github.com/kubernetes/kubernetes/issues/55713" rel="nofollo... | Jonas |
<p>I have a kubernetes ingress configured on google cloud with a managed certificate. Then I have the theia/theia-full docker image as a pod and a kubernetes service connecting the ingress and the pod.</p>
<p>The initial load of the theia page in my browser works and all plugins are started in the backend. After that e... | markop | <p>The default timeout for <a href="https://cloud.google.com/load-balancing/docs/backend-service#timeout-setting" rel="nofollow noreferrer">Google Load Balancers</a> is 30 seconds.</p>
<blockquote>
<p>For external HTTP(S) load balancers and internal HTTP(S) load balancers, if the HTTP connection is upgraded to a WebSoc... | Jonas |
<p>Trying to decide where to store some critical sharding configs, and I have not yet found sufficient documentation around the reliability of Kube ConfigMaps to ease my mind.</p>
<p>Say I have a single-cluster kube pod spec that injects an environment variable with the value of a configmap entry at pod start (using <... | David Grant | <p>Kubernetes is an eventual consistency system. It is <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/configGeneration.md" rel="nofollow noreferrer">recommended</a> to <em>create a new ConfigMap</em> when you want to change the value.</p>
<blockquote>
<p>Changing the data held by a live conf... | Jonas |
<p>I am using Azure Kubernetes and I have created Persistent Volume, Claims and Storage Class.</p>
<p>I want to deploy pods on the Persistent Volume so we can increase the Volume anytime as per the requirement. Right now our Pods are deployed in the Virtual Machines OS Disk. Since we are using the default Pods deployme... | Mrugesh Shah | <p>You don't have to create a Persistent Volume manually, if you want Azure Disk, this can be created dynamically for you.</p>
<p>From <a href="https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/aks/azure-disks-dynamic-pv.md#built-in-storage-classes" rel="nofollow noreferrer">Azure Built-in storage classe... | Jonas |
<p>I have a pod running in a production cluster. The pod is for debugging purpose and I would like to sniff the host network traffic. For security reason, I cannot deploy the pod in the host network.</p>
<p>Is it possible to sniff the host network traffic from a non hostnetwork pod in kubernetes?</p>
| Kintarō | <p>A Pod only received traffic that is addressed to the Pod.</p>
<p>A <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni" rel="nofollow noreferrer">CNI plugin</a> is the component that you would be interested in, since that a way to plugin and intercept the traffic.<... | Jonas |
<p>We are trying to choose schema for allocation microservices in multi tenant application. We want to use kubernates and see two cases:</p>
<p>First case: </p>
<p>+ Looks like a more productive scheme <br>
+ Easy to administer <br>
- Difficult to implement<br></p>
<p><a href="https://i.stack.imgur.com/hiYCQ.png" re... | Vladimir | <p>Use the <em>second case</em> with a separate namespace per tenant.</p>
<p><strong>Different configurations</strong></p>
<p>You have designed a solution with a separate database for each tenant. You can run the same <em>container image</em> for the tenants but the should use <strong>different configurations</strong... | Jonas |
<p>I have one application which servers for REST request and also is listening on a Kafka topic.
I deployed the application to Kubernetes and configure the readiness probe like this</p>
<pre><code>readinessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds: 5
periodSeconds: 5
</code></pr... | Shenghua Liu | <p>This is two very different things:</p>
<ul>
<li><strong>Receiving requests</strong>: An <em>external service</em> is sending a request and expect a response.</li>
<li><strong>Sending requests</strong>: Your service is sending a request and waiting for a response.</li>
</ul>
<h2>ReadinessProbe</h2>
<p>When a Readi... | Jonas |
<p>Can a confuration for a progam running in container/pod be placed in a Deployment yaml instead of ConfigMap yaml - like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
spec:
containers:
- env:
-name: "MyConfigK... | Evgeny Benediktov | <h2>Single environment</h2>
<p>Putting values in environment variables in the <code>Deployment</code> works.</p>
<p><strong>Problem:</strong> You should not work on the environment that is the production environment, so you will need at least another environment.</p>
<p>Using docker, containers and Kubernetes makes it ... | Jonas |
<p>I have deployed a mosquitto image in a pod in kubernetes with this dockerfile:</p>
<pre><code>FROM eclipse-mosquitto:1.6.7
</code></pre>
<p>I downloaded the image an added it to my cluster, using this yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: mosquitto-demo
namespace: default
spec... | Manu Ruiz Ruiz | <p>Do you get an IP-address on the Service?</p>
<h2>Using ClusterIP</h2>
<p>To have an cluster interal IP, you should set <code>type=ClusterIP</code> on your service:</p>
<pre><code>spec:
type: ClusterIP
</code></pre>
<p>Your clients route it requests to a DNS name for the service, depending on how your namespace... | Jonas |
<p>I have too many LoadBalancer services consuming too many external IPs and I'd like to switch to using an Ingress controller.</p>
<p>I did the <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">tutorial</a> and everything worked fine with the google provided p... | Alex Ryan | <p>Add a <strong>readinessProbe</strong> to your <code>Deployment</code> object.</p>
<pre><code> readinessProbe:
httpGet:
path: /healthz
port: 4444
initialDelaySeconds: 120
</code></pre>
<p>An IngressController may wait with routing traffic to the service until the pods in the service b... | Jonas |
<p>I'm using <code>react-router-dom</code> to capture parameters from a url on my website, however everytime I try reaching my ending point at <code>www.mywebsite.com/video/id</code> I get a 404 response from my nginx ingress. I've configured it to point the incoming request to my frontend deployment appropriately but ... | Adrian Coutsoftides | <p>Since you don't want to use <em>exact match</em> on <code>path:</code>, you probably want to enable <a href="https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/" rel="nofollow noreferrer">regex path matching</a> by adding an annotation:</p>
<pre><code> annotations:
nginx.ingress.kuberne... | Jonas |
<p>I can only find documentation online for attaching pods to nodes based on labels.
Is there a way to attach pods to nodes based on labels and count - So only x pods with label y?</p>
<p>Our scenario is that we only want to run 3 of our API pods per node.
If a 4th API pod is created, it should be scheduled onto a dif... | TomH | <p>No, you can not schedule by <em>count</em> of a specific <em>label</em>. But you can avoid co-locate your pods on the same node.</p>
<h2>Avoid co-locate your pods on same node</h2>
<p>You can use <code>podAntiAffinity</code> and <code>topologyKey</code> and <code>taints</code> to avoid scheduling pods on the same ... | Jonas |
<p>I have two projects:</p>
<blockquote>
<p>Project A - Contains the Source code for my Microservice application</p>
<p>Project B - Contains the Kubernetes resources for Project A using Helm</p>
</blockquote>
<p>Both the Projects reside in their own separate git repositories.</p>
<p>Project A builds using a full blown ... | joesan | <blockquote>
<p>via a git push from the CI server. It does so by committing a simple txt file with the Docker version that it just built.</p>
</blockquote>
<p>What I usually do here, is that I write the value to the correct field in the yaml directly. To work with yaml on the command line, I recommend the cli tool <a h... | Jonas |
<p>This is a follow-up from my last question - <a href="https://stackoverflow.com/q/64881584/5291015">How to programmatically modify a running k8s pod status conditions?</a> after which I realized, you can only patch the container spec from the deployment manifest to seamlessly let the controller apply the patch change... | Inian | <blockquote>
<p>how to apply patch to make the Pod phase to go to Succeeded or Failed</p>
</blockquote>
<p>Pods are intended to be <strong>immutable</strong> - don't try to change them - instead, replace them with new Pods. You can create <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/" r... | Jonas |
<p>We are using Azure AKS v1.17.9 with auto-scaling both for pods (using HorizontalPodAutoscaler) and for nodes. Overall it works well, but we have seen outages in some cases. We have some deployments where minReplicas=1 and maxReplicas=4. Most of the time there will only be one pod running for such a deployment. In so... | ewramner | <blockquote>
<p>In some cases where the auto-scaler has decided to scale down a node, the last remaining pod has been killed. Later a new pod is started on another node, but this means an outage.</p>
</blockquote>
<p>For this reason, you should always have at least 2 replicas for <code>Deployment</code> in a production... | Jonas |
<p>I seem to find it hard to quickly lookup something in k8s docs or api reference. Terraform docs are very clear to understand.</p>
<p>How do one find what's the child element for parent? For example, for PV Claim <code>resources</code> needs a child <code>requests</code> but its not described anywhere except in exam... | user630702 | <blockquote>
<p>I seem to find it hard to quickly lookup something in k8s docs or api reference. Terraform docs are very clear to understand.</p>
</blockquote>
<p>The fastest and easiest way to quickly get documentation about Kubernetes resources is to use <code>kubectl explain <resource></code> e.g:</p>
<pre><co... | Jonas |
<p>This question has been asked in the past, but I did not manage to find clear answer. Is that good practice to set up rabbit as a pod in Kubernetes cluster? We got ~7 pods in our cluster, and some queuing mechanism starts to be necessary. First idea was to create pod for rabbit with persistent volume and service, and... | Mateusz Pydych | <p>Pods represents any container group/binary on Kubernetes. What is owning/managing those pods is important, is it a ReplicaSet, DaemonSet or a StatefulSet? ReplicaSets are supposed to be <strong>stateless</strong> and a RabbitMQ borker is <strong>stateful</strong>.</p>
<p>You can deploy stateful workload on Kubernet... | Jonas |
<p>I would like to build a web application that processes video from users' webcams. It looks like WebRTC is ideal for this project. But, I'm having a hard time creating a peer connection between the user's machine and a pod in my Kubernetes cluster. How would you connect these two peers?</p>
<p>This question on Server... | Andrew | <p>The document you link to is helpful, <a href="https://cloud.google.com/solutions/orchestrating-gpu-accelerated-streaming-apps-using-webrtc" rel="noreferrer">Orchestrating GPU-accelerated streaming apps using WebRTC</a></p>
<p>What they do to allow for <code>RTCPeerConnection</code> is:</p>
<p>Use two separate Node p... | Jonas |
<p><strong>EDIT</strong>: As mentioned in <a href="https://stackoverflow.com/users/213269/jonas">Jonas'</a> response Kubernetes REST API can be actually considered as declarative and not imperative.</p>
<p>Kubernetes is well known for its declarative model.
Controller are watching objects in ETCD which contains the des... | scoulomb | <p>The Kubernetes API can be used both <em>declaratively</em> and also <em>imperatively</em>. For quick development an imperative workflow might work better whereas for traceability and production workload a declarative workflow is recommended.</p>
<h2>Declarative HTTP example using curl</h2>
<p>This requires to run <c... | Jonas |
<p>Is there a way to restart pods automatically after some time or when they reach some memory limit?</p>
<p>I want achieve the same behavior as gunicorn(or any mainstream process manager does)</p>
| kharandziuk | <h1>Memory limit</h1>
<p>If you set a limit for the memory on a container in the podTemplate, this pod will be restarted if it uses more than specified memory.</p>
<pre><code>resources:
limits:
memory: 128Mi
</code></pre>
<p>See <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-c... | Jonas |
<p>queries which will allow us to track kubeevents and get notified if there are any issues with the pods being scheduled or killed..</p>
| Vijay | <p>You may be interested in <a href="https://github.com/heptiolabs/eventrouter" rel="nofollow noreferrer">eventrouter</a>.</p>
<p>It is a service for handling your Kubernetes Events, e.g. log them or send them to any <em>sink</em> e.g. Kafka.</p>
| Jonas |
<p>I am trying to set <code>PersistentVolumeClaims</code> to my pods. Now the problem is when the <code>deployment</code> is success, the pods are in <code>pending</code> state. When I try to describe the pods, I get the error why they are not spinning up as below:</p>
<blockquote>
<p>Warning FailedScheduling 20s (x3... | Jananath Banuka | <p>As described in <a href="https://stackoverflow.com/a/52669115/213269">answer to pod has unbound PersistentVolumeClaims</a>, if you use a <code>PersistentVolumeClaim</code> you typically need a <em>volume provisioner</em> for Dynamic Volume Provisioning. The bigger cloud providers typically has this, and also Minikub... | Jonas |
<p>I have the following situation:</p>
<p>I have a couple of microservices, only 2 are relevant right now.
- Web Socket Service API
- Dispatcher Service</p>
<p>We have 3 users that we'll call respectively 1, 2, and 3. These users connect themselves to the web socket endpoint of our backend. Our microservices are runn... | Emixam23 | <h2>Dispatcher ≈ Message broker</h2>
<p>As how I understand your design, your <em>Dispatcher</em> is essentially a message broker for the pods of your <em>Websocket Service</em>. Let all Websocket pods connect to the broker and let the broker route messages. This is a <em>stateful</em> service and you should use a <a ... | Jonas |
<p>How get client IP from nginx ingress load blanacer? I've tried setting <code>use proxy protocol</code> and <code>externalTrafficPolicy</code> but still it doesn't show client IP.</p>
<p>Apache logs <code>10.0.0.225</code> for each http request. I'm not sure what IP that is, it doesn't seem to be pod's
IP or node IP.... | user630702 | <p>You should get the origin IP in the <code>X-Forwarded-For</code> header, this is a default config for nginx-ingress: <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#forwarded-for-header" rel="nofollow noreferrer">forwarded-for-header</a></p>
<p>This is configured in a <a... | Jonas |
<p>I have two different types of worker nodes, ones that do data preparation and nodes that do machine learning.<br />
I want to run a Cronjob that runs one process on a preparation node, then (only when finished) a second process on an ML node.<br />
How can I do this in Kubernetes?</p>
| GDev | <blockquote>
<p>I want to run a Cronjob that runs one process on a preparation node, then (only when finished) a second process on an ML node.</p>
</blockquote>
<p>A CronJob is only one Pod.</p>
<p>What you want to do here is a <em>Workflow</em> or <em>Pipeline</em> consisting of two pods, executed on different nodes.<... | Jonas |
<p>I confused between Multi-Container Pod Design patterns.<br>
(sidecar, adapter, ambassador) </p>
<p>What I understand is :<br>
<strong>Sidecar</strong> : container + container(share same resource and do other functions)<br>
<strong>Adapter</strong> : container + adapter(for checking other container's status. <em>e.... | GRu. L | <p>First, you are right, the term <strong>sidecar</strong> container has now became a word for describing <em>an extra container</em> in your pod. <a href="https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/" rel="noreferrer">Originally(?)</a> it was a specific multi-container design pattern.</p... | Jonas |
<p>I'm getting a</p>
<pre><code>Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
GET https://sqladmin.googleapis.com/v1/projects/adstudio-sandbox1/instances/us-central1~adspromosdb-sandbox/connectSettings
{
"code": 403,
"errors": [
{
"dom... | Andrew Cheong | <p>A Google Cloud Service Account and a Kubernetes Service Account are two different things.</p>
<p>For connecting to a Cloud SQL database from a Kubernetes cluster, it is recommended and easiest to use an <a href="https://cloud.google.com/sql/docs/mysql/connect-auth-proxy" rel="nofollow noreferrer">Cloud SQL Auth Prox... | Jonas |
<p>I've been working on a <a href="https://github.com/dgp1130/chatter" rel="nofollow noreferrer">small side project</a> to try and learn Kubernetes. I have a relatively simple cluster with two services, an ingress, and working on adding a Redis database now. I'm hosting this cluster in <a href="https://cloud.google.com... | Douglas Parker | <p>Yes, you have found some parts of Kubernetes configuration that was not perfect from the beginning. But there are newer solutions.</p>
<h2>Storage abstraction</h2>
<p>The idea in <em>newer</em> Kubernetes releases is that your <strong>application configuration</strong> is a <em>Deployment</em> with Volumes that re... | Jonas |
<p>I need to know a way to scale down all the deployments on a kubernetes namespace except for one with a specific string inside the name since it has dependencies. This on an AzureCLI task inside of an azure pipeline. Any ideas?</p>
<p>Something like:
If name contains "randomname" then do not scale up/down t... | Gilberto Graham | <p>You can add a <em>label</em> on the one you want to exclude, and then use queries using <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api" rel="nofollow noreferrer">labels and selectors</a> to apply operations on the selected set of resources.</p>
| Jonas |
<p>I need to deploy a GPU intensive task on GCP. I want to use a Node.js Docker image and within that container to run a Node.js server that listens to HTTP requests and runs a Python image processing script on-demand (every time that a new HTTP request is received containing the images to be processed). My understandi... | Asdasdprog | <blockquote>
<p>runs a Python image processing script on-demand (every time that a new HTTP request is received containing the images to be processed)</p>
</blockquote>
<p>This <em>can</em> be solved on Kubernetes, but it is not a very common kind of workload.</p>
<p>The project that support your problem best is <a hre... | Jonas |
<p>We are building a rate limiter and calculate config values based on number of pods available at that moment. Is there any way to get the number of pods that are active in any instance from a java application? Also, is it possible to get the number of tasks in the case of AWS Fargate from a Java application?</p>
| Venkat | <p>You need to request this info from the Kubernetes API Server. You can do it with Java with <a href="https://github.com/kubernetes-client/java" rel="nofollow noreferrer">kubernetes-client/java</a>. See <a href="https://github.com/kubernetes-client/java/blob/master/examples/src/main/java/io/kubernetes/client/examples/... | Jonas |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.