Question stringlengths 65 39.6k | QuestionAuthor stringlengths 3 30 ⌀ | Answer stringlengths 38 29.1k | AnswerAuthor stringlengths 3 30 ⌀ |
|---|---|---|---|
<p>I'm running Prometheus in a kubernetes cluster. All is running find and my UI pods are counting visitors. </p>
<p><a href="https://i.stack.imgur.com/Eb8l4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Eb8l4.png" alt="enter image description here"></a></p>
<p>Please ignore the title, what you s... | Jeanluca Scaljeri | <p>Rate, then sum, then multiply by the time range in seconds. That will handle rollovers on counters too.</p>
| coderanger |
<p>We have the following deployment <code>yaml</code>:</p>
<pre><code>---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{DEP_ENVIRONMENT}}-{{SERVICE_NAME}}
namespace: {{DEP_ENVIRONMENT}}
labels:
app: {{DEP_ENVIRONMENT}}-{{SERVICE_NAME}}
spec:
replicas: {{NUM_REPLICAS}}
selector:
matchLab... | lola_the_coding_girl | <p>Lifecycle hooks are intended to be short foreground commands. You cannot start a background daemon from them, that has to be the main <code>command</code> for the container.</p>
| coderanger |
<p>Is it possible to have more than one instance of the actual <code>Service</code> object created in deployments that actually manages the access to pods (containers) and what happens if the actual service object itself is somehow deleted or destroyed? </p>
<p>This is the service object specified in a deployment YAML... | JayD | <p>The Service object only exists as an abstraction within the Kubernetes API. The actual implementation is distributed across your entire cluster, generally in the form of iptables rules created by kube-proxy on every node.</p>
| coderanger |
<p>Lets say I have a pod with one volume created from a secret, which comes to life in ~5sec.</p>
<p>Now if I create a bigger amounts of pods and secrets everything getting slower. Which is kind of normal I guess.</p>
<p>Lets say I create 20pod with 500secret. It takes ~150sec to get into running state.
I get a ton of ... | beatrice | <p>The kubelet handles this. There is no reason for anyone to have load-tested such a weird edge case because why would you ever do that? The slowdown is likely the Kubelet getting access to all the data because that has to wait for the scheduler (because of NodeRestriction) and then it might be hitting a client-side r... | coderanger |
<p>Can multiple long waiting threads (blocked on remote rest call response, non cpu-bound) throttle CPU ?
This cpu throttle causes leads to pod restart as health check response takes time to respond.</p>
| pranav prashant | <p>Something blocked in a waiting syscall (select and friends, sleep(), blocking read or write) does not count as using any CPU time, the task (how Linux thinks about threads internally) won't be marked as runnable until something interrupts the wait.</p>
| coderanger |
<p>I'd like to direct traffic from a load balancer within Kubernetes to a deployment. However, rather than attempting to achieve a uniform load across all pods of a deployment, I'd like each connection to and maintain a connection to a specific pod. I'll be sending GRPC requests to a stateful instance on the pod and ... | Alex Kaszynski | <p>The default iptables service proxy implementation uses a very simple randomized round-robin algorithm for selecting which pod to use. If you use the IPVS implementation instead that does offer a lot more options, though that is unlikely to be an option on a hosted provider like AKS. So that would leave you with usin... | coderanger |
<p>I have several celery workers running in minikube, and they are working on tasks passed using the rabbitMQ. Recently I updated some of the code for the celery workers and changed the image. When I do <code>helm upgrade release_name chart_path</code>, all the existing worker pods are terminated and all the unfinished... | RonZhang724 | <p>This is just how Kubernetes Deployments work. What you should do is to fix your Celery worker image so that it waits to try and complete whatever tasks are pending before actually shutting down. This should already probably be the case unless you did something funky such that the SIGTERM isn't making it to Celery? S... | coderanger |
<p>I have a configmap which contains a toml file</p>
<p>something like </p>
<pre><code>apiVersion: v1
kind: ConfigMap
data:
burrow.toml: |
[zookeeper]
servers=[abc.2181, cde.2181]
timeout=6
root-path="/burrow"
</code></pre>
<p>When I am trying to create a helm chart to generate this configmap, I wa... | ustcyue | <p>Try this, <code>servers=[{{ .Values.config.zookeeperServers | join "," }}]</code>. Quoting could get weird if you put TOML metachars in those values, but for simple things it should work.</p>
| coderanger |
<p>By default Kubernetes cluster has a taint on master nodes that does not allow to schedule any pods to them.</p>
<p>What is the reason for that?</p>
<p>Docker Swarm, for example, allows to run containers on manager nodes by default.</p>
| yaskovdev | <p>Safety during failures. Imagine if a pod running on a control plane node started eating all your CPU. Easy to fix right, just <code>kubectl delete pod</code> and restart it. Except if that CPU outburst has kube-apiserver or Etcd locked up, then you have no way to fix the problem through the normal tools. As such, it... | coderanger |
<p>Is there a way to specify a <code>hostPath</code> volume so that it includes the pod's name? For example, something like the following:</p>
<pre><code> volumes:
- name: vol-test
hostPath:
path: /basedir/$(POD_NAME)
type: Directory
</code></pre>
<p>Simply using /basedir directly and then ha... | Behram Mistree | <p>You set it as an env var first via valueFrom and then certain fields understand <code>$(FOO)</code> as an env var reference to be interpolated at runtime.</p>
<p>EDIT: And <code>path</code> is not one of those fields. But <code>subPathExpr</code> is.</p>
| coderanger |
<p>I got error when creating deployment.
This is my Dockerfile that i have run and test it on local, i also push it to DockerHub</p>
<pre><code>FROM node:14.15.4
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
RUN npm install pm2 -g
COPY . .
EXPOSE 3001
CMD [ "pm2-runtime", "server.js" ]... | Hoang Pham Huy | <p>You are trying to launch a container built for x86 (or x86_64, same difference) on an ARM machine. This does not work. Containers for ARM must be built specifically for ARM and contain ARM executables. While major projects are slowly adding ARM support to their builds, most random images you find on Docker Hub or wh... | coderanger |
<p>I'm running <code>rook-ceph-cluster</code> on top of <code>AWS</code> with <code>3 masters - 3 worker node</code> configuration.
I have created my cluster using <a href="https://rook.io/docs/rook/v1.0/ceph-examples.html" rel="nofollow noreferrer">this</a>.</p>
<p>Each <code>worker node</code> is <code>100 GiB</code... | Rajat Singh | <p>You can delete pods manually as mentioned by Graham, but the rest are trickier. For simulating an OOM, you could <code>kubectl exec</code> into the pod and run something that will burn up RAM. Or you could set the limit down below what it actually uses. Simulating network issues would be up to your CNI plugin, but I... | coderanger |
<p>I would like to develop a playbook rule for addressing how to manage socket securing for Docker and Kubernetes from either the standpoint of Docker For Mac or MiniKube- after auto-updates to any of the pieces of the puzzle. Maybe we need to throw out there the LLVM or (VM in question if we say use Virtual Box <em>an... | Rudy | <p>Kubernetes works over an HTTP API and normal IP sockets, not a local domain socket. So there isn't really anything to lock down. DfM's control socket is already tightly locked down to the active GUI user because DfM runs inside a Mac app container (totally different use of the term "container"). Basically there isn'... | coderanger |
<p>External firewall logs show blocked connection from < node IP >:< big port >.
The current cluster uses calico networking.</p>
<p>How do I detect which pod trying to connect?</p>
| Pav K. | <p>This would usually be pretty hard to work out, you would have to check the NAT table on the node where the packets exited to the public internet.</p>
| coderanger |
<p>I have two services name Product and Order.
Order table inside OrderDb has price and productId columns for storing product price and product id that ordered. Order services has 3 replica.</p>
<p>Now, suppose a product is ordered and it's id 80, and a series of sequential update event fired from product service to o... | Rafiq | <p>This is generally up to your database. I see you put NATS in the tags so I'm assuming you mean you have some kind of worker queue model, but you probably have a database of record behind that with its own consistency model. With event streaming systems where you want to defend against out of order or multi-delivery,... | coderanger |
<p>On my master node I am running <strong>Kubernetes v1.16.3</strong> which users will submit some jobs to our servers from time to time, which is working right now. However, in my case I have many users and they should not only have priorites on their jobs, but also a <strong><em>minimum</em> lifetime</strong> of each... | TheHeroOfTime | <p>Kubernetes' scheduler doesn't understand time so not directly. You can set PriorityClasses and PodDisruptionBudgets (in this case the budget being maxDisruptions 0) which control voluntary evictions. It might be possible to write something which changes the PriorityClass value after a certain amount of time but I do... | coderanger |
<p>I am using k8s with version 1.11 and CephFS as storage.</p>
<p>I am trying to mount the directory created on the CephFS in the pod. To achieve the same I have written the following volume and volume mount config
in the deployment configuration</p>
<p>Volume</p>
<pre><code>{
"name": "cephfs-0",
"cephfs": {
... | Yudi | <p>Unfortunately Kubernetes' volume system differs from Docker's, so this is not possible directly.</p>
<p>However, in case of a single file <code>foo.conf</code> you can use:</p>
<ul>
<li>a <code>mountPath</code> ending in this file name and</li>
<li>a <code>subPath</code> containing this file name, like this:</li>
</... | coderanger |
<p><a href="https://i.stack.imgur.com/bd6P3.jpg" rel="nofollow noreferrer">enter image description here</a>I don't' see why adding selector when we are creating <strong>replicaSet</strong> I thought maybe we can select different pod but we can't so I don't see what is used for</p>
<pre><code>apiVersion: apps/v1
kind: R... | Mohamed Ghatbaoui | <p>Because you can have more than one label on the resulting pods and it doesn't know which of them to use for tracking. The selector labels are read-only once initialized, but other labels you can add and remove as needed for other purposes.</p>
| coderanger |
<p>I have an NFS based PVC in a kubernetes cluster that I need to freeze to take a snapshot of. I tried fsfreeze, but I get "operation not supported". I assume because it is trying to freeze the entire nfs instead of just the mount. I have checked and I can freeze the filesystem on the side of the NFS serve... | deef0000dragon1 | <p>From <a href="https://github.com/vmware-tanzu/velero/issues/2042" rel="nofollow noreferrer">https://github.com/vmware-tanzu/velero/issues/2042</a> and some other quick poking around, fsfreeze doesn't support NFS mounts. In general it seems to mostly on work with real local volumes which you'll almost never use with ... | coderanger |
<p>Our goal is to run kubernetes in AWS and Azure with minimal customization (setting up kubernetes managed env), support and maintenance. We need portability of containers across cloud providers. </p>
<p>Our preferred cloud provider is AWS. We are planning on running containers in EKS. We wanted to understand the cus... | siv | <p>You need to define a common set of storage classes that map to similar volume types on each provider. If you are using some kind of provider based Ingress controller those can vary so I would recommend using an internal one like nginx or traefik. If you are using customization annotations for things like networking ... | coderanger |
<p>My question is related to Kubernetes and the units of the metrics used for the HPA (autoscaling).</p>
<p>When I run the command</p>
<p><code>kubectl describe hpa my-autoscaler</code></p>
<p>I get (a part of more information) this:</p>
<pre><code>...
Metrics: ( curren... | Lobo | <p>No, they are just different multipliers. The actual code is using a raw number of bytes under the hood.</p>
| coderanger |
<p>What is the best way to send slack notification when a k8s cluster node is not ready? (Master and worker)</p>
<p>I already have Prometheus and alert manager up and running. Ideally I would use them to do that.</p>
| ThatChrisGuy | <p>Use kube-state-metrics and an alert rule. The query to start with is something like <code>kube_node_status_condition{condition="Ready",status!="true"} > 0</code> but you can play with it as needed.</p>
| coderanger |
<p>I'm new to DevOps work and am having a though time figuring out how the whole final architecture should look like. My project currently runs on a single Kubernetes Cluster and a single node with a single pod, in the very common Nginx reverse proxy + UWSGI Django app. I have to implement a scaling architecture. My un... | mrj | <ol>
<li><p>Every pod has its own networking setup so two replicas (i.e. two pods) can both listen on the same port. <em>Unless</em> you've enabled host networking mode which should not be used here.</p>
</li>
<li><p>Not directly, the ingress controller can be a lot of things. If you're using a self-hosted one (I see t... | coderanger |
<p>I am currently working in dynamic scaling of services with custom metrics and I wanted to send some data <strong>from HPA to my external API service</strong>. Is there any way or any post request which will send the <em>current replica count</em> to my external API ?
Like HPA has its sync period and it sends GET req... | Museb Momin | <p>You don't per se, your service can watch the Kubernetes API for updates like everything else though. All components in Kubernetes communicate through the API.</p>
| coderanger |
<p>Stateless is the way to go for services running in pods however i have been trying to move a stateful app which needs to perform session persistence if one pod goes does for resiliency reasons.</p>
<p>In websphere world IHS can be used to keep track of the session and if a node goes down it can be recreated on the ... | Sudheej | <p>Cookie-based sessions are just that, based on cookies. Which are stored by the user's browser, not your app. If you mean a DB-based session with a cookie session ID or similar, then you would need to store things in some kind of central database. I would recommend using an actual database like postgres, but I suppos... | coderanger |
<p>So I have an API that's the gateway for two other API's.
Using docker in wsl 2 (ubuntu), when I build my Gateway API.</p>
<pre><code>docker run -d -p 8080:8080 -e A_API_URL=$A_API_URL B_API_URL=$B_API_URL registry:$(somePort)//gateway
</code></pre>
<p>I have 2 environnement variables that are the API URI of the t... | DylanB | <p>You just have to hardwire them. Kubernetes doesn't know anything about your local machine. There are templating tools like Helm that could inject things like Bash is in your <code>docker run</code> example but generally not a good idea since if anyone other than you runs the same command, they could see different re... | coderanger |
<p>I am installing Custom Resources through an Operator. However, <code>kubectl apply</code> is blocked on<br>
<em>"Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "my-crd.example.com" not found."</em></p>
<p>If there were a switch on <code>kubectl apply</code> along the lines of <code>-... | Joshua Fox | <p>No, you can’t use a CRD API without actually creating the CRD. It’s not a type check, it’s how the system works through and through.</p>
| coderanger |
<p>I have applied the following pvc yaml.</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ebs-claim
spec:
accessModes:
- ReadWriteOnce
storageClassName: ebs-sc
resources:
requests:
storage: 4Gi
</code></pre>
<p>I now want my statefulset to use the PVC I have created. In... | michael_fortunato | <p>Specify it like normal in the <code>volumes</code> section of the pod spec template. But you won't get the special behavior of creating a new PVC for each replica since that requires creating new ones.</p>
| coderanger |
<p>I have a k8s cluster with an nginx based ingress and multiple services (ClusterIP). I want to use Consul as a service mesh and documentation is very clear on how to set up and govern communication between services. What is not clear though is how to setup the nginx ingress to talk to these services via the injected ... | Harindaka | <p>You would inject the sidecar into the ingress-nginx controller and have it talk to backend services just like any other service-to-service thing. This will probably require overriding a lot of the auto-generated config so I'm not sure it will be as useful as you hope.</p>
| coderanger |
<p>Let's say that a Service in a Kubernetes cluster is mapped to a group of cloned containers that will fulfil requests made for that service from the outside world.</p>
<p>What are the steps in the journey that a request from the outside world will make into the Kubernetes cluster, then through the cluster to the desi... | CodeMed | <p>Assuming you are using mostly the defaults:</p>
<ol>
<li>Packet comes in to your cloud load balancer of choice.</li>
<li>It gets forwarded to a random node in the cluster.</li>
<li>It is received by the kernel and run through iptables.</li>
<li>Iptables defines a mapping rule to forward the packet to a container IP... | coderanger |
<p>I am using <code>client-go</code> to read K8s container resource usage using the <code>Get</code> method of the core client-go client, but re-fetching the K8s object on an interval seems like the wrong approach. What is the better approach for periodically fetching status changes to a K8s container?</p>
| Dnlhoust | <p>You would use an Informer which runs an API watch that receives push updates from kube-apiserver. Though that said, you might find it easier to use one of the operator support frameworks like Kubebuilder, or at least directly use the underlying controller-runtime library as raw client-go can be a little gnarly to co... | coderanger |
<p>I have a umbrella chart and I want to know if it's possible to update an existing helm deployment through my requirements.yaml in my umbrella chart.
<a href="https://i.stack.imgur.com/zpbXj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zpbXj.png" alt="First app tier should be updated by my umbre... | Bruno Macedo | <p>Not directly. If you did some kind of funky CRD with one of the existing Helm operators then maybe, but overall releases don't know about each other.</p>
| coderanger |
<p>I am using kubernetes and its resources like secrets. During deployment one secret has been created (say test-secret) with some values inside it.
Now I need to renamed this secretes (dev-secret) within the same namespace.
How can I rename the secret or how can I copy test-secret value to dev-secret.</p>
<p>Please le... | keepmoving | <p>There is no specific way to do this. The Kubernetes API does not have "rename" as an operation. In this particular case you would <code>kubectl get secret test-secret -o yaml</code>, clean up the <code>metadata:</code> sections that don't apply anymore, edit the name of the secret, and <code>kubectl apply<... | coderanger |
<p>I have a template part like:</p>
<pre><code> spec:
containers:
- name: webinspect-runner-{{ .Values.pipeline.sequence }}
...
env:
- name: wi_base_url
valueFrom:
secretKeyRef:
name: webinspect
key: wi-ba... | Romulus Urakagi Ts'ai | <p>Two options, the first is add <code>optional: true</code> to the secretKeyRef block(s) which makes it skip. The second is a much more complex approach using the <a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/" rel="nofollow noreferrer"><code>lookup</code> template function in Helm</a>. Pr... | coderanger |
<p>I want to deploy eureka server on kubernetes, and want to specify the service name to the clients , so that whenever any client wants to connect to eureka server , it should do it using the service name of eureka server.</p>
| Parosh Dey | <p>It looks like the official images for Eureka haven’t been updated in years, so I think you’re on your own and will have to work this out from scratch. There are a few Helm charts but they all seem to reference private images and are pretty simple so not sure how much that will help.</p>
| coderanger |
<p>I came across this page regarding the kube auto-scaler: <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca</a></p>... | Jty.tan | <p>You cannot. The only option the GKE gives is a vague "autoscaling profile" choice between the default and "optimize utilization". You can, however, override it with per-pod annotations.</p>
| coderanger |
<p>I have a Kubernetes cluster and I am figuring out in what numbers have pods got scaled up using the <strong>Kubectl</strong> command.</p>
<p>what is the possible way to get the details of all the scaled-up and scaled-down pods within a month?</p>
| Sudarshan Sharma | <p>That is not information Kubernetes records. The Events system keeps some debugging messages that include stuff about pod startup and sometimes shutdown, but that's only kept for a few hours. For long term metrics look at something like Prometheus + kube-state-metrics.</p>
| coderanger |
<p>I am running a Kubernetes cluster including metrics server add-on and Prometheus monitoring. I would like to know which Kubernetes components or activities use/can use monitoring data from the cluster.</p>
<p><em>What do I mean with "Kubernetes components or activities"?</em></p>
<p>Obviously, one of the m... | shiggyyy | <p><code>metrics-server</code> data is used by <code>kubectl top</code> and by the HorizontalPodAutoscaler system. I am not aware of any other places the use the metrics.k8s.io API (technically doesn't have to be served by <code>metrics-server</code> but usually is).</p>
| coderanger |
<p>For some context, I'm trying to build a staging / testing system on kubernetes which starts with deploying a mariadb on the cluster with some schema and data. I have a trunkated / clensed db dump from prod to help me with that. Let's call that file : dbdump.sql which is present in my local box in the path /home/rjos... | smaikap | <p>Are you sure your home directory is visible to Kubernetes? Minikube generally creates a little VM to run things in, which wouldn't have your home dir in it. The more usual way to handle this would be to make a very small new Docker image yourself like:</p>
<pre><code>FROM mariadb:10.2
COPY dbdump.sql /docker-entryp... | coderanger |
<p>I am new to the writing a custom controllers for the kubernetes and trying to understand this. I have started referring the sample-controller <a href="https://github.com/kubernetes/sample-controller" rel="nofollow noreferrer">https://github.com/kubernetes/sample-controller</a>.</p>
<p>I want to extend the sample-con... | john snowker | <p>Start from <a href="https://book.kubebuilder.io/" rel="nofollow noreferrer">https://book.kubebuilder.io/</a> instead. It's a much better jumping off point than sample-controller.</p>
| coderanger |
<p>I'm running Kubernetes service using exec which have few pods in statefulset.
If I kill one of the master pod used by service in exec, it exits with code 137. I want to forward it to another pod immediately after killing or apply wait before exiting. I need help. Waiting for answer. Thank you.</p>
| Sabir Piludiya | <p>137 means your process exited due to SIGKILL, usually because the system ran out of RAM. Unfortunately no delay is possible with SIGKILL, the kernel just drops your process and that is that. Kubernetes does detect it rapidly and if you're using a Service-based network path it will usually react in 1-2 seconds. I wou... | coderanger |
<p>I want to ssh minikube/docker-desktop, but I cant. How can i do that?</p>
<pre><code>NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
minikube Ready control-plane,master 4m47s v1.20.2 192.168.49.2 <non... | cosmos-1905-14 | <p><code>minikube</code> is the node name within the Kubernetes API, not a hostname in this case. Minikube offers a wrapper <a href="https://minikube.sigs.k8s.io/docs/commands/ssh/" rel="nofollow noreferrer"><code>minikube ssh</code></a> command to automate pulling the IP and whatnot. Docker Desktop does not offer an o... | coderanger |
<p>tl;dr: I have a server that handles WebSocket connections. The nature of the workload is that it is necessarily stateful (i.e., each connection has long-running state). Each connection can last ~20m-4h. Currently, I only deploy new revisions of this service at off hours to avoid interrupting users too much.</p>
<p>I... | Travis DePrato | <p>This is already how things work with normal Services. Once a pod is terminating, it has already been removed from the Endpoints. You'll probably need to tune up your max burst in the rolling update settings of the Deployment to 100%, so that it will spawn all new pods all at once and then start the shutdown process ... | coderanger |
<p>Using nodePort service with ingress, I success expose the service to the out world.</p>
<pre><code>--- service
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP
default postgres ... | ccd | <p>From the inside, <a href="http://user-api.default:3000/user-api" rel="nofollow noreferrer">http://user-api.default:3000/user-api</a>. From the outside, use any node external IP (see <code>kubectl get node -o wide</code> for a list of them).</p>
| coderanger |
<p>my natural thought is that if nginx is just a daemon process on the k8s node, but not a pod(container) in the k8s cluster, looks like it still can fullfill ingress controller jobs. because:
if it's a process, because it is on the k8s node, it still can talk to apiserver to fetch service backend pods information, li... | ericxu1983 | <p>Because Pods are how you run daemon processes (or really, all processes) inside Kubernetes. That's just how you run stuff. I suppose there is nothing stopping you from running it outside the cluster, manually setting up API configuration and authentication, doing all the needed networking bits yourself. But ... why?... | coderanger |
<p>I installed the Prometheus helm chart to a kubernetes cluster for monitoring.
By default, </p>
<ul>
<li>persistent volume size for prometheus server is defined as 8Gi.</li>
<li>Prometheus server will store the metrics in this volume for 15 days (retention period)</li>
</ul>
<p>After some days of deploying the char... | AnjK | <p>15 days is about 1.3 million seconds. Let’s overestimate 8 bytes per sample. So each metric takes about 10mb. So 8gb would let you store 800 metrics. You probably have more than that. Multiply the number of series you want to store by 10 and that’s the number of megabytes you need. Roughly, that will get you the rig... | coderanger |
<p>Inside my Dockerfile I have:</p>
<pre><code>FROM python:3.7
RUN apt update
RUN apt install -y git
RUN groupadd -g 1001 myuser
RUN useradd -u 1001 -g 1001 -ms /bin/bash myuser
USER 1001:1001
USER myuser
WORKDIR /home/myuser
COPY --chown=myuser:myuser requirements.txt ./
ENV PYTHONPATH="/home/myuser/.local/lib... | Eduardo Morales | <p>A revised Dockerfile more in line with standard practices:</p>
<pre><code>FROM python:3.7
RUN apt update && \
apt install -y --no-install-recommends git && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN python3.7 -m pip install -r requirements.txt
COPY . .
ENV PYTH... | coderanger |
<p>I have an <em>unsecured</em> <code>Postfix</code> instance in a container that listens to port <code>25</code>. This port is not exposed using a <code>Service</code>. The idea is that only a <code>PHP</code> container that runs inside the same pod should be able to connect to Postfix and there is no need for additio... | Popi | <p>Yes, you can use <code>kubectl port-forward</code> to set up a tunnel directly to it for testing purposes. </p>
| coderanger |
<p>I need to update a file in a container running in k8s using my local editor and save back the updates to the original file in the container <em>without</em> restarting/redeploying the container.</p>
<p>Right now I do:</p>
<pre><code>$ kubectl exec tmp-shell -- cat /root/motd > motd && vi motd && k... | u123 | <p>One option that might be available is <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-running-pod/#ephemeral-container" rel="nofollow noreferrer">ephemeral debug containers</a> however they are an alpha feature so probably not enabled for you at time of writing. Barring that, yeah what you ... | coderanger |
<p>I have certain requirements where volumeMounts: should be an optional field. </p>
<pre><code>spec:
volumes:
-
name: aaa
secret:
secretName: aaa-certs
containers:
-
name: my-celery
volumeMounts:
-
name: aaa
... | Goutam | <p>No, that is not possible. You would need a higher level system like Helm or an operator to manage that kind of dynamic configuration.</p>
| coderanger |
<p>I tried to do a simple deployment of nextcloud on a k8s cluster hosted using minikube on my local machine for learning purposes. This deployment doesn't have any database/storage attached to it. I'm simply looking to open the nextcloud homepage on my local machine. However, I am unable to do so. Here are my yamls.</... | user5735224 | <p>Run <code>minikube service nextcloud-service</code> and it will open it for you.</p>
| coderanger |
<p>I'm trying to find a generic best practice for how to:</p>
<ol>
<li>Take an arbitrary (parent) Dockerfile, e.g. one of the official Docker images that run their containerized service as root,</li>
<li>Derive a custom (child) Dockerfile from it (via <code>FROM ...</code>),</li>
<li>Adjust the <em>child</em> in the w... | Oliver | <p>Permissions on volume mount points don't matter at all, the mount covers up whatever underlying permissions were there to start with. Additionally you can set this kind of thing at the Kubernetes level rather than worrying about the Dockerfile at all. This is usually though a PodSecurityPolicy but you can also set i... | coderanger |
<p>I am setting up my <code>Kubernetes</code> cluster using <code>kubectl -k</code> (kustomize). Like any other such arrangement, I depend on some secrets during deployment. The route I want go is to use the <code>secretGenerator</code> feature of <code>kustomize</code> to fetch my secrets from files or environment var... | Mr. Developerdude | <p>I'm not aware of a plugin for that. The plugin system in Kustomize is somewhat new (added about 6 months ago) so there aren't a ton in the wild so far, and Secrets Manager is only a few weeks old. You can find docs at <a href="https://github.com/kubernetes-sigs/kustomize/tree/master/docs/plugins" rel="nofollow noref... | coderanger |
<p>How do I get rid of them? Docker doesn't think they exist and my kubernetes-fu isn't good enough yet.</p>
<p><a href="https://i.stack.imgur.com/BVXDa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BVXDa.png" alt="enter image description here" /></a></p>
| Dave Hodgkinson | <p>You cannot remove them while they are in use. You'll have to shut down the Kubernetes system first, that's under Preferences (the gear icon) and then Kubernetes. Once that is done, run <code>docker system prune</code> to clean up unused everything.</p>
| coderanger |
<p>I want to integrate Kubernetes cluster configured in on-premises environment with gitlab.</p>
<p>When adding a cluster, I clicked Add Existing Cluster and filled in all other spaces, and the API URL entered the IP output by the following command.</p>
<pre><code>kubectl cluster-info | grep 'Kubernetes master' | awk... | 윤태일 | <p>As mentioned in comments, you are running your CI job on someone else's network. As such, it cannot talk to your private IPs in your own network. You will need to expose your kube-apiserver to the internet somehow. This is usually done using a LoadBalancer service called <code>kubernetes</code> that is created autom... | coderanger |
<p>I've started to use <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/" rel="nofollow noreferrer">kustomize</a> to update the yaml files.
I'm trying to add labels to <code>Deployment</code> object. <code>commonLabels</code> seems pretty good but it applies the label to <code>selector... | Mahyar | <p>You would need to define a patch for that object specifically.</p>
| coderanger |
<p>I am following this <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/" rel="nofollow noreferrer">example</a></p>
<p>When I run the following command I get the error:</p>
<pre class="lang-sh prettyprint-override"><code>➜ kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:... | DmitrySemenov | <p>Your kubectl is version 1.5 which is very old. It’s trying to use an outdated format for the Deployment resource which no longer exists in the server.</p>
| coderanger |
<p>I have a deployment with scale=1
but when I run get pods, i have 2/2...
When I scale the deployment to 0 and than to 1, I get back 2 pods again... how is this possible?
as i can see below prometeus-server has 2:</p>
<pre><code>PS C:\dev\> kubectl.exe get pods -n monitoring
NAME ... | toto | <p>Two containers, one pod. You can see them both listed under <code>Containers:</code> in the describe output too. One is Prometheus itself, the other is a sidecar that trigger a reload when the config file changes because Prometheus doesn't do that itself.</p>
| coderanger |
<p>I need to create pods on demand in order to run a program. it will run according to the needs, so it could be that for 5 hours there will be nothing running, and then 10 requests will be needed to process, and I might need to limit that only 5 will run simultaneously because of resources limitations.</p>
<p>I am not... | Moshe Shaham | <p>There are many options and you’ll need to try them out. The core tool is HorizontalPodAutoscaler. Systems like KEDA build on top of that to manage metrics more easily. There’s also Serverless tools like knative or kubeless. Or workflow tools like Tekton, Dagster, or Argo.</p>
<p>It really depends on your specifics.<... | coderanger |
<p>I have a command that generates a secrets file that contains multiple <code>yaml</code> documents separated by <code>---</code> that looks like the following output:</p>
<pre><code>## THE COMMAND THAT RUNS
kubectl kustomize .
## SENDS THE FOLLOWING TO STDOUT
data:
firebase-dev-credentials.json: |
MY_BASE_64_C... | Jordan Lewallen | <p>You can pipe through <code>yq eval 'select(di == N)'</code> to select out document N. But really, you wouldn't do this. You would include the already sealed data in your Kustomize config, it's not something you want to run automatically.</p>
| coderanger |
<p>I have a service account with a Policy Rule that works perfectly in mynamespace. But it also works perfectly in other namespaces, which I want to prevent.</p>
<pre><code>---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: myapp
namespace: mynamespace
rules:
- apiGroups: ["extensions"]... | grahamoptibrium | <p>You use a RoleBinding instead of a ClusterRoleBinding.</p>
| coderanger |
<p>I am running simple native Java 8 code to spawn number of threads. These threads connect to database through their own dedicated OJDBC connection. As Database is continuously populated with records so thee threads use this dedicated connection to perform various tasks in database. each thread poll database after som... | Hassnain Alvi | <p>Echoing down from comments, you probably want to turn on TCP keepalives but if that's impossible look at the <code>net.netfilter.nf_conntrack_tcp_timeout_established</code> sysctl and similar conntrack settings. You can also potentially bypass the proxy mesh using a headless-mode Service instead though that would li... | coderanger |
<p>I am trying to build docker image with postgres data included.I am following below link.</p>
<pre><code>https://sharmank.medium.com/build-postgres-docker-image-with-data-included-489bd58a1f9e
</code></pre>
<p>It is built with data as below.</p>
<pre><code>REPOSITORY TAG ... | User1984 | <p>In the many years since that post came out, it looks like the <code>postgres</code> community container image has been tweaked to automatically provision a volume for the data when running under Docker (via the <code>VOLUME</code> directive). This means your content was stored outside the running container and thus ... | coderanger |
<p>I want to create an environment variable in the pod created by my sts which would consist of its FQDN.
As the dns domain - ".cluster.local" can be different for various clusters, like '.cluster.abc', or '.cluster.def', I want to populate that dynamically based on the cluster settings.
I checked that .fieldRed.fieldP... | Akshay Nagpal | <p>This is not a feature of Kubernetes. You would need to use a higher level templating system like Kustomize or Helm.</p>
| coderanger |
<p>I'm aware that I can use <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/update-existing-nodepools" rel="nofollow noreferrer">k8s node affinity</a> to select for nodes that have a value of a label <code>gt</code> than some value. However is it possible to make k8s prefer to schedule on nodes that hav... | user13468984 | <p>Not directly. You can tune weights in the scheduler but I don't think any those would help here so would need a custom scheduler extender webhook.</p>
| coderanger |
<p>I have an Kubernetes Cluster with a working Ingress config for one REST API. Now I want to add a port forward to my mqtt adapter to this config, but I have problems finding a way to add an TCP rule to the config. The Kubernetes docs only show a HTTP example. <a href="https://kubernetes.io/docs/concepts/services-netw... | JWo | <p>the Ingress system only handles HTTP traffic in general. A few Ingress Controllers support custom extensions for non-HTTP packet handling but it's different for each. <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="noreferrer">https://kubernetes.github.io/ingress-nginx... | coderanger |
<p>I'm projecting a token into a pod in order to use this token to authenticate into an external system. I do not fully trust the code that can potentially run into this pod, so I would like to use the token projection to perform the authentication and then remove the projected token so that the code that will run at a... | BPas | <p>No, as it says it uses a read only ramdisk so you can’t change things. I’m not 100% sure this is possible but you could try using an initContainer to copy the token to a r/w ramdisk volume and then skip mounting the token volume in the main container entirely.</p>
| coderanger |
<p>DockerFile</p>
<pre><code>FROM centos
RUN yum install java-1.8.0-openjdk-devel -y
RUN curl --silent --location http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo | tee /etc/yum.repos.d/jenkins.repo
RUN rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
RUN yum install jenkins --nogpgcheck -y
RUN yum in... | Ajinkya Khandave | <p>There isn't an init system inside a container so this isn't going to work. Likely the specific issue is that with plain Docker you are using <code>docker run -it</code> so there is a stdin, so <code>bash</code> starts in interactive mode and keeps running. In Kubernetes there is no input so bash exits immediately an... | coderanger |
<p>My source k8s cluster version is v1.11.5 and the dest k8s cluster version is v1.15.2 with in-place upgrade.</p>
<p>K8S Cluster Status.Three master nodes with k8s controll plane:</p>
<pre><code>NAME STATUS ROLES AGE VERSION
a1 Ready master 23h v1.11.5
a2 Ready master 23h v1.11.5
a3 ... | Miro | <p>Yes, you should generally do each version upgrade. Not only can there be intermediary upgrades that need to happen for things like CNI plugins, running Kubelet with more than one version of skew is not supported. So if you were going to do this, you would instead have to drain and stop every node, then do the upgrad... | coderanger |
<p>When kops is used to create a k8s cluster, a <code>/srv/kubernetes</code> folder gets created and distributed to all the nodes, populated with files automatically created by the provisioning process.
My question is whether it's possible for the cluster admin to add files to this volume so that such files can be ref... | Michael Martinez | <p>Use the <a href="https://godoc.org/k8s.io/kops/pkg/apis/kops#FileAssetSpec" rel="nofollow noreferrer"><code>fileAssets</code></a> key in your Cluster manifest:</p>
<pre><code>fileAssets:
- content: |
asdf
name: something
path: /srv/kubernetes/path/to/file
</code></pre>
| coderanger |
<blockquote>
<p><em>How to change the Docker <code>ENTRYPOINT</code> in a Kubernetes deployment, without changing also the Docker <code>CMD</code>?</em></p>
</blockquote>
<p>In the Pod I would do</p>
<pre><code>image: "alpine"
entrypoint: "/myentrypoint"
</code></pre>
<p>but this overwrites either <... | Kamafeather | <p>That's not a thing.</p>
<ul>
<li><code>ENTRYPOINT</code> (in Dockerfile) is equal to <code>command:</code> (in PodSpec)</li>
<li><code>CMD</code> (in Dockerfile) equals <code>args:</code> (in PodSpec)</li>
</ul>
<p>So just override <code>command</code> but not <code>args</code>.</p>
| coderanger |
<p>I'm reading a lot of documentation about <a href="https://github.com/kubernetes/sample-controller" rel="nofollow noreferrer">CRD Controller</a></p>
<p>I've implemented one with my business logic, and sometimes I got this race condition:</p>
<ul>
<li>I create a Custom Object, let's call it <code>Foo</code> with nam... | XciD | <p>Generally you only run one copy of a controller, or at least only one is active at any given time. As long as you were careful to write your code convergently then it shouldn't technically matter, but there really isn't much reason to run multiple.</p>
| coderanger |
<p>I have applications needs to give each pod a public ip and expose ports on this public ip.</p>
<p>I am trying not to use virtual machines.</p>
<p>matellb has similar feature. But, it binds a address to a service not pod. And, it wastes a lot of bandwidth.</p>
| Lod | <p>Technically this is up to your CNI plugin, however very few support this. Pods generally live in the internal cluster network and are exposed externally through either NodePort or LoadBalancer services, for example using MetalLB. Why do you think this "wastes bandwidth"? If you're concerned about internal ... | coderanger |
<p>I'm working on a personal project involving a browser-based code editor (think <a href="https://repl.it" rel="nofollow noreferrer">https://repl.it</a>). My plan:</p>
<p>1) Constantly stream the code being written to a remote docker volume on kubernetes.</p>
<p>2) Execute this code when the user presses "run".</p>
... | Jay K. | <ol>
<li>THIS IS A VERY BAD IDEA DO NOT DO IT</li>
<li>You would want to run each snippet in a new container for maximum isolation.</li>
</ol>
| coderanger |
<p>I've a application Java/Spring boot that is running in a Kubernetes pod, the logs is configure to stdout, fluentd get logs from default path:</p>
<pre><code><source>
@type tail
path /var/log/containers/*.log
pos_file /pos/containers.pos
time_key time
time_format %Y-%m-%dT%H:%M:%S.%NZ
tag kubernetes.*
f... | Pedro Henrique | <p>You need to: </p>
<ol>
<li>move that file onto an emptyDir volume (or hostPath I guess but use emptyDir) and then </li>
<li>run fluentd/bit as a sidecar which reads from that volume and </li>
<li>forwards to the rest of your fluentd setup.</li>
</ol>
| coderanger |
<p>When I deploy the new release of the Kubernetes app I got that error</p>
<pre><code>Error: secret "env" not found
</code></pre>
<p><a href="https://i.stack.imgur.com/7TbF4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7TbF4.png" alt="enter image description here" /></a></p>
<p>even I h... | Mina Fawzy | <p>You ran <code>kubeseal</code> against the wrong Kubernetes cluster or you tried to edit the name or namespace after encrypting without enabling those in the encryption mode. More likely the first.</p>
| coderanger |
<p>I want to run two commands in my cronjob.yaml one after each other. The first command runs a python-scipt and the second changes an environment variable in another pod. The commands added separately work.</p>
<p>This is what I'm trying right now (found the syntax in <a href="https://stackoverflow.com/q/33887194/112... | Florian | <p>You have nested double quotes, try something more like this:</p>
<pre><code>command:
- /bin/bash
- -c
- python3 recalc.py && kubectl set env deployment recommender --env="LAST_MANUAL_RESTART=$(date)" --namespace=default
</code></pre>
<p>i.e. without the outer double quotes.</p>
| coderanger |
<p>I am <a href="https://piotrminkowski.com/2021/02/18/blue-green-deployment-with-a-database-on-kubernetes/" rel="nofollow noreferrer">reading about blue green deployment with database changes on Kubernetes.</a> It explains very clearly and in detail how the process works:</p>
<ol>
<li>deploy new containers with the n... | Babyburger | <p>Even when doing blue-green for the application servers, you still have to follow normal rules of DB schema compatibility. All schema changes need to be backwards compatible for whatever you consider one full release cycle to be. Both services talk to the same DB during the switchover time but thanks to careful plann... | coderanger |
<p>Currently I have a Spring containers running in a Kubernetes cluster. I am going through Udacity's Spring web classes and find the Eureka server interesting.</p>
<p>Is there any benefit in using the Eureka server within the cluster?</p>
<p>any help will be appreciated.</p>
<p>Thank you</p>
| Ricardo Carballo | <p>This is mostly an option question but ... probably not? The core Service system does most of the same thing. But if you're specifically using Eureka's service metadata system then maybe?</p>
| coderanger |
<p>Declarative definitions for resources in a kubernetes cluster such as <code>Deployments</code>, <code>Pods</code>, <code>Services</code> etc.. What are they referred to as in the Kubernetes eco-system? </p>
<p>Possibilities i can think of: </p>
<ul>
<li>Specifications (specs)</li>
<li>Objects</li>
<li>Object confi... | AndrewMcLagan | <p>The YAML form is generally a manifest. In a Helm chart they are templates for manifests (or more often just "templates"). When you send them to the API you parse the manifest and it becomes an API object. Most types/kinds (you can use either term) have a sub-struct called <code>spec</code> (eg. <code>DeploymentSpec<... | coderanger |
<p>I am deploying Metrics Server <a href="https://github.com/kubernetes-sigs/metrics-server" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/metrics-server</a>
and notice there is one Requirements in README:
<code>Metrics Server must be reachable from kube-apiserver by container IP address (or node IP if h... | wartih | <p>You do it by doing it, there's no specific answer. If you run kube-apiserver within the cluster (e.g. as a static pod) then this is probably already the case. Otherwise you have to arrange for this to work in whatever networking layout you have.</p>
| coderanger |
<p>I know a scenario of kubernetes headless service <strong>with</strong> selector.
But what’s the usage scenario of kubernetes headless service <strong>without</strong> selector?</p>
| Cain | <p>Aliasing external services into the cluster DNS.</p>
| coderanger |
<p>If I move a relevant config file and run <code>kubectl proxy</code> it will allow me to access the Kubernetes dashboard through this URL:</p>
<pre><code>http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
</code></pre>
<p>However if I try to access the node directly, wit... | Liz Av | <p>You would want to set up a Service (either NodePort or LoadBalancer) for the dashboard pod(s) to expose it to the outside world (well, outside from the PoV of the cluster, which is still an internal network for you).</p>
| coderanger |
<p>Is there a way to configure the minikube cluster to automatically pull "all" the latest docker images from GCR for all the pods in the cluster and restarted those pods once you start your minikube cluster?</p>
| efgdh | <p>You can use the <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#alwayspullimages" rel="nofollow noreferrer">AlwaysPullImages admission controller</a> which forces the <code>imagePullPolicy</code> to <code>Always</code> which will repull images on pod restart. And then just res... | coderanger |
<p>Assuming that the pods have exposed port 80.</p>
<p>How to send a requets to all the running pods, rather than 1.</p>
<p>Since the load balancer would route the traffic to only 1 pod.
(Note : using HAproxy load balancer here, FYI)</p>
| shrw | <p>There is no particular way, <code>kubectl exec</code> only works one container at a time so you will need to call it into a loop if you want to use it on many.</p>
| coderanger |
<pre><code>apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: testingHPA
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
kind: Deployment
name: my_app
minReplicas: 3
maxReplicas: 5
targetCPUUtilizationPercentage: 85
</code></pre>
<p>Above is the normal hpa.yaml structure, is it possi... | Museb Momin | <p>A single Pod is only ever one Pod. It does not have any mechanism for horizontal scaling because it is that mechanism for everything else.</p>
| coderanger |
<p>GKE uses Calico for networking by default. Is there an option to use some other CNI plugin ?</p>
| Manohar | <p>No, GKE does not offer such option, you have to use the provided Calico.</p>
| coderanger |
<p>I am having rough time trying to create a docker image that exposes <a href="https://developers.cloudflare.com/argo-tunnel/downloads/" rel="nofollow noreferrer">Cloudflare's Tunnel</a> executable for linux. Thus far I got to this stage with my docker image for it (image comes from <a href="https://github.com/jakejar... | Ilja | <p>In the dockerfile it is <code>./cloudflared</code>, so that would be:</p>
<pre><code> command:
- ./cloudflared
- tunnel
- --url=http://localhost:8080
- --hostname=my-website
- --origincert=/etc/cloudflared/cert.pem
- --no-autoupdate
</code></pre>
<p>(also there ... | coderanger |
<p>Helm Chart has the concept of Version and appVersion.</p>
<p>We are using the Version to document that a content of the Helm Chart changed or not (for ex, a template, deployment.yaml has new Envrionment value or a configmap.yaml has an additional) value, for these scenarios Version number should increase. We are usi... | posthumecaver | <p>appVersion doesn't work this way, it isn't involved in dependency management. It's just for humans to know "this chart packages version 1.2 of Foobar", though these days many charts support multiple versions of the underlying thing so it usually is just set to the default one, if it's set at all.</p>
| coderanger |
<p>I have a service deployed in Kubernetes and I am trying to optimize the <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-requests-and-limits-of-pod-and-container" rel="nofollow noreferrer">requested cpu resources</a>.</p>
<p>For now, I have deployed 10 instances and s... | Carsten | <p>Basically come up with a number that is your lower acceptable bound for how much the process runs. Setting a request of <code>100m</code> means that you are okay with a lower limit of your process running 0.1 seconds for every 1 second of wall time (roughly). Normally that should be some kind of average utilization,... | coderanger |
<p>An existing Pod(<code>P</code>) is running 3 containers for API.</p>
<p>To scale Pod <code>P</code> horizonatally,</p>
<p>Is it possible to add one(or n) more container to an existing Pod(running 3 containers)?</p>
<p>or</p>
<p>Is Pod replica set concept supposed to be applied for this scenario(to scale horizontally... | overexchange | <p>No, you don't use multi-container Pods for scaling. Pods with multiple containers are for cases where you need multiple daemons running together (on the same hardware) for a single "instance". That's pretty rare for new users so you almost certainly want 3 replicas of a Pod with one container.</p>
| coderanger |
<p>By default most people seem to avoid running anything on the masters. These nodes are less likely to be re-provisioned or moved around than the rest of the cluster. It would make them a perfect fit for ingress controllers.</p>
<p>Is there any security and/or management implications/risks in using the masters as ingr... | ITChap | <p>As always, the risk is that if your Ingress Controller eats all your IOPS (or memory or CPU but in this case it would probably be IOPS) then your control plane can go unavailable, leaving you fewer ways to fix the problem.</p>
| coderanger |
<p>I have a problem: I use eviction policies (evict-soft and evict-hard) and when my pods are being evicted out beacause of resource lack on one node, pod dies and starts on another node, so, that during this time service is down. What can I do to make pod first start on another node before being killed on the first?</... | Stas Fanin | <p>Run two of them and use a pod disruption budget so it won’t do a soft evict of both at the same time (or use affinity settings so they run on different nodes, or both).</p>
| coderanger |
<p>I am running a very basic blogging app using Flask. Its runs fine when I run it using Docker i.e. <code>docker run -it -d -p 5000:5000 app</code>.</p>
<pre class="lang-py prettyprint-override"><code> * Serving Flask app 'app' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not ... | Tanuj Dutta | <p>The <code>port:</code> on a Service only controls the internal port, the one that's part of the ClusterIP service. By default the node port is randomly assigned from the available range. This is because while the <code>port</code> value only has to be unique within the Service itself (couldn't have the same port go ... | coderanger |
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: portal-ingress-home
namespace: portal
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
#nginx.ingress.kubernetes.io/rewrite-target: /$2
ingress.kubernetes.io/whitelist-source-ra... | Naren Karanam | <p>You put the two bits under rules: in two different list items. Remove the second -.</p>
| coderanger |
<p>I would like to understand one thing on OpenId Connect and GKE to better manage IAM and RBAC.I cannot find any info on this:</p>
<ol>
<li>I'm Project Owner in my GCP project</li>
<li>After applying
<code>gcloud container clusters get-credentials $CLUSTER --zone $ZONE</code>
my <em>.kube.conf</em> is populated.</li>
... | Maciek Leks | <p>I don't think they have ever said publicly. Kubernetes does natively support group claims in OIDC tokens however as you said, there are none in Google tokens so we know it isn't using that. Given the deep integration between GCP IAM and GKE it's generally assumed the Google internal fork has some custom admission co... | coderanger |
<p>I am new to kubernetes. Basically,I am trying to add windows node to cluster(contains linux node). My host machine is linux. For now, i am trying to add only 1 windows node but in future it should work for multiple windows nodes). <strong>while joining windows node to the kubernetes cluster using kubeadm</strong> it... | anuja tol | <p>You can download all the various binaries from links in the Changelog for each release. <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.13.md#downloads-for-v1131" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.13.md#downloads-for-v1131</a> is the ... | coderanger |
<p>I currently have a single-node Kubernetes instance running on a VM. The disk attached to this VM is 100GB, but 'df -h' shows that the / partition only has 88GB available (other stuff is used for OS overhead etc...)</p>
<p>I have a kubernetes manifest that creates a 100GB local Persistent Volume.
I also have a pod cr... | Ian Campbell | <p>The local provisioner does no size checks, nor is the size enforced anyway. The final "volume" is just a bind mount like with hostPath. The main reason <code>local</code> PVs exist is because hostPath isn't something the scheduler understands so in a multi-node scenario it won't restrict topology.</p>
| coderanger |
<p>Here is my use case:
We have a customer, where each of their services has to be available on dedicated subdomain. Naming convention should be <code>service-name.customerdomain.com</code>, where <code>service-name</code> is the deployed service and <code>customerdomain.com</code> is the customer domain. When a new se... | Angel Todorov | <p>You would generally do this by having a template for the Ingress resource as a part of your base application chart. You can have more than one Ingress object and they will all get muxed at run time to build the routing table for your controller.</p>
| coderanger |
<p>I have a ansible script to deploy my microservices to the customer cluster... I have a lot of k8s deployment files, one for each microservice. It's a good idea to deploy a PVCs and PVs to the customer cluster?</p>
| Clarencio | <p>The feature does what it says in docs. If that is a good idea depends entirely on your needs and how you use it.</p>
| coderanger |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.