Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I have a StatefulSet with 2 pods. It has a headless service and each pod has a LoadBalancer service that makes it available to the world. </p> <p>Let's say pod names are pod-0 and pod-1. </p> <p>If I want to delete pod-0 but keep pod-1 active, I am not able to do that. </p> <p>I tried</p> <pre><code>kubectl dele...
crossvalidator
<p>This is not supported by the StatefulSet controller. Probably the best you could do is try to create that pod yourself with a sleep shim and maybe you could be faster. But then the sts controller will just be unhappy forever.</p>
coderanger
<p>I am make a nfs file share and using it in kubernetes pods, but when I start pods, it give me tips :</p> <pre><code>2020-05-31 03:00:06+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.30-1debian10 started. chown: changing ownership of '/var/lib/mysql/': Operation not permitted </code></pre> <p>I ...
Dolphin
<p>You wouldn't set this via chown, you would use <code>fsGroup</code> security setting instead.</p>
coderanger
<p>This question is regarding the Kubernetes behavior when request need more memory than allocated to Pod containing php app . If GC is not able to free memory and request need more memory due to which pods becomes unresponsive or request gets timed out , will kube restart the pod in itself ?</p> <p>In case swap memor...
user3198603
<p>Swap is not supported with Kubernetes and it will refuse to start if active. Request values for pod resources cannot be overcommitted so if a pod requests 1GB and no node has 1GB available (compared to total RAM minus the requests on all pods scheduled to that node) then the pod will remain unscheduled until somethi...
coderanger
<p>I want to create external authentication for Service A, which listens to traffic on port <code>8080</code>. What I desire is to have a second container (<em>Service B</em>) running in the same pod as <em>Service A</em>, that intercepts, evaluates and (maybe) forwards the traffic going in on port <code>8080</code> "M...
Nils Martel
<p>Look up Traefiks forward auth mode or nginx’s mod auth request. They both do what you are looking for. Or more generally this kind of thing is called an API gateway and there are many good ones.</p>
coderanger
<p>I have a Openshift Route of type :</p> <pre><code>- apiVersion: route.openshift.io/v1 kind: Route metadata: name: &lt;Route name&gt; labels: app.kubernetes.io/name: &lt;name&gt; spec: host: &lt;hostname&gt; port: targetPort: http tls: termination: passthrough to: ...
Kumud Jain
<p>TLS passthrough is not officially part of the Ingress spec. Some specific ingress controllers support it, usually via non-standard TCP proxy modes. But what you probably want is a LoadBalancer-type service.</p>
coderanger
<p>I have set up an nginx ingres that routes traffic to specific deployments based on host. </p> <blockquote> <p><code>host A --&gt; Service A, host B --&gt; Service B</code></p> </blockquote> <p>If I update the config for Deployment A, that update completes in <em>less than 2 seconds</em>. However, my nginx ingres...
crossvalidator
<p>You can use the <code>nginx.ingress.kubernetes.io/service-upstream</code> annotation to suppress the normal Endpoints behavior and use the Service directly instead. This has better integration with some deployment models but 5-7 seconds is extreme for ingress-nginx to be seeing the Endpoints update. There can be a s...
coderanger
<p>Is there a way to enable caching between pods in Kubernetes cluster? For eg: Lets say we have more than 1 pods running on High availability mode.And we want to share some value between them using distributed caching between the pods.Is this something possible?</p>
Rad4
<p>There are some experimental projects to let you reuse the etcd that powers the cluster, but I probably wouldn’t. Just run your own using etcd-operator or something. The specifics will massively depend on what your exact use case and software is, distributed databases are among the most complex things ever.</p>
coderanger
<p>I have a home Kubernetes cluster with multiple SSDs attached to one of the nodes. I currently have one persistence volume per mounted disk. Is there an easy way to create a persistence volume that can access data from multiple disks? I thought about symlink but it doesn't seem to work.</p>
Steve
<p>You would have to combine them at a lower level. The simplest approach would be Linux LVM but there's a wide range of storage strategies. Kubernetes orchestrates mounting volumes but it's not a storage management solution itself, just the last-mile bits.</p>
coderanger
<p>I have an image called <code>http</code> which has a file called <code>httpd-isec.conf</code>. I'd like to edit <code>httpd-isec.conf</code> before the image is started by kubernetes. Is that possible?</p> <p>Would <code>initContainers</code> and mounting the image work in some way? </p>
Vladimir
<p>This is not possible. Images are immutable. What you can do is use an init container to copy the file to an emptyDir volume, edit it, and then mount that volume over the original file in the main container.</p>
coderanger
<p>As an example, if I define a CRD of <code>kind: Animal</code>, can I define a CRD, <code>Dog</code>, as a specific <code>type</code> of <code>Animal</code>? The <code>Dog</code> CRD would have a different/extended schema requirement than the base <code>Animal</code> CRD. </p> <p>My goal here is to be able to do a <...
ivandov
<p>No, this is not a feature of Kubernetes. All Secret objects are of the same Kind, and Type is just a string field.</p>
coderanger
<p>I have an app that requires MS office. This app is docker containerized app and should run on GCP kubernetes cluster. How can i install MS office in a linux docker container?</p>
Nipu
<p>Via <a href="https://learn.microsoft.com/en-us/dotnet/architecture/modernize-with-azure-containers/modernize-existing-apps-to-cloud-optimized/when-not-to-deploy-to-windows-containers" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/dotnet/architecture/modernize-with-azure-containers/modernize-existing-ap...
coderanger
<p>I'm building an SPA using with React and Node.js on Kubernetes. I have separate services and ingresses for the front-end and back-end services. I've seen people also use Nginx to serve the React build, but I found that doing below works well. </p> <pre><code># Dockerfile.production FROM node:8.7.0-alpine RUN mkdir ...
Diego Balvin
<p>Serve is fine. Nginx might use a few bytes less RAM for serving, but that will be cancelled out by carrying around all the extra features you aren't using. We use a similar Serve setup for a lot of our K8s SPAs and it uses between 60 and 100MB of RAM per pod at full load. For a few other apps we have a cut down vers...
coderanger
<p>The idea is instead of installing these scripts they can instead be applied via yaml perhaps and ran with access to kubectl and host tools to find potential issues with the running environment. </p> <p>I figure the pod would need special elevated permissions, etc. I'm not quite sure if there is an example or even...
lucidquiet
<p>It's an Alpha feature and not recommended for production use, but check out the ephemeral containers system: <a href="https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/</a></p> <p>It's designed ...
coderanger
<p>today while trying to run my pod , I discovered this error which we see in the describe events:</p> <pre><code># kubectl describe pod monitor-prometheus-alertmanager-c94f7b6b7-tg6vc -n monitoring Name: monitor-prometheus-alertmanager-c94f7b6b7-tg6vc Namespace: monitoring Priority: 0 Node: kube...
Ciasto piekarz
<p>Because <code>docker.io</code> does not respond to pings, from anywhere.</p>
coderanger
<p>i'm stack at k8s log storage.we have logs that can't output to stdout,but have to save to dir.we want to save to glusterfs shared dir like /data/logs/./xxx.log our apps are written in java ,how can we do that</p>
tennis wang
<p>This is mostly up to your CRI plugin, usually Docker command line options. They already do write to local disk by default, you just need to mount your volume at the right place (probably /var/log/containers or similar, look at your Docker config).</p>
coderanger
<p>I am doing <a href="https://kubernetes.io/docs/tutorials/stateless-application/guestbook/" rel="nofollow noreferrer">this exercise</a> on my vagrant built bare metal cluster on a windows machine.</p> <p>Was able to successfully run the app.</p> <p><a href="https://i.stack.imgur.com/VYVTb.png" rel="nofollow noreferre...
VivekDev
<p>Short answer: there isn't one.</p> <p>Long answer: you are using the <code>mongo</code> image, do you can pull up the readme for that on <a href="https://hub.docker.com/_/mongo" rel="nofollow noreferrer">https://hub.docker.com/_/mongo</a>. That shows that authentication is disabled by default and must be manually en...
coderanger
<p>I am still learning kubernetes and I stumbled over the objects 'Ingress' and 'IngressRoute'. What is the different between these two objects? Did IngressRoute replace the 'old' Ingress? I am running a Kubernetes Cluster V1.17 with Traefik 2.1. My IngressRoute works fine but I also found blogs explaining how to defi...
Ralph
<p>Ingress is a shared abstraction that can be implemented by many providers (Nginx, ALBs, Traefik, HAProxy, etc). It is specifically an abstraction over a fairly simple HTTP reverse proxy that can do routing based on hostnames and path prefixes. Because it has to be a shared thing, that means it's been awkward to hand...
coderanger
<p>I have created a <strong>k8s <a href="https://www.howtoforge.com/tutorial/centos-kubernetes-docker-cluster/" rel="nofollow noreferrer">cluster</a> by installing &quot;kubelet kubeadm kubectl&quot;</strong>. Now i'm trying to Deploy microservice application as</p> <ol> <li><p>docker build -t demoserver:1.0 . =&gt;<st...
Piyush Kumar
<p>Minikube and kubeadm are two unrelated tools. Minikube builds a (usually) single node cluster in a local VM for development and learning. Kubeadm is part of how you install Kubernetes in production environments (sometimes, not all installers use it but it's designed to be a reusable core engine).</p>
coderanger
<p>I know that k8s has default Hard Eviction Threshold memory.available&lt;100Mi. So k8s should evict pods if thresholds exceed. In these conditions can pod provoke SYSTEM OOM? When I talk about SYSTEM OOM I mean such situation when Linux starts to kill processes randomly (or not almost randomly, doesn't matter). Lets ...
Kirill Bugaev
<p>Yes, very yes. Eviction takes time. If the kernel has no memory, oomkiller activates immediately. Also if you set a <code>resources.limits.memory</code> then if you exceed that you get an OOM.</p>
coderanger
<p>I have a Windows Server 2019 (v1809) machine with Kubernetes (bundled with Docker Desktop for Windows). I want to enable Vertical Pod Autoscaling for the cluster I have created.</p> <p>However, all the documentation I can find is either for a <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/vertical...
Burhan
<p>While VPA itself is a daemon, the pods it controls are just API objects as far it knows and can be anything on any platform. As for compiling a VPA container for Windows, I wouldn't expect any problems, you'll just need to build it yourself since we don't provide one.</p>
coderanger
<p>When secrets are created, they are 0755 owned by root:</p> <pre><code>/ # ls -al /var/run/secrets/ total 0 drwxr-xr-x 4 root root 52 Apr 16 21:56 . drwxr-xr-x 1 root root 21 Apr 16 21:56 .. drwxr-xr-x 3 root root 28 Apr 16 21:56 eks.amazonaws.com drwxr-xr-x 3...
graywolf
<p>You can disable the default service account token mount and then mount it yourself as you showed.</p>
coderanger
<p>We tried attaching a shell to container inside "Traefik" Pod using following command but it didn't work. Just FYI, we used helm chart to install Traefik on our k8s cluster. </p> <p><code>kubectl exec -it &lt;traefik Pod name&gt; -- /bin/sh</code> </p> <p>tried this too but no success - <code>kubectl exec -it &lt...
Sunny Goel
<p>Traefik 1.7 uses a <a href="https://github.com/containous/traefik/blob/master/Dockerfile" rel="nofollow noreferrer"><code>FROM scratch</code></a> container image that has only the Traefik executable and some support files. There is no shell. You would have to switch to the <code>-alpine</code> variant of the image. ...
coderanger
<p>Is it possible to set a liveness probe to check that a separate service is existing? For an app in one pod, and a database in a separate pod, I would like for the app pod to check the liveness of the database pod rather than this pod itself. The reason for this is that once the db is restarted, the app is unable to ...
mmiara
<p>No, you would need to write that in a script or as part of your http endpoint.</p>
coderanger
<p>I have created a StorageClass and PersistentVolume but when I try to create a PersistentVolumeClaim I get the following error, "The PersistentVolumeClaim "esp-pv" is invalid: spec: Forbidden: is immutable after creation except resources.requests for bound claims". I have tried to delete the StorageClass PersistentV...
annette_dio
<p>Solved in comments, deleting a namespaced object (which is most of them) requires specifying the namespace.</p>
coderanger
<p>We have a statefulset with 2 replicas, on each pod there is Postgres instance. One acts as master while the other acts as replica.</p> <p>There are 2 services exposed, one is PG master service and the other is PG replica service. Both services are without selector, and there are 2 endpoints sharing the name of its r...
zhanshen8D
<p>Yes? This is just a thing that happens, there is no way to atomically update things because the world is not transactional. Any active-passive HA system doing this kind of failover will have a time in which the system is not converged. The important thing is that Postgres itself never have more than one primary. It ...
coderanger
<p>In docker host and the containers do have separate process name-space. In case of Kubernetes the containers are wrapped inside a pod. Does that mean in Kubernetes the host (a worker node), the pod in the node and the container in the pod all have separate process namespace?</p>
ananda
<p>Pods don't have anything of their own, they are just a collection of containers. By default, all containers run in their own PID namespace (which is separate from the host), however you can set all the containers in a pod to share the same one. This is also used with Debug Containers.</p>
coderanger
<p>I have a few CRDs and each of them supposed to make edit <code>Container.Spec</code>'s across the cluster. Like ENVs, Labels, etc...</p> <p>Is it okay, if the resource is managed by more that one controller? </p> <p>What are the possible pitfalls of this approach?</p>
ubombi
<p>Yes, the same object can be updated by multiple controllers. The Pod object is updated by almost a dozen at this point I think. The main problem you can run into is write conflicts. Generally in an operator you do a get, then some stuff happens, then you do an update (usually to the status subresource for a root obj...
coderanger
<pre><code>apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: hello-kubernetes-ingress annotations: kubernetes.io/ingress.class: nginx spec: rules: - host: hw1.your_domain http: paths: - backend: serviceName: hello-kubernetes-first servicePort: 80 - hos...
Prata
<p>The Ingress system is an abstraction over a simple HTTP fanout proxy, with routing on hostnames and URL prefixes. Nginx can be this kind of proxy, but it can also be an HTTP server. The first Ingres is a hostname-based fanout between two backend services. The second is a fallback route when no other rule matches, pr...
coderanger
<p>I am trying to parse a helm chart YAML file using python. The file contains some curly braces, that's why I am unable to parse the YAML file.</p> <p>a sample YAML file</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.nginx.name }}-config-map labels: app: {{ .Values.nginx.name }}-confi...
Manoj Kumar Maharana
<p>You would have to write an implementation of Go's <code>text/template</code> library in Python. A better option is probably to push your content through <code>helm template</code> first and then parse it.</p>
coderanger
<p>I have a error with unhealty pod even though I think the pod works as expected after reschduling. If I restart (delete) it, it becomes ready but I would like to understand why it ends up in a unhealty state.</p> <p>My probe is simple as this:</p> <pre><code>readinessProbe: httpGet: path: / port: 4000 i...
Glenn
<p>Oomkilled is the previous state. The current state is running (Ready). The problem is the readiness probe.</p>
coderanger
<p>Due to customer's requirements, I have to install k8s on two nodes(there's only two available nodes so adding another one is not an option). In this situation, setting up etcd in only one node would cause a problem if that node went down; however, setting up a etcd cluster(etcd for each node) would still not solve t...
pandawithcat
<p>No, you cannot force it to lie to itself. What you see is what you get, two nodes provide the same redundancy as one.</p>
coderanger
<p>I want to deploy some java (Spring Boot, MicroProfile, ...) apps to k8s. I want to define CPU requests and limits for those apps. The problem with limit is, that the apps need very long (30-90 seconds) time depending on the limit (around 300-500m). This is pretty/too long. The apps also don't need that much CPU. In ...
Fdot
<p>The usual solution is just to not use CPU limits. They are often best left off unless you know the service abuses the CPU and you can't fix it any other way.</p>
coderanger
<p>I'm wondering for a batch distributed job I need to run. Is there a way in K8S if I use a Job/Stateful Set or whatever, a way for the pod itself(via ENV var or whatever) to know its 1 of X pods run for this job?</p> <p>I need to chunk up some data and have each process fetch the stuff it needs.</p> <p>--</p> <p>I...
Tom Barber
<p>This is planned but not yet implemented that I know of. You probably want to look into higher order layers like Argo Workflows or Airflow instead for now.</p>
coderanger
<p>One of the options to use <code>Kubernetes</code> on Windows 10 is to enable it from <code>Docker for Windows</code>.</p> <p>However reading many tutorials from K8S site they manage something by using minikube - for example adding addons.</p> <p>Since using the option with docker we don't have minikube.</p> <p>Fo...
ashur
<p>You would have to manually grab the addon YAML file and <code>kubectl apply -f</code> it. But most things have Helm charts available too so maybe just do that instead?</p>
coderanger
<p>I have been experimenting with blue green deployment in <code>kubernetes</code> using <code>nginx-ingress</code>. I created few concurrent http request to hit v1 version of my application. In the meanwhile I switched the router to point to v2 version of my application. As expected v2 version was serving the request...
bhavanak
<p>Usually in-flight requests are allowed to complete, just no new requests will be sent by the proxy.</p>
coderanger
<p>I am trying to run a process in only ONE docker pod (and not the other n pods),</p> <p>can I know (from inside a pod/instance) </p> <ul> <li>am I the first pod?</li> <li>how many pods are running?</li> </ul> <p>thanks.</p>
BarganBanananas
<p>Don't do this. Put that thing in its own deployment (or statefulset more likely) that is unrelated to the others.</p>
coderanger
<p>What is the best way to deploy a Helm chart using C#? Helm 3 is written in go and I could not find a C# wrapper, any advise on that? Thank you.</p>
Florian Boehmak
<p>Helm is written in Go so unless you want to get incredibly fancy your best bet is running it as a subprocess like normal. A medium-fancy solution would be using one of the many Helm operators and then using a C# Kubernetes api client library to set the objects.</p>
coderanger
<p>I’m looking for a really simple, lightweight way of persisting logs from a docker container running in kubernetes. I just want the stdout (and stderr I guess) to go to persistent disk, I don’t want anything else for analysing the logs, to send them over the internet to a third party, etc. as part of this.</p> <p>Ha...
rich
<p>Fluentd supports a simple file output plugin (<a href="https://docs.fluentd.org/output/file" rel="nofollow noreferrer">https://docs.fluentd.org/output/file</a>) which you can easily aim at a PersistentVolume mount. Otherwise you would configure Fluentd (or Bit if you prefer) just like normal for Kubernetes so find y...
coderanger
<p>I have four kubernetes clusters, and I want to check the expiration time of them with kubernetes-python-client.</p> <p>I am following this page: <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">https://github.com/kubernetes-client/python</a></p> <p>Is there anyone know how to get it?</...
KeithTt
<p>The apiserver certificate is generally handled out of band, either by your Kubernetes installer tool (kubeadm, rancher, talos, etc) or off-cluster in a load balancer layer. As such the K8s API won't help you with this.</p> <p>That said, you can get the certificate of any HTTPS server in Python using <code>ssl.get_se...
coderanger
<p>I need to expose application-wide metrics for Prometheus collection from a Kubernetes application that is deployed with multiple instances, e.g. scaled by Horizontal Pod Autoscaler. The scrape point is exposed by every instance of the pod for fail-over purposes, however I do not want Prometheus to actually call the...
sergey_o
<p>This implies the metrics are coming from some kind of backend database rather than a usual in-process exporter. Move the metrics endpoint to a new service connected to the same DB and only run one copy of it.</p>
coderanger
<p>I am trying to run a Redis cluster on Kubernetes. I am not planning to persist any Redis data to the disk. Is it possible to run the Redis cluster as Kubernetes deployment and not as a stateful set?</p>
Sashi
<p>Yes, though I would probably still use StatefulSet specifically for the features to ensure only one pod starts at a time.</p>
coderanger
<h3>Context</h3> <p>I am running Airflow, and trying to run a proof of concept for a Docker container using Airflow's <a href="https://airflow.apache.org/docs/apache-airflow/1.10.4/_api/airflow/operators/docker_operator/index.html" rel="nofollow noreferrer">DockerOperator</a>. I am deploying to Kubernetes (EKS), but no...
alt-f4
<p>Copying down from comment:</p> <p>The direct issue is likely that the docker control socket file is owned by something like <code>root:docker</code> on the host, and assuming Airflow isn't running as root (which it shouldn't) then you would need to specifically set it to run with the same gid as the <code>docker</co...
coderanger
<p>My Situation at the moment: I'm setting up a mail server and just after getting it to work, the logs are flooded with <code>authentication failed</code> messages from an suspicious iran network trying to login to random accounts.</p> <p>After some googeling I found out that <code>fail2ban</code> can stop those attac...
8bit
<p>There isn't really a good way to do this. Both on the log access front, and more importantly on tweaking the iptables rules from inside a container. You could definitely use the core engine of fail2ban to build a tool around the k8s native APIs (<code>pods/logs</code>, NetworkPolicy) however I don't know any such pr...
coderanger
<p>Whether the application will be live (In transaction) during the time of POD deployment in AKS?</p> <p>While we are performing the POD deployment, whether the application transactions will go through (or) get error out?</p>
goofyui
<p>The Deployment system does a rolling update. New pods are created with the new template and once Ready they are added to the service load balancer, and then old ones are removed and terminated.</p>
coderanger
<p>Ask a question, how to control the usage of each GPU used on each machine in k8s cluster of two machines with two graphics cards on each machine. Now each card has 15g. I want to use 10g + for the other three cards, leaving 7g + free for one graphics card.</p>
problem-ten
<p>That's not how graphics cards work. the GPU RAM is physically part of the graphics card and is exclusive to that GPU.</p>
coderanger
<p>I have the following manifest:</p> <pre><code>apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: my-psp-rb roleRef: kind: Role name: psp-role apiGroup: rbac.authorization.k8s.io subjects: - kind: Group name: system:serviceaccounts:${NAMESPACE} </code></pre> <p>I would like to deploy...
Simon Ernesto Cardenas Zarate
<p>Copying down from comments and confirming, this is not a thing kubectl supports. It's very simple :)</p>
coderanger
<p>I'm trying to write a script that runs some commands inside the container using kubectl exec. I'd like to use the environment variables that exist inside the container, but struggling to figure out how to prevent my local shell from evaluating the var and still have it evaluated in the container.</p> <p>This was my...
MattTheCat
<p>You need a <code>sh -c</code> in there, like <code>exec -- sh -c 'whatever $PASSWORD'</code>.</p>
coderanger
<p>It seems that I can't get my target scraped by <code>prometheus</code> neither via the annotation method nor the <code>ServiceMonitor</code> workaround.</p> <p>Here is the <code>spec</code> scetion of my <code>Service</code> Object exposing the metrics</p> <pre><code>spec: clusterIP: 10.107.228.89 ports: - nam...
pkaramol
<p>Answered in Slack, need to make sure the labels on the ServiceMonitor object itself match the <code>serviceMonitorSelector</code> on the Prometheus object.</p>
coderanger
<p>I have 2 components that run in a Kubernetes environment. One is listing all the nodes in the cluster (using Kubernetes API) and the other is reporting details of the node it runs on to the first one.</p> <p>I want my first component to match the reported node from the second component to a node in the first compon...
yoav hizki
<p>You would use the node name, as in the name on the API object. You can pass it in to the DaemonSet process using an env var with a field ref or a downward api volume.</p>
coderanger
<p>I am trying to run a legacy application inside Kubernetes. The application consists of one of more controllers, and one or more workers. The workers and controllers can be scaled independently. The controllers take a configuration file as a command line option, and the configuration looks similar to the following:</...
Mickster
<p>Nope, that's the way to do it (use an initContainer to update the config file).</p>
coderanger
<p>In a Kubernetes operator based on operator-sdk, do you know how to write code to synchronize CR resource when CR specification is updated with <code>kubectl apply</code>? Could you please provide some code samples?</p>
Fabrice Jammes
<p>It is mostly up to how you deploy things. The default skeleton gives you a Kustomize-based deployment structure so <code>kustomize build config/default | kubectl apply -f</code>. This is also wrapped up for you behind <code>make deploy</code>. There is also <code>make install</code> for just installing the generated...
coderanger
<p>Is my understanding of the following workflow correct:</p> <ol> <li><p>When a request goes to the Load Balancer, it will also go through the Ingress Object (essentially a map of exactly how to process the incoming request).</p> </li> <li><p>This request is then forwarded to an Ingress Controller to fulfil (the reque...
thatguyjono
<p>To your main question, having multiple ingress controller replicas for redundancy in case of node failure is very common and probably a good thing to do on any production setup.</p> <p>As to how it works: there's two modes for Load Balancer services depending on the &quot;external traffic policy&quot;. In the defaul...
coderanger
<p>I've been working on a <code>Kubernetes</code> cluster with microservices written in <code>Flask</code> for some time now and I'm not sure if my current method for containerizing them is correct. </p> <p>I've been using <a href="https://github.com/tiangolo/uwsgi-nginx-flask-docker" rel="nofollow noreferrer">this</a...
theelk801
<p>"better" is entirely relative, but here is the one I use.</p> <pre><code>FROM python:3.7 AS build ENV PYTHONFAULTHANDLER=1 \ PYTHONUNBUFFERED=1 \ PYTHONHASHSEED=random \ PIP_NO_CACHE_DIR=off \ PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DEFAULT_TIMEOUT=100 RUN pip install poetry==1.0.5 WORKDIR /ap...
coderanger
<p>In plain nginx, I can use the <a href="http://nginx.org/en/docs/http/ngx_http_geo_module.html" rel="nofollow noreferrer">nginx geo module</a> to set a variable based on the remote address. I can use this variable in the ssl path to choose a different SSL certificate and key for different remote networks accessing th...
Pit Wegner
<p>You can customize the generated config both for the base and for each Ingress. I'm not familiar with the config you are describing but some mix of the various *-snippet configmap options (<a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#server-snippet" rel="nofollow noref...
coderanger
<p>Requirement is to orchestrate ETL containers depending upon the number of records present at the Source system (SQL/Google Analytics/SAAS/CSV files).</p> <p>To explain take a Use Case:- ETL Job has to process 50K records present in SQL server, however, it takes good processing time to execute this job by one server...
fortanu82
<p>You would generally use a queue of some kind and Horizontal Pod Autoscaler (HPA) to watch the queue size and adjust the queue consumer replicas automatically. Specifics depend on the exact tools you use.</p>
coderanger
<p>I have a <em>kustomization.yaml</em> file that uses a private repository as a resource:</p> <pre><code>apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - https://gitlab.com/my-user/k8s-base-cfg.git patchesStrategicMerge: - app-patch.yaml </code></pre> <p>I want to automate this on a Jen...
Fernando Lozano
<p>You can't, you would set up the credentials in git before starting Kustomize. In this case probably something very simple like <code>git config --global user.password &quot;your password&quot;</code> but look up the <code>credentials.helper</code> setting for more complex options, either from a local file or a tool ...
coderanger
<p>I'm using <a href="https://github.com/helm/charts/tree/master/stable/jenkins" rel="nofollow noreferrer">Jenkins with Kubernetes plugin</a> but I think the problem will be the same with Tekton or any pipeline that build, test, and deploy a project using Kubernetes'pods and Gradle.</p> <p>Is there a way to share the ...
Karbos 538
<p>Not easily. The whole model of the Kubernetes plugin is that every build runs in a new environment. You would have to run it outside of the build, probably via a DaemonSet with hostNetwork mode on and then configure Gradle in the build to look at a different IP (the host IP) instead of localhost. </p> <p>Basically ...
coderanger
<p>How can i upload Binary file like cert file as Config-map</p> <p>I am trying to upload Cert file like .p12 as config map but it's failing every time. After upload i do not see the file just entry.</p> <p>Command that i used:</p> <pre><code>oc create configmap mmx-cert --from-file=xyz.p12 </code></pre> <p>Failed....
Kul Bhushan Prasad
<p>You cannot, ConfigMaps cannot contain binary data on their own. You will need to encode it yourself and decode it on the other side, usually base64. Or just a Secret instead, which can handle binary data.</p>
coderanger
<p>I am trying to install Kubernetes on Debian 9 (stretch) server, which is on cloud and therefore can't do virtualization. And it doesn't have systemd. Also, I'm trying for really minimal configuration, not big cluster.</p> <p>I've found Minikube, <a href="https://docs.gitlab.com/charts/development/minikube/index.htm...
Honza
<p>Since you are well off the beaten path, you can probably just run things by hand with k3s. It's a single executable AFAIK. See <a href="https://github.com/rancher/k3s#manual-download" rel="nofollow noreferrer">https://github.com/rancher/k3s#manual-download</a> as a simple starting point. You will eventually want som...
coderanger
<p>during deployment of new version of application sequentially 4 pods are terminated and replaced by newer ones; but for those ~10minutes the app is hitting other microservice is hitting older endpoints causing 502/404 errors - anyone know of a way to deploy 4 new pods, then drain traffic from old ones to new ones and...
CptDolphin
<p>This probably means you don't have a readiness probe set up? Because the default is already to only roll 25% of the pods at once. If you have a readiness probe, this will include waiting until the new pods are actually available and Ready but otherwise it only waits until they start.</p>
coderanger
<p>I'm reading the Kubernetes docs on <a href="https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/" rel="nofollow noreferrer">Reserve Compute Resources for System Daemons</a>, and it says "Be extra careful while enforcing system-reserved reservation since it can lead to critical system servic...
Ryan Gilbert
<p>You probably have at least a few things running on the host nodes outside of Kubernetes' view. Like systemd, some hardware stuffs, maybe sshd. Minimal OSes like CoreOS definitely have a lot less, but if you're running on a more stock OS image, you need to leave room for all the other gunk that comes with them. Witho...
coderanger
<p>I am working on moving a application which require near real time exchange of data between processes running in multiple containers in kubernetes cluster. I am thinking of using redis cache for this purpose. </p> <p>The type of data that needs to be exchanges are simple types like double,string values. The frequenc...
Vijay
<p>This is hugely complex question with way more nuance than can fit in here. It very much depends on the object sizes, uptime requirements, cluster scale, etc. I would recommend you try all of them, evaluate performance, and analyze failure modes as they apply to your use case.</p> <p>Some things you can try out:</p>...
coderanger
<pre><code>values.yaml aa: bb: cc: dd: "hi~!!" </code></pre> <p>In the values ​​file above, the value "cc" is a variable. I'm want to get "hi~!!".</p> <pre><code>myPod.yaml apiVersion: v1 ... ... data: myData: {{ printf "%s\.dd" $variableKey | index .Values.aa.bb }} </code></pre> <p>Is this possible?</...
김태우
<p>You need two separate args, <code>{{ index .Values.aa.bb $variableKey “dd” }}</code></p>
coderanger
<p>Does anyone know how to get a Kubernetes deployment to automatically update when a configMap is changed?</p>
Hammed
<p>Unfortunately there is nothing built in for this. You used the <code>helm</code> tag, so with Helm you do this by setting a checksum of the rendered configmap (or secret, same issue there) as an annotation in the pod template. This means that changing the configmap results in a (meaningless) change to the pod templa...
coderanger
<p>I apologize for my poor English.</p> <p>I created 1 master-node and 1 worker-node in cluster, and deployed container (replicas:4).<br> then <code>kubectl get all</code> shows like as below. (omitted)</p> <pre><code>NAME  NODE pod/container1 k8s-worker-1.local pod/container2 k8s-worker-1.local pod/...
user13049712
<p>Scheduling only happens when a pod is started. After that, it won't be moved. There are tools out there for deleting (evicting) pods when nodes get too imbalanced, but if you're just starting out I wouldn't go that far for now. If you delete your 4 pods and recreate them (or let the Deployment system recreate them a...
coderanger
<p>I am able to access the <code>nginx ingress controller</code> on the <code>NodePort</code>. My goal is to access the controller on <code>port 80</code>.</p> <blockquote> <p>Output of <code>kubectl -n ingress-nginx describe service/ingress-nginx</code></p> </blockquote> <pre><code>Name: ingres...
elp
<p>The normal way to handle this is with a LoadBalancer mode service which puts a cloud load balancer in front of the existing NodePort so that you can remap the normal ports back onto it.</p>
coderanger
<p>I want to load-balance 2 stateful applications running on 2 pods. This application cannot have 2 replicas as it is stateful. </p> <p>I tried giving the same service names to both the pods but it looks like Kubernetes get confused and nothing is served.</p> <p>I am using on-premies Kubernetes cluster with metallb ...
Aravind GV
<p>The selector on a service can be anything, and can match pods from multiple statefulsets (or deployments). So make a label on your pods and use that in the selector of a new service to target both.</p>
coderanger
<p>This is my first time running through the Kubernetes tutorial. I installed Docker, Kubectl and Minikube on a headless Ubuntu server (18.04). I ran Minikube like this - </p> <pre><code>minikube start --vm-driver=none </code></pre> <p>I have a local docker image that run a restful service on port 9110. I create a ...
Quest Monger
<p>I think <code>minikube tunnel</code> might be what you're looking for. <a href="https://github.com/kubernetes/minikube/blob/master/docs/networking.md" rel="nofollow noreferrer">https://github.com/kubernetes/minikube/blob/master/docs/networking.md</a></p> <blockquote> <p>Services of type <code>LoadBalancer</code> ...
coderanger
<p>is it possible to pass a function as the value in a K8s' pod command for evaluation? I am passing in JVM arguments to set the MaxRAM parameter and would like to read the cgroups memory to ascertain a value for the argument</p> <p>This is an example of what I'm trying to do</p> <pre><code>- command: - /opt/tools...
frpet
<p>That is shell syntax so you need to run a shell to interpret it.</p> <pre><code>command: - sh - -c - | exec /opt/tools/Linux/jdk/openjdk1.8.0_181_x64/bin/java -XX:MaxRAM=$(( $(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) * 70/100 )) </code></pre>
coderanger
<p>If a distributed computing framework spins up nodes for running Java/ Scala operations then it has to include the JVM in every container. E.g. every Map and Reduce step spawns its own JVM.</p> <p>How does the efficiency of this instantiation compare to spinning up containers for languages like Python? Is it a que...
Kermit
<p>Linux container technology uses layered filesystems so bigger container images don't generally have a ton of runtime overhead, though you do have to download the image the first time it is used on a node which can potentially add up on truly massive clusters. In general this is not usually a thing to worry about, as...
coderanger
<p>I am fairly new to Kubernetes and had a question concerning kube-state-metrics. When I simply monitor Kubernetes using Prometheus I obtain a set of metrics from the cAdvisor, the nodes (node exporter), the pods, etc. When I include the kube-state-metrics, I seem to obtain more "relevant" metrics. Do kube-state-metri...
Tony.H
<p>The two are basically unrelated. Cadvisor is giving you low-level stats about the containers like how much RAM and CPU they are using. KSM gives you info from the Kubernetes API like the Pod object status. Both are useful for different things and you probably want both.</p>
coderanger
<p>My namespace contains multiple secrets and pods. The secrets are selectively mounted on pods as volumes using the deployment spec. Is it possible to deny specific secrets from being mounted as volumes in certain pods. I have tested RBAC and it prevents pods from accessing secrets over api. Is there a similar mechani...
Basil Paul
<p>The other answer is the correct one but in the interest of completeness, you could write an admission controller which checks requests against some kind of policy. This is what the built in NodeRestriction admission controller does to help limit things so the kubelet can only access secrets for pods it is supposed t...
coderanger
<p>I have a config yaml file for a kubernetes deployment that looks like this:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: labels: app: &lt;some_app&gt; name: &lt;some_app&gt; namespace: dataengineering spec: replicas: 1 strategy: rollingUpdate: maxSurge: 1 ma...
Jwan622
<p>Something like this would help with the env vars:</p> <pre><code> envFrom: - configMapRef: name: myapp-config - secretRef: name: myapp-secrets </code></pre> <p>You can then use different namespaces for dev vs. prod so the references don't have to vary. For handling labels, look at Kustomize overla...
coderanger
<p>I have a service that generates a picture. Once it's ready, the user will be able to download it.</p> <p>What is the recommended way to share a storage volume between a worker pod and a backend service?</p>
Sahbi BG
<p>In general the recommended way is "don't". While a few volume providers support multi-mounting, it's very hard to do that in a way that isn't sadmaking. Preferably use an external services like AWS S3 for hosting the actual file content and store references in your existing database(s). If you need a local equivalen...
coderanger
<p>I have a kustomization file that's generating a ConfigMap and behaving as expected. I need to be able to create a new pod that pulls in the environment variables from that same configMap without regenerating the configMap. In other words, I'm having to do this:</p> <pre><code>envFrom: - configMapRef: na...
Samuel Henderson
<p>That is not possible. While ConfigMap volumes update in-place and automatically (so you could switch that and make your app re-read the file when it updates), env vars pulled from a ConfigMap (or Secret, all of this applies to both) are only checked when the pod is launched. The usual workaround is to put a checksum...
coderanger
<p>I have one service called "workspace-service-b6" which is running on port 5000, See the below ingress file. Now I want to serve the static content on the same service (workspace-service-b6) by adding the path route.</p> <p>Example:- Service is working on <a href="https://workspace-b6.dev.example.com" rel="nofollow ...
me25
<p>While it’s kind of possible, the real answer is “don’t”. The ingress system is just a proxy, set up separate pods for content.</p>
coderanger
<p>The Google Cloud Platform Kubernetes Engine based backend deployment I work on has between 4-60 nodes running at all times, spanning two different services.</p> <p>I want to interface with an API that employs IP whitelisting however, which would mean that all outgoing requests would have to be funneled through one ...
sk0g
<p>You have already found the solution, you have to rebuild things using either Cloud NAT or an equivalent solution made yourself. Even that is relatively recent and I've not actually tried it myself, as recently as a 6 months ago we were told this was not supported for GKE. Our solution was the proxy idea you mentione...
coderanger
<p>When I type <code>kubectl edit clusterrolebinding foo-role</code>, I can see something like:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: foo-role roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: e...
johnlinp
<p>Give them different names in the metadata. You didn't make a new one, you just overwrote the same one.</p>
coderanger
<p>I came across an <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/" rel="nofollow noreferrer">article</a> which States that we can have mixed os in cluster.</p> <p>Article talk about having flannel as networking plugin but i want to use Calico opensource plugin instead as it...
Shrijan Tiwari
<p>Calico for Windows does exist <a href="https://www.tigera.io/tigera-products/calico-for-windows/" rel="nofollow noreferrer">https://www.tigera.io/tigera-products/calico-for-windows/</a></p> <p>But it appears to be a commercial product so you would probably want to contact them to ask about it. Assuming it's equival...
coderanger
<p>The setup is on GCP GKE. I deploy a Postgres database with a persistent volume (retain reclaim policy), and:</p> <pre><code> strategy: type: Recreate </code></pre> <p>Will the data be retained or re-initialized if the database pod gets deleted?</p>
sirodoht
<p>The update strategy has nothing to do with the on-delete behavior. That's used when a change to the pod template triggers an update. Basically does it nuke the old ReplicaSet all at once or gradually scale things up/down. You almost always way RollingUpdate unless you are working with software that requires all node...
coderanger
<p>We got an existed secret in K8S(suppose it is "secret_1") and we want to write a yaml to create a new secret "secret_2", using some values from secret_1.</p> <p>That is, in this yaml we'd like to </p> <ol> <li>Read values from other secret</li> <li>Store values to new secret</li> </ol> <p>Is it possible to do thi...
Lijing Zhang
<p>You cannot do this directly in YAML. You would need to write a script of some kind to do the steps you described, though you can use <code>kubectl get secret -o yaml</code> (or <code>-o json</code>) for a lot of the heavy lifting, possibly with <code>jq</code> for the reformatting.</p>
coderanger
<p>It's possible to make an Ingress Controller, or anything else (preferably something already done, not needing to code a service per say), to send traffic to an external IP? Why: I have an application which will interact with my k8s cluster from the outside, I already know that I can use an Ingress Controller to make...
Thiago Casa Nova
<p>It depends on the controller, but most will work with an ExternalName type Service to proxy to an arbitrary IP even if that's outside the cluster.</p>
coderanger
<p>I have a requirements.yaml file:</p> <pre><code>dependencies: - name: mongodb-replicaset # Can be found with "helm search &lt;chart&gt;" version: 3.13.0 # This is the binaries repository, as documented in the GitHub repo repository: https://kubernetes-charts.storage.googleapis.com/ </code></pre> ...
NyaSol
<p>You put the values under a key matching the name of the upstream chart so</p> <pre><code>mongodb-replicaset: auth: enabled: true etc etc </code></pre>
coderanger
<p>I am very confused about why my pods are staying in pending status.</p> <p>Vitess seems have problem scheduling the vttablet pod on nodes. I built a 2-worker-node Kubernetes cluster (nodes A &amp; B), and started vttablets on the cluster, but only two vttablets start normally, the other three is stay in pending sta...
user1208081
<p>As you can see down at the bottom:</p> <pre><code>message: '0/3 nodes are available: 1 node(s) had taints that the pod didn''t tolerate, 2 Insufficient cpu.' </code></pre> <p>Meaning that your two worker nodes are out of resources based on the limits you specified in the pod. You will need more workers, or small...
coderanger
<p>I am running filebeat as deamon set with 1Gi memory setting. my pods getting crashed with <code>OOMKilled</code> status.</p> <p>Here is my limit setting </p> <pre><code> resources: limits: memory: 1Gi requests: cpu: 100m memory: 1Gi </code></pre> <p>What is ...
sfgroups
<p>The RAM usage of Filebeat is relative to how much it is doing, in general. You can limit the number of harvesters to try and reduce things, but overall you just need to run it uncapped and measure what the normal usage is for your use case and scenario.</p>
coderanger
<p>I want to create a symlink using a kubernetes deployment yaml. Is this possible?</p> <p>Thanks</p>
andrew headington
<p>Not really but you could set your command to something like <code>[/bin/sh, -c, "ln -s whatever whatever &amp;&amp; exec originalcommand"]</code>. Kubernetes isn't involved per se, but it would probably do the job. Normally that should be part of your image build process, not a deployment-time thing.</p>
coderanger
<p>With the instruction <a href="https://docs.aws.amazon.com/eks/latest/userguide/worker.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/worker.html</a> it is possible to bring up Kube cluster worker nodes. I wanted the worker node not to have public ip. I don't see Amazon gives me that...
R-JANA
<p>You would normally set this up ahead of time in the Subnet rather than doing it per machine. You can set <code>Auto-assign public IPv4 address</code> to false in the subnets you are using the for the worker instances.</p>
coderanger
<p>I would like to mount an amazon ebs volume (with data on it) to my pod. The problem is that I didn't find a way to determine in advance the availability zone of the pod before starting it. If the pod doesn't start on the same availability zone of the volume, it leads to a binding error.</p> <p>How can I specify or ...
Noé
<p>You use the <code>topology.kubernetes.io/zone</code> label and node selectors for this kind of thing. However unless you're on a very old version of Kubernetes, this should be handled automatically by the scheduler.</p>
coderanger
<p>I have been deploying apps to Kubernetes for the last 2 years. And in my org, all our apps(especially stateless) are running in Kubernetes. I still have a fundamental question, just because very recently we found some issues with respect to our few python apps.</p> <p>Initially when we deployed, our python apps(Wri...
Ysak
<p>We use Twisted's WSGI server with 30 threads and it's been solid for our Django application. Keeps to a single process per pod model which more closely matches Kubernetes' expectations, as you mentioned. Yes, the GIL means only one of those 30 threads can be running Python code at time, but as with most webapps, mos...
coderanger
<p>Dnsjava is an implementation of DNS in Java. We have built some of our application logic around it.. Just wanted to check if Kubernetes would support DNS interfaces at application level</p>
Yukti Kaura
<p>Not entirely sure what you mean, but Kubernetes doesn't care what you run on it. Your workloads are your problem :)</p>
coderanger
<p>I'm using <code>kubectl apply</code> to update my Kubernetes pods:</p> <pre><code>kubectl apply -f /my-app/service.yaml kubectl apply -f /my-app/deployment.yaml </code></pre> <p>Below is my service.yaml:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: my-app labels: run: my-app spec: type: N...
Floating Sunfish
<p>If nothing changes in the deployment spec, the pods will not be updated for you. This is one of many reasons it is not recommended to use <code>:latest</code>, as the other answer went into more detail on. The <code>Deployment</code> controller is very simple and pretty much just does <code>DeepEquals(old.Spec.Templ...
coderanger
<p>I am looking for keeping some kind of baseline for everything applied to kubernetes(or just a namespace).</p> <p>Like versioning microservices in a list and then check that in to github, in case of the need to roll something back.</p>
Chris G.
<p>Check out Velero, it is a backup tool for kubernetes. I don’t think it can use git as a backend, but you could add that (or use s3 or similar).</p>
coderanger
<p>I am new to K8s. Say I want to start up a RabbitMQ in my cluster but I also want to ensure its default AMQP port is secure (AMQPS). Is it possible to do so using a GCP-managed key + certificate? If so, how? For example, I was thinking of using a LoadBalancer somehow to take care of it. Or, maybe Ingress, although it...
Sagi Mann
<p>I don’t think so, all the ways you can interact with Google certs are aimed at HTTPS. You can use cert-manager with LetsEncrypt though.</p>
coderanger
<p><a href="https://github.com/kubernetes-retired/contrib/tree/master/ingress/controllers/nginx/examples/tls" rel="nofollow noreferrer">https://github.com/kubernetes-retired/contrib/tree/master/ingress/controllers/nginx/examples/tls</a> </p> <p>I've tried to configure https for my ingress resource by this tutorial. I'...
Andrey Radkevich
<p>As mentioned in the comments, this tutorial is guiding you through setting up a self-signed certificate, which is not trusted by your browser. You would need to provide a cert your browser trusts or temporarily ignore the error locally. LetsEncrypt is an easy and free way to get a real cert, and cert-manager is a wa...
coderanger
<p>I was looking for a load-balancing technique with health checks while making my worker-nodes communicating with the API server. </p> <p>Kubernetes itself has a service called "kubernetes" whose endpoints are the API servers.</p> <p>I entered the domain of this service in kubeconfig of workernodes and it is behavin...
Vyom Srivastava
<p>It's magic ✨. The endpoints of the service are managed directly by the apiservers themselves. That's why it has no selector. The Service is really only there for compat with cluster DNS. It is indeed what you use to talk to the API from inside the cluster, this is generally detected automatically by most client libr...
coderanger
<p>My Traefik Ingress DaemonSet shows some awkard metrics in its dashboard. </p> <p>Is it correct? I really doubt that my average response time is beyond minutes.</p> <p>I think I'm doing something wrong but I have no idea what it is.</p> <p><a href="https://i.stack.imgur.com/72SCs.png" rel="nofollow noreferrer"><im...
Pedro Henrique
<p>Answered in comments, Traefik's stats are very literal and when using Websockets it thinks that's a single HTTP connect (because it technically is) which is lasting for minutes or hours.</p>
coderanger
<p>I need this information to measure mean time to recovery (MTTR). I have tried using different kube-state-metrics but it does not seem to help much. Any hints on measuring MTTR will also be appreciated</p>
Ayush Dewan
<p>You can use the pod status information, it records last transition time for each status signal. In this case you probably want the time difference between <code>PodScheduled</code> and <code>Ready</code>, but up to you to decide what counts as "startup time" or not (for example, does the time spent on pulling contai...
coderanger
<p>I followed this tutorial: <a href="https://cloud.google.com/python/django/kubernetes-engine" rel="nofollow noreferrer">https://cloud.google.com/python/django/kubernetes-engine</a> on how to deploy a Django application to GKE. </p> <p>Unfortunately, I made a mistake while deploying the application, and one of my 3 p...
Vishaal Kalwani
<p>The normal way would be to push a new image with a new tag and then edit the container image tag in the Deployment (<a href="https://github.com/GoogleCloudPlatform/python-docs-samples/blob/78d8a59d59c5eca788495666b43283534a50b7ee/container_engine/django_tutorial/polls.yaml#L42" rel="nofollow noreferrer">https://gith...
coderanger
<p>Due to some internal issues, we need to remove unused images as soon as they become unused.<br> I do know it's possible to use <a href="https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/" rel="nofollow noreferrer">Garbage collection</a> but it doesn't offer strict policy as we nee...
SagiLow
<p>This doesn't really accomplish much since things will be re-downloaded if they are requested again. But if you insist on a silly thing, best bet is a DaemonSet that runs with the host docker control socket hostPath-mounted in and runs <code>docker system prune</code> as you mentioned. You can't use a cron job so you...
coderanger
<p>I've finally managed to run my containers and let them communicate. Currently, they're 1-1 (1 frontend, 1 backend). Now I wish to have n instances of frontend and m instances of the backend, but a question came to me, about handling the logs. If I run only 1 instance of each, I can configure 2 volumes (1 for fronten...
advapi
<p>You don't write logs to a volume, generally. You write them to stdout/err and then the container runtime system manages them for you. You can then access them via <code>kubectl logs</code> or ship them elsewhere using tools like Fluentd.</p>
coderanger