Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I'm trying to verify that shutdown is completing cleanly on Kubernetes, with a .NET Core 2.0 app.</p> <p>I have an app which can run in two "modes" - one using ASP.NET Core and one as a kind of worker process. Both use Console and JSON-which-ends-up-in-Elasticsearch-via-Filebeat-sidecar-container logger output whi...
Kieren Johnstone
<p><code>SIGTERM</code> does indeed signal termination. The less obvious part is that when the <code>SIGTERM</code> handler returns, everything is considered finished.</p> <p>The fix is to not return from the <code>SIGTERM</code> handler until the app has finished shutting down. For example, using a <code>ManualRese...
Kieren Johnstone
<p>I initialized master node and joined workers nodes to the cluster with <code>kubeadm</code>. According to the logs worker nodes successfully joined to the cluster.</p> <p>However, when I list the nodes in master using <code>kubectl get nodes</code>, worker nodes are absent. What is wrong?</p> <pre><code>[vagrant@l...
Tuomas Toivonen
<p>By default the nodes (kubelet) identify themselves using their hostnames. It seems that your VMs' hostnames are not set.</p> <p>In the <code>Vagrantfile</code> set the <code>hostname</code> value to different names for each VM. <a href="https://www.vagrantup.com/docs/vagrantfile/machine_settings.html#config-vm-hos...
Janos Lenart
<p>I am running Docker Desktop 4.10 on Windows 10, with K8s enabled. I have the following k8s resources deployed through a helm chart, using Helm 3.12:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: fab-rabbitmq labels: type: mydata spec: capacity: storage: 2Gi accessModes: - R...
Sagi Mann
<p>I found the explanation <a href="https://stackoverflow.com/questions/68948411/mounting-volume-resulting-empty-folder-in-kubernetes-minikube">here</a> and <a href="https://minikube.sigs.k8s.io/docs/handbook/mount/" rel="nofollow noreferrer">here</a>. When running in Minikube, the &quot;host path&quot; is not actually...
Sagi Mann
<p>Headless VirtualBox successfully runs inside Docker container</p> <pre><code>docker run --device=/dev/vboxdrv:/dev/vboxdrv my-vb </code></pre> <p>I need to run this image on Kubernetes and I get:</p> <pre><code>VBoxHeadless: Error -1909 in suplibOsInit! VBoxHeadless: Kernel driver not accessible </code></pre> <p...
Jonas
<p>Slight modification is required in the configuration for this work:</p> <pre><code>metadata: name: vbox labels: app: vbox spec: selector: matchLabels: app: vbox template: metadata: labels: app: vbox spec: securityContext: runAsUser: 0 containers: ...
Janos Lenart
<h1>What happened</h1> <p>Resolving an external domain from within a pod fails with <strong>SERVFAIL</strong> message. In the logs, <strong>i/o timeout</strong> error is mentioned.</p> <h1>What I expected to happen</h1> <p>External domains should be successfully resolved from the pods.</p> <h1>How to reproduce it</h1> ...
Nikola Malešević
<p>Finally found the solution which was the combination of two changes. After applying both changes, my pods could finally resolve addresses properly.</p> <h3>Kubelet configuration</h3> <p>Based on <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues" rel="noreferrer">know...
Nikola Malešević
<p><strong>I'm setting up multi node cassandra cluster in kubernetes (Azure AKS),Since this a headless service with statefull set pods without having a external IP. How can i connect my spark application with cassandra which is in kubernetes cluster</strong></p> <p><b>We have tried with cluster ip,ingress ip also but ...
suraj1287
<p>It depends on what exactly you are trying to do. If you need an external IP then in general you'd need to create an additional Service object (probably <code>type: LoadBalancer</code>) like this:</p> <pre><code>apiVersion: v1 kind: Service metadata: labels: app: cassandra name: cassandra-ext spec: type: L...
Janos Lenart
<p>I would like to access role's aws key and secret within EKS pod but have been unsuccessful so far.</p> <p>The idea is to retrieve them from instance metadata and inject them as ENV variables into pod. I have already linked service account to role and specified it in pod deployment but it doesn't look like key is aut...
Anton Kim
<p>Using ak/sk is not a good practice, you can use <a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html" rel="nofollow noreferrer">IAM role for service account</a> to bind the RBAC in k8s with the IAM roles .</p>
Kane
<p>I would like to migrate an application from one GKE cluster to another, and I'm wondering how to accomplish this while avoiding any downtime for this process.</p> <p>The application is an HTTP web backend.</p> <p>Usually how I'd usually handle this in a non GCP/K8S context is have a load balancer in front of the app...
Chris Stryczynski
<p>I see 2 approaches:</p> <ol> <li>In the new cluster get a new IP address and update the DNS record to point to the new load balancer</li> <li>See if you can switch to Multi-cluster gateways, however that would probably require you to use approach 1 to switch to multi-cluster gateways as well: <a href="https://cloud....
Sam Stoelinga
<p>My workload needs network connectivity to start properly and I want to use a <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" rel="nofollow noreferrer">postStart lifecycle hook</a> that waits until it is ready and then does something. However, lifecycle hooks seem t...
dippynark
<p>This is an interesting one :-) It's not much of an answer but I did some investigation and I thought I share it - perhaps it is of some use.</p> <p>I started from the yaml posted in the question. Then I logged into the machine running this pod and located the container.</p> <pre><code>$ kubectl get pod -o wide NAM...
Janos Lenart
<p>I created a CronJob resource with</p> <pre><code>kubectl create -f cronjob.yaml </code></pre> <p>Now I have too much mess on my comp,cronjob attempts to create one node every </p> <pre><code>15 minutes batch-job-every-fifteen-minutes-1528876800-h8dsj 0/1 Pending 0 39m batch-job-every...
Richard Rublev
<p>You can delete it with this command:</p> <pre><code>kubectl delete -f cronjob.yaml </code></pre> <p>It is also possible to delete it directly by name:</p> <pre><code>kubectl delete cronjob batch-job-every-fifteen-minutes </code></pre> <p>I am not sure whether the generated Pods and Jobs also get deleted with thi...
svenwltr
<p>I have 5 microservices which I wish to allow external traffic to. These microservices will be hosted on different subdomains. I am using K8s cluster on EKS and have the cluster and other services running. There seems to be quite a lot of confusion when it comes to Ingress. I have configured the ALB ingress controlle...
Divyansh Khandelwal
<ol> <li>Application load balancer uses the rules to conditional route the requests to different hosts/paths. So <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/" rel="nofollow noreferrer">AWS load balancer controller</a> supports that feature via annotations, see <a href="https://kuberne...
Kane
<p>I have a deployment on google gke, and I can't see the pod logs on the console even though the Cloud logging is enabled on the cluster? So what could be the issue? did I miss something?</p>
Navir
<p>It sounds like Workload monitoring and logging may not have been enabled and currently it's only doing system monitoring and logging. Please see the docs here on how to change the logging settings: <a href="https://cloud.google.com/stackdriver/docs/solutions/gke/installing#installing" rel="nofollow noreferrer">https...
Sam Stoelinga
<p>I allocated resource to 1 pod only with 650MB/30% of memory (with other built-in pods, limit memory is 69% only)</p> <p>However, when the pod handling process, the usage of pod is within 650MB but overall usage of node is 94%. </p> <p>Why does it happen because it supposed to have upper limit of 69%? Is it due to ...
DaiKeung
<p>This effect is most likely caused by the 4 Pods that run on that node <strong>without</strong> a memory limit specified, shown as <code>0 (0%)</code>. Of course 0 doesn't mean it can't use even a single byte of memory as no program can be started without using memory; instead it means that there is no limit, it can ...
Janos Lenart
<p>I am trying to create an S3 bucket using </p> <p><code>aws s3api create-bucket —bucket kubernetes-aws-wthamira-io</code></p> <p>It gives this error: </p> <pre class="lang-sh prettyprint-override"><code>An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified ...
wthamira
<p>try this:</p> <pre><code>aws s3api create-bucket --bucket kubernetes-aws-wthamira-io --create-bucket-configuration LocationConstraint=eu-west-1 </code></pre> <p>Regions outside of <code>us-east-1</code> require the appropriate <code>LocationConstraint</code> to be specified in order to create the bucket in the des...
Asdfg
<p><strong>UPDATED</strong></p> <p>Following the <a href="https://www.youtube.com/watch?v=PitS8RiyDv8" rel="nofollow noreferrer">AWS instance scheduler</a> I've been able to setup a scheduler that starts and stops at the beginning and end of the day.</p> <p>However, the instances keep being terminated and reinstalled...
Cédric Bloem
<p>EKS node group would create an auto scaling group to manage the worker nodes. You need specify the minimum, maximum and desired size of worker nodes. Once any instance is stopped, the auto scaling group would create new instance to match the desired instance size.</p> <p>Check below doc for details,</p> <p><a href...
Kane
<p>I have an application deployed to kubernetes (AKS) where I have a mix of gRPC and http services. I initially added the route for a new gRPC service to the existing ingress which was previously serving only http. That didn't work and digging into it, I read that we need to add the <code>nginx.ingress.kubernetes.io/...
bhnat
<p>This wound up being resolved by creating a second host name that pointed to our k8s cluster. I changed the route for the grpc service to be the root path and pathType of ImplementationSpecific.</p> <pre><code> - path: / pathType: ImplementationSpecific </code></pre> <p>Both host names needed to be incl...
bhnat
<p>An ingress controller is a Layer 7 construct. Does it bypass the Service (VIP) and Layer 4 kube proxy?</p>
Compendius
<p>In a nutshell: Ingress deals with North-South traffic (bringing traffic from the outside world into the cluster), a service acts a load balancer, routing the traffic to one of its pods. So, if I understand your question correctly, the answer is no: Ingress and services work together to get traffic from a client outs...
Michael Hausenblas
<p>I created an EKS cluster but while deploying pods, I found out that the native AWS CNI only supports a set number of pods because of the IP restrictions on its instances. I don't want to use any third-party plugins because AWS doesn't support them and we won't be able to get their tech support. What happens right no...
Anshul Tripathi
<p>EKS's node group is using auto scaling group for nodes scaling. </p> <p>You can follow <a href="https://eksworkshop.com/scaling/deploy_ca/" rel="nofollow noreferrer">this workshop</a> as a dedicated example.</p>
Kane
<p>I have installed a K8S cluster on laptop using Kubeadm and VirtualBox. It seems a bit odd that the cluster has to be up and running to see the documentation as shown below.</p> <pre><code>praveensripati@praveen-ubuntu:~$ kubectl explain pods Unable to connect to the server: dial tcp 192.168.0.31:6443: connect: no r...
Praveen Sripati
<p>So the rather sobering news is that AFAIK there's not out-of-the box way how to do it, though you could totally write a <code>kubectl</code> plugin (it has become rather trivial now in 1.12). But for now, the best I can offer is the following:</p> <pre><code># figure out which endpoint kubectl uses to retrieve docs...
Michael Hausenblas
<p>Is there a way to automatically remove completed Jobs besides making a CronJob to clean up completed Jobs?</p> <p>The <a href="http://kubernetes.io/docs/user-guide/jobs/" rel="noreferrer">K8s Job Documentation</a> states that the intended behavior of completed Jobs is for them to remain in a completed state until m...
Josh Newman
<p>You can now set history limits, or disable history altogether, so that failed or successful CronJobs are not kept around indefinitely. See my answer <a href="https://stackoverflow.com/a/43115763/379037">here</a>. Documentation is <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/" rel="no...
JJC
<p>I want to know how label can be set while namespace is getting created in e2e. This line of code simply creates a namespace <a href="https://github.com/kubernetes/kubernetes/blob/v1.25.0/test/e2e/framework/framework.go#L239" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/v1.25.0/test/e2e/fra...
ambikanair
<p>This label is set by an admission controller. Setting it manually will cause the controller to reject your pod.</p> <p>To get the correct Pod Security Policy (PSP) assigned you need RBAC rules that allows <code>use</code> on that PSP: <a href="https://v1-24.docs.kubernetes.io/docs/concepts/security/pod-security-poli...
Janos Lenart
<p>A word of warning, this is my first posting, and I am new to docker and Kubernetes with enough knowledge to get me into trouble. I am confused about where docker container images are being stored and listing images.</p> <p>To illustrate my confusion I start with the confirmation that &quot;docker images&quot; indica...
RoyalCoachman
<p>I will try to bring some clarity to you despite the fact your question already contains about 1000 questions (and you'll probably have 1000 more after my answer :D)</p> <p>Before you can begin to understand any of this, you need to learn a few basic things:</p> <ol> <li><p>Docker produces images which are used by co...
tftd
<p>Basically, when using Google Cloud Build, how do I read a value that was written in an earlier build step in subsequent steps? </p> <p>Specifically, I'd like to make a custom image tag that's based on a combination of the timestamp and $SHORT_SHA. Something like the below. Though, it doesn't work, as docker compla...
JJC
<p>I never found a way to set an environment variable in one build step that can be read in other steps, but I ended up accomplishing the same effect by building on Konstantin's answer in the following way: </p> <p>In an early step, I generate and write my date-based tag to a file. The filesystem (/workspace) is reta...
JJC
<p>Currently I run a curl container and directly connect with its terminal to verify connectivity to services and check we can can connect on some port to an external service or a service maintained by some other team.</p> <pre><code>kubectl run curl -it --rm --image=curlimages/curl -- sh </code></pre> <p>Now the probl...
Faisal
<p>You can do something like this, if you need to run it on a specific node that is tainted (it will run despite any taints):</p> <pre><code>kubectl run curl -it --rm --image=curlimages/curl --overrides \ '{&quot;spec&quot;:{&quot;tolerations&quot;:[{&quot;operator&quot;:&quot;Exists&quot;}]},&quot;nodeName&quot;:&qu...
Janos Lenart
<p>I have a container with a backend processing application that only connects to other services, but does not expose any ports it listens to. For example in my case it connects to a JMS broker and uses the Rest API of another service. </p> <p>I want to deploy that container along with the JMS broker and the server wi...
SpaceTrucker
<p>Simply remove the entire <code>Service</code> object. Since you have an app that doesn't need to communicate via the network, you don't need a service. Think of the service as a kind of specialized load-balancer in front of an (HTTP?) API your pods expose. Since you don't have that API, you don't need it. The <code>...
Michael Hausenblas
<p>I plan to make secret in k8s from appsetting.json but how to store the file before using by devops pipelines</p> <p>I want to store the appsettings.json and pipeline can fetch it to make a secret</p>
agungardiyanta
<p>Is your k8s cluster hosted in a cloud? If so, you should be using AWS Secret Manager or Azure Key Vault to store secret settings.</p> <p>If that is not an option, create an encrypted configuration provider that would allow encrypting data inside the <code>appsettings.json</code>. Here are some examples: <a href="htt...
Dmitry S.
<p>Right now, I can add my ip using</p> <pre><code>gcloud container clusters update core-cluster --zone=asia-southeast1-a --enable-master-authorized-networks --master-authorized-networks w.x.y.z/32 </code></pre> <p>but it overrides all the existing authorized networks that was already there.</p> <p>Is there any way to ...
Krishna
<p>You could automate what @Gari Singh said using gcloud, jq and tr. See below for doing it with CLI:</p> <pre class="lang-bash prettyprint-override"><code>NEW_CIDR=8.8.4.4/32 export CLUSTER=test-psp OLD_CIDR=$(gcloud container clusters describe $CLUSTER --format json | jq -r '.masterAuthorizedNetworksConfig.cidrBlocks...
Sam Stoelinga
<p>I am trying to run a Spark job on a separate master Spark server hosted on kubernetes but port forwarding reports the following error:</p> <pre class="lang-none prettyprint-override"><code>E0206 19:52:24.846137 14968 portforward.go:400] an error occurred forwarding 7077 -&gt; 7077: error forwarding port 7077 to po...
Tristan Dubé
<p>After tinkering with it a bit more, I noticed this output when launching the helm chart for Apache Spark <code>** IMPORTANT: When submit an application from outside the cluster service type should be set to the NodePort or LoadBalancer. **</code>.</p> <p>This led me to research a bit more into Kubernetes networking....
Tristan Dubé
<p>I am learning kubernetes by playing with minikube.</p> <p>This is my pod deployment file which is fine.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: my-deployment spec: replicas: 2 selector: matchLabels: component: web template: metadata: labels: component...
KitKarson
<p>You can get your minikube node's IP address with:</p> <pre><code>minikube ip </code></pre> <p>The ingress' IP address will not populate in minikube because minikube lacks a load balancer. If you'd like something that behaves like a load balancer for your minikube cluster, <a href="https://github.com/knative/servin...
Seth Difley
<p>Can I set the default namespace? That is:</p> <pre><code>$ kubectl get pods -n NAMESPACE </code></pre> <p>It saves me having to type it in each time especially when I'm on the one namespace for most of the day.</p>
mac
<p>Yes, you can set the namespace <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-preference" rel="noreferrer">as per the docs</a> like so:</p> <pre><code>$ kubectl config set-context --current --namespace=NAMESPACE </code></pre> <p>Alternatively, you can u...
Michael Hausenblas
<p>I want to drain a Node from the Node itself. I therefore created a Service Account and added the token to the .kube/config file on the Node. I also creaded the Role Binding.</p> <p>But I can't figure out the right permissions. I tried this so far but it didn't work.</p> <pre class="lang-yaml prettyprint-override"><c...
erkum
<p>First off, you should not use the name <code>admin-clusterrole</code> for this ClusterRole, because you risk locking yourself out of your own cluster by overwriting default bindings.</p> <p>Here's a ClusterRole which should be able to drain a Node. Let me know if it doesn't work for you.</p> <pre class="lang-yaml pr...
OregonTrail
<p>Is it possible to specify the Pod creation time as part of the k8s Pod Name? </p> <p><strong>Scenario:</strong><br> I have many pods with the same name prefix (and uniquely generated tail-end of the name) and these are all names of log groups. </p> <p>I wish to distinguish between log groups by creation time. ...
cryanbhu
<p>No, not with a deployment at least, a stateful set would work but you should really be using labels here.</p>
Michael Hausenblas
<p>After far as I know: </p> <ul> <li>deploymentconfig &rarr; replicationcontroller &rarr; pod</li> </ul> <p>vs.</p> <ul> <li>deployment &rarr; replicaset &rarr; pod</li> </ul> <p>Otherwise, do these two resources have additional differences?</p> <p>The more detail the better.</p>
Weiwei Jiang
<p>A <a href="https://docs.openshift.com/container-platform/3.9/dev_guide/deployments/how_deployments_work.html" rel="noreferrer">DeploymentConfig</a> (DC) in OpenShift is more or less equivalent to a Kubernetes <code>Deployment</code>, nowadays. Main difference (besides that one is using <code>ReplicationController</c...
Michael Hausenblas
<p>I got two types of strange situations when deploying Vault in Kubernetes and using <code>Kubernetes Auth</code> method</p> <blockquote> <p>Kubernetes version: v1.25.6<br /> Vault version: v1.12.1</p> </blockquote> <h3><strong>1. It kept getting 403 <code>permission denied</code> from <code>/v1/auth/kubernetes/login<...
Suge
<p>Fixed:</p> <p>We should do <code>raft join</code> rather than <code>vault operator init</code> for three times:</p> <p><a href="https://developer.hashicorp.com/vault/tutorials/kubernetes/kubernetes-minikube-raft" rel="nofollow noreferrer">https://developer.hashicorp.com/vault/tutorials/kubernetes/kubernetes-minikube...
Suge
<p>Any help much appreciated , I have couple of spring boot application running in aks with default profile , i am trying to change the profile from my deployment.yaml using helm</p> <pre><code> apiVersion: apps/v1 kind: Deployment metadata: name: {{ include &quot;helm-chart.fullname&quot; . }} labels: app.kube...
Dilu
<p>First of all, please check what profile the application is using, search for line like this (in log):</p> <pre class="lang-none prettyprint-override"><code>The following profiles are active: test </code></pre> <p>When I tested with Spring Boot v2.2.2.RELEASE, <code>application_test.yml</code> file is not used, it ha...
Betlista
<p>I have a cluster that scales based on the CPU usage of my pods. The documentation states that i should prevent <em>thrashing</em> by scaling to fast. I want to play around with the autoscaling speed but i can't seem to find where to apply the following flags: </p> <ul> <li>--horizontal-pod-autoscaler-downscale-dela...
Dimitrih
<p>The HPA controller is part of the controller manager and you'll need to pass the flags to it, see also the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/" rel="noreferrer">docs</a>. It is not something you'd do via kubectl. It's part of the control plane (master) ...
Michael Hausenblas
<p>I have set up Kubernetes secrets.</p> <pre><code>kubectl create secret generic mysecret --from-file=mysecret=/home/ubuntu/secret.txt </code></pre> <p>And this secret can be converted to plaintext using the same <code>kubectl</code> command:</p> <pre><code>kubectl get secret mysecret -o yaml # and base64 decode </...
enerudfwqenq
<p>OK, so you need to define a (cluster) role and then bind it to you (== human user is the target entity) and/or to a service account (== app is the target entity) which you then <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="noreferrer">use in the pod</a> instead of...
Michael Hausenblas
<p>I am stuggling with a simple one replica deployment of the <a href="https://hub.docker.com/r/eventstore/eventstore/" rel="nofollow noreferrer">official event store image</a> on a Kubernetes cluster. I am using a persistent volume for the data storage. </p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment ...
Oskar
<p>I was refered to this pull request on Github that stated the the proces was not killed properly: <a href="https://github.com/EventStore/eventstore-docker/pull/52" rel="nofollow noreferrer">https://github.com/EventStore/eventstore-docker/pull/52</a></p> <p>After building a new image with the Docker file from the pul...
Oskar
<p>I have a container that runs some data fetching from a MySQL database and simply displays the result in console.log(), and want to run this as a cron job in GKE. So far I have the container working on my local machine, and have successfully deployed this to GKE (in terms of there being no errors thrown so far as I c...
jlyh
<p>A <code>CronJob</code> is essentially a cookie cutter for jobs. That is, it knows how to create jobs and execute them at a certain time. Now, that being said, when looking at garbage collection and clean up behaviour of a <code>CronJob</code>, we can simply look at what the Kubernetes docs have to say about this top...
Michael Hausenblas
<p>How can I reset RESTART counts to zero in below Kubernetes command output. I know stats are saved in etcd, but how to reset/erase the data?</p> <pre><code>/home/mytest&gt;kubectl get pods -A -o wide NAMESPACE NAME READY STATUS RESTARTS AGE ...
myquest4 sh
<p>The only way to accomplish this is by restarting the pod.</p> <p>Also, a feature to artificially reset the counter has been rejected.</p> <p><a href="https://github.com/kubernetes/kubernetes/issues/50375" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/50375</a></p>
KevinO
<p>Is there a variant of <code>kubectl delete all --all</code> command or some other command to delete all resources except the <em>kubernetes service</em>?</p>
Nimsa
<p>I don't think there's a built-in command for it, which means you'll have to script your way out of it, something like this (add an <code>if</code> for the namespace you want to spare):</p> <pre><code>$ for ns in $(kubectl get ns --output=jsonpath={.items[*].metadata.name}); do kubectl delete ns/$ns; done; </code></...
Michael Hausenblas
<p>Looking into Kubernetes documentation:</p> <ul> <li><a href="https://kubernetes.io/docs/concepts/policy/pod-security-policy/" rel="noreferrer">Pod Security Policy</a></li> <li><a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" rel="noreferrer">Pod Security Context</a></li> </ul> <...
Illidan
<p>I have no idea why folks are down-voting this question, it's spot on and actually we've got our docs to blame and not the OP. OK, here goes:</p> <p>The pod security context (which is preceded by and largely based on OpenShift <a href="https://docs.openshift.com/container-platform/3.9/admin_guide/manage_scc.html" re...
Michael Hausenblas
<p>I think just a quick sanity check, maybe my eyes are getting confused. I'm breaking a monolithic terraform file into modules. </p> <p>My <code>main.tf</code> call just two modules, <code>gke</code> for the google kubernetes engine and <code>storage</code> which creates a persistent volume on the cluster created pre...
jonnybinthemix
<p>In your <code>/root-folder/variables.tf</code>, delete the following entries:</p> <pre><code>variable "host" {} variable "client_certificate" {} variable "client_key" {} variable "cluster_ca_certificate" {} </code></pre> <p>Those are not variables per se that the Terraform code at the root level needs. Instead, th...
KJH
<p>I am new to Kubernetes and started reading through the documentation. There often the term 'endpoint' is used but the documentation lacks an explicit definition.</p> <p>What is an 'endpoint' in terms of Kubernetes? Where is it located?</p> <p>I could image the 'endpoint' is some kind of access point for an individ...
Chris
<p>While you're correct that in the <a href="https://kubernetes.io/docs/reference/glossary" rel="noreferrer">glossary</a> there's indeed no entry for endpoint, it is a well defined Kubernetes network concept or abstraction. Since it's of secondary nature, you'd usually not directly manipulate it. There's a core resourc...
Michael Hausenblas
<p>I am following the steps in the getting started guide for <a href="https://github.com/kubeflow/website/blob/master/content/docs/started/getting-started-minikube.md" rel="nofollow noreferrer">kubeflow</a> and i got stuck at verify the setup works.</p> <p>I managed to get this:-</p> <pre><code>$ kubectl get ns NAME ...
Chirrut Imwe
<p>Yes you're missing something here and that is to use the correct namespace. Use:</p> <pre><code>$ kubectl -n kubeflow-admin get all </code></pre>
Michael Hausenblas
<p>I am using docker + AKS to manage my containers. When I run my containers locally/or on a VM using docker-compose ..my services(which are containerized) can communicate with my databases which are also in containers. The bridge between these containers is created using networks. After I converted the docker-compose ...
Ashish Chettri
<p>If you need these services internally only, you should not expose it publicly using load balancers.</p> <p>Kubernetes has two possibilities for service discovery. DNS and environment variables. While DNS is an optional component, I did not see any cluster without it. Also I assume that AKS uses it.</p> <p>So, for ...
svenwltr
<p>I have created a local ubuntu Kubernetes cluster, having 1 master and 2 slave nodes.</p> <p>I deployed 2 applications in 2 pods and created service for both of the pods, it's working fine. I entered inside pod by typing this command ,</p> <pre><code>$ kubectl exec -it firstpod /bin/bash # apt-get update </code></...
Chintamani
<p>There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).</p> <p>So, you wonder why the following doesn't work:</p> <pre><code># ping secondservice </code></pre> <p>This is not a bug or unexpected (actually, I wrote about it <a href...
Michael Hausenblas
<p>I have asked myself this question and invested time researching it. Running out of time. Can someone point me in the right direction? I have created a kubernetes cluster on minikube, with its Ingress, Services and Deployments. There is a whole configuration of services in there. Can, now, I point this kubectl comma...
Tauqir Chaudhry
<p>Yes, you can use different clusters via the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/" rel="nofollow noreferrer">context</a>. List them using <code>kubectl config get-contexts</code> and switch between them using <code>kubectl config use-context</code>.<...
Michael Hausenblas
<p>I am creating a Replication controller with one init-container. however the init container fails to start and the status of the pod is:</p> <pre><code>NAME READY STATUS RESTARTS AGE testcontainer 0/1 CrashLoopBackOff 12 37m </code></pre> <p>I am not sure wh...
greg
<p>I think the problem here isn't the init container. The <code>hello-world</code> image print a text and exits immediately. Since <a href="https://kubernetes.io/docs/api-reference/v1/definitions/#_v1_podspec" rel="nofollow noreferrer"><code>.spec.restartPolicy</code></a> of the pod defaults to <code>Always</code>, it ...
svenwltr
<p>Is there any easy command line option to export my entire ETCD database to json file but also decode the keys and values automatically from base64?</p> <p>What I succeeded to the moment is this(example show 1x key/value):</p> <pre><code> ./etcdctl get &quot;&quot; --prefix -w json | jq -r &quot;.[] | .[] &quot; ...
R2D2
<p>If the encoded data is a string and not binary data, you can decode it to a UTF-8 string using the <code>@base64d</code> filter. This should be available in jq 1.6.</p> <pre><code>$ ./etcdctl ... | jq '.[][] | (.key, .value) |= @base64d' { &quot;key&quot;: &quot;by-dev/meta/snapshots/root-coord/partitions/44004742...
Jeff Mercado
<p>Hei,</p> <p>I'm looking for the documentation for Kubernetes's configuration files. The ones used by kubectl (e.g. <code>kubectl create -f whatever.yaml</code>).</p> <p>Basically, the Kubernetes equivalent of this <a href="https://docs.docker.com/compose/compose-file/" rel="nofollow noreferrer">Docker Compose</a> ...
e741af0d41bc74bf854041f1fbdbf
<p>You could use the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/" rel="nofollow noreferrer">official API docs</a> but a much more user-friendly way on the command line is the <code>explain</code> command, for example, I never remember what exactly goes into the spec of a pod, so I do:<...
Michael Hausenblas
<p>I know that PVC can be used as a volume in k8s. I know how to create them and how to use, but I couldn't understand why there are two of them, PV and PVC. </p> <p>Can someone give me an architectural reason behind PV/PVC distinction? What kind of problem it try to solve (or what historical is behind this)?</p>
George Shuklin
<p>Despite their names, they serve two different purposes: an abstraction for storage (PV) and a request for such storage (PVC). Together, they enable a clean separation of concerns (using a figure from our <a href="http://shop.oreilly.com/product/0636920064947.do" rel="noreferrer">Kubernetes Cookbook</a> here to illus...
Michael Hausenblas
<p>I'm new to k8s, so some of my terminology might be off. But basically, I'm trying to deploy a simple web api: one load balancer in front of n pods (where right now, n=1). </p> <p>However, when I try to visit the load balancer's IP address it doesn't show my web application. When I run kubectl get deployments, I get...
Slothario
<p>Your problem is that the container image <code>tlk8s.azurecr.io/devicecloudwebapi:v1</code> is in a private container registry. See the events at the bottom of the following command:</p> <pre><code>$ kubectl describe po -l=app=tl-api </code></pre> <p>The official Kubernetes docs describe how to resolve this issue,...
Michael Hausenblas
<p>What happened: I have been following this guidelines: <a href="https://kubernetes.io/docs/setup/minikube/" rel="noreferrer">https://kubernetes.io/docs/setup/minikube/</a> and I have the "connection refused" issue when trying to curl the application. Here are the steps I did</p> <pre><code>~~&gt; minikube status min...
Developer
<p>Not sure where you got the port <code>9500</code> from but that's the reason it doesn't work. NGINX serves on port <code>8080</code>. This should work (it does for me, at least):</p> <pre><code>$ kubectl expose deployment hello-minikube \ --type=NodePort \ --port=8080 --target-port=8080 $ curl...
Michael Hausenblas
<p>Could someone explain the benefits/issues with hosting a database in Kubernetes via a persistent volume claim combined with a storage volume over using an actual cloud database resource? </p>
Barry Jacobs
<p>It's essentially a trade-off: convenience vs control. Take a concrete example: let's say you pay Amazon money to use <a href="https://aws.amazon.com/athena/" rel="nofollow noreferrer">Athena</a>, which is really just a nicely packaged version of <a href="https://prestodb.io/" rel="nofollow noreferrer">Facebook Prest...
Michael Hausenblas
<p>I have set up an EKS cluster using eksctl using all the default settings and now need to communicate with an external service which uses IP whitelisting. Obviously requests made to the service from my cluster come from whichever node the request was made from, but the list of nodes (and their ips) can and will chang...
JazzyP
<p>You can follow <a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario2.html" rel="noreferrer">this guide</a> to create public subnets and private subnets in your VPC.</p> <p>Then create NAT gateways in public subnets. Also run all EKS nodes in private subnets. The pods in K8S will use NAT gateway to...
Kane
<p>I am really new on this kind of stuff, new on Kubernetes and Docker, but already have some experience on Java.</p> <p>I tried using Docker Hub by connecting it to GitHub.</p> <p>On my Git-hub there are only 2 codes:</p> <ol> <li>Dockerfile</li> <li>Simple hello world Java code.</li> </ol> <p>Every time I run it ...
newbielearner
<p>Since you didn't specify how you executed it, I will assume you've been using <code>kubectl run</code> (by default creates a deployment) or a manifest defining a deployment. If so, then the <code>CrashLoopBackOff</code> is expected because <a href="http://kubernetesbyexample.com/deployments/" rel="nofollow noreferre...
Michael Hausenblas
<p>I have some questions about the golang API for kubernetes.</p> <ol> <li><p>which one should I use? k8s.io/client-go or k8s.io/kubernetes/pkg/client? What's the difference?</p></li> <li><p>I want to get list of all pods and then listen to add/update/delete events, what's the difference between using the api.Pods("")...
areller
<blockquote> <p>which one should I use? k8s.io/client-go or k8s.io/kubernetes/pkg/client?</p> </blockquote> <p>Use <code>k8s.io/client-go</code>.</p> <blockquote> <p>what's the difference between using the api.Pods("").Watch method and using an informer?</p> </blockquote> <p>The informer is essentially a shared ...
Michael Hausenblas
<p>I am trying to add new user to EKS cluster and giving then access. So far I was able to add the user just by editing <code>configmap/aws-auth</code> (<code>kubectl edit -n kube-system configmap/aws-auth</code>) and adding new user to </p> <pre><code>mapUsers: | - userarn: arn:aws:iam::123456789:user/user01 user...
roy
<p>Essentially what you want is to define a cluster role and use a role binding to apply it to a specific namespace. Using a cluster role (rather than a role) allows you to re-use it across namespaces. Using a role binding allows you to target a specific namespace rather than giving cluster-wide permissions.</p>
Michael Hausenblas
<p>I had a t2.micro server running where i had deployed Minikube, however due to memory issue i scared up the server size. For which i had to stop and start the instance.</p> <p>But now after restarting, when i try with kubectl commands i get the below error.</p> <pre><code>root@ip-172-31-23-231:~# kubectl get nodes ...
Shruthi Bhaskar
<p>I had the same error. In my case minikube was not running. I started it with</p> <pre><code>minikube start </code></pre>
mkumar118
<p>Consider the following shell script, where <code>POD</code> is set to the name of a K8 pod.</p> <pre><code>kubectl exec -it $POD -c messenger -- bash -c &quot;echo '$@'&quot; </code></pre> <p>When I run this script with one argument, it works fine.</p> <pre><code>hq6:bot hqin$ ./Test.sh x x </code></pre> <p>When I ...
merlin2011
<p>I managed to work around this with the following solution:</p> <pre><code>kubectl exec -it $POD -c messenger -- bash -c &quot;echo $*&quot; </code></pre> <p>This appears to have the additional benefit that I can do internal redirects.</p> <pre><code>./Test.sh x y '&gt; /tmp/X' </code></pre>
merlin2011
<p>In the Amazon EKS User Guide, there is <a href="https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html" rel="nofollow noreferrer">a page</a> dedicated to creating ALB ingress controllers by using an eponymous third-party tool, <a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller" rel="no...
David Bruce Borenstein
<blockquote> <p>Does anyone happen to know which it is? Why doesn't the AWS walkthrough need me to install Kube2iam?</p> </blockquote> <p>Yes, I can authoritatively answer this. In 09/2019 <a href="https://aws.amazon.com/blogs/opensource/introducing-fine-grained-iam-roles-service-accounts/" rel="noreferrer">we launc...
Michael Hausenblas
<p>When I try to run <code>kubectl get namespaces</code> or <code>kubectl get nodes</code> commands etc. I am getting this error (I am using Azure Kubernetes Service). I would appreciate any help with this issue.</p> <pre><code>Error from server (Forbidden): namespaces is forbidden: User "XXXXXXXXXXXXXX" cannot list n...
krishna m
<p>This is an authorization module error message: as explained in the <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="nofollow noreferrer">Kubernetes docs</a> and, for example, <a href="https://speakerdeck.com/mhausenblas/kubernetes-security-from-image-hygiene-to-network-policies?slide=29" ...
Michael Hausenblas
<p>I have several docker images that I want to use with <code>minikube</code>. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?</p> <p>Stuff I tried: <br>1. I tried running these commands (separately, deleting the instances of miniku...
Kapil Gupta
<p>As the <a href="https://minikube.sigs.k8s.io/docs/handbook/pushing/#1-pushing-directly-to-the-in-cluster-docker-daemon-docker-env" rel="noreferrer">handbook</a> describes, you can reuse the Docker daemon from Minikube with <code>eval $(minikube docker-env)</code>.</p> <p>So to use an image without uploading it, you ...
svenwltr
<p><strong>Updated</strong></p> <p>So, I followed the <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate-getting-started.html" rel="nofollow noreferrer">AWS docs</a> on how to setup an EKS cluster with Fargate using the <a href="https://eksctl.io/usage/fargate/" rel="nofollow noreferrer">eksctl</a> tool...
Kryten
<p>In your service, try adding the following annotation:</p> <pre><code> annotations: alb.ingress.kubernetes.io/target-type: ip </code></pre> <p>And also you'd need to explicitly tell the Ingress resource via the <code>alb.ingress.kubernetes.io/healthcheck-path</code> annotation where/how to perform the health c...
Michael Hausenblas
<p>I have a config file named "pod.yaml" for making a pod like bellow:</p> <p><code> apiVersion: v1 kind: Pod metadata: name: myapp labels: app: myapp spec: containers: - name: comet-app image: gcr.io/my-project/my-app:v2 ports: - containerPort: 5000 </code></p> <p>and a co...
Quoc Lap
<p>The problem with <code>service.yaml</code> is that the selector is wrong. <a href="https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" rel="nofollow noreferrer">How it works</a> is that a service by default routes traffic to pods with a certain label. Your pod has the label <code>app...
Michael Hausenblas
<p>I have a Kubernetes cluster with 2 containers running in a single workload. </p> <p>One container is running a Flask server application and the other is running an angular application. I need to have this pod set up in a way where both applications can communicate with each other within the localhost. I need the a...
Jithin Thomas
<p>Rather than localhost (<code>127.0.0.1</code>), make sure your flask server is reachable via <em>any</em> local IP, that is, <code>app.run(host='0.0.0.0')</code>.</p>
Michael Hausenblas
<p>I have a Microk8s cluster running gitea, harbor and droneci. Everything is hosted under *.dev.mydomain.com and there is a wildcard certificate for that. The certificate is signed using a private CA.</p> <p>I'm trying to push the CA certificate to the Pods running the Drone CI builds such that they can push/pull from...
Constantine Loukas
<p>As the runners are Alpine Linux based all you should have to do is to mount your certificates in the <code>/usr/local/share/ca-certificates/</code> folder (<em>not</em> in a subfolder but right into that folder). Alpine should then add all certificates from there to <code>/etc/ssl/certs</code> for you.</p>
omni
<p>I need to create a shell-script which examine the cluster Status.**</p> <p>I saw that the <code>kubectl describe-nodes</code> provides lots of data I can output it to json and then parse it but maybe it’s just overkill. Is there a simple way to with <code>kubectl</code> command to get the status of the cluster ? ju...
Jenny M
<p>The least expensive way to check if you can reach the API server is <code>kubectl version</code>. In addition <code>kubectl cluster-info</code> gives you some more info.</p>
Michael Hausenblas
<p>There are some methods natively supported such as basic auth , X509 certificates and webhook tokens.</p> <p>Is there some workaround/project to use LDAP for user authentication with Kubernetes. I need users to be grouped in LDAP , and then use role binding to bind the group to a specific namespace with a role.</p>
Ijaz Ahmad
<p>Yes you can integrate with LDAP, for example:</p> <ul> <li>Using <a href="https://github.com/dexidp/dex#connectors" rel="noreferrer">dex</a></li> <li>With Torchbox's <a href="https://github.com/torchbox/kube-ldap-authn" rel="noreferrer">kube-ldap-authn</a> (hint: read this <a href="https://icicimov.github.io/blog/v...
Michael Hausenblas
<p>I am trying to setup Fluent Bit for Kuberentes on EKS + Fargate. I was able to get logs all going to one general log group on Cloudwatch but now when I add fluent-bit.conf: | to the data: field and try to apply the update to my cluster, I get this error:</p> <blockquote> <p>for: &quot;fluentbit-config.yaml&quot;: a...
Frederick Haug
<p>As per <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate-logging.html" rel="nofollow noreferrer">docs</a> (at the very bottom of that page and yeah, we're in the process of improving them, not happy with the current state) you have a couple of sections in there that are not allowed in the context of ...
Michael Hausenblas
<p>I have tried setting max nodes per pod using the following upon install:</p> <pre class="lang-sh prettyprint-override"><code>curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC=&quot;--max-pods 250&quot; sh -s - </code></pre> <p>However, the K3s server will then fail to load. It appears that the <code>--max-pods</code> ...
Kyle
<p>To update your existing installation with an increased max-pods, add a kubelet config file into a k3s associated location such as <code>/etc/rancher/k3s/kubelet.config</code>:</p> <pre><code>apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration maxPods: 250 </code></pre> <p>edit <code>/etc/systemd/sys...
dols
<p>Is it possible to visualize kubernetes topology and see it update on-the-fly as objects are added/deleted/linked?</p> <p>I saw a video at <a href="https://www.youtube.com/watch?v=38SNQPhsGBk" rel="nofollow noreferrer">https://www.youtube.com/watch?v=38SNQPhsGBk</a> where service/pods show up as icons on a graph. Fo...
user674669
<p>There are many options but the one I like most is <a href="https://www.weave.works/oss/scope/" rel="nofollow noreferrer">Weave Scope</a> where you get visualizations such as:</p> <p><a href="https://i.stack.imgur.com/lTFKn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lTFKn.jpg" alt="Weave scope...
Michael Hausenblas
<p>For our use-case, we need to access a lot of services via NodePort. By default, the NodePort range is 30000-32767. With <strong>kubeadm</strong>, I can set the port range via <em>--service-node-port-range</em> flag.</p> <p>We are using Google Kubernetes Engine (GKE) cluster. How can I set the port range for a GKE c...
Huy Hoang Pham
<p>In GKE, the control plane is managed by Google. This means you don't get to set things on the API Server yourself. That being sad, I <em>believe</em> you can use the <code>kubemci</code> CLI tool to achieve it, see <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/multi-cluster-ingress" rel="nofollow n...
Michael Hausenblas
<p>I have to setup a monitoring environment for my EKS cluster. Prometheus is running on external node and I am trying to use node exporter daemonset for getting metrics. But on prometheus when I see the targets I am not able to see any target instead of just local host.</p> <p><strong>Kubernetes_sd_config block</stron...
meghashukla
<p>The logs you shared point to the problem:</p> <pre><code>... unable to read authorization credentials file /etc/prometheus/token: open /etc/prometheus/token: no such file or directory&quot; </code></pre> <p>The token file for in-cluster workloads is by default mounted at <code>/var/run/secrets/kubernetes.io/servicea...
Michael Hausenblas
<p>We have an openshift container platform url that contains multiple projects like</p> <ul> <li>project1</li> <li>project2</li> <li>project3</li> </ul> <p>Each project contains several pods that we are currently monitoring with NewRelic like </p> <ul> <li>pod1</li> <li>pod2</li> <li>pod3</li> </ul> <p>We are tryin...
Tywin Lannister
<p>Your question is pretty broad, so the answer will be the same :) Just to clarify - in your question:</p> <blockquote> <p>implement Prometheus + Grafana for all these projects <strong>separately</strong></p> </blockquote> <p>Are going to have for each project dedicated installation of Kubernetes? Prometheus + Grfana?...
evgenyl
<p>I am using Kubernetes Service of type Cluster IP, which will expose a deployment. In my container I want to use the Service IP (cluster IP). Is there any way I can get the IP Address inside the Pod/container? </p> <p>Is it possible to get the cluster IP from Service name?</p>
Karthik
<p>Yes, via the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" rel="nofollow noreferrer">environment-level service discovery</a> mechanism. Note, however that any service that you want to access like this must be created <strong>before</strong> the pod itself has been la...
Michael Hausenblas
<p>What is the simplest way to find out the Availability of a K8s service over a period of time, lets say 24h. Should I target a pod or find a way to calculate service reachability</p>
Nesim Pllana
<p>I'd recommend to not approach it from a binary (is it up or down) but from a &quot;how long does it take to serve requests&quot; perspective. In other words, phrase your availability in terms of SLOs. You can get a very nice automatically generated SLO-based alter rules from <a href="https://promtools.dev/alerts/lat...
Michael Hausenblas
<p>I need to start kubernetes pods in a sequence like pod2 should start only when pod1 is up and running.</p> <p>we can do this in <code>docker-compose.yml</code> using <code>depends_on</code></p>
sam
<p>No, there is no built-in dependency management equivalent to <code>depends_on</code> available. In general, we assume loosely coupled services and as a good practice there should be no hard dependency in terms of start-up order, but retries and timeouts should be used. If you have to hardcode dependencies, you can u...
Michael Hausenblas
<p>I'm moving an Apache Mesos application, where my configurations are based in JSON, to Kubernetes, where my configurations are based in YAML. Would the JSON configuration files work as a YAML file since YAML is a superset of JSON, or would I need to write a new YAML file?</p>
emp440
<p>Yes, JSON works as well, it's just more pain than YAML to write it, manually. Also, you may be able to use <a href="https://github.com/micahhausler/container-transform" rel="nofollow noreferrer">micahhausler/container-transform</a> to convert your Marathon specs to Kubernetes specs.</p>
Michael Hausenblas
<p>I have a Kubernetes Service that selects by doing:</p> <pre><code>spec: selector: backend: nlp-server </code></pre> <p>If there are multiple <code>Pods</code> which match the selector, which <code>Pod</code> does the <code>Service</code> route a request to? </p> <p>I am using the default <code>ClusterIP<...
cryanbhu
<p>In a nutshell, no you don't need the internal load-balancer you linked to. The <code>Service</code> resource <em>is</em> indeed a load-balancer. Depending on the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" rel="noreferrer">proxy mode</a> it could be roun...
Michael Hausenblas
<p>If a node loses communication with the master, will it continue to run its workload in a self-healing way?</p> <p>For instance, if the master is unavailable and a pod exceeds its cpu limit and is killed, will the node independently restart the pod because that pod has already been scheduled on the node?</p>
Dan Bowling
<p>Yes. The local (node) supervisor looking after your pods is the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/" rel="nofollow noreferrer">kubelet</a> and while you can't change things while the connection to the API server is not available, the pods already scheduled on the node ...
Michael Hausenblas
<p>currently i used docker-compose to arrange my application that consists of 3 dockerimages - a postgresql database and 2 wildfly application servers (Frontend-ui, backend).</p> <p>My <strong>docker-compose.yml</strong> looks like this:</p> <pre><code>version: '3.0' services: my-webgui-service: image: test/myw...
Shannon
<p>Yes it's possible, simply separate the different resources such as deployments, services, etc. with <code>---</code>. Concerning if it's a good practice or not: a matter of taste, rather. If you have all in one file it's more self-contained but for <code>kubectl apply -f</code> it doesn't really matter since it oper...
Michael Hausenblas
<p>I basically want to find the hard eviction strategy that kubelet is currently using.<br> I checked the settings in the /etc/systemd/system/kubelet.service file on my K8s node. In that the strategy I mentioned is as follows:<br> <code>--eviction-hard=nodefs.available&lt;3Gi</code> </p> <p>However, my pods seem to ...
Amanjeet Singh
<p>It is possible to <a href="https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generate-the-configuration-file" rel="noreferrer">dump the current kubelet configuration</a> using <code>kubectl proxy</code> along with the <code>/api/v1/nodes/${TARGET_NODE_FOR_KUBELET}/proxy/configz</code> path, de...
Michael Hausenblas
<p>I have a kubernetes setup with the configuration like below:</p> <pre class="lang-yaml prettyprint-override"><code>#--- kind: Service apiVersion: v1 metadata: name: myservice spec: selector: app: my-service ports: - protocol: &quot;TCP&quot; # Port accessible inside cluster port: 8080 ...
Ock
<p>Your ingress targets this service:</p> <pre><code> serviceName: myservice servicePort: 80 </code></pre> <p>but the service named <code>myservice</code> exposes port <code>8080</code> rather than <code>80</code>:</p> <pre><code> ports: - protocol: "TCP" # Port accessible inside cluster po...
Kos
<p>What about ReplicaSet_B and ReplicaSet_A update the same db? I hoped the pods in ReplicaSet_A were stopped with taking a snapshot. But there is not any explanation like this in <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">https://kubernetes.io/docs/concept...
Tolga Golelcin
<p>Yes. <code>ReplicaSets</code> (managed by <code>Deployments</code>) make two assumptions: 1. your workload is stateless, and 2. all pods are identical clones (other than their IP addresses). Now, <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSets</...
Michael Hausenblas
<p>I have a problem that my pods in minikube cluster are not able to see the service through the domain name.</p> <p>to run my minikube i use the following commands (running on windows 10):<br> <code>minikube start --vm-driver hyperv;</code><br> <code>minikube addons enable kube-dns;</code><br> <code>minikube addons e...
GrimSmiler
<p>So, you want to expose your app on Minikube? I've just tried it using the default <code>ClusterIP</code> service type (essentially, removing the <code>ExternalName</code> stuff you had) and with <a href="https://gist.github.com/mhausenblas/37e43f1755f2895a2f87719bb4144daa" rel="nofollow noreferrer">this YAML file</a...
Michael Hausenblas
<p>I have Windows 11 Home (which does not allow Hyper-V, only Pro edition does). Installed WSL2 and Docker Desktop.</p> <p>Installed Minikube using Chocolatey but it refused to start. Searching on SO, I found this advice in several posts, but it failed to work.</p> <pre><code>PS C:\WINDOWS\system32&gt; docker system pr...
likejudo
<p>I thought of trying to have <em>Docker Desktop</em> already running <strong>before</strong> I start minikube.</p> <p>From the Windows Start menu, I ran <em>Docker Desktop in Administrator mode</em>.</p> <p>Now I ran the command again to remove old stuff,</p> <pre><code>PS C:\WINDOWS\system32&gt; minikube delete * Re...
likejudo
<p>Is <a href="https://jfrog.com/container-registry/" rel="noreferrer">the registry</a> a pivot for JFrog product portfolio or is it some set of additional capabilities? The functionality is very interesting either way but it would be nice to to understand the details.</p>
rhatr
<p>In a nutshell, <a href="https://jfrog.com/container-registry/" rel="noreferrer">JFrog Container Registry</a> <strong>is</strong> Artifactory. It is the same codebase, the same architecture and mostly the same features. You get:</p> <ul> <li>Unlimited Docker and Helm registries* <ul> <li>local registries for your i...
JBaruch
<p>We are planning to setup Highly Available Jenkins setup in container platform using kubernetes. We are looking at setting up one Active master and another master in standby mode. Jenkins data volume is going to be stored in a global storage that is shared between the two master containers.</p> <p>In case the active...
P Ekambaram
<p>This contradicts with how one should IMHO run applications in Kubernetes. Active/passive is a concept for the past century.</p> <p>Instead, configure a health check for the Jenkins Deployment. If that fails, Kubernetes will automatically kill the task and start a replacement (which will be available only a few seco...
StephenKing
<p>So I'm setting up a NATS cluster at work in OpenShift. I can easily get things to work by having each NATS server instance broadcast its Pod IP to the cluster. The guy I talked to at work strongly advised against using the Pod IP and suggested using the Pod name. In the email, he said something about if a pod restar...
Fred Ma
<p>I believe "the guy at work" has a point, to a certain extent, but it's hard to tell to which extent it's cargo-culting and what is half knowledge. The point being: the pod IPs are not stable, that is, every time a pod gets re-launched (on the same node or somewhere else, doesn't matter) it will get a new IP from the...
Michael Hausenblas
<p>In CI, with gcp auth plugin I was using gcloud auth activate-service-account ***@developer.gserviceaccount.com --key-file ***.json prior to execute kubectl commands. Now with gke-gcloud-auth-plugin I can’t find any equivalent to use a gcp service account key file. I've installed <code>gke-gcloud-auth-plugin</code> a...
bonomo
<p>You will need to set the env variable to use the new plugin before doing the <code>get-credentials</code>:</p> <pre class="lang-bash prettyprint-override"><code>export USE_GKE_GCLOUD_AUTH_PLUGIN=True gcloud container clusters get-credentials $CLUSTER \ --region $REGION \ --project $PROJECT \ --internal-ip </co...
Ben Walding
<p>My namespace has some custom metadata labels. Some have the labels some don't. Is there any way to get the namespaces which has a particular label using kubectl?</p>
codec
<p>Yes. Like so:</p> <pre><code>$ kubectl create ns nswithlabels $ kubectl label namespace nswithlabels this=thing $ kubectl describe ns/nswithlabels Name: nswithlabels Labels: this=thing Annotations: &lt;none&gt; Status: Active No resource quota. No resource limits. $ kubectl get ns -l=this ...
Michael Hausenblas
<p>I'm doing some tutorials using k3d (k3s in docker) and my yml looks like this:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: nginx labels: app: nginx spec: selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers...
A G
<p>The question is, is the NodePort range mapped from the host to the docker container acting as the node. The command <code>docker ps</code> will show you, for more details you can <code>docker inspect $container_id</code> and look at the <code>Ports</code> attribute under <code>NetworkSettings</code>. I don't have k3...
pst
<p>I am trying to delete <a href="https://github.com/tektoncd/pipeline" rel="nofollow noreferrer">tekton</a> kubernetes resources in the context of a service account with an on-cluster kubernetes config, and am experiencing errors specific to accessing <code>deletecollection</code> with all tekton resources. An example...
scniro
<p>Given two namespaces <code>my-namespace</code> and <code>my-account</code> the default service account in the <code>my-account</code> namespace is correctly granted permissions to the <code>deletecollection</code> verb on <code>pipelines</code> in <code>my-namespace</code>.</p> <p>You can verify this using <code>kub...
pst
<p>I have a few different containerized web apps running on Azure Container Instance (ACI). I recently noticed that some of these containers just restart with no apparent reason once in a month or so. Since the restarts are on different apps/containers each time, I have no reason to suspect that the apps are crashing.<...
rahulmohan
<p>Same here</p> <p>I've contacted MS support and got the response that <strong>per design</strong> ACI maintenance can restart the hosts so <strong>it can't be expected to run ACI for weeks uninterrupted</strong></p> <p>Recommendation is to</p> <ul> <li>adapt your app to be resilient (so you don't care about restarts)...
Tomas
<p>I have 3 applications in separate directories handled with the kubernetes manifest files.</p> <p>And I want to use terraform to deploy all the applications in different directories.</p> <p>The structure of the applications show below.</p> <pre><code>app-1 L kubernetes_manifest L deployment.yaml. ## use Dockerf...
Eric Lee
<p>I maintain the <a href="https://registry.terraform.io/providers/kbst/kustomization/latest" rel="nofollow noreferrer">Kustomization Provider</a> which allows you to use native Kubernetes YAML in Terraform.</p> <p>You can either use the provider directly or use a convenience module I additionally provide. I maintain b...
pst
<p>I am trying to create a Dynamic storage volume on Kubernetes in Ali cloud. First I have created a storage class.</p> <pre><code>kind: StorageClass apiVersion: storage.k8s.io/v1beta1 metadata: name: alicloud-pv-class provisioner: alicloud/disk parameters: type: cloud_ssd regionid: cn-beijing zoneid: cn-beij...
ygnr
<p>As pointed out in <a href="https://www.alibabacloud.com/help/doc-detail/86612.htm" rel="noreferrer">the docs</a>, the minimum size for SSD is <code>20Gi</code>, so I'd suggest to change <code>storage: 64Mi</code> to <code>storage: 20Gi</code> to fix it.</p>
Michael Hausenblas
<p>I need to forward port of one Kubernetes pods. One possible way is to execute kubectl command like bellow:</p> <p>kubectl port-forward podm-resource-manager-56b9ccd59c-8pmdn 8080</p> <p>Is there a way to achieve the same using python (for example python kubernetes-client)?</p>
japiasec
<p>The method <a href="https://github.com/kubernetes-client/python/blob/release-9.0/kubernetes/docs/CoreV1Api.md#connect_get_namespaced_pod_portforward" rel="noreferrer">connect_get_namespaced_pod_portforward</a> is available in in the python kubernetes-client to do a port forward.</p>
Jaime M.
<p>Is it possible to configure which storageclasses can be used by namespace?</p> <p>So for example I have a single cluster for production and development.</p> <p>I want to configure a set of storageclasses for development and a different set of storageclasses for production.</p> <p>I want to strictly configure that...
Jxadro
<p>A <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="noreferrer">storage class</a> in Kubernetes is a cluster-wide resource, so you can't restrict the usage regarding a namespace out-of-the-box. What you can do, however, is to write a customer controller akin to what Banzai did with their <a...
Michael Hausenblas