Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I have a Kube manifest that need be applied to a couple of kubernetes clusters with different resource settings. For that I need to change resource section of this file on the fly. Here's its contents:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: abc-api labels: app: abc-api spec: ports: ...
SS-eth0
<p>Use the <code>-d</code> CLI option. See <a href="https://mikefarah.gitbook.io/yq/commands/write-update#multiple-documents" rel="nofollow noreferrer">https://mikefarah.gitbook.io/yq/commands/write-update#multiple-documents</a> for more details.</p> <p>Also Kubernetes has its own thing for in <code>kubectl patch</cod...
coderanger
<p>I have been trying to install Python in minikube of the below version</p> <pre><code>Linux minikube 4.19.107 #1 SMP Thu May 28 15:07:17 PDT 2020 x86_64 GNU/Linux </code></pre> <p>However i havent been able to find out a installation package that availabe in this O.S in the minikube.</p> <p>My objective is to inst...
trial999
<p>Minikube is a dedicated application appliance. It is only for running Kubernetes. You would not install things on it via Ansible. You can use Ansible to automate Kubernetes, but you don't change anything on the host itself, that's just talking to the API.</p>
coderanger
<p>I have a simple bash script to execute at postStart, but i get an error which is not informative at all:</p> <p><code>Exec lifecycle hook ([/bin/bash -c sleep 30;/xcom/scripts/sidecar_postStart.sh]) for Container "perfcibuddy" in Pod "xcomapp-597fb859c5-6r4g2_ns(412852d1-5eea-11ea-b641-0a31ddb9a71e)" failed - error...
inspiral
<p>Curl exit code 7 is generally “unable to connect” so your IP is probably wrong or the kiam agent is not set up correctly.</p>
coderanger
<p>After making 2 replicas of PostgreSQL StatefulSet pods in k8s, are the the same database? If they do, why I created DB and user in one pod, and can not find the value in the other. If they not, is there no point of creating replicas?</p>
John Wu
<p>There isn't one simple answer here, it depends on how you configured things. Postgres doesn't support multiple instances sharing the same underlying volume without massive corruption so if you did set things up that way, it's definitely a mistake. More common would be to use the volumeClaimTemplate system so each po...
coderanger
<p>I am trying to create k8s cluster. Is it necessary to establish ssh connection between hosts ?</p> <p>If so, should we make them passwordless ssh enabled ?</p>
shreyas.k
<p>Kubernetes does not use SSH that I know of. It's possible your deployer tool could require it, but I don't know of any that works that way. It's generally recommended you have some process for logging in to the underlying machines in case you need to debug very low-level failures, but this is usually very rare. For ...
coderanger
<p>Currently I tried to fetch already rotated logs within the node using --since-time parameter. Can anybody suggest what is the command/mechanism to fetch already rotated logs within kubernetes architecture using commands</p>
Chandru Appaji
<p>You can't. Kubernetes does not store logs for you, it's just providing an API to access what's on disk. For long term storage look at things like Loki, ElasticSearch, Splunk, SumoLogic, etc etc.</p>
coderanger
<p>So I am looking to set up cert-manager on GKE using google clouddns. It seems like a lot of the older questions on SO that have been asked are using http01 instead of dns01. I want to make sure everything is correct so I don't get rate limited.</p> <p>here is my <code>issuer.yaml</code></p> <pre><code>apiVersion: ce...
danielsmith1789
<p>I answered you on Slack already. And you would change the name by changing the value in the <code>dnsNames</code> section of the Certificate or the <code>spec.tls.*.hosts</code> if using ingress-shim, you just include the wildcard name exactly as you showed it.</p>
coderanger
<p>I have a grafana dashboard running in a kubernetes cluster which is configured. yaml via a ConfigMap to use Azure AD to restrict access.</p> <p>I would now like to parameterize the grafana.ini in that configmap so i can use different subdomains in my release pipeline like this:</p> <pre><code>kind: ConfigMap data:...
myaccforcoding
<p>No, there is no string templating in YAML. The examples you are looking at are using Helm to process the YAML. You can do that, but you need actually use Helm for that.</p>
coderanger
<p>Running k8s 1.6 and in api-server, below is configured:</p> <p><code>--enable-admission-plugins SecurityContextDeny</code></p> <p>Is it possible to disable it for one pod or is there an exclusion list or override for a deployment.</p> <p>I need to run a pod with:</p> <pre><code> securityContext: run...
tomarv2
<p>No, this was a very limited system which is why PodSecurityPolicies were added in 1.8 to be a far more flexible version of the same idea.</p>
coderanger
<p>Let's say I have such architecture based on Java Spring Boot + Kubernetes:</p> <ul> <li>N pods with similar purpose (lets say: order-executors) - GROUP of pods</li> <li>other pods with other business implementation</li> </ul> <p>I want to create solution where:</p> <ol> <li>One (central) pod can communicate with all...
cackoa
<p>You can use a &quot;headless Service&quot;, one with <code>clusterIP: none</code>. The result of that is when you do an DNS lookup for the normal service DNS name, instead of a single A result with the magic proxy mesh IP, you'll get separate A responses for every pod that matches the selector and is ready (i.e. the...
coderanger
<p>In Docker Compose, when I mount an empty host volume to a location that already has data in the container, than this data is copied to the empty host volume on the first run.</p> <p>E.g. if I use the nginx image and mount my empty host volume <code>nginx-config</code> to <code>/etc/nginx</code> in the nginx contain...
stefan.at.kotlin
<p>You need to use an initContainer, mount the volume on a different path and do the copy explicitly.</p>
coderanger
<p>I am trying to get pvc and it's volume and in which pod it is mounted and the node it is hosted.</p> <p>There are separate commands are there like below</p> <p>To get PVC and it's volume</p> <pre><code>kubectl get pvc &lt;pvcname&gt; </code></pre> <p>then from PVC i am getting where it is mounted </p> <pre><cod...
Samselvaprabu
<p>A PVC can be used on any number of pods so this model does not match how Kubernetes works. You could of course write your own script that ignores that possibility.</p>
coderanger
<p>I have Kubernetes app with two namespaces: project-production and project-development. It contains of React frontend, Express backend and two databases. This is one of my ingress files. The second one is almost the same.</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress namesp...
Robert Jankowski
<p>Your regex is wrong, you want <code>path: &quot;/development/(api/.*)&quot;</code> for the first one.</p>
coderanger
<p>I know k8s does not support swap by default.</p> <p>But since I have a rather static deployment of pods in k8s (3 nodes, each with a solr + zookeeper pod), so I decided to set up 2G swap on all my worker nodes anyway and allow the use of swap by starting <strong>kubelet</strong> with --<code>fail-swap-on=false</cod...
John the Traveler
<p>And now you know why the kubelet literally refuses to start by default if there swap active. This is not exposed anywhere in CRI and won’t be.</p>
coderanger
<p>while evaluating the network security using nmap on Kubernetes server, we noticed a warning as below</p> <p>~]# nmap xxx.xx.xx.xx -p 6443 -sVC --script=ssl*</p> <pre><code>. . . ssl-enum-ciphers: | TLSv1.2: | ciphers: | TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048) - A | TLS_RSA_WITH_AES_256_GCM_SH...
Thribhuvan HRz
<p>You can use the <code>--cipher-suites</code> CLI option to etcd. See <a href="https://etcd.io/docs/v3.4/op-guide/security/" rel="nofollow noreferrer">https://etcd.io/docs/v3.4/op-guide/security/</a> for a summary of all their TLS config options. The default ciphers is based on the version of Go used to compile it.</...
coderanger
<p>I want to create hundreds of Jobs in kubernetes by its api. Is there any way to do this? I have to create them one by one now. Thanks.</p>
kyleqian
<p>I mean you have to make 1 API call per object you want to create, but you can certainly write a script for that. Kubernetes does not offer a "bulk create" API endpoint if that's what you are asking, or really much of anything for bulk operations. It's a boring old REST API :)</p>
coderanger
<p>Is there a way to fire alerts when some run commands over pods like delete, exec, cp? and alerts message should include in which namespace, which pod, which command, and who run these commands. thanks.</p>
Net Sim
<p>This isn’t what Prometheus does, it’s about metrics. For most api operations, you can use the audit log to check if they happen and why, but exec requests are complicated since they are opaque to the apiserver. The only tool I know of which can decode and log exec requests is Sysdig Trace and it isn’t supported on a...
coderanger
<p>We have a scenario in our deployment process where an activity needs to be performed only once before the actual application containers are live and ready. This activity can not be placed as an init container because init container will be executed with every replica of application container but in this case, this a...
DD2607
<p>Helm has post-deploy hooks for this kind of thing, though they can be a little rough to work with. We use a custom operator for this so we can have an explicit state machine on our deployments (init -> migrate -> deploy -> test -> ready). But that's a lot of work to write.</p>
coderanger
<p>I am fairly new to kubernetes. Wanted to know if a program running inside a pod can access the namespace in which the pod is running.</p> <p>Let me explain my usecase. There are two pods in my application's namespace. One pod has to be statefulset and must have atleast 3 replicas. Other pod (say POD-A) can be just a...
aniztar
<p><a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api</a> has an example of this and more.</p> <p...
coderanger
<blockquote> <p>How to use <code>kubectl</code> with system:anonymous account without using impersonation with <code>--as=system:anonymous</code>?</p> </blockquote> <p>How can I send requests with <code>kubectl</code> using the <code>system:anonymous</code> account?</p> <p>I've tried using the <code>--as=</code> op...
Shuzheng
<p>Set up a new configuration context that doesn't specify any authentication information and then use <code>--context whatever</code>. Or just use curl, that's honestly fine too since I'm really hoping this is just to confirm some security settings or similar. If you run kubectl with <code>-v 10000000</code> (or some ...
coderanger
<p>I am new to Kubernetes and have an application deployed via GKE on mydomain.com and now want to add another service which should be available on api.mydomain.com without adding a new expensive load balancer. What should the new ingress file for api.mydomain look like? I read the documentation, but cannot figure out ...
needRhelp
<p>You would generally use a different Ingress Controller than the default ingress-gce. ingress-nginx is very common and easy to get started with, but there are many options so I recommend you research them and pick which one matches your use case best.</p>
coderanger
<p>Is there a way to limit the number os replicas per node in Kubernetes? I found some info about Spreading Constraints but didn't understand if this is possible.</p> <p>Example: I want to have only 1 replica per node on the cluster.</p> <p>I know that K8S automatically balances the replicas spreading across the node...
Hugo Marques
<p>The scheduler has many ways to just about everything but in the particular case of 1 replica per node you can use a <code>required</code> mode anti-affinity.</p>
coderanger
<p>My approach is:</p> <pre class="lang-golang prettyprint-override"><code>func restartPod(meta metav1.ObjectMeta, kubeClient kubernetes.Interface) error { err := kubeClient.CoreV1().Pods(meta.Namespace).Delete(meta.Name, deleteInForeground()) if err != nil { return err } //time.Sleep(2 * time...
Mohammad Fahim Abrar
<p>In the metadata of every object there is UUID in a field called <code>uid</code>. You can compare and wait until the pod is Ready <em>and</em> has a different UUID. See <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" rel="nofollow noreferrer">https://kubernetes.io/docs/concept...
coderanger
<p>How could I clear existing log of a specific pod?</p> <p>So that I can get all logs since that time with <code>kubectl logs</code> next time.</p> <p>Thanks!</p>
Wei Huang
<p>You can't, the log rotation is generally implemented in Docker (or sometimes via logrotate on the node host). However you can use <code>kubectl logs --since-time</code> and fill in the time of your last get. If you're trying to build something to iteratively process logs automatically, probably use Fluentd to load t...
coderanger
<p>I am writing python script for kubernetes using python client.</p> <p>I want to count or calculate the POD <code>Ready</code> state time.</p> <p>In 30 Second pod Ready or similar.</p> <p>Right now i am planning to use</p> <pre><code>'status': { 'conditions': [ { 'last_probe_time': None, ...
chagan
<p>There isn't something specific, you already have the data you need. Just go through the list and find the two last_transition_times for Ready and Initialized and then subtract.</p>
coderanger
<p>Im getting this error</p> <pre><code>Error creating: pods "node-exporter" is forbidden: unable to validate against any pod security policy: [spec.secur ityContext.hostNetwork: Invalid value: true: Host network is not allowed to be used spec.securityContext.hostPID: Invalid value: true: Host PID is not allowed to be...
Soju George
<p>node-exporter needs direct access to the node-level network namespace to be able to gather statistics on this. You have a default security policy that blocks this access. You'll need to make a new policy which allows it, and assign that policy to node-exporter.</p>
coderanger
<p>Is it possible for a kubernetes operator to watch files in a Persistent Volume Claim(PVC)? I am creating a k8s Golang operator to deploy and manage my application. The application pods will have a mounted volume. I need to be able to stop and start a pod if configuration files are changed on the PVC. Is this possibl...
F. K.
<p>As mentioned in the comments, you would need a ReadWriteMany-capable volume provider but then sure. This isn't how most operators work so you'll have to manage the file watch yourself but there's some good low-level inotify bindings available and I think Viper can reload on the fly itself. Combine that with a channe...
coderanger
<p>when I run <code>kubectl get pods</code> it shows pod existing and ready, but when run <code>kubectl port-forward</code> I get <code>pod not foud</code> error. what's going on here?</p> <pre><code>(base):~ zwang$ k get pods -n delivery NAME READY STATUS RESTARTS AGE screensho...
JamesWang
<p>You need to specify the namespace on the <code>port-forward</code> command too. <code>kubectl port-forward -n delivery screenshot-history-7f76489574-wntkf 8000:8000</code></p>
coderanger
<p>I was handed a kubernetes cluster to manage. But in the same node, I can see running docker containers (via docker ps) that I could not able to find/relate in the pods/deployments (via kubectl get pods/deployments).</p> <p>I have tried kubectl describe and docker inspect but could not pick out any differentiating pa...
himekami
<p>There will be many. At a minimum you'll see all the pod sandbox pause containers which are normally not visible. Plus possibly anything you run directly such as the control plane if not using static pods.</p>
coderanger
<p>I have scenario; where I want to redirect to different services at back end based on a query parameter value. I have gone through documents but couldn't find any help there.</p> <p>For example:</p> <pre><code>if Path=/example.com/?color=red ---&gt; forward request to service--&gt; RED-COLOR-SERVICE:8080 if Path=/e...
Jaraws
<p>In general no, the Ingress spec only offers routing on hostname and path. Check the annotation features offered by your specific controller, but I don’t know of any for this off the top of my head.</p>
coderanger
<p>I have configured NGINX as a reverse proxy with web sockets enabled for a backend web application with multiple replicas. The request from NGINX does a <code>proxy_pass</code> to a Kubernetes service which in turn load balances the request to the endpoints mapped to the service. I need to ensure that the request fro...
Dinoop Thomas
<p>This is not an option with Nginx. Or rather it's not an option with anything in userspace like this without a lot of very fancy network manipulation. You'll need to find another option, usually an app-specific proxy rules in the outermost HTTP proxy layer.</p>
coderanger
<p>Prometheus deployed on kubernetes using prometheus operator is eating too much memory and it is at present at ~12G. I see <code>/prometheus/wal</code> directory is at ~12G. I have removed all <code>*.tmp</code> files but that couldn't help. Unable to figure out the solution for this problem. Any suggestions ??</p>
Yogesh Jilhawar
<p>Reduce your retention time or reduce your number of time series.</p>
coderanger
<p>I built a promethues for my kubernetes, and it works well now. It can get node and container/pod cpu, memory data, but I don't know how to get the kubernetes CPU Usage in promethues. Because in my application, if pod restart, deployment will not get data before.</p>
edselwang
<p>A deployment is only an abstraction within the Kubernetes control plane, the things actually using CPU will all be pods. So you can use something like this <code>container_cpu_usage_seconds_total{namespace="mynamespace", pod_name=~"mydeployment-.*"}</code>.</p>
coderanger
<p>So I was following along this tutorial (<a href="https://www.youtube.com/watch?v=KBTXBUVNF2I" rel="nofollow noreferrer">https://www.youtube.com/watch?v=KBTXBUVNF2I</a>) and after setting up the reconciler, when I execute "make run", I am getting the following error:</p> <pre><code>/Users/sourav/go/bin/controller-ge...
DarthSett
<p>That is using a relatively new feature, make sure your kubernetes is very up to date and has server side apply enabled.</p>
coderanger
<p>In <strong>Minikube</strong>, created many <em>Persistent Volumes</em> and its <em>claims</em> as a practice? Do they reserve disk space on local machine? </p> <p>Checked disk usage </p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: pv spec: capacity: storage: 100Gi accessModes: ...
engineerbaz
<p>No, it's just a local folder. The size value is ignored.</p>
coderanger
<p>I've faced a strange behaviour with K8s pods running in AWS EKS cluster (version 1.14). The services are deployed via Helm 3 charts. The case is that pod receives more environment variables than expected.</p> <p>The pod specification says that variables should be populated from a config map.</p> <pre class="lang-y...
sviklim
<p>If you mean the <code>_PORT</code> stuff, that's for compatibility with the old Docker Container Links system. All services in the namespace get automatically set up that way to make it easier to move things from older Docker-based systems.</p>
coderanger
<p>Currently in my <code>kubernetes-nodes</code> job in Prometheus, The endpoint <code>/api/v1/nodes/gk3-&lt;cluster name&gt;-default-pool-&lt;something arbitrary&gt;/proxy/metrics</code> is being scraped</p> <p>But the thing is I'm getting a 403 error which says <code>GKEAutopilot authz: cluster scoped resource &quot;...
MatsuzakaSteven
<p>While the Autopilot docs don't mention the node proxy API specifically, this is in the limitations section:</p> <blockquote> <p>Most external monitoring tools require access that is restricted. Solutions from several Google Cloud partners are available for use on Autopilot, however not all are supported, and custom ...
coderanger
<p>Was unable to find any K8s API which can query all volumeIDs related to specific AWS account region wide. My primary intention is to clean all stale volumes. For doing this, I'm collecting volume information from AWS which are in Available state using below shell script. </p> <pre><code> for regions in $(aws ec2 d...
jagatjyoti
<p>Two answers: first you can <code>kubectl get pvc —all-namespaces</code>. Second, the PVs themselves are not in namespaces so <code>kubectl get pv</code>.</p>
coderanger
<p>I am unable to configure my stateful application to be resilient to kubernetes worker failure (the one where my application pod exists)</p> <pre><code>$ kk get pod -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES ex...
marek
<p>It will eventually release the volume, usually limiting factor is the network storage system being slow to detect the volume is unmounted. But you are correct that it's a limitation. The usual fix would be to use a multi-mount capable volume type instead, such as NFS or CephFS.</p>
coderanger
<p>I have a case where we use custom Authorization in Kubernetes via a webhook. Once authorized is there any way the user id could propagated on to the metadata or labels or env of a resource in Kubernetes.</p> <p>Eg - When a user creates a pod, the userid should be available on the request object.</p> <p>The only plac...
saipavan
<p>You could use a mutating webhook to inject it. The webhook admission request struct has the user identity data and you can patch the incoming object in the admission response. There is nothing off the shelf for that though, you would have to build it yourself.</p>
coderanger
<p>I have 4 services running as 4 different deployments/pods in my kubernetes cluster, name them, <strong>A</strong>, <strong>B</strong>, <strong>C</strong> and <strong>D</strong>. <strong>D</strong> is providing a common service which <strong>A</strong> and <strong>B</strong> are using via rest API calls, but it beha...
Ming Zhu
<p>What you have is correct, Service account tokens are the way to do, other systems generally build on top of them. Most service mesh tools do offer simpler systems for identity, though for something this small it would likely be overkill.</p>
coderanger
<p>I'm currently following a course on udemy called <code>Microservices with Node JS and React</code> from Stephen Grider, and I've come to a part where I need to run a command:</p> <pre><code>kubectl expose deployment ingress-nginx-controller --target-port=80 --type=NodePort -n kube-system </code></pre> <p>And this co...
Skyler Brandt
<p>The first time you ran it (with the correct namespace) it worked and you probably didn't notice. Your tutorial seems to be fairly out of date, you might want to find a newer one. If you want to remove the previously created service and do it again, <code>kubectl delete service -n ingress-nginx ingress-nginx-controll...
coderanger
<p>The Openshift documentation is absolutely abysmal. I can't find direct documentation for any of the objects that are available.</p> <p>I did find a section in the Kubernetes docs that seems to describe the ability to do something like this... </p> <p><a href="https://kubernetes.io/blog/2018/07/09/ipvs-based-in-clu...
Allenph
<p>Answered on Slack, but short version it is not an option for this user given their situation.</p> <p>For others, IPVS does support this but it is enabled and configured at a global level. A better option is usually a userspace proxy, often via the Ingress system.</p>
coderanger
<p>We have a docker image that is processing some files on a samba share.</p> <p>For this we created a cifs share which is mounted to /mnt/dfs and files can be accessed in the container with:</p> <pre><code>docker run -v /mnt/dfs/project1:/workspace image </code></pre> <p>Now what I was aked to do is get the container ...
Serve Laurijssen
<p>No, that field has no effect on the FlexVol plugin you linked. It doesn't even bother parsing out the size you pass in :)</p>
coderanger
<p>Following <a href="https://stackoverflow.com/questions/31693529/how-to-share-storage-between-kubernetes-pods">this post</a> and <a href="https://stackoverflow.com/questions/58683486/share-storage-between-worker-nodes-in-kubernetes">this</a>, here's my situation:<br /> Users upload images to my backend, setup like so...
mrj
<p>Third option: don't move the file data through your app at all. Have the user upload it directly to object storage. This usually means making an API which returns a pre-signed upload URL that's valid for a few minutes, user uploads the file, then makes another call to let you know the upload is finished. Then your a...
coderanger
<p>I am seeing a continuous 8 to 15% CPU usage on Rancher related processes while there is not a single cluster being managed by it. Nor is any user interacting with. What explains this high CPU usage when idle? Also, there are several "rancher-agent" containers perpetually running and restarting. Which does not look r...
Dojo
<p>I'm not sure I would call 15% "high", but Kubernetes has a lot of ongoing stuff even if it looks like the cluster is entirely quiet. Stuff like processing node heartbeats, etcd election traffic, controllers with time-based conditions which have to be processed. K3s probably streamlines that a bit, but 0% CPU usage i...
coderanger
<p>I'm using docker for windows on my local laptop, and I'm trying to mimic a dev installation of kubernetes by using the &quot;run kubernetes' setting on the same laptop. One thing that's awkward is the docker registry. I have a docker registry container running in-cluster that I can push to no problem from the lapt...
Eddie Parker
<p>You would use the internal cluster DNS, as managed by the Service object you probably created for the registry. All Services are available inside the cluster via <code>$name.$namespace.svc.cluster.local</code> (technically <code>cluster.local</code> is the cluster domain however this is the default and most common v...
coderanger
<p>I am trying to install <a href="https://www.weave.works/blog/install-fluxctl-and-manage-your-deployments-easily" rel="nofollow noreferrer">fluxctl</a> on my WSL (Ubuntu 18.04). I saw the official recommendation to install on Linux is through <a href="https://snapcraft.io/fluxctl" rel="nofollow noreferrer">snapcraft<...
Segmented
<p>You could check if someone had made a PPA but it seems unlikely. Also FWIW they publish Windows binaries too, right next to the Linux ones.</p>
coderanger
<p>I've got a Kubernetes cluster with nginx ingress setup for public endpoints. That works great, but I have one service that I don't want to expose to the public, but I do want to expose to people who have vpc access via vpn. The people who will need to access this route will not have kubectl setup, so they can't use ...
ZECTBynmo
<p>It depends a lot on your Ingress Controller and cloud host, but roughly speaking you would probably set up a second copy of your controller using a internal load balancer service rather than a public LB and then set that service and/or ingress to only allow from the IP of the VPN pods.</p>
coderanger
<p>My Docker container running in a <code>minikube</code> pod has configured a directory mounted from the host's <strong>non-empty</strong> <code>/home/my_username/useful/dir</code>. <code>kubectl</code> shows what I expect:</p> <pre><code>$ kubectl get --namespace=my_namespace pods/my-pod -o json | jq '.spec.volumes[3...
Konstantin Shemyak
<p>Issue solved in comments, the driver was running dockerd inside a container itself so it didn't have a global filesystem view. Solved via <code>minikube mount</code>.</p>
coderanger
<p>There is a Kubernetes cluster that I am not really familiar with. I need to set up backups with Velero. It is possible that velero has been installed on the cluster by someone else. How do I make sure it has or has not been previously installed before I install it?</p>
BanzaiTokyo
<pre><code>kubectl get pods --all-namespaces | grep velero </code></pre> <p>That’s an easy place to start at least.</p>
coderanger
<p>I applied my PVC yaml file to my GKE cluster and checked it's state. It says the follwing for the yaml:</p> <pre><code>apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"anno...
xetra11
<p>GKE includes default support for GCP disk PV provisioning, however those implement ReadWriteOnce and ReadOnlyMany modes. I do not think GKE includes a provisioner for ReadWriteMany by default.</p> <p>EDIT: While it's not set up by default (because it requires further configuration) <a href="https://stackoverflow.co...
coderanger
<p>I have a <code>nginx conf</code> like below</p> <pre><code>map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80 default_server; access_log off; return 200 'Hello, World! - nginx\n'; } server { listen 80; server_name ~^(dev-)?(?&lt;app&gt;[^.]+)\.mysite\.com$;...
ke ke
<p>No, you would make a separate Ingress object for each (or one huge one, but that's less common). Usually this is semi-automated through either Helm charts or custom controllers.</p>
coderanger
<p>I've setup a small Kubernetes cluster at home using 4 RPIs. Now I'm at the step where I want to try and deploy some stuff to it but it's not working.</p> <p>I've created a small Flask application for testing purposes:</p> <pre><code>from flask import Flask app = Flask(__name__) @app.route("/") def test(): retu...
Gurkang
<p>RaspberryPis use ARM CPUs. Your container images are built for x86_64. These are not compatible. You'll need to specifically build your images for ARM. There are many ways to do that, Docker's official tool is <code>buildx</code> I think. Check out <a href="https://www.docker.com/blog/multi-arch-images/" rel="nofoll...
coderanger
<p>queries which will allow us to track kubeevents and get notified if there are any issues with the pods being scheduled or killed..</p>
Vijay
<p>YAML is not a scripting language, it is a data markup language like JSON or XML. So no, but perhaps you meant to ask something else?</p>
coderanger
<p>I have multiple nodes, which are lying mostly idle, but getting an error while scheduling pods/services saying &quot;Insufficient CPU&quot;</p> <p>Node usage output :-</p> <pre><code>top - 17:59:45 up 17 days, 2:52, 1 user, load average: 5.61, 7.85, 8.58 Tasks: 2030 total, 3 running, 1771 sleeping, 0 stopped,...
hsc
<p>You cannot overcommit on requests, as those form the minimum required resources for a given pod to run. You can overcommit on limits, as you can see by your <code>192%</code> there.</p>
coderanger
<p>I am trying to get the CPU usage from the <code>/apis/events.k8s.io/v1beta1</code> endpoint in the kubernetes internal api. </p> <p>I run the following command</p> <p><code>kubectl proxy --port=8080</code></p> <p>Then load the url <a href="http://localhost:8080/apis/metrics.k8s.io/v1beta1/pods" rel="nofollow nor...
leemicw
<p><code>u</code> is a simplification of the lowercase Greek mu (μ) which means 10^-6, aka "micro-cpus". The unit is always the same, it's in terms of CPU cores. Metrics-server tries to report in nano-cpus for maximum accuracy, but if the number won't fit in an int64, it will change the scaling factor until it fits.</p...
coderanger
<p>I want to create a <code>serviceaccount</code> in Kubernetes with no permissions.</p> <p>However, creating a new <code>serviceaccount</code> as follows results in a privileged <code>serviceaccount</code>, <code>sa</code>, that is able to e.g. retrieve pod information:</p> <pre><code>kubectl create serviceaccount s...
Shuzheng
<p>DfM Kubernetes injects a ClusterRoleBinding called docker-for-desktop-binding which does indeed give all perms to everything.</p>
coderanger
<p>I have a dockerfile where I am trying to copy everything in Github to dockerfile and build it as an image. I have a file called config.json which contains sensitive user data such as username and password. This will also be copied. The issue here is, I want this data to be encrypted and passed onto the dockerfile. W...
Bhargav Mg
<p>You shouldn't put this in the container image at all. Use a tool like Sealed Secrets, Lockbox, or sops-operator to encrypt the values separately, and then those get decrypted into a Secret object in Kubernetes which you can mount into your container as a volume so the software sees the same <code>config.json</code> ...
coderanger
<p>Today I have started to learn about Kubernetes because I have to use it in a project. When I came to the Service object, I started to learn what is the difference between all the different types of ports that can be specified. I think now I undertand it. </p> <p>Specifically, the <strong>port</strong> (spec.ports.p...
Abraham Simpson
<p>The biggest use is with LoadBalancer services where you want to expose something on (usually) 80 or 443, but don't want the process to run as root so it's listening on 8080 or something internally. This lets you map things smoothly.</p>
coderanger
<p>We have created common helm charts. Using the common charts, we have derived HelloWorld helm chart</p> <pre><code>Charts Common templates &gt; _deployment.yaml &gt; _configmap.yaml &gt; _service.yaml Chart.yaml HelloWorld templates &gt; deployment.yaml &gt; configmap...
Sunil Gajula
<p>I'm not 100% sure what you're asking, but in general you can override subchart values at any point by putting them under a key matching the charts name. So something like:</p> <pre><code>Common: foo: bar </code></pre>
coderanger
<p>What is the purpose of args if one could specify all arguments using command in kubernetes manifest file? for example i can use below syntax which totally negates the usage of the args.</p> <pre><code>command: [ &quot;bin/bash&quot;, &quot;-c&quot;, &quot;mycommand&quot; ] </code></pre> <p>or also</p> <pre><code>com...
quicksilver
<p>The main reason to use <code>args:</code> instead of <code>command:</code> is if the container has a specific entrypoint directive that you don't want to change. For example if the Dockerfile has <code>ENTRYPOINT [&quot;/myapp&quot;]</code> you might put <code>args: [--log-level=debug]</code> to add that one argumen...
coderanger
<p>In Kubernetes field selectors are limited to certain fields for each resource Kind. But almost every resource has field selector for name and namespace on metadata If so why there's a need to have a separate label selector.</p> <pre><code>labels: { app: foo } </code></pre> <p>Instead of querying <code>kubectl ge...
manikawnth
<p>Short answer: because etcd is not optimized for general purpose querying and so Kubernetes has to pick and choose what to index and what not to. This is why both labels and annotations exist despite seeming very similar, labels are indexed for searching on and annotations are not.</p>
coderanger
<p>I am implementing a Kubernetes based solution where I am autoscaling a deployment based on a dynamic metric. I am running this deployment with autoscaling capabilities against a workload for 15 minutes. During this time, pods of this deployment are created and deleted dynamically as a result of the deployment autosc...
Mazen Ezzeddine
<p>Yes, by default GKE sends logs for <em>all</em> pods to Stackdriver and you can view/query them there.</p>
coderanger
<p>I am getting below error while running kubeadm init :</p> <pre><code>[init] Using Kubernetes version: v1.16.2 [preflight] Running pre-flight checks [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes...
Penguin Tech
<p>You do not have enough RAM. Your machine is surviving because you use a swap file (i.e. using your hard drive for extra pseudo-RAM) but that is not supported by Kubernetes so it tried to turn that off which failed because you don't have enough RAM.</p>
coderanger
<p>I have a kubernetes cluster that is currently running in the region europe-north1 and zone europe-north1-a. I want to move this cluster to the new region europe-west3 with the zone europe-west3-b to get access to nvidia-tesla-t4 accelerators.</p> <pre><code>gcloud compute accelerator-types list NAME ...
tech34841916559242495
<p>No, you can’t move things between regions at all, least of all an entire running cluster. You’ll need to back up your data and restore it onto a new cluster in the new region.</p>
coderanger
<p>I'm running into an issue with an nginx ingress controller (ingress-nginx v0.44.0) on EKS where the X-Forwarded-* headers are set to the kubernetes worker node the controller pod is running on as opposed to the details of the request of the actual user hitting the controller itself. As we're terminating our SSL on t...
arjen_iw
<p>It depends a lot on the exact networking setup in front of Nginx. By default, Kubernetes routes all external connections through the kube-proxy mesh which hides the true client IP. You also might have an AWS ELB of some kind in front of that which also can hide the client IP depending on settings.</p> <p>For the fir...
coderanger
<p>I have application run inside the kuberentes pod that update the user configuration file and on every deployment it flush the data, as the file reside in a folder which cann't be mounted so I created the empty configmap to mount that file as configmap with subpath mounting and also set the defaultmode of file 777 bu...
Khushboo Kumari
<p>No, a configmap mount is read-only since you need to go through the API to update things. If you just want scratch storage that is temporary you can use an emptyDir volume but it sounds like you want this to stick around so check out the docs on persistent volumes (<a href="https://kubernetes.io/docs/concepts/storag...
coderanger
<p>I have built a small, single user, internal service that stores data in a single JSON blob on disk (it uses tinydb) -- thus the service is not designed to be run on multiple nodes to ensure data consistency. Unfortunately, when I send API requests I get back inconsistent results -- it appears the API is writing to d...
user491880
<p>Files written inside the container (i.e. not to a persistent volume of some kind) will disappear when then container is restarted for any reason. In fact you should really have the file permissions set up to prevent writing to files in the image except maybe /tmp or similar. You should use a GCE disk persistent volu...
coderanger
<p>I have network policy created and implemented as per <a href="https://github.com/ahmetb/kubernetes-network-policy-recipes" rel="nofollow noreferrer">https://github.com/ahmetb/kubernetes-network-policy-recipes</a>, and its working fidn , however I would like to understand how exactly this gets implemeneted in the bac...
sai prashanth
<p>"It depends". It's up to whatever controller actually does the setup, which is usually (but not always) part of your CNI plugin.</p> <p>The most common implementation is Calico's <a href="https://github.com/projectcalico/felix" rel="nofollow noreferrer">Felix daemon</a>, which supports several backends, but iptable...
coderanger
<p>I've got some doubts about deploying Spring Cloud Gateway (old Zuul) with Kubernetes and getting zero-downtime. I'm completely new to Kubernetes and I'm a bit lost with quite a lot of concepts.</p> <p>We would like to use the Spring Cloud Gateway verify the JWT. I've also read that when I've got a call, it should g...
Elena
<p>Kubernetes Deployments use a rolling update model to achieve zero downtime deploys. New pods are brought up and allowed to become ready, then added to the rotation, then old ones are shut down, repeat as needed.</p>
coderanger
<p>I need to connect a service running in a local container inside Docker on my machine to a database that's running on a Kubernetes cluster.</p> <p>Everything I found on port forwarding allowed me to connect my machine to the cluster, but not the local container to the cluster (unless I install kubectl on my container...
Joe Santos
<p><a href="https://www.telepresence.io/" rel="nofollow noreferrer">https://www.telepresence.io/</a> is what you're looking for. It will hook into the cluster network like a VPN and patch the services so traffic will get routed through the tunnel.</p>
coderanger
<p>OpenShift:</p> <p>I have the below MySQL Deployment</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: mysql-master spec: selector: matchLabels: app: mysql-master strategy: type: Recreate template: metadata: labels: app: mysql-master spec: volumes:...
Abdul
<p>If you dive into the entrypoint script in your image (<a href="https://github.com/docker-library/mysql/blob/75f81c8e20e5085422155c48a50d99321212bf6f/5.7/docker-entrypoint.sh#L341-L350" rel="nofollow noreferrer">https://github.com/docker-library/mysql/blob/75f81c8e20e5085422155c48a50d99321212bf6f/5.7/docker-entrypoin...
coderanger
<p>I have a Kubernetes cluster version 1.15.5 in Azure where I have installed <a href="https://cert-manager.io/docs/installation/kubernetes/" rel="nofollow noreferrer">cert-manager</a> version v0.14.0</p> <p>It works fine with automatically issuing lets encrypt certificates against a valid DNS name: <strong>MY_DOMAIN<...
u123
<p>Short version of the comments: certbot in DNS mode will probably work, HTTP01 will not since you would need to dynamically adjust Ingress settings, which is exactly what cert-manager does. Overall this is a great example of why running a version of Kube from 2.5 years ago is not good.</p>
coderanger
<p>I am testing connecting an application running in an external docker container, to a database running in a separate kubernetes cluster. What is the best way to make this connection with security practices in mind.</p> <p>I am planning on creating an ingress service for the database in the kubernetes cluster. Then, ...
mmiara
<p>Just like anything else, use TLS, make sure all hops are encrypted and verified. Unless your database of choice uses an HTTP-based protocol, Ingress won't help you. So usually this means setting up TLS at the DB level and exposing it with a LoadBalancer service.</p>
coderanger
<p>I am beginner with Kubernetes. I tried to deploy Prometheus from helm and now I need to setup Ingress in internal network.</p> <p>I have problem with resolving Prometheus by hostname. If I use IP address I get it work but when I use syntax &quot;host&quot; it is 404 error. I don't know why is not resolved by hostnam...
Martin Smola
<p>What you want is this:</p> <pre><code> rules: - host: prom.tipsport.it http: paths: - path: / pathType: Prefix backend: service: name: prometheus-kube-prometheus-prometheus port: number: 9090 </code></pre> <p>The <code>host:</code> fi...
coderanger
<p>How to run a helm hook based on a condition.</p> <p>What I want to solve: <br> I have created a postupgrade hook which will load some data to service A, which is created from a zipped subchart.<br> Right now it runs every time when an upgrade happened. I want it only run when the service A or the job itself has bee...
beatrice
<p>Not really. It doesn't have enough info to know when that is the case.</p>
coderanger
<p>I am not sure if I'm interpreting the output from my container correctly, but I am seeing the following output from sequelize in the logs:</p> <pre><code>Nates-MacBook-Pro:k8s natereed$ docker logs 1a3e6141d050 ... (node:36) UnhandledPromiseRejectionWarning: SequelizeConnectionError: password authentication failed ...
Nate Reed
<p>The simple option:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: env-secret type: Opaque stringData: POSTGRESS_USERNAME: myapp POSTGRESS_PASSWORD: supersecret </code></pre> <p><code>stringData</code> takes plain strings instead of base-64 encoded <code>[]byte</code>s.</p>
coderanger
<p>In Kubernetes deployments, you can specify volume mounts as readonly. Is there a performance advantage to it, or logical only?</p> <p>Is it dependant on the volume type?</p> <p>To make my intentions clear, I'm using a pv in a scenario where I have one writer and many readers, and noticed any fs operation on the mo...
Mugen
<p>It entirely depends on the volume type. Some might implement performance optimizations when they know the volume is read only.</p>
coderanger
<p>I'm reading through:</p> <p><a href="https://github.com/kubernetes/ingress-nginx/issues/8" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/8</a> <a href="https://github.com/kubernetes/kubernetes/issues/41881" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/4188...
Chris Stryczynski
<p>As you said it’s up to each individual controller but all of them do that I know of.</p>
coderanger
<p>I am maintaining a K8s cluster and recently kubelet evicted pods many times on different nodes because of disk pressure. After investigation, I found out that the problem is the container log files at <code>/var/lib/docker/containers/.../*-json.log</code> and these files can grow to hundreds of Gi and consume all of...
AVarf
<p>Every Kubernetes installer should include Logrotate to handle this. <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/cluster-administration/logging/</a> has some basic info but it depends on your exact configuration.</p> <p>E...
coderanger
<p>Kubernetes documentation describes pod as a <code>wrapper</code> around one or more containers. containers running <code>inside</code> of a pod share a set of namespaces (e.g. network) which makes me think <code>namespaces</code> are nested (I kind doubt that). What is the <code>wrapper</code> here from container ru...
gqli
<p>The main difference is networking, the network namespace is shared by all containers in the same Pod. Optionally, the process (pid) namespace can also be shared. That means containers in the same Pod all see the same <code>localhost</code> network (which is otherwise hidden from everything else, like normal for loca...
coderanger
<p>I have more kubernetes cluster and use different CNI plugin. When I coding a CMDB agent ,I want used kubernetes apiserver get CNI plugin, next write in to my CMDB database.</p> <p>I used Go languages.</p>
sober
<p>This isn't really a thing. You would have to write a separate detection mode for each CNI plugin. Additionally it's probably possible (if inadvisable) to have multiple plugins active on the same node as long as only one tries to configure each pod.</p>
coderanger
<p>I'm trying to use different secrets on a StatefulSet, based on the index o the pods. Here is the things I tried:</p> <pre><code> env: - name: POD_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name - name: SECRET_KEY val...
Marco Reply
<p>AFAIK this is not supported. The only volumes you can have differ are the PVs. Instead you would use a single secret with keys or whatnot based on the pod index, and write your software to read from the correct key.</p>
coderanger
<p>When I was labeling my worker nodes I accidentally labeled my master node as a worker.</p> <p><strong>kubectl label node node01 node-role.kubernetes.io/worker=worker</strong></p> <p>now my cluster looks like this:</p> <pre><code>NAME STATUS ROLES AGE VERSION node01 Ready master,worker 54m...
mikev1963
<p><code>kubectl label node node01 node-role.kubernetes.io/worker-</code>. The <code>-</code> tells it to remove the label.</p>
coderanger
<p>Here is what I am working with. I have 3 nodepools on GKE </p> <ol> <li>n1s1 (3.75GB)</li> <li>n1s2 (7.5GB) </li> <li>n1s4 (15GB)</li> </ol> <p>I have pods that will require any of the following memory requests. Assume limits are very close to requests. </p> <pre><code>1GB, 2GB, 4GB, 6GB, 8GB, 10GB, 12GB, 14GB <...
crossvalidator
<p>Why would you have 3 pools like that in the first place? You generally want to use the largest instance type you can that gets you under 110 pods per node (which is the default hard cap). The job of the scheduler is to optimize the packing for you, and it's pretty good at that with the default settings.</p>
coderanger
<p>I am new to Kubernetes world,I am trying to deploy &quot;Filebeat&quot; demonset on Azure Kubernetes services(AKS) but facing the below error, please help me out:</p> <p><strong>Error:</strong> <a href="https://i.stack.imgur.com/7W1qJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7W1qJ.png" alt=...
Docgyan
<pre><code> #- name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName </code></pre> <p>You commented out the <code>name:</code> line when you didn't mean to.</p>
coderanger
<p>I'm using k8s java client and need a way to get OAuth access token for some clusters. Now I can do that only with this bash script:</p> <pre><code>export KUBECONFIG=~/.kube/&lt;config-file&gt; APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ") SECRET_NAME=$(kubectl get secrets |...
Alexey Usharovski
<p>Kubernetes is not involved in the OAuth side of things at all. That’s up to your IdP. More normally you would use a ServiceAccount token for automation though.</p>
coderanger
<p>everyone.</p> <p>I'm wondering is there an option to authorize users to access kubernetes objects via local groups?</p> <p>Like currently I'm doing this:</p> <pre><code>kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: example-rolebinding namespace: mynamespace subjects: - kind: User ...
Pavel Perminov
<p>Groups are kind of an opaque construct between the authentication layer and the rbac system. Whichever authn plugin you are using can tag the request with a username and any number of groups, and then rbac will use them. But k8s itself doesn’t know what a user or group really is. So tldr it’s up to your authn config...
coderanger
<p>I'm moving a PHP application into Kubernetes and running into a "Bad Gateway" after some actions are performed.</p> <p>I'm thinking the error is from one of two things:</p> <ul> <li>The PHP program is sending a <code>GET</code> to <code>http://192.168.39.129/admin/a_merge_xls_db.php?tmp_tbl=_imp_companies_20200329...
cjones
<p>You need to specify the <code>nginx.ingress.kubernetes.io/use-regex: "true"</code> annotation. This is called out because by default Kubernetes Ingress objects expect plain prefix matching, not regexs. Or in your case, just use an actual prefix, <code>/</code>, <code>/admin</code>, and <code>/api</code>.</p>
coderanger
<p>I was running the older 2.16.0 version of ChartMuseum Helm Chart. I am trying to update it to use newer 3.1.0. When I try to upgrade using helm upgrade -n , the upgradation fails with the following error:</p> <pre><code>Error: UPGRADE FAILED: cannot patch &quot;...&quot; with kind Deployment: Deployment.apps &quot...
ray an
<p>That's not from Helm, that's a Kubernetes error. This chart does not support clean upgrades or your values are not matching what you had before. If you can take the downtime, delete the offending deployment and let Helm recreate it. Otherwise you have to look up the right dance of orphan deletes and whatnot.</p>
coderanger
<p>I am developing a <a href="https://medium.com/ovni/writing-a-very-basic-kubernetes-mutating-admission-webhook-398dbbcb63ec" rel="noreferrer">mutating webhook</a> with <a href="https://kind.sigs.k8s.io/docs/user/quick-start" rel="noreferrer">kind</a> and as I understand, the API end-point should be <code>https</code>...
cogitoergosum
<p>It doesn't need to be signed with the cluster's CA root. It just needs to match the CA bundle in the webhook configuration.</p>
coderanger
<p>So I have two hypervisors running the following Kubernetes VMs:</p> <p>A) 1x K8s master, 1x k8s node</p> <p>B) 1x K8s node</p> <p>If hypervisor B goes offline, all pods still work, as designed. What happens to the cluster and the nodes when hypervisor A goes offline? Will all running pods on the hypervisor B K8s ...
dom_weissb03
<p>Pods will keep running and will restart if they crash but the API will not be available so it will not be possible to run anything new or change them.</p>
coderanger
<p>I'm migrating our swarm cluster to a k8s one, and that means I need to rewrite all the composes files to k8s files. Everything was going smothy, till I reach the redis compose...</p> <p>The compose file from redis: Yes, Its simple because is just to test during development for cache stuff...</p> <pre><code>version: ...
Daniel Reis Alves
<p>As mentioned in comments, the Ingress system is only for HTTP traffic. Traefik does also support TCP and UDP traffic but that's separate from Ingress stuff and had to be configured through Traefik's more-specific tools (either their custom resources or a config file). More commonly you would use a LoadBalancer-type ...
coderanger
<p>I run <code>kubectl delete</code> with <code>--all</code> flag. This command deleted all namespace on my cluster. (I couldn't see any namespace on K8S Dashboard) So How can I recover all these deleted namespace ? </p> <p>And is it possible to restore data on namespance ?</p> <pre><code>➜ kubectl delete ns --all wa...
Tran B. V. Son
<p>No. Your cluster is probably no longer viable and will need to be restored from backup or rebuilt.</p>
coderanger
<p>I have simple OpenShift setup with a Service configured with 2 backend PODS. The PODS have its READINESS Probe configured. The Service is exposed via NodePort. All these configuration are fine it is working as expected. Once the readiness probes fails the Services marks the pod as unreachable and any NEW requests do...
Pradyumna Mohapatra
<p>kube-proxy (or rather the iptables rules it generates) intentionally does not shut down existing TCP connections when changing the endpoint mapping (which is what a failed readiness probe will trigger). This has been discussed a lot on many tickets over the years with generally little consensus on if the behavior sh...
coderanger
<p>I have multiple kubernetes clusters metric data being scraped in prometheus. When i get metrics how can i differentiate the metrics from different clusters? I am not seeing any label that contains data regarding a specific cluster, so that i can filter out data of a particular cluster like below,</p> <pre><code>con...
Sathish Kumar
<p>You have to add that label yourself in your relabel_configs. Generally you do this on the intake cluster (i.e. the normal "cluster-level" ones) via a global relabel to add it, but it's also possible to add during the remote write if you're doing federation that way or via the jobs on the central cluster if you're do...
coderanger
<p>everyone.</p> <p>Please teach me why <code>kubectl get nodes</code> command does not return master node information in full-managed kubernetes cluster. </p> <p>I have a kubernetes cluster in GKE. When I type <code>kubectl get nodes</code>command, I get below information.</p> <pre><code>$ kubectl get nodes NAME ...
yu saito
<p>Because there are no nodes with that role. The control plane for GKE is hosted within their own magic system, not on your own nodes.</p>
coderanger
<p>I have a tiny Kubernetes cluster consisting of just two nodes running on <code>t3a.micro</code> AWS EC2 instances (to save money). </p> <p>I have a small web app that I am trying to run in this cluster. I have a single <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow nor...
Andrés Mejía
<p>The correct solution for this would be to set memory requests and limits correctly matching your steady state and burst RAM consumption levels on every pod, then the scheduler will do all this math for you.</p> <p>But for the future and for others, there is a new feature which kind of allows this <a href="https://k...
coderanger
<p>I've built 3 nodes on linux academy. On the control plane I can see 3 nodes running. On either of the two worker nodes I try to run <code>kubectl get nodes</code>. Initially I was prompted that <code>KUBERNETES_MASTER</code> was not set. </p> <p>Inside the worker nodes, I've tried setting this to the server value f...
bravinator932421
<p>You can only use cluster DNS names from inside pods, not from the nodes directly. As for the cert issue, your kube config file will generally include the CA used for API TLS.</p>
coderanger