Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I have two Api's on the same cluster and when I run the get services I get the following.</p> <pre><code>dh-service ClusterIP 10.233.48.45 &lt;none&gt; 15012/TCP 70d api-service ClusterIP 10.233.54.208 &lt;none&gt; 15012/TCP </code></pre> <p>Now I want to make a Api ...
Mr.Gomer
<blockquote> <p>I want to make a Api call from one API to the other</p> </blockquote> <p>If they are in the same namespace and you use http, you can use:</p> <pre><code>http://dh-service http://api-service </code></pre> <p>to access them.</p> <p>If e.g. the <code>api-service</code> is located in a different namespace e...
Jonas
<p>I am configuring a statefulset deploying 2 Jira DataCenter nodes. The statefulset results in 2 pods. Everything seems fine until the 2 pods try to connect to eachother. They do this with their <strong>short hostname</strong> being <em>jira-0</em> and <em>jira-1</em>.</p> <p>The jira-1 pod reports <em>UnknownHostExce...
Charlie
<blockquote> <p>That solves my issue but I think it shouldn't be necessary to add this?</p> </blockquote> <p>From the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet documentation</a>:</p> <blockquote> <p>StatefulSets currently require a Headless Se...
Jonas
<p>we have defined our YAML with</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: mypod spec: containers: - image: mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine name: mypod volumeMounts: - name: azure mountPath: /mnt/azure volumes: - name: azure azureFile: secretName: ...
vel
<p>Your Pod Yaml is ok.</p> <p>The <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">Kubernetes Persistent Volumes</a> is a newer abstraction. If your application instead uses <code>PersistentVolumeClaim</code> it is <strong>decoupled</strong> from the type of storage y...
Jonas
<p>I have to create a readyness and liveness probe for a node.js container (docker) in kubernetes. My problem is that the container is NOT a server, so I cannot use an http request to see if it is live. </p> <p>My container runs a <a href="https://www.npmjs.com/package/cron" rel="nofollow noreferrer">node-cron</a> pro...
OLIVIER
<p><strong>Liveness command</strong></p> <p>You <em>can</em> use a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command" rel="nofollow noreferrer">Liveness command</a> as you describe. However, I would recommend to design your job/task...
Jonas
<p>After upgrade to new version of kubernetes, I found it add <code>annotation</code> and <code>managedFields</code> field config. Now the yaml file is so long that 96% of content is the two field, but I did not think I would use the field and change it, is it possible to hidden the content and make the yaml config mor...
Dolphin
<p>If you upgrade you <code>kubectl</code> client to 1.21 or newer, these fields are hidden.</p>
Jonas
<p>When I run <code>skaffold init</code> in my app directory it shows me:</p> <pre><code>one or more valid Kubernetes manifests are required to run skaffold </code></pre> <p>The content of the directory:</p> <p><a href="https://i.stack.imgur.com/LnTop.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LnTop.png"...
softshipper
<p>Yes, you need Kubernetes manifests in the same project. Typically a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="noreferrer">Deployment</a>-manifest and perhaps Service and Ingress as well if you want.</p> <p>A Deployment-manifest can be generated with (using <code>&gt;</code>...
Jonas
<p>A simple question about scalability. I have been studying about scalability and I think I understand the basic concept behind it. You use an orchestrator like Kubernetes to manage the automatic scalability of a system. So in that way, as a particular microservice gets an increase demand of calls, the orchestrator wi...
Luca Prodan
<blockquote> <p>In the case of our application, we are using SQLite, so each microservice has its own copy of the database.</p> </blockquote> <p>One of the most important aspects of services that scale-out is that they are <a href="https://12factor.net/processes" rel="nofollow noreferrer">stateless</a> - services on Ku...
Jonas
<p>As the title suggests, I can view Kubernetes bearer tokens in the Jenkins logs (/logs/all endpoints). Isn't this a security concern? Is there a way to stop it without having to meddle with the Kubernetes plugin source code? </p> <p>Edit:</p> <p>Example log:</p> <pre><code>Aug 29, 2020 7:39:41 PM okhttp3.internal....
user5056973
<p>See the documentation for <a href="https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor" rel="nofollow noreferrer">okhttp</a></p> <blockquote> <p><strong>Warning:</strong> The logs generated by this interceptor when using the HEADERS or BODY levels have the potential to leak sensitive informati...
Jonas
<p>Let's say I have deployed a full stack application in my minikube cluster(with frontend and several backend APIs), and I want the authentication api pod to scale from 0 replica to n only when I clicked &quot;login&quot; in the frontend UI, is it possible to achieve this through service discovery? If so, how? Thanks!...
efgdh
<p>It's unclear what you mean by &quot;pod to speed up only when...&quot; but if you mean that you want to have your app deployed, but scaled down to <strong>0 replicas</strong>, and only scale up to <strong>n replicas</strong> when there is traffic to the service, then <a href="https://knative.dev/docs/serving/" rel="...
Jonas
<p>I have installed the latest Minishift release <code>1.34.3</code> on Windows 10 Hyper-V. The OpenShift client version is <code>4.6.16</code> as expected however the Kubernetes version is <code>1.11</code>.</p> <pre><code>PS C:\Tools&gt; minishift version minishift v1.34.3+4b58f89 PS C:\Tools&gt; oc version Client V...
pirateofebay
<p><a href="https://github.com/minishift/minishift" rel="nofollow noreferrer">minishift</a> is based on OpenShift 3, not the newer OpenShift 4.</p> <blockquote> <p><strong>Note:</strong> Minishift runs OpenShift 3.x clusters. Due to different installation methods, OpenShift 4.x clusters are not supported.</p> </blockqu...
Jonas
<p>Is there a way to prevent a Pod from deploying onto Kubernetes if it does not have memory resource requests &amp; limits set?</p>
DarVar
<p>Yes, you can apply <a href="https://kubernetes.io/docs/concepts/policy/limit-range/" rel="nofollow noreferrer">Limit Ranges</a>. See e.g. <a href="https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/" rel="nofollow noreferrer">Configure Minimum and Maximum CPU Constraints fo...
Jonas
<p>According to the Kubernetes docs a cluster can have up to 5000 nodes. Imagine I have then node0 with 1CPU, node1 with 2CPU, etc.</p> <p>Let's say I have a single-core, synchronous process which I want to run instances of. Am I then limited by the smallest node in a heterogeneous cluster of nodes? If not, can I enfor...
Peter Badida
<blockquote> <p>Am I then limited by the smallest node in a heterogeneous cluster of nodes? If not, can I enforce choosing the node largest CPU (which would then limit me to the single node) or smallest CPU (which would then allow seamless and consistent parallel execution) or will Kubernetes do it in the background?</...
Jonas
<p>In Kubernetes, I have a statefulset with a number of replicas. I've set the updateStrategy to RollingUpdate. I've set podManagementPolicy to Parallel. My statefulset instances do not have a persistent volume claim -- I use the statefulset as a way to allocate ordinals 0..(N-1) to pods in a deterministic manner.</p> ...
Jon Watte
<p>I assume that you need this for a <em>stateful workload</em>, a workload that e.g. requires writes. Otherwise you can use Deployments with multiple pods online for your shards. A key feature with StatefulSet is that they provide <strong>unique stable network identities</strong> for the instances.</p> <blockquote> <p...
Jonas
<p>I have 2 services deployed in Kubernetes both should be ssl end to end. </p> <ol> <li>Web based applications</li> <li>Business service</li> </ol> <p>Web based Application needs sticky session, so its been exposed using Ingress.</p> <pre><code>Web Based Application ---&gt; Ingress(HTTPS) --&gt; Service(ClusterIP) ...
user1578872
<p>It depends on how you access the <em>Business Service</em> from your <em>Web Based App</em>. You should use DNS service discovery here, see <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">DNS for Services and Pods </a> and your https-certificate must refle...
Jonas
<ul> <li><p>I am trying to figure out the networking in Kubernetes, and especially the handling of multicontainer pods. In my simple scenario, I have total of 3 pods. One has two containers in it and the other one has only one container which wants to communicate with a specific container in that multicontainer pod. I ...
Mark R. Chandar
<p><a href="https://curl.se/" rel="nofollow noreferrer">curl</a> is a command line tool. It is not a server that is listening to a port, but a client tool that can be used to access servers.</p> <p>This container does not contain a <em>server</em> that listen to a port:</p> <pre><code> - name: sidecar image: curlima...
Jonas
<p>I'm still a Kubernetes newbie but I am already confronted with what I think is a mammoth task. My company is hosting a Kubernetes cluster. Because of internal policies, we are obliged to have everything georedundand. Which means we are supposed to build a second cluster (identical to the already existing one) in a d...
Macus Smith
<p>Kubernetes is already a distributed system, by design.</p> <p>It is more common to run a Kubernetes cluster by using <strong>3</strong> data centers - since it is built upon consensus algorithms like <a href="https://raft.github.io/" rel="nofollow noreferrer">raft</a>. This replaces older ways to run systems by usin...
Jonas
<p>I am unable to identify what the exact issue with the permissions with my setup as shown below. I've looked into all the similar QAs but still unable to solve the issue. The aim is to deploy Prometheus and let it <strong>scrape</strong> <code>/metrics</code> endpoints that my other applications in the cluster expose...
BentCoder
<blockquote> <p>User &quot;system:serviceaccount:default:default&quot; cannot list resource &quot;endpoints&quot; in API group &quot;&quot; at the cluster scope&quot;</p> </blockquote> <blockquote> <p>User &quot;system:serviceaccount:default:default&quot; cannot list resource &quot;pods&quot; in API group &quot;&quot; ...
Jonas
<p>I have a really strange and annoying Kubernetes issue. I developed sign-in service (like <a href="https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-aspnet-core-webapp" rel="nofollow noreferrer">this</a>) and it is working without errors when running it on my Windows laptop. In addition, ...
Daan
<blockquote> <p>Microsoft.AspNetCore.Server.Kestrel[0] Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied at</p> </blockquote> <p>Looks like your container did not have enough permissions to listen on the port that you want.</p> <p>In Linux, you typically need privileged permissions to ...
Jonas
<p>We have microservices running AWS EKS cluster and many of the microservices having more than 10 pod replicas, for monitoring we are using grafana. unfortunately some of the pods in same microsevices are showing very high CPU usage say 80% and some are lke 0.35%. we have understanding like kubernetes will do the load...
Vishwanath.M
<p>How traffic is distributed from outside the cluster to your pods depends on the Load Balancer Controller, e.g. <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/how-it-works/" rel="nofollow noreferrer">AWS Load Balancer Controller</a>.</p> <p>But the Load Balancer Controller typically does...
Jonas
<p><strong>What I'm trying to solve :</strong> Have a Java microservice be aware of total number of Replicas. This replica count is dynamic in nature</p> <p><strong>Problem:</strong> Kubernetes downward API has limited metadata that doesnt include this information. Is there a way to qausi-query a kubectl-like command n...
stackoverflow
<blockquote> <p>Kubernetes downward API has limited metadata that doesnt include this information. Is there a way to qausi-query a kubectl-like command natively from a container?</p> </blockquote> <p>You need to query the Kubernetes API server for info about the number of replicas for a specific Deployment. You can do ...
Jonas
<p>Currently our k8s project has following use case were the namespaces are hardcoded into the values.yaml and application source codes</p> <pre><code>(apps) namespace - NS1 &gt; micro-service-A1 &gt; micro-service-A2 &gt; micro-service-A3 (database) namespace - DB1 &gt; mongo-service (messaging...
Bhavani Prasad
<h2>Externalize configuration</h2> <p>It is good to <em>externalize your configuration</em> so that you can use a different configuration without building a new image.</p> <p>Use a ConfigMap for configuration with address e.g. to other services or databases. See <a href="https://kubernetes.io/docs/concepts/services-n...
Jonas
<p>Is it possible to specify or change the service account to be used when accessing the kube api from within the cluster using rest.InClusterConfig in golang? It seems to use the default service account (or the service account the pod running is under) but i want to use another service account. I am aware that i can u...
NonoPa Naka
<p>In Kubernetes, a Pod (or multiple for the same service) has a ServiceAccount. That is the way it is designed.</p> <p>This ServiceAccount can be a specific that you create, you don't have to use a default ServiceAccount in a Namespace.</p>
Jonas
<p>I am using the kubernetes operator to create a custom resource in the cluster, the CR has the <code>Status</code> field populated, but when the object gets created the <code>Status</code> field is empty.</p> <p>This is how I am creating the CR:</p> <pre><code>reconcile.Create(ctx, &amp;object) </code></pre> <p>This ...
Vishrant
<p>The architecture of Kubernetes API and resources follows a pattern.</p> <ol> <li><p>Clients may create resources, by specifying a <em>desired state</em> (This is the <code>spec:</code> part of a resource). This is a &quot;create&quot; request sent to the API Server.</p> </li> <li><p>Controllers, subscribe/watch to c...
Jonas
<p>I have an ASP.NET Core app that I want to configure with HTTPS in my local kubernetes clustur using minikube.</p> <p>The deployment yaml file is:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: kube-volume labels: app: kube-volume-app spec: replicas: 1 selector: matchLabels: ...
yogihosting
<p>I think your approach does not fit well with the architecture of Kubernetes. A TLS certificate (for https) is coupled to a hostname.</p> <p>I would recommend one of two different approaches:</p> <ul> <li>Expose your app with a Service of <code>type: LoadBalancer</code></li> <li>Expose your app with an <a href="https...
Jonas
<p>My requirement is to copy large files from Kubernetes Prod PVC to Non-Prod PVC? This has to happen by a scheduled job. What options do I have to achieve this? Any suggestions, please.</p>
Visweswara Sriadibhatla
<p>In order to do that please remember that the Prod PVC has to be on filesystem/volume which supports multiple access modes (for example, NFS can support multiple read/write clients).</p> <p>Filesystems like ext4 are not clustered and you cannot have two different systems accessing the same ext4 filesystem (unless you...
pb100
<p>I'm not quite sure if which of the following approaches is the better approach to create a controller in kubernetes however I know that:</p> <ul> <li>I don't want to create a custom resource by any means.</li> <li>I do only want to fetch information about k8s native resources (pods, ...) given that there might be a ...
Elaheh
<p>If you don't want to &quot;control&quot; anything, there is no need to create a <em>controller</em>.</p> <p>If you just want to &quot;read&quot; and &quot;watch&quot; resources, you can use <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">client-go</a> and see e.g. <a href="https://www.cnc...
Jonas
<p>Everytime I try to access a NodePort on my machine, it says &quot;Error Connection Refused.&quot; I don't understand since the examples I read online imply that I can run Docker Desktop on my laptop, connect to the cluster, and access services via their nodeport.</p> <p>My machine:</p> <ul> <li>Windows 10</li> <li>D...
Veridian Dynamics
<p>Kubernetes run locally, still runs on its internal network.</p> <blockquote> <p>curl.exe <a href="http://192.168.65.4:30007" rel="nofollow noreferrer">http://192.168.65.4:30007</a></p> </blockquote> <p>Here you use an IP address that is internal Kubernetes network. You must expose your Kubernetes service so that it ...
Jonas
<p>I'm having trouble with finding a solution that allows to terminate only certain pods in a deployment.</p> <p>The application running inside the pods does some processing which can a take lot of time to be finished.</p> <p>Let's say I have 10 tasks that are stored in a database and I issue a command to scale the dep...
Aurel Drejta
<p>In this case Kubernetes Job might be better suited for this kind of task.</p>
pb100
<p>I am looking for how to have a spare/cold replica/pod in my Kubernetes configuration. I assume it would go in my Kuberentes deployment or HPA configuration. Any idea how I would make it so I have 2 spare/cold instances of my app always ready, but only get put into the active pods once HPA requests another instance...
Brian
<blockquote> <p>I am just wanting to always have 2 spare for scaling, or if one becomes unavailable or any reason</p> </blockquote> <p>It is a good practice to have at least two replicas for services on Kubernetes. This helps if e.g. a node goes down or you need to do <a href="https://kubernetes.io/docs/concepts/worklo...
Jonas
<p>I have a problem mounting 2 files in a pod, one is being treated as a directory for some reason (maybe stupid one, but I looked and looked, couldn't find a solution).</p> <p>in my <code>config</code> folder there's 2 files:</p> <pre><code>config |- log4j.properties |- server.main.properties </code></pre> <p>Running ...
dejanmarich
<blockquote> <p>subPath: server.properties</p> </blockquote> <p>Wouldn't you want to use it as below?</p> <blockquote> <p>subPath: server.main.properties</p> </blockquote>
Jonas
<p>I have an 7.4.0 ES cluster using ECK 1.0 and after my 3 dedicated master nodes got out of disk space, I deleted them along with the volumes to test a critical scenario.</p> <p>Once the new eligible masters were created, they couldn't elect a new member. Now the cluster is stuck forever although it sees the new mast...
gmolaire
<blockquote> <p>Be aware that the masters had no data.</p> </blockquote> <p>This is not really true. The master nodes hold the cluster metadata which Elasticsearch needs to correctly understand the data stored on the data nodes. Since you've deleted the metadata, the data on the data nodes is effectively meaningless...
Dave Turner
<p>In most resource managers, we can set the container's CPU usage and memory usage. But I'm curious about the technical reasons for not supporting disk I/O resource allocation for containers.</p>
김민우
<p>According to <a href="https://andrestc.com/post/cgroups-io/" rel="nofollow noreferrer">Using cgroups to limit I/O</a> this requires <strong>cgroups v2</strong> and that is quite recent feature for container runtimes.</p> <p>For Kubernetes support, you should probably follow <a href="https://github.com/kubernetes/enh...
Jonas
<p>I'm having a hard time getting EKS to expose an IP address to the public internet. Do I need to set up the ALB myself or do you get that for free as part of the EKS cluster? If I have to do it myself, do I need to define it in the terraform template file or in the kubernetes object yaml?</p> <p>Here's my EKS cluster...
williamcodes
<p>You need to install the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/" rel="nofollow noreferrer">AWS Load Balancer Controller</a> by following the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/deploy/installation/" rel="nofollow noreferrer">installat...
Jonas
<p>I'm new to Kubernetes and to supporting a particular website hosted in Kubernetes. I'm trying to figure out why cert-manager did not renew the certificate in the QA environment a few weeks back.</p> <p>Looking at the details of various certificate-related resources, the problem seems to be that the challenge failed...
Simon Elms
<p>In the end I was unable to determine the cause of the certificate renewal failure. However, events on one of the certificate-related resources suggested previous renewals had worked. So I thought it was possible whatever the problem was might have been transient or a one-off, and that trying again to renew the cer...
Simon Elms
<p><strong>Setup</strong>:</p> <ul> <li>Azure Kubernetes Service</li> <li>Azure Application Gateway</li> </ul> <p>We have kubernetes cluster in Azure which uses Application Gateway for managing network trafic. We are using appgw over Load Balancer because we need to handle trafic at layer 7, hence path-based http rules...
Michael
<blockquote> <p>The exposed port should not be public, but public in the kubernetes cluster.</p> </blockquote> <p>I assume that you mean that your application should expose a port for clients within the Kubernetes cluster. You don't have to do any special in Kubernetes for Pods to do this, they can accept TCP connectio...
Jonas
<p>I have a cluster in AWS EKS and 1 node group which has 1 node, how to display node and pods using aws api? I have credentials for service account, how to use these credentials in an API and get list of available nodes and pods? when I try to execute command <code>kubectl get pods</code> it shows an error:</p> <block...
dev
<p>You need to do two things before accessing your cluster.</p> <ol> <li><p>Add your IAM Roles or Users to the <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">aws-auth ConfigMap</a> to configure who can access the cluster. The IAM role that was used for creating t...
Jonas
<p>I am trying to install the <code>aws-encryption-provider</code> following the steps at <a href="https://github.com/kubernetes-sigs/aws-encryption-provider" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/aws-encryption-provider</a>. After I added the <code>--encryption-provider-config=/etc/kubernetes/aw...
David Medinets
<p>Realizing that the apiserver is running inside a docker container, I connected to one of my controller nodes using SSH. Then I started a container using the following command to get a shell prompt using the same docker image that apiserver is using.</p> <pre class="lang-sh prettyprint-override"><code>docker run \ ...
David Medinets
<p>I am trying to create a deployment using its deployment yaml file in minikube. I have saved the deployment file locally.Please share the minikube kubectl command to create the deployment from the yaml file.</p>
Sailee Das
<p>Using native <code>kubectl</code> client you do this with the <code>kubectl apply</code> command and pass the <code>--filename</code> flag followed by the name of your yaml-file.</p> <p>Example:</p> <pre><code>kubectl apply --filename my-deployment.yaml </code></pre> <p>When using <a href="https://minikube.sigs.k8s....
Jonas
<p>I see that Kubernetes <code>Job</code> &amp; <code>Deployment</code> provide very similar configuration. Both can deploy one or more pods with certain configuration. So I have few queries around these:</p> <ul> <li>Is the pod specification <code>.spec.template</code> different in <code>Job</code> &amp; <code>Deploym...
Mukund Jalan
<p>Many resources in Kubernetes use a <a href="https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates" rel="noreferrer">Pod template</a>. Both <code>Deployments</code> and <code>Jobs</code> use it, because they manage Pods.</p> <blockquote> <p>Controllers for workload resources create Pods from a pod templat...
Jonas
<p>In my application I am using <a href="https://github.com/kubernetes-client/csharp" rel="nofollow noreferrer">c# kubernetes client</a>. I need to use Task.WhenAll but everytime namespaces is different and it fails compiling.</p> <pre><code> var configMap = await client.ListConfigMapForAllNamespacesAsync(cancellationT...
Arzu Suleymanov
<p>By using <code>await</code> every call is made and completed before the next runs. So, just remove the awaits and then you have a bunch of <code>Task</code>s which you can wait all:</p> <pre><code>var configMap = client.ListConfigMapForAllNamespacesAsync(cancellationToken: cancellationToken); var secret = client.Lis...
Jamiec
<p>For any example, the client-go connect to the kubernetes cluster with the kubeconfig file, but I don't want to do that. I've createed a service account, now I have a ServiceAccount Token, how to connect to the kubernetes cluster with this token outside of the kubernetes cluster?</p> <pre><code>package main import (...
yzhengwei
<p>The client-go already has built-in authentication both <strong>In Cluster Authentication</strong> (to be used from a Pod with a ServiceAccount) and also <strong>Out of Cluster Authentication</strong> (to be used from outside the cluster, e.g. for local development)</p> <p>The client-go has examples of both:</p> <ul>...
Jonas
<p>I'm new to k8s, so this question might be kind of weird, please correct me as necessary.</p> <p>I have an application which requires a <code>redis</code> database. I know that I should configure it to connect to <code>&lt;redis service name&gt;.&lt;namespace&gt;</code> and the cluster DNS will get me to the right pl...
Iain Lane
<h2>Design for resiliency</h2> <p>Modern applications and Kubernetes are (or should be) designed for resiliency. The applications should be designed without <em>single point of failure</em> and be resilient to changes in e.g. network topology. Also see <a href="https://12factor.net/backing-services" rel="nofollow noref...
Jonas
<p>What api endpoint can I call to get a pod or service's yaml?</p> <p>The kubectl command to get a pod's yaml is</p> <blockquote> <p>kubectl get pod my-pod -o yaml</p> </blockquote> <p>but what endpoint does kubectl use to get it?</p>
Cinnabams
<blockquote> <p>kubectl get pod my-pod -o yaml</p> </blockquote> <blockquote> <p>but what endpoint does kubectl use to get it?</p> </blockquote> <p>If you add <code>-v 7</code> or <code>-v 6</code> to the command, you get verbose logs that show you all the <strong>API requests</strong></p> <p>Example:</p> <pre><code>ku...
Jonas
<p>I wanted to understand if a sidecar container can send a unix signal to the main container process).</p> <p>The use-case is I have Nginx running as the main content serving app container and I want the sidecar container to receive Nginx config updates and reload Nginx by sending a signal. These two containers would ...
Bhakta Raghavan
<p>You can share process namespace by setting <code>shareProcessNamespace: true</code>.</p> <p>The Kubernetes documentation has an example where a sidecar sends a <code>SIGHUP</code> to an nginx container in the same pod: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/#configu...
Jonas
<p>I’m getting started with Kubernetes, Knative and Gloo. My goal is to deploy a simple http service to a gke cluster. I’ve managed to setup knative, gloo and deploy a healthy service there named <code>backend</code>. Next step is to setup routing <code>/api/v1</code> -> <code>backend</code>. I’ve created a virtualserv...
Andrey Kuznetsov
<p>Thanks to great community help on solo.io slack, I've got answers.</p> <ol> <li>I should route to <code>backend-bdtr2</code>. This value can be obtained by running <code>kubectl get proxy -n gloo-system knative-external-proxy -oyaml</code>.</li> <li>Two upstreams with 80 port are Knative's placeholder services rout...
Andrey Kuznetsov
<p>I have a web applicaton (e.g. <code>&quot;india&quot;</code>) that depends on postgres and redis (e.g. a typical Rails application).</p> <p>I have a <code>docker-compose.yml</code> file that composes the containers to start this application.</p> <pre><code>version: '3' services: redis-india: image: redis:5.0....
user2490003
<h1>Independent components</h1> <p>Your three components should run as separate deployments on Kubernetes. You want these three components to be:</p> <ul> <li>Independently upgradable and deployable (e.g. you deploy a new version of Redis but not your app or database)</li> <li>Independently scalable - e.g. you might ge...
Jonas
<p><strong>Current state:</strong> From local command line, after authenticating to the cluster and setting the right context, I am using Kubectl to get list of &quot;Completed&quot; pods and then deleting them using a simple one liner. This works, but we want to automate it.</p> <p>These are pods NOT jobs which are in...
shan
<blockquote> <p>We want to be able to deploy a pod/cronjob inside a namespace which will just look for &quot;Completed&quot; pods and delete them, without using Kubectl.</p> </blockquote> <p>This should work perfectly fine. Just make sure that the ServiceAccount has RBAC permissions to delete those pods.</p> <blockquot...
Jonas
<p>I am designing a chat like application where I am running 2 pods of same service for scalability.</p> <p>Now assume user 1 connected to pod1 through web socket connection and user 2 connected to pod2. User1 want to interact with user2 but both got connected to different pods. Now how to establish inter pod communica...
veer vignesh
<blockquote> <p>Now how to establish inter pod communication on K8S.</p> </blockquote> <p>You can do this using <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a> - it provides a &quot;stable network identiy&quot;.</p> <p>But the easiest way to han...
Jonas
<p>I'm new to Kubernetes and I'm trying to get a deploy running.</p> <p>After I pushed the deploy config the replica set is created and that one will create the pod. But the pod stays in the <code>Pending</code> state.</p> <p>The pod has an event listed that it can't be scheduled because there are no nodes available. O...
Sven van Zoelen
<blockquote> <p>But the pod stays in the Pending state.</p> </blockquote> <blockquote> <p>The pod has an event listed that it can't be scheduled because there are no nodes available.</p> </blockquote> <p>This is as expected if you have reached your capacity. You can check the capacity of any node with:</p> <pre><code>k...
Jonas
<p>I have the following <code>pv.yaml</code> Kubernetes/Kustomization file:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: myapp-common-pv namespace: myapp labels: app.kubernetes.io/name: myapp-common-pv app.kubernetes.io/component: common-pv app.kubernetes.io/part-of: myapp spec...
simplezarg
<blockquote> <p>quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]<em>[-+]?[0-9]</em>)$', error found in #10 byte of ...|ge&quot;:&quot;30gi&quot;}}</p> </blockquote> <p>Change</p> <pre><code>storage: 30gi </code></pre> <p>to</p> <pre><code>storage: 30Gi </code></pre> <p>The <code>Gi</code> pa...
Jonas
<p>I have an application that accepts TCP traffic (not HTTP) and I'd like the ability to have the traffic load balanced to it. However, one requirement is that when a client makes a connection, we do not close that connection under any circumstances (ideally) since we are dealing with some clients with older technology...
biscuit_cakes
<p>What you describe is how nginx works out of the box with http. However</p> <ol> <li>Nginx has a detailed understanding of http</li> <li>HTTP is a message based protocol i.e. uses requests and replies</li> </ol> <p>Since nginx knows nothing about the protocol you are using, even if it uses a request/reply mechanism w...
symcbean
<p>I have what I would consider a common use case but I am really struggling to find a solution:</p> <p>I want to reuse a variable in <code>Kustomize</code> patches in our deployments. Specifically, we are using commit IDs to reference image tags (Use Case A) and k8s Jobs related to the deployments (Use Case B).</p> ...
tech4242
<blockquote> <p>but I want to reuse a variable within the manifests.</p> </blockquote> <p>This is not how you typically work with Kustomize. Its a good thing that things are <em>declarative</em> and <em>explicit</em> when working with Kustomize.</p> <blockquote> <p>when developers do PRs for releases, they should only ...
Jonas
<p>I have an app that get data from a third-party data source, it will send data to my app automatically and I can't filter it, I can only receive all. When data arrive, my app will transmit this data to a rocketmq topic.</p> <p>Now I have to make this app a container and deploy it in k8s deployment with 3 replica. But...
Wayne Chang
<blockquote> <p>Now I have to make this app a container and deploy it in k8s deployment with 3 replica. But these pods will all get same data and send to the same rocketmq topic.</p> </blockquote> <blockquote> <p>There is no request. My app connect to a server and it will send data to app by TCP. Every Pod will connect...
Jonas
<p>I am trying to create a secret using JSON file content and stringData like below but giving some error which I am not able to identify after multiple tries.</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: image-secret type: Opaque stringData: creds: _json_key:{&quot;type&quot;: &quot;service_accoun...
gaurav agnihotri
<p>You're getting bitten by a yaml-ism, as <code>yaml2json</code> or <code>yamllint</code> would inform you</p> <pre><code>Error: Cannot parse as YAML (mapping values are not allowed here in &quot;&lt;byte string&gt;&quot;, line 5, column 28: creds: _json_key:{&quot;type&quot;: &quot;service_account&quot;,&quo...
mdaniel
<p>I accidentally did: <code>k delete service/kubernetes</code>. it sounds like an essential service... so i would think deleting would break the kubernetes cluster but somehow the service just came back.</p> <h3>will deleting the service &quot;service/kubernetes&quot; break my kubernetes cluster? if no why?</h3> <p>re...
Trevor Boyd Smith
<blockquote> <p>what causes the service service/kubernetes to come back automatically?</p> </blockquote> <p>A part of the control plane run controllers, and there is a controller that is responsible for the <code>kubernetes</code> Service. See <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/controlpla...
Jonas
<p>The following command is messy, but works just fine:</p> <pre class="lang-yaml prettyprint-override"><code>dict( &quot;resources&quot; (ternary $args.resources (ternary $.Values.machines.micro (ternary $.Values.machines.small (ternary $.Values.machines.medium $.Values.machines.large (eq $args.machine &quot;medium&qu...
ilmoi
<p>As best I can tell, you'd want <code>|default</code> to make the <code>index</code> structure intact when they don't specify a <code>machine:</code> key at all, and then a separate <code>| default</code> for falling back to the inlined <code>resources:</code> block on bogus machine reference (as will be the case for...
mdaniel
<p>Following is the basic k8 setup deployed using kubeadm tool. when I delete pods like etcd,api-server,sheduler and controller it re-created immediately. I am wodering who is really monitoring these pods as these are not part of replicaset or deployments and these are just stand alone pods.</p> <pre><code>root@kmaste...
Nag Devineni
<p>These pods are typically supervised by the Kubelet, directly on the node.</p> <blockquote> <p>Static Pods are always bound to one Kubelet on a specific node. The main use for static Pods is to run a self-hosted control plane: in other words, using the kubelet to supervise the individual control plane components.</p>...
Jonas
<p>Trying to deploy <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/" rel="nofollow noreferrer">aws-load-balancer-controller</a> on Kubernetes.</p> <p>I have the following TF code:</p> <pre><code>resource &quot;kubernetes_deployment&quot; &quot;ingress&quot; { metadata { name = &...
alexis
<p>With your Terraform code, you apply an <code>Deployment</code> and an <code>Ingress</code> resource, but you must also add the <code>CustomResourceDefinitions</code> for the <code>TargetGroupBinding</code> custom resource.</p> <p>This is described under &quot;Add Controller to Cluster&quot; in the <a href="https://k...
Jonas
<p>Considering the scenario where all of the nodes are fully utilized and there is a user's pod in the scheduler queue that has a higher priority, and there are no more Best Effort and Burstable pods left, only Guaranteed with lower priority, then can that Guaranteed pod be evicted to make space for the higher priority...
woj.sierak
<p>From <a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#interactions-of-pod-priority-and-qos" rel="nofollow noreferrer">Interactions between Pod priority and quality of service</a></p> <blockquote> <p>The scheduler's preemption logic does not consider QoS when choosing preemption tar...
Jonas
<p>I am creating an Helm Chart and I am having problems when it comes to importing files:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: vcl-template namespace: {{.Release.Namespace}} data: {{- (.Files.Glob &quot;config/varnish/default.vcl.tmpl&quot;).AsConfig | nindent 2 }} {{- (.Files.Glob ...
Rafael Moreira
<p>They're actually equivalent from YAML's PoV, just not as pretty, but most important for your specific case it's because yaml cannot represent <strong>trailing</strong> whitespace without quoting it, which is what it did due to line 164 of your .tmpl file, as seen by the <code>\n \n</code> in:</p> <pre class="lang...
mdaniel
<p>From this page: <a href="https://www.pingidentity.com/en/company/blog/posts/2019/jwt-security-nobody-talks-about.html" rel="noreferrer">https://www.pingidentity.com/en/company/blog/posts/2019/jwt-security-nobody-talks-about.html</a>:</p> <blockquote> <p>The fourth security-relevant reserved claim is &quot;iss.&quot;...
Aaron
<p><em>JWT token issuer</em> - is the <strong>party</strong> that &quot;created&quot; the token and signed it with its private key.</p> <p>Anyone can create tokens, make sure that the tokens you receive is created by a party that you trust.</p>
Jonas
<p>At page 67 of <a href="https://www.oreilly.com/library/view/kubernetes-up-and/9781492046523/" rel="nofollow noreferrer">Kubernetes: Up and Running, 2nd Edition</a>, the author uses the command below in order to create a <code>Deployment</code>:</p> <pre class="lang-sh prettyprint-override"><code>kubectl run alpaca-p...
Fabrice Jammes
<p>It is now preferred to use <code>kubectl create</code> to create a new <code>Deployment</code>, instead of <code>kubectl run</code>.</p> <p>This is the corresponsing command to your <code>kubectl run</code></p> <pre><code>kubectl create deployment alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue --replicas=2 </...
Jonas
<p>I am currently attempting to use the lookup function via Helm 3.1 to load a variable during installation.</p> <pre><code>{{ $ingress := (lookup &quot;v1&quot; &quot;Ingress&quot; &quot;mynamespace&quot; &quot;ingressname&quot;).status.loadBalancer.ingress[0].hostname }} </code></pre> <p>Of course, this returns, &quo...
CriticalFoxes
<p>You are attempting to use &quot;normal&quot; array indexing syntax, but helm charts use &quot;golang templates&quot; and thus array indexing is done via <a href="https://helm.sh/docs/chart_template_guide/function_list/#index" rel="nofollow noreferrer">the <code>index</code> function</a></p> <pre class="lang-yaml pre...
mdaniel
<p>I am getting <code>unknown image flag</code> when creating a deployment using <code>minikube</code> on <code>windows 10</code> <code>cmd</code>. Why?</p> <pre><code>C:\WINDOWS\system32&gt;minikube kubectl create deployment nginxdepl --image=nginx Error: unknown flag: --image See 'minikube kubectl --help' for usage. ...
Manu Chadha
<p>When using <a href="https://minikube.sigs.k8s.io/docs/handbook/kubectl/" rel="noreferrer">kubectl bundled with minikube</a> the command is little different.</p> <p>From the <a href="https://minikube.sigs.k8s.io/docs/handbook/kubectl/" rel="noreferrer">documentation</a>, your command should be:</p> <pre><code>minikub...
Jonas
<p>I have a project where we are consuming data from kafka and publishing to mongo. In fact the code base does only one task, may be mongo to kafka migration, kafka to mongo migration or something else.</p> <p>we have to consume from different kafka topics and publish to different mongo collections. Now these are paral...
spattanaik75
<blockquote> <p>Is it wise to use multiple containers in one pod. Easy to distinguish, but as they are tightly coupled , i am guessing high chance of failure and not actually proper microservice design.</p> </blockquote> <p>You most likely want to deploy them as separate services, so that you can update or re-configure...
Jonas
<p>I have been using kubebuilder for writing custom controller, and aware of Get(), Update(), Delete() methods that it provides. But Now I am looking for a method which mimic the behaviour of <code>kubectl rollout restart deployment</code>. If there is no such direct method then I am looking for correct way to mimic th...
hrishi
<p>In all cases where you wish to replicate <code>kubectl</code> behavior, the answer is always to increase its verbosity and it'll show you exactly -- sometimes down to the wire payloads -- what it is doing.</p> <p>For rollout restart, one will find that it just <a href="https://sourcegraph.com/github.com/kubernetes/k...
mdaniel
<p>How can I speedup the rollout of new images in Kubernetes?</p> <p>Currently, we have an automated build job that modifies a yaml file to point to a new revision and then runs <code>kubectl apply</code> on it.</p> <p>It works, but it takes long delays (up to 20 minutes PER POD) before all pods with the previous revis...
Leonel
<blockquote> <p>I would rather kill all 3 pods and have 3 new ones with the new image.</p> </blockquote> <p>You can do that. Set <code>strategy.type:</code> to <code>Recreate</code> instead of the default <code>RollingUpdate</code> in your <code>Deployment</code>. See <a href="https://kubernetes.io/docs/concepts/worklo...
Jonas
<p>As mentioned in this <a href="https://stackoverflow.com/a/37423281/3317808">answer</a>: allow for easy updating of a Replica Set as well as the ability to roll back to a previous deployment.</p> <p>So, <code>kind: Deployment</code> scales replicasets, which scales Pods, supports zero-downtime updates by creating and...
overexchange
<p>As you write, with a <code>Deployment</code> it is easy to <em>manually</em> scale an app horizontally, by changing the numer of replicas.</p> <p>By using a <code>HorizontalPodAutoscaler</code>, you can <em>automate</em> the horizontal scaling by e.g. configuring some metric thresholds, therefore the name <strong>au...
Jonas
<p>In Helm's v3 documentation: <a href="https://helm.sh/docs/chart_template_guide/accessing_files/" rel="nofollow noreferrer">Accessing Files Inside Templates</a>, the author gives an example of 3 properties (toml) files; where each file has only one key/value pair.</p> <p>The configmap.yaml looks like this. I'm only a...
paiego
<p>Helm will read in that file, but it is (for good or bad) a <strong>text</strong> templating engine. It does not understand that you are trying to compose a YAML file and thus it will not help you. That's actually why you will see so many, many templates in the wild with <code>{{ .thing | indent 8 }}</code> or <code>...
mdaniel
<p>I have a very simple kustomization.yaml:</p> <pre><code>configMapGenerator: - name: icecast-conifg files: - icecast.xml </code></pre> <p>When I run <code>kubectl kustomize .</code> it spits out a generated configMap properly, but how do I actually load it into my cluster? I'm missing some fundamental s...
user3056541
<p>With Kustomize you can use the <code>-k</code> (or <code>--kustomize</code>) flag instead of <code>-f</code> when using <code>kubectl apply</code>. Example:</p> <pre><code>kubectl apply -k &lt;my-folder-or-file&gt; </code></pre> <p>See <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization...
Jonas
<p>Service abstract Pod IP address from consumers, load balances between pods, relies on labels to associate a service with a Pod, holds virtual IP provided by Node's kube-proxy, non-ephemeral</p> <p>Given below services:</p> <pre><code>$ kubectl -n mynamespace get services | more NAME TYPE CLUSTER-IP ...
overexchange
<blockquote> <p>Is &quot;service&quot; type kubernetes object launched as a separate Pod container in data plane?</p> </blockquote> <p>Nope, a <code>Service</code> is an <strong><em>abstract</em></strong> resource in Kubernetes.</p> <p>From the <a href="https://kubernetes.io/docs/concepts/services-networking/service/" ...
Jonas
<p><strong>Getting error</strong> postgres deployment for service is getting fail. Checked yaml with yamllint and it is valid, but still getting the error. Deployment file contains ServiceAccount , Service and Statefulset.</p> <pre><code>install.go:158: [debug] Original chart version: &quot;&quot; install.go:175: [debu...
Yashika Chandra
<p>The templating mustaches in helm (and its golang text/template peer) must be one token, otherwise yaml believes that <code>{</code> opens a dict, and then <code>{</code> tries to open a <em>child</em> dict and just like in JSON that's not a valid structure</p> <p>So you'll want:</p> <pre class="lang-yaml prettyprint...
mdaniel
<p>In the below yaml syntax:</p> <pre><code> readinessProbe: httpGet: path: /index.html port: 80 initialDelaySeconds: 3 timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 3 </code></pre> <hr /> <p>Readiness probe is used during initial deployments of ...
overexchange
<blockquote> <p>using rolling deployment strategy, Is readiness probe used for rolling deployment?</p> </blockquote> <p>Yes, the new version of Pods is rolled out and older Pods are not terminated until the new version has Pods in <em>ready</em> state.</p> <p>E.g. if you roll out a new version, that has a bug so that t...
Jonas
<p>I was trying to debug some mount problems and the mount logs led me to paths under <code>/var/lib/kubelet/pods</code>, i.e</p> <p><code>/var/lib/kubelet/pods/f6affad1-941d-4df1-a0b7-38e3f2ab99d5/volumes/kubernetes.io~nfs/my-pv-e0dbe341a6fe475c9029fb372e</code></p> <p>How can I map the guid of the root directory unde...
Mugen
<p>They're the <code>.metadata.uid</code> of the Pod; one can map them back by using your favorite mechanism for querying all pods and filtering on its <code>.metadata.uid</code>, and optionally restricting to just those pods scheduled on that Node if you have a so many Pods as to make the <code>-A</code> infeasible</p...
mdaniel
<p>I'm making a realtime multiplayer game and I have an idea on how to structure the backend, but I don't even know if its possible, let alone how to build and deploy it. Basically I want to deploy my backend as a container to cloud run but instead of syncing data through a database common to all instances I want to st...
Ben Baldwin
<p>This is possible to do on Kubernetes, but I doubt that this can be easily done on Google Cloud Run. Your game-pod is essentially <em>stateful</em> workload and does not fit well on Google Cloud Run, but you can run this on Kubernetes as <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/"...
Jonas
<p>I would like to understand if through PVC/PV a pod that is using a volume after a failure will be always re-attached to the same volume or not. Essentially I know that this can be a case for Statefulset but I am trying to understand if this can be also achieved with PVC and PV. Essentially assuming that a Pod_A is a...
toto'
<blockquote> <p>a pod that is using a volume after a failure will be always re-attached to the same volume or not</p> </blockquote> <p>yes, the Pod will be re-attached to the same volume, because it still has the same PVC declared in its manifest.</p> <blockquote> <p>Essentially assuming that a Pod_A is attached to Vol...
Jonas
<p>I am new to this platform and this is my second question. For one month, I have been trying to set up a Kubernetes cluster using AWS unsuccessfully. But every day, I get a new error, but this time, I could not solve this error.</p> <p>I am using Kali Linux in Virtual Box with Windows as a host. I am following a tuto...
yousuf
<blockquote> <p>unsupported architecture for instance type &quot;t2.micro&quot;: i386</p> </blockquote> <p>Some EC2 t2.micro instances are actually 32-bit machines. See <a href="https://stackoverflow.com/a/11565748/213269">How to find if my Amazon EC2 instance is 32 bit or 64 bit?</a>.</p> <p>Your Kubernetes container ...
Jonas
<p>I like the work methology of Kuberenetes, use self-contained image and pass the configuration in a ConfigMap, as a volume.</p> <p>Now this worked great until I tried to do this thing with Liquibase container, The SQL is very long ~1.5K lines, and Kubernetes rejects it as too long.</p> <p>Error from Kubernetes:</p>...
aclowkay
<p>The error you are seeing is not about the size of the actual ConfigMap contents, but about the size of the <code>last-applied-configuration</code> annotation that <code>kubectl apply</code> automatically <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-to-create-objects" re...
David
<p>I'm trying to deploy a Quarkus app to a Kubernetes cluster, but I got the following stacktrace:</p> <pre><code>exec java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/quarkus-run.jar __ ____ __ _____ ___ __ ____ ____...
Nagy Vilmos
<p>It's due to the <a href="https://github.com/kubernetes/kubernetes/blob/v1.20.0/pkg/kubelet/envvars/envvars.go#L87-L90" rel="noreferrer">docker link variables</a> that kubernetes mimics for <code>Service</code> names in scope; it bites people a lot when they have generically named services such as <code>{ apiVersion:...
mdaniel
<p>I've split out the initial <code>azure-pipelines.yml</code> to use templates, iteration, etc... For whatever reason, the new images are not being deployed despite using <code>latest</code> tag and/or <code>imagePullPolicy: Always</code>.</p> <p>Also, I basically have two pipelines <code>PR</code> and <code>Release</...
cjones
<blockquote> <p>For whatever reason, the new images are not being deployed despite using latest tag</p> </blockquote> <p>How should Kubernetes know that there is a new image? Kubernetes config is <em>declarative</em>. Kubernetes is already running what once was &quot;latest&quot; image.</p> <blockquote> <p>Here is an e...
Jonas
<p>I have a StatefulSet with several replicas, for example 3 and multiple kubernetes Node in two zones.</p> <p>I want to place the <strong>FIRST</strong> replica in the selected zone and the rest in the others zones.</p> <ul> <li>mysts-0-0 &lt; <strong>main_zone</strong></li> <li>mysts-0-1 &lt; back_zone</li> <li>mysts...
jesmart
<p>This is not supported in <code>StatefulSet</code>, as the Pod-template is identical for each replica.</p> <p>You might be able to achieve this by writing a custom scheduler. For inspiration, see this article for a custom scheduler for CockroachDB: <a href="https://kubernetes.io/blog/2020/12/21/writing-crl-scheduler/...
Jonas
<p>Generally in the kubernetes we can create definition files. for non-running and running pods, namespaces, deployments etc. If we generate yaml file for non running and non existing pods it create required defination file. However, if we have to get the defination file from running pod it also generates lots tags of ...
user190245
<blockquote> <p>after running below command it also generates lot of not required elements</p> </blockquote> <p>A large part of the problem you describe is the <code>managedFields:</code>. I agree this is very verbose and mostly annoying output.</p> <p>However, this is now fixed. If you upgrade to <code>kubectl</code> ...
Jonas
<p>I'm refactoring a helm chart, and wanted to put some values from <code>deployment.yaml</code> to <code>values.yaml</code> and that value is</p> <pre><code>hosts: - {{ include &quot;myApp.externalHostName&quot; . | quote }} </code></pre> <p>but it gives me the error</p> <pre><code>[ERROR] values.yaml: unable to par...
CptDolphin
<p>The <code>values.yaml</code> files are not subject to golang interpolation. If you need dynamic content, you'll need to update files inside the <code>templates</code> directory (which are subject to golang interpolation), or generate the <code>values.yaml</code> content using another mechanism</p> <p>In this specifi...
mdaniel
<p>I am running on prem kubernetes. I have a release that is running with 3 pods. At one time (I assume) I deployed the helm chart with 3 replicas. But I have since deployed an update that has 2 replicas.</p> <p>When I run <code>helm get manifest my-release-name -n my-namespace</code>, it shows that the deployment y...
Vaccano
<blockquote> <p>What is needed (from a helm point of view) to get the number of replicas down to the limit I set?</p> </blockquote> <p>Your pods need to be in a &quot;healthy&quot; state. Then they are in your desired number of replicas.</p> <p>First, you deployed 3 replicas. This is managed by a ReplicaSet.</p> <p>The...
Jonas
<p>I having my Pod manifest as below:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: pod-nginx-container spec: containers: - name: nginx-alpine-container-1 image: nginx:alpine ports: - containerPort: 80 </code></pre> <p>And I can get a shell to the Container running my Nginx using <code>kub...
pjj
<h2>Kubernetes</h2> <p>Kubernetes schedules <a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="noreferrer">Pods</a> to nodes. A Pod consists of one or more containers - that are instantiated from container images.</p> <h2>Container image</h2> <p>A container image contains a command that will run as the ...
Jonas
<p>I'm new to Kubeflow and k8s. I have setup a single node k8s cluster and installed Kubeflow on this. I'm now trying the 'conditional pipeline' simple example from &quot;Kubeflow for Machine Learning&quot; book but I am getting &quot;cannot post /apis/v1beta1/experiments&quot; error ...</p> <pre><code>Reason: Not Foun...
soumeng78
<p>I've made some progress. However, issues are not fully resolved but I can at least proceed with client creation, do health check, list existing pipelines.</p> <p>I could find ml-pipeline service is running on following internal IP:</p> <p>kubeflow service/ml-pipeline ClusterIP 172.19.31.22...
soumeng78
<p>I am learning about highly available distributed systems and some of the concepts that keep coming up are load balancing (Nginx) and container orchestration (Kubernetes). Right now my simplified understanding of them is as so:</p> <h3>Nginx</h3> <ul> <li>Web server that handles Http requests</li> <li>Performs load b...
nick2225
<blockquote> <p>So my question is, do we use both of these tools in conjunction? It seems like there is some overlap?</p> </blockquote> <p>You seem to have mixed a few concepts. Don't look to much on the number of IP addresses, but more on the <strong>role</strong> of the different components.</p> <h2>Load Balancer / G...
Jonas
<p>This is my Pod manifest:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: pod-nginx-container spec: containers: - name: nginx-alpine-container-1 image: nginx:alpine ports: - containerPort: 80 </code></pre> <p>Below is output of my &quot;kubectl describe pod&quot; command:</p> <pre><code>C:...
pjj
<h2>Pods</h2> <p>A <a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="nofollow noreferrer">pod</a> in Kubernetes is the smallest deployment unit. A pod is a group of one or more containers. The containers in a pod share storage and network resources.</p> <h2>Pod networking</h2> <p>In Kubernetes, each po...
Jonas
<p>I am unable to connect to our Kubernetes cluster. The <code>kubectl</code> command does not seem to take the configuration into account...</p> <p>When I issue a <code>kubectl cluster-info</code> (or <code>kubectl get pods</code>) I get the following error message:</p> <blockquote> <p>The connection to the server loc...
E. Jaep
<p>Your current context is unset, as seen with <code>current-context: &quot;&quot;</code>; if you were to run <code>kubectl --context username-context get pods</code> I would expect it to do more what you want. If that turns out to be the case, one can run <code>kubectl config use-context username-context</code> to set...
mdaniel
<p>I am trying to list all the workloads/deployments we're running on the clusters we're running on AKS. I don't see an endpoint for this in <a href="https://learn.microsoft.com/en-us/rest/api/aks/" rel="nofollow noreferrer">AKS API REST reference</a>, how do I get the deployments etc?</p>
Sameer Mhaisekar
<p>AKS API is for managing clusters.</p> <p>See <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/" rel="nofollow noreferrer">Kubernetes API</a> if you want to access anything <em>within</em> a cluster. E.g. the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#-strong-wor...
Jonas
<p>Currently I do this:</p> <pre><code>configMapGenerator: - name: sql-config-map files: - &quot;someDirectory/one.sql&quot; - &quot;someDirectory/two.sql&quot; - &quot;someDirectory/three.sql&quot; </code></pre> <p>and I would like to do sth. like this:</p> <pre><code>configMapGenerator: - na...
eventhorizon
<p>Nope.</p> <p>See discussion around that feature in <a href="https://github.com/kubernetes-sigs/kustomize/issues/189#issuecomment-409042317" rel="nofollow noreferrer">comment on &quot;configMapGenerator should allow directories as input&quot;</a></p> <p>The main reason:</p> <blockquote> <p>To move towards explicit de...
Jonas
<p>In a GitOps setting, there are usually two repositories - a code repo and an environment repo. My understanding is that there are some security benefits in separating the repos so developers only need to be given access to the code repo, and environment repo's write access can be limited to only the CI/CD tools. As ...
hai huang
<blockquote> <p>there are usually two repositories - a code repo and an environment repo. My understanding is that there are some security benefits in separating the repos so developers only need to be given access to the code repo, and environment repo's write access can be limited to only the CI/CD tools.</p> </block...
Jonas
<p>The duty of replication controller in K8S/Openshift is to ensure the actual state is same as desired state. So if the desired state is 2 Pods, then it ensures that exactly 2 pods are created/running. If a pod fails for some reason then the replication controller ensures that it will restart a new pod to compensate f...
joven
<blockquote> <p>A thing i want to confirm, if the Pod/Container exists with an error - then will the replication controller care about the error code and find that the pod is failing due to error and hence decide to not start the pod any further. ??</p> </blockquote> <p>Errors can be shown in many different ways:</p> <...
Jonas
<p>I have the following configuration for rewrite for user-service and it is supposed to remove either 'sso' or 'user' and use the rest of the path to redirect to the user-service</p> <p>nginx-ingress-controller:0.32.0</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: user-service namespac...
Andrey Yaroshenko
<p>The annotation has a typo, in that it omitted the leading <code>nginx.</code> from <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#rewrite" rel="nofollow noreferrer"><code>nginx.ingress.kubernetes.io/rewrite-target:</code></a></p>
mdaniel
<p>I am deploying pyspark in my aks Kubernetes cluster using this guides:</p> <ul> <li><a href="https://towardsdatascience.com/ignite-the-spark-68f3f988f642" rel="nofollow noreferrer">https://towardsdatascience.com/ignite-the-spark-68f3f988f642</a></li> <li><a href="http://blog.brainlounge.de/memoryleaks/getting-starte...
J.C Guzman
<p>In general you can spin up new pod with specified command running in it i.e.:</p> <pre><code>kubectl run mypod --image=python3 --command -- &lt;cmd&gt; &lt;arg1&gt; ... &lt;argN&gt; </code></pre> <p>In your case you would need to provide the code of the myscript.py to the pod (i.e.: by mounting a ConfigMap with the ...
pb100
<p>As I understand it, most databases enable the use of replicas that can take over from a leader in case the leader is unavailable.</p> <p>I'm wondering the necessity of having these replicas in a Kubernetes environment, when using say a StatefulSet. Once the pod becomes unresponsive, Kubernetes will restart it, right...
vmayer
<blockquote> <p>As I understand it, most databases enable the use of replicas that can take over from a leader in case the leader is unavailable.</p> </blockquote> <blockquote> <p>I'm wondering the necessity of having these replicas in a Kubernetes environment, when using say a StatefulSet.</p> </blockquote> <p>There h...
Jonas
<p>From the documentation I see</p> <blockquote> <p>NodePort: Exposes the service on each Node’s IP at a static port (the NodePort). A ClusterIP service, to which the NodePort service will route, is automatically created. You’ll be able to contact the NodePort service, from outside the cluster, by requesting :.</p> </b...
Always_Beginner
<p>They're the same underlying risk (with respect to what you wrote as &quot;disadvantages&quot;) because a <code>type: LoadBalancer</code> <strong>is</strong> a <code>type: NodePort</code> which just additionally works with the cluster's configured cloud-provider to provision a cloud load balancer which points to the ...
mdaniel
<p>I am using multiple ingresses resource on my GKE, say I have 2 ingress in different namespaces. I create the ingress resource as shown in the yaml below. With the annotations used in the below yaml, I clearly mention that I am using the GCE controller that comes with GKE(<a href="https://github.com/kubernetes/ingres...
Suhas Chikkanna
<p>In your Ingress resource you can specify you need the Load Balancer to use a specific IP address with the <code>kubernetes.io/ingress.global-static-ip-name</code> annotation like so:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: gce kuberne...
Carlos Gomez
<p>Let's say you are using either <em><strong>ServiceFabric</strong></em> or <em><strong>Kubernetes</strong></em>, and you are hosting a transaction data warehouse microservice (maybe a bad example, but suppose all it dose is a simple CQRS architecture consisting of Id of sender, receiver, date and the payment amount, ...
Alphas Supremum
<blockquote> <p>what will happen when we will scale out the microservices and a new microservice instances will be raise up? they will write to the same database?</p> </blockquote> <p>Yes, the instances of your service, all share the same logical database. To achieve high availability, you typically run a distributed d...
Jonas
<p>I'm using Helm on a Kubernetes cluster and have installed the stable <a href="https://github.com/helm/charts/tree/master/stable/rabbitmq-ha" rel="nofollow noreferrer">rabbitmq-ha chart</a>. I would like to push data to an exchange in rabbitmq from Logstash. I am trying to use the <a href="https://github.com/helm/cha...
Stephen Paulger
<p>Turns out that it is possible to get logstash to read values from the environment variables since at least version 5.0 of logstash. <a href="https://www.elastic.co/guide/en/logstash/current/environment-variables.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/logstash/current/environment-variables.ht...
Stephen Paulger