Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I have private Docker registry which works over https with self-signed SSL certificate. I've installed this certificate on local machine and it's working fine (can push and pull).<br/> Is it possible to configure Kubernetes to use this certificate for deployments (pull images from private registry)?</p>
Kirill
<p>Kubernetes it self doesn't support this. you have to deploy certificate to all worker nodes. You can simplify the process using <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a> and <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel...
Maciek Sawicki
<p>Considering the following scenario:</p> <ul> <li>I have one main <strong>heavy service</strong> and many other <strong>small microservices</strong>.</li> <li>The <strong>small microservices</strong> are consumed only the <strong>heavy service</strong>.</li> <li>Only the main <strong>heavy service</strong> is expose...
kilobaik
<p>There are some misunderstandings here.</p> <p>There terminology about <em>microservice</em> is <strong>not about size</strong> but more an organizational thing. Ten years ago, the whole system was deployed as a <em>monolith</em> but now it is recommended that teams should not be bigger than 5-8 persons - and those ...
Jonas
<p>I use <strong>AKS</strong> to create our cluster with <strong>3</strong> worker node and their names are <strong>node-0</strong>, <strong>node-1</strong>, <strong>node-2</strong>. They are created by <strong>Azure VMSS</strong>.</p> <p>When I deploy a <strong>pod-new</strong> through Helm, the scheduler always sched...
Loofah
<p>In order for kubernetes to understand the resource utilization, requests data is used. You can read about best practices mentioned by AKS from <a href="https://learn.microsoft.com/en-us/azure/aks/developer-best-practices-resource-management" rel="nofollow noreferrer">link</a>.</p> <p>Requests tells the kubernetes to...
Atul
<p>Is it possible to send requests to all pods behind a service/ingress controller based on the requests?</p> <p>My requirement is to send requests to all the pods if the request is /send/all.</p>
user1578872
<p>It's not possible because ingress controller can't do this (for sure nginx and GLBC based ingress can't do it, bud due to the way how to http works I assume this is the case for all ingress controllers).</p> <p>Depending what your exact case is you have few options.</p> <p>If your case is just monitoring and you c...
Maciek Sawicki
<p>I could not find a documentation that specifies how Kubernetes service behaves when the affiliated deployment is scaled with multiple replicas.</p> <p>I'm assuming there's some sort of load balancing. Is it related to the service type?</p> <p>Also, I would want to have some affinity in the request forwarded by the...
Mugen
<h2>Deployment: Stateless workload</h2> <blockquote> <p>I could not find a documentation that specifies how Kubernetes service behaves when the affiliated deployment is scaled with multi replicas.</p> </blockquote> <p>Pods deployed with <code>Deployment</code> is supposed to be stateless.</p> <h2>Ingress to Service rou...
Jonas
<p>I have a Spring Boot (1.5.8) webapp, with several other Spring Boot services, all deployed to AWS. The webapp module is deployed to two EC2 instances managed by an Elastic Load Balancer. The whole system is orchestrated by Kubernetes.</p> <p>I'm trying to set the session cookie max age to work around a problem, as ...
Greg Charles
<p>OK, it turned out that the session is being managed by Spring due to <code>spring.session.store-type</code> being set to <code>redis</code> in the integration environments. It's <code>none</code> in my local build, which means Tomcat manages the session instead. Sorry, I didn't mean to obfuscate that. I just didn't ...
Greg Charles
<p>I have installed Traefik on Kubernetes and followed allong the official tutorial. I have a cluster of 4 machines for Kubernetes.</p> <p>When I run <code>kubectl --namespace=kube-system get pods</code> I see <code>traefik-ingress-controller-678226159-eqseo</code>, so all fine.</p> <p>Then I executed:</p> <pre><cod...
Max
<p>in <a href="https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/ui.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/ui.yaml</a> there is following ingress definition:</p> <pre><code>--- apiVersion: extensions/v1beta1 kind: Ingress metadata...
Maciek Sawicki
<p>Running an Akka cluster on k8s and it is using a downing strategy (let’s say Autodowning), so in the case where a node goes unreachable the container which went unreachable exits. The problem is that this node went unreachable because of a network issue/ issue with the platform provided by k8s and as such the entire...
cyborg-panther
<blockquote> <p>Because scheduling can take some time we only want to reschedule the container onto a new pod on a new node if unreachability is the cause of the failure. </p> </blockquote> <p>Kubernetes manages all scheduling and health checks for you.</p> <blockquote> <p>Is there any way to propagate failure me...
Jonas
<p>I am wondering if there are examples of full application stack based on Kubernetes, for ex: golang+solr+postgres with all the services and load balancers configured? And is it a good idea to have services like PostgreSQL and Solr on Kubernetes?</p>
Gadelkareem
<p>For databases, you can use SaaS, since it relives you of tasks like backup and management. Or if you really want to go all in on Kubernetes, for databases, you can go with operators. Operators manages most lifecycles for you.</p> <p>As far as the other components are concerned, you will have to containerize them and...
Ashok Pon Kumar
<p>I am new to kubernetes. I have an issue in the pods. When I run the command</p> <pre><code> kubectl get pods </code></pre> <p>Result:</p> <pre><code>NAME READY STATUS RESTARTS AGE mysql-apim-db-1viwg 1/1 Running 1 20h mysql-govdb-qioee 1/1 ...
Dilshani Subasinghe
<p>In case of not having the yaml file:</p> <p><code>kubectl get pod PODNAME -n NAMESPACE -o yaml | kubectl replace --force -f -</code></p>
Maciek Sawicki
<p>Currently I have one VM for kubernetes master (k8s-server), second for worker node(node-server). I need to specify a rule how this 2 server communicate each other. Through which ports should k8s-server have access to node-server and vice versa?</p>
George
<p>Strictly speaking Kubernetes makes use of the following ports, depending on your topology and configuration:</p> <pre><code>Kubelet - healthz, default tcp:10248 - kubelet, default tcp:10250 - readonly, default tcp:10255 Kube-proxy - healthz, default tcp:10256 - metrics, default tcp:10249 - proxy-port-range, ...
cewood
<p>I want to setup a k8s cluster, but I despair with the nginx-ingress controller and some special settings I need to set: especially proxy_pass.</p> <p>I tried to achieve that already with the "server-snippet"-snippet, but it didn't work.</p> <pre><code>apiVersion: networking.k8s.io/v1beta1 # for versions before 1.1...
Peter Lang
<p>I believe what you're looking for is:</p> <p><code>nginx.ingress.kubernetes.io/rewrite-target: /site</code></p> <p>However this will effectively mean that you can only use this particular ingress instance for this one app, or others like it, since this rewrite would apply to all the rules for that ingress instance...
cewood
<p>I have self hosted a .NET framework 4.x version of WCF with net.tcp binding console app, which is running in Azure k8s contianer, as a selfhosted wcf service</p> <p>exposed as <a href="http://net.tcp://CONTAINERIP:5000/WCFServiceName" rel="nofollow noreferrer">net.tcp://CONTAINERIP:5000/WCFServiceName</a></p> <p>and...
solairaja
<p>Guys thanks for the inputs,</p> <p>Found the reason for the issue, since the app is deployed using the LoadBalancer type service, its not required to provide APP Name in the URL.</p> <p>when the outside world access the service :</p> <p><a href="http://net.tcp://LoadBalancerIP:5000/containerAppName/WCFServiceName" r...
solairaja
<p>The issue is that I would like to persistent one status file(status generated by the service), not the directory, of some service in case the status lost when service restart, how to solve?</p>
zulv
<p>If it's just a status file, you should be able to write it into a config map. See <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#add-configmap-data-to-a-volume" rel="nofollow noreferrer">Add ConfigMap data to a Volume</a>. If in volumes you have</p> <pre><code>volumes: ...
Jan Hudec
<p>What we're looking for is a way for an actuator health check to signal some intention like "I am limping but not dead. If there are X number of other pods claiming to be healthy, then you should restart me, otherwise, let me limp."</p> <p>We have a rest service hosted in clustered Kubernetes containers that periodi...
Brian Deacon
<p>In Kubernetes you can use LivenessProbe and ReadinessProbe to let a controller to <em>heal</em> your service, but some situations is better handled with HTTP response codes or alternative <em>degraded</em> service.</p> <h2>LivenessPobe</h2> <p>Use a LivenessProbe to <strong>resolve a deadlock</strong> situation. W...
Jonas
<p>I'm experiencing an issue where an image I'm running as part of a Kubernetes deployment is behaving differently from the expected and consistent behavior of the same image run with <code>docker run &lt;...&gt;</code>. My understanding of the main purpose of containerizing a project is that it will always run the sam...
Mike S
<p>The general answer of why they're different is <em>resources</em>, but the real answer is that they should both be identical given identical resources.</p> <p>Kubernetes uses <code>docker</code> for its container runtime, at least in most cases I've seen. There are some other runtimes (<a href="https://cri-o.io/" r...
Maelstrom
<p>I have a cluster hosted on GKE, I have several deployments on this cluster, <br>I can connect with <code>kubectl exec</code> to the pods:</p> <p><code>kubectl exec -it mypod-1234566-7890976 -- bash</code></p> <p>I want to remove the option to connect with <code>kubectl exec</code> to a certain container </p> <p>...
dina
<p>To limit the ability to <code>kubectl exec</code> to pods what you want to do is create a custom Role &amp; RoleBinding that removes the <code>create</code> verb for the <code>pods/exec</code> resource. An easy approach to this might be to copy the default RBAC policies, and then make the appropriate edit and rename...
cewood
<p>I noticed more and more stuff is distributed using Ansible collections. It looks great but it is unclear to me how Ansible collections are used / should be used.</p> <p>For example when I try </p> <pre><code>ansible-galaxy collection install community.kubernetes </code></pre> <p>It just displays a warning and err...
onknows
<p>Collections require Ansible 2.9.*</p>
onknows
<p>Using Spring Boot and managing database changes by Liquibase all changes are executed on application start. This is totally fine for fast running changes.</p> <p>Some changes, e.g. adding DB index, can run for a while. If running application on K8s it happens that liveness/readyness checks trigger an application res...
lunanigra
<p>Defer long running script after application start. Expose DB upgrade invocation via private REST API or similar.</p> <p>Your code and dev practice have to support n-1 version of DB schema. Eg: hide the feature that needs new column behind feature flag until schema upgrade fully rolled out.</p>
gerrytan
<p>It's possible to perform an authorization(rule-based like) into Kubernetes ingress(like kong, nginx). For example, i have this:</p> <p>apiVersion: extensions/v1beta1</p> <pre><code>kind: Ingress metadata: name: foo-bar spec: rules: - host: api.foo.bar http: paths: - path: /service bac...
Ricardo Palazzio
<p><code>Ingress</code> manifest is just input for a controller. You also need an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress Controller</a>, an proxy that understand the <code>Ingress</code> object. Kong and Nginx is two examples of implement...
Jonas
<p>I am writing out json structured log messages to stdout with exactly one time field, called <code>origin_timestamp</code>. </p> <p>I collect the log messages using Fluent Bit with the tail input plugin, which uses the parser <code>docker</code>. The parser is configured with the <code>Time_Key time</code>. </p> <p...
DaveFar
<p>I came across the following issue in the Fluent-bit issue tracker, <a href="https://github.com/fluent/fluent-bit/issues/628#issuecomment-518316428" rel="nofollow noreferrer">Duplicate @timestamp fields in elasticsearch output</a>, which sounds like it might be related to your issue in question.</p> <p>I've deep lin...
cewood
<p>We have deployed a few pods in cluster in various namespaces. I would like to inspect and identify all pod which is not in a Ready state.</p> <pre><code> master $ k get pod/nginx1401 -n dev1401 NAME READY STATUS RESTARTS AGE nginx1401 0/1 Running 0 10m </code></pre> <p>In above list...
sachin
<p>There is a long-standing feature request for this. The <a href="https://github.com/kubernetes/kubernetes/issues/49387#issuecomment-663903782" rel="nofollow noreferrer">latest entry</a> suggests</p> <pre><code>kubectl get po --all-namespaces | gawk 'match($3, /([0-9])+\/([0-9])+/, a) {if (a[1] &lt; a[2] &amp;&amp; $4...
michaelrp
<p>We are running a .NET Core 3.1 application in a Kubernetes cluster. The application connects to an Azure SQL Database using EF Core 3.1.7, with Microsoft.Data.SqlClient 1.1.3.</p> <p>At seemingly random times, we would receive the following error.</p> <pre><code> ---&gt; System.Data.SqlClient.SqlException (0x8013190...
André Haupt
<p>The problem was an infrastructure issue at <a href="https://github.com/Azure/aks-engine/issues/4341" rel="noreferrer">Azure</a>.</p> <blockquote> <p>There is a known issue within Azure Network where the dhcp lease is lost whenever a disk attach/detach happens on some VM fleets. There is a fix rolling out at the mome...
André Haupt
<p>It is not possible to join master nodes without having <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/#steps-for-the-first-control-plane-node" rel="nofollow noreferrer">set a <code>controlPlaneEndpoint</code></a>:</p> <blockquote> <p>error execution phase prefligh...
OJFord
<p>Looking at the <a href="https://github.com/kubernetes/kubernetes/blob/63e27a02ed41f9554b547b18d4bffd69f6adf08a/cmd/kubeadm/app/apis/kubeadm/v1beta2/types.go#L70-L80" rel="noreferrer">kubeadm types definition</a> I found this nice description that clearly explains it:</p> <blockquote> <p>ControlPlaneEndpoint sets ...
cewood
<p>I would like to access a Windows file share share (SMB3) from a docker container, but I do not want to compromise the security of the host machine. All the guides I have read state that I need to use either the <code>--privileged</code> flag or <code>--cap-add SYS_ADMIN</code> capability.</p> <p>Here is the command...
ben
<p>After more research I have figured out how to do this. There is a Container Storage Interface (CSI) driver for SMB called <strong>SMB CSI Driver for Kubernetes</strong> (<a href="https://github.com/kubernetes-csi/csi-driver-smb" rel="noreferrer">https://github.com/kubernetes-csi/csi-driver-smb</a>).</p> <p>After i...
ben
<p>How do I give my pod or minikube the ability to see the 10.x network my laptop is VPN'd onto?</p> <p>Setup: * minikube * php containers</p> <p>php code accesses a private repository, 10.x address. Things are find locally, but I cannot access this same 10.x address while in a pod.</p> <p>How can I give my pods/min...
guice
<p>There are a few ways you could achieve this.</p> <p>If you only want to expose a few services into minikube from the VPN, then you could exploit SSH's reverse tunnelling, as described in this article; <a href="https://medium.com/tarkalabs/proxying-services-into-minikube-8355db0065fd" rel="nofollow noreferrer">Proxy...
cewood
<p>I've upgrade from Flux V1 to V2. It all went fairly smooth but I can't seem to get the <code>ImageUpdateAutomation</code> to work. Flux knows I have images to update but it doesn't change the container image in the <code>deployment.yaml</code> manifest and commit the changes to Github. I have no errors in my logs so...
jwerre
<p>My issue was that I didn't add the comment after my image declaration in my deployment yaml. <a href="https://fluxcd.io/docs/guides/image-update/#configure-image-updates" rel="nofollow noreferrer">More details</a>. Honestly, I'm surprised this is not <a href="https://kubernetes.io/docs/concepts/overview/working-with...
jwerre
<p>A default Google Kubernetes Engine (GKE) cluster </p> <pre><code>gcloud container clusters create [CLUSTER_NAME] \ --zone [COMPUTE_ZONE] </code></pre> <p>starts with 3 nodes. What's the idea behind that? Shouldn't 2 nodes in the same zone be sufficient for high availability?</p>
stefan.at.kotlin
<p>Kubernetes uses <a href="https://github.com/etcd-io/etcd" rel="nofollow noreferrer">etcd</a> for state. Etcd uses <a href="https://raft.github.io/" rel="nofollow noreferrer">Raft</a> for consensus to achieve high availability properties.</p> <p>When using a consensus protocol like Raft, you need <em>majority</em> i...
Jonas
<p>I have a problem. In my kubernetes cluster, I am trying to run my Rails application. I got the image loaded, but now I want to write a custom command. The default command in my Dockerfile is:</p> <pre><code>CMD [&quot;bundle&quot;, &quot;exec&quot;, &quot;rails&quot;, &quot;server&quot;, &quot;-b&quot;, &quot;0.0.0....
A. Vreeswijk
<p>Use <code>entrypoint</code> for that:</p> <pre><code>services: app: build: . entrypoint: ./entrypoint.sh command: bundle exec rails s -p 3000 -b 0 ports: - 3000:3000 </code></pre> <pre class="lang-bash prettyprint-override"><code># entrypoint.sh #!/bin/bash set -e # is this still an issue? r...
Alex
<p>I'm writing an application to be deployed to Kubernetes where I want each pod to hold a TCP connection to all the other pods in the replica set so any container can notify the other containers in some use case. If a pod is added, a new connection should be created between it and all the other pods in the replica set...
jrefior
<blockquote> <p>E.g., open a TCP connection to that DNS name repeatedly in a loop, requesting a container ID over the connection each time, pausing when I've gotten say at least three connections for each container ID. Then repeating that every minute or so to get new pods that have been added.</p> </blockquote> <p>...
Jonas
<p>I'm currently in the process of setting up a Kubernetes AKS cluster, mostly for learning purposes for myself and as a proof of concept. My goal is like this:</p> <ul> <li>CI / CD with Azure DevOps <ul> <li>Every commit to the master-branch triggers an automated release to Kubernetes in the namespace &quot;production...
Matthias Müller
<p>You probably wanna use different hosts per environment. Something like:</p> <pre><code>rules: - host: dev.09ab799fd5674c4594a5.centralus.aksapp.io http: paths: - path: / pathType: Prefix backend: service: name: {{include &quot;helmaksk...
Max
<p>How to make load balancing for GRPC services on GKE on L7 (with Ingress over HTTP/2 + TLS)?</p> <p>I know that I have the option to use L4 (TCP layer) to configure Service with "LoadBalancer" type. But I want to know if I can use Ingress + L7 load balancing over HTTP/2+TLS.</p> <p>Also I see "HTTP/2 to backends is...
Harlam
<p>GKE Ingress can now <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-http2" rel="nofollow noreferrer">load balance with HTTP/2</a>, when you use <strong>https</strong>.</p> <p>To get HTTP/2 between the load balancer (ingress controller) and your pods, your service need an extra annotation:</p...
Jonas
<p>When I run this command</p> <pre><code>kubectl get deployments </code></pre> <p>at my Linux Ubuntu 18 machine, I got different output than expected (according to documentation).</p> <p>Expected: <a href="https://i.stack.imgur.com/I9SIh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I9SIh.png" ...
Lucas
<p>This is just an old output format. The newer output you're getting below contains all the same information; the "READY" field is a combination of the old "DESIRED" and "CURRENT".</p> <p>It's showing as <code>4/5</code> in your output to indicate 4 pods ready/current, and 5 pods desired.</p> <p>Hope this helps.</p>...
cewood
<p>I'm kind of new to Docker, and I'm running into an issue I can't find a straightforward explanation for. I have a pretty simple Dockerfile that I'm building into an image, but when I deploy the image to Kubernetes as a pod, the results aren't what I expect.</p> <pre><code>FROM ubuntu:16.04 RUN mkdir workspace WORKD...
Ethan
<p>I would venture to guess that the <code>ubuntu:...</code> image doesn't have a WORKDIR set to /, and hence your copy command isn't working as expected.</p> <p>Try changing the run command to be <code>RUN mkdir /workspace</code> and I think you'll see what you expected.</p> <p>Hope this helps.</p>
cewood
<p>So, what I'm trying to do is use helm to install an application to my kubernetes cluster. Let's say the image tag is 1.0.0 in the chart.</p> <p>Then, as part of a CI/CD build pipeline, I'd like to update the image tag using kubectl, i.e. <code>kubectl set image deployment/myapp...</code> </p> <p>The problem is if ...
Darragh
<p>When using CI/CD to build and deploy, you should use a <em>single source-of-truth</em>, that means a file versioned in e.g. Git and you do <em>all changes</em> in that file. So if you use Helm charts, they should be stored in e.g. Git and all changes (e.g. new image) should be done in your Git repository.</p> <p>Yo...
Jonas
<p>I have multiple pods of the same app deployed using Kubernetes. The app manages multiple 'Project' objects. When Marry is working on 'Project 1' on pod-01, Tom logs on pod-02. Here is the requirement, if Tom tries to open 'Project 1' on pod-02, we need to route him to pod-01 where 'Project 1' is already open by Marr...
Shawn Pan
<p>What you are describing is <strong>stateful</strong> workload, where each instance of your application contain <em>state</em>. </p> <p><em>Normal</em> workload in Kubernetes is <strong>stateless</strong> and deployed with <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow ...
Jonas
<p>I am running Traefik on Kubernetes and I have create an Ingress with the following configuration: </p> <pre><code>--- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: whitelist-ingress annotations: kubernetes.io/ingress.class: traefik traefik.frontend.rule.type: PathPrefix traefik.ingres...
Justin
<p>In LoadBalancer service type doc <a href="https://kubernetes.io/docs/concepts/services-networking/#ssl-support-on-aws" rel="nofollow noreferrer">ssl support on aws</a> you can read the following statement:</p> <blockquote> <p>HTTP and HTTPS will select layer 7 proxying: the ELB will terminate the connection wit...
mdaguete
<p>I'd like to access cluster deployed Helm charts programmatically to make web interface which will allow manual chart manipulation.</p> <p>I found <a href="https://pypi.org/project/pyhelm" rel="nofollow noreferrer">pyhelm</a> but it supports only Helm 2. I looked on npm, but nothing there. I wrote a bash script but ...
Adam
<blockquote> <p>I'd like to access cluster deployed Helm charts programmatically to make web interface which will allow manual chart manipulation.</p> </blockquote> <p><a href="https://helm.sh/blog/helm-3-released/" rel="nofollow noreferrer">Helm 3 is different</a> than previous versions in that it is a <strong>clie...
Jonas
<p>So I did update the manifest and replaced <strong>apiVersion: extensions/v1beta1</strong> to <strong>apiVersion: apps/v1</strong></p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: secretmanager namespace: kube-system spec: selector: matchLabels: app: secretmanager template: me...
DmitrySemenov
<p>The <code>Deployment</code> <a href="https://github.com/kubernetes/kubernetes/issues/58131#issuecomment-356823588" rel="nofollow noreferrer">exists in multiple apiGroups</a>, so it is ambiguous. Try to specify e.g. <code>apps/v1</code> with:</p> <pre><code>kubectl get deployments.v1.apps </code></pre> <p>and you sho...
Jonas
<p>Let's say I have classic application with </p> <ul> <li>Web</li> <li>Backend</li> <li>DB</li> </ul> <p>If I understand correctly I will create deployment for each of them. What if I want to deploy all in one step? How should I group the deployments. I have read something about labels and services, I'm totally not ...
Zveratko
<p>You need multiple Kubernetes objects for this and there is multiple ways to solve this.</p> <p><strong>Web</strong> - it depends what this is. Is it just <strong>static</strong> JavaScript files? In that case, it is easiest to deploy it with a CDN solution, on any cloud provider, an on-prem solution or possible usi...
Jonas
<p>I want to access to the codes regarding Cgroup in Kubernetes GitHub repository. Where is the exact place?</p>
HamiBU
<p>The cgroups code is in the container engine selected, not in k8s. K8s take care of running containers and talks with the runtime using CRI. CRI is an API to let any container engine interact with kubelet. Kubelet is a piece of kubernetes that sits on every node and make sure that all pods are running as expected.</p...
mdaguete
<p>I'm just trying out a very simple example of NodePort, using minikube on an Apple M1 machine. I basically create a single-node k8s cluster via minikube, then create a 1-pod deployment, and NodePort service. The NodePort URL keeps loading for me. Below are the commands I use.</p> <pre><code>$ minikube start 😄 minik...
Kien Nguyen
<p>I solved this problem by switching to use Docker Desktop kubernetes. Seems like minikube doesn't play well with Apple M1.</p>
Kien Nguyen
<p>I have an Argo workflow that has two steps, the first runs on Linux and the second runs on Windows</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: my-workflow-v1.13 spec: entrypoint: process volumeClaimTemplates: - metadata: ...
areller
<blockquote> <p>the first runs on Linux and the second runs on Windows</p> </blockquote> <p>I doubt that you can mount the same volume on both Linux, typically ext4 file system and on a Windows node, <a href="https://learn.microsoft.com/en-us/azure/aks/windows-faq#what-kind-of-disks-are-supported-for-windows" rel="nofo...
Jonas
<p>I am working with a minecraft server image to create a cluster of statefulsets that all should have a random external port. I was told using a nodeport would do the job but not exactly how that is done. I was looking at nodeport but it looks like you would need to specify that exact port name. </p> <p>I need each r...
mjwrazor
<p>You need to create a <code>NodePort</code> service for each instance of minecraft server.</p> <p>A <code>NodePort</code> open a random port up to &lt; 30000 and links it to an internal (set of) based on the selectors.</p> <p>For instance, let's say there is one instance of the minecraft server with the following r...
Kartoch
<p>I have 1 question regarding pods scheduling for runner pods in k8s. As I can see, during different jobs It creates pods like runner-xxxx-project-xxxx-concurrent and this pods creating dynamically. How I can configure scheduling (nodeSelector) for this pods only (runner-xxxx-project-xxxx-concurrent), not for runner-g...
Andrew Striletskyi
<p>First, depending on the way you have installed your master nodes, they usually have a taint <code>node-role.kubernetes.io/master:NoSchedule</code> to avoid scheduling of pods.</p> <pre><code>$ kubectl describe nodes node1 Name: node1 Roles: master Labels: beta.kubernetes.io/ar...
Kartoch
<p>I have existing applications built with Apache Camel and ActiveMQ. As part of migration to Kubernetes, what we are doing is moving the same services developed with Apache Camel to Kubernetes. I need to deploy ActiveMQ such that I do not lose the data in case one of the Pod dies. </p> <p>What I am doing now is runni...
Debdeep Das
<p>In high-level terms, what you want is a <strong>StatefulSet</strong> instead of a Deployment for your ActiveMQ. You are correct that you want "shared file system" -- in kubernetes this is expressed as a "<strong>Persistent Volume</strong>", which is made available to the pods in your StatefulSet using a "<strong>Vo...
Andrew McGuinness
<p>I understand the concepts of a Kubernetes service ClusterIP and Headless service but when would I use one over the other?</p>
Wunderbread
<p>The common case is to use <code>ClusterIP</code> for services within your cluster, unless you have a specific reason for another kind of <code>Service</code>.</p> <blockquote> <p>For headless Services, a cluster IP is not allocated, kube-proxy does not handle these Services, and there is no load balancing or proxyin...
Jonas
<p>When we run <code>kubectl apply -k github.com/minio/direct-csi</code> command, how kubectl downloads and apply the deployment manifest?</p> <p>How can we download this file to local using <code>curl</code> or <code>wget</code> command?</p> <p>Thanks SR</p>
sfgroups
<p>You can see all the http request that <code>kubectl</code> does by using a <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-output-verbosity-and-debugging" rel="nofollow noreferrer">verbose log level</a>.</p> <p>E.g.</p> <pre><code>kubectl get po --v=7 </code></pre> <p>Output</p> <pre><code>...
Jonas
<p>So yes, <code>StatefulSet</code> helps preserve the order and name of the pod, but what is it that it does extra (or different) that is advantageous over a regular <code>Deployment</code> with respect to volumes.</p> <p>I see many examples of master/slave setup for databases as a use case for <code>StatefulSet</code...
Gurleen Sethi
<blockquote> <p>So yes, StatefulSet helps preserve the order and name of the pod, but what is it that it does extra (or different) that is advantageous over a regular Deployment with respect to volumes.</p> </blockquote> <p>With a <strong>StatefulSet</strong> each Pod get its own PersistentVolumeClaim, but with <strong...
Jonas
<p>I'm trying to modify the running state of my pod, managed by a deployment controller both from command line via <code>kubectl patch</code> and from the k8s python client API. Neither of them seem to work</p> <p>From the command line, I tried both strategic merge match and JSON merge patch, but neither of them works....
Inian
<p>You should not.</p> <p>Clients write the <em>desired state</em> in the <code>spec:</code> and controllers write the <code>status:</code>-part.</p>
Jonas
<p>Is it possible for an InitContainer to change the environment variables of the application container when running inside the same Pod?</p> <p>Note that I am looking for a detailed answer that describes the technical reasons why this is or isn't possible. Example: 'Current container technology supports environment v...
atomaras
<p>Short answer is No, they can't.</p> <p>You can try some hack something using <a href="https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/" rel="nofollow noreferrer">ShareProcessNamespace</a> and <a href="https://stackoverflow.com/questions/205064/is-there-a-way-to-change-the-environmen...
Maciek Sawicki
<p>What rules should be used to assign affinity to Kubernetes pods for distributing the pods across all Availability Zones? I have a region with 3 Availability Zones and Nodes in each of these. I want to make sure that each of the 3 pods are spread across all the 3 Availability Zones.</p>
user4202236
<p>You should be able to use the label <code>topology.kubernetes.io/zone</code> (for e.g. topologyKey) and add <strong>anti-affinity</strong> rules.</p> <p>This is part of the <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#an-example-of-a-pod-that-uses-pod-affinity" rel="nofollow nore...
Jonas
<p>I knew I can tag the image name from official name with private image name and push to it</p> <pre><code>docker pull alpine docker tag alpine &lt;abc.jrog.io&gt;/alpine docker push &lt;abc.jrog.io&gt;/alpine </code></pre> <p>But this is not the case when I deal with Kubernetes helm charts, especailly with sub-charts...
Bill
<p>What you want, is to configure a custom <em>default registry</em>. Wether this is possible or how to do it depends on what container runtime and nodes that you are using. See e.g. <a href="https://stackoverflow.com/questions/33054369/how-to-change-the-default-docker-registry-from-docker-io-to-my-private-registry">Ho...
Jonas
<p>I'm currently working on my own custom operator that deploys a fully functional Wordpress. I'm required to implement SSL. Now this is where I'm stuck, I'm not really sure how to implement this using Go.</p> <p>Is there a way of adding already existing CRDs, for example cert-manage, into my operator and then create a...
Modx
<p>Yes, every Go controller also has clients generated. See e.g. <a href="https://github.com/jetstack/cert-manager/tree/master/pkg/client" rel="nofollow noreferrer">client-go cert-manager</a>.</p> <p>If you import the client-go for cert-manager, you can use it to e.g. <code>create</code> resources or <code>watch</code>...
Jonas
<p>Assume that I have a pod active and contains only one active container initially. This container is a nodejs application in typescript and shows user interface when opened in browser.</p> <p>Can this container create another container on-demand/dynamically within the SAME POD ? How can we achieve this? Please advise...
che_new
<blockquote> <p>Can this container create another container on-demand/dynamically within the SAME POD ? How can we achieve this?</p> </blockquote> <p>No, the containers within a Pod is declared in the <code>PodTemplate</code> that need to be declared upfront before the pod is created. More specific, what use case do yo...
Jonas
<p>I created a cluster:</p> <pre><code>gcloud container clusters create test </code></pre> <p>so there will be 3 nodes:</p> <pre><code>kubectl get nodes NAME STATUS ROLES AGE VERSION gke-test-default-pool-cec920a8-9cgz Ready &lt;none&gt; 23h v1.9.7-gke.5 gk...
gacopu
<p>After running <code>kubectl delete node gke-test-default-pool-cec920a8-9cgz</code> run <code>gcloud compute instances delete gke-test-default-pool-cec920a8-9cgz</code></p> <p>This will actually delete VM (<code>kubectl delete</code> only "disconnects" it from the cluster). GCP will recreate the VM and it will auto...
Maciek Sawicki
<p>My Kubernetes deployment has a PVC attached, and it has 3 replicas. I was trying to understand what it actually means. 3 replicas are all on different nodes, in different zones, but the pods can access the same piece of storage at the same time.</p> <p>So my question is that where the physical disk locates? If it's ...
Keno
<p>Kubernetes <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">PersistentVolume</a> is an abstraction. PV works with different storage system and they may have different properties. E.g. the <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="no...
Jonas
<p>I would imagine the interface would have some button I could click to launch the kubectl proxy dashboard, but I could not find it.</p> <p>I tried this command to get the token and entered it in:</p> <pre><code>gcloud container clusters get-credentials mycluster kubectl -n kube-system describe secret $(kubectl -n ...
atkayla
<p>Provided you are authenticated with <code>gcloud auth login</code> and the current project and k8s cluster is configured to the one you need, authenticate <code>kubectl</code> to the cluster (this will write <code>~/.kube/config</code>):</p> <pre><code>gcloud container clusters get-credentials &lt;cluster name&gt; ...
Alexander
<p>I have got a deployment.yaml and it uses a persistentvolumeclaim like so</p> <pre><code>kind: PersistentVolumeClaim apiVersion: v1 metadata: name: mautic-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: standard </code></pre> <p>I am trying to scale my ...
jeril
<p>Using <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a> is great if your app can scale <em>horizontally</em>. However, using a <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">Persistent Volume</...
Jonas
<p>Sometimes I got a bunch of jobs to launch, and each of them mounts a pvc. As our resource is limited, some pods fail to mount in less than one minute.</p> <blockquote> <p>Unable to mount volumes for pod &quot;package-job-120348968617328640-5gv7s_vname(b059856a-ecfa-11ea-a226-fa163e205547)&quot;: timeout expired wait...
Nick Allen
<blockquote> <p>So why is this happening? Shouldn't pod retry mount automatically instead of needing manual intervention? And if this is not avoidable, is there a workaround that it will automatically delete pods in Init Phase more than 2 min?</p> </blockquote> <p>There can be multiple reasons to this. Do you have any ...
Jonas
<p>I have a kubernetes cluster setup, I am converting a docker-compose using komposer , and I get:</p> <pre><code>WARN Volume mount on the host &quot;&lt;SOME_PATH&gt;&quot; isn't supported - ignoring path on the host WARN Volume mount on the host &quot;&lt;SOME_PATH_2&gt;&quot; isn't supported - ignoring path on the h...
user1562431
<blockquote> <p>or is there another standard way to apply certs at the application layer?</p> </blockquote> <p>Yes, for TLS and mTLS between applications within your cluster, I would consider to use a <em>service mesh</em>, e.g. <a href="https://istio.io/latest/docs/tasks/security/authentication/authn-policy/#auto-mutu...
Jonas
<p>I'm new to the Apache Kamel. I have installed Kubernetes on master machine and then I downloaded the binary file "kamel" and placed in the path "/usr/bin". My versions are,</p> <pre><code>Camel K Client 0.3.3 </code></pre> <p>My kubernetes master and kubeDNS is running fine. When I tried to install kamel on kubern...
Shr4N
<p>You need to set the container registry where camel-k can publish/retrieve images, you can do it by editing camel-k's integration platform</p> <pre><code>oc edit integrationplatform camel-k </code></pre> <p>or upon installation</p> <pre><code>kamel install --registry=... </code></pre>
Luca Burgazzoli
<p>When you decrease the number of pods in a Kubernetes workload, I am assuming it is doing a soft kill. Does it start that process by stopping incoming connections? In an event-driven microservice environment, where container reads message from a queue. When I deploy, what happens to the message that are currently bei...
Ash_this
<blockquote> <p>When you decrease the number of pods in a kubernetes workload, i am assuming it is doing a soft kill.</p> </blockquote> <p>Yes, it does a <em>graceful termination</em>, so your pod get a <code>SIGTERM</code> signal, but it is up to you to implement this handling in the app, before the pod is killed afte...
Jonas
<p>I am using <code>apiversion : apps/v1beta2</code>in most of deployment however Kubernetes cluster version <code>1.14</code> it's recommended to use <code>apiversion : apps/v1</code>. Also v1beta2 will be deprecated from <code>Kubernetes 1.16</code>.</p> <p>Is there any better option to reduce manual work and update...
Harsh Manvar
<p>You can try using move2kube (<a href="https://github.com/konveyor/move2kube" rel="nofollow noreferrer">https://github.com/konveyor/move2kube</a>) tool to achieve the above.</p> <p>To achieve the above, do the following:</p> <p>Create a yaml file that defines your cluster kinds like below (call is say clusterconfig.y...
Ashok Pon Kumar
<p>we have an app in production which need to be highly available (100%),so we did the following:</p> <ol> <li>We configure 3 instance as HA but then the node died</li> <li>We configure anti-affinity (to run on differents nodes) but some update done on the nodes and we were unavailable(evicted) for some min.</li> <li>N...
Rayn D
<blockquote> <p>How the affinity works with pod disruption Budget, could be any collusion ? or this is redundant configs ?</p> </blockquote> <p><a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity" rel="nofollow noreferrer">Affinity and Anti-affinity</a> is about ...
Jonas
<p>When deploying Kubernetes Daemonset, what will happen when single node (out of a few nodes) is almost out of resource, and a pod can't be created, and when there are no pods that can be evicted? Though Kubernetes can be horizontally scaled, I believe it is meaningless to scale horizontally as Daemonset would need ev...
Piljae Chae
<blockquote> <p>Though Kubernetes can be horizontally scaled, I believe it is meaningless to scale horizontally as Daemonset would need every pod on each node.</p> </blockquote> <p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a> is a workload type t...
Jonas
<p>I am trying to change my existing deployment logic/switch to kubernetes (My server is in gcp and till now I used docker-compose to run my server.) So I decided to start by using <code>kompose</code> and generating services/deployments using my existing docker-compose file. After running </p> <pre><code>kompose --fi...
Prethia
<p>You should consider using Persistent Volume Claims (PVCs). If your cluster is managed, in most cases it can automatically create the PersistentVolumes for you.</p> <p>One way to create the Persistent Volume Claims corresponding to your docker compose files is using Move2Kube(<a href="https://github.com/konveyor/move...
Ashok Pon Kumar
<p>Is there any way to setup cross communication with different namespace, say pods of <code>namespace-a</code> to communicate pods of <code>namespace-b</code> with each other in GKE cluster except for setting network policies?</p>
Neelam
<p>Networking within a Kubernetes cluster can be done in different ways, but the recommended and most common way is to use DNS names. Pods get their own DNS names, but it is recommended that you access another app in the cluster via the <a href="https://kubernetes.io/docs/concepts/services-networking/connect-applicatio...
Jonas
<p>I'm working on a project and encountered some issues. I'm still a beginner with Kubernetes and need some help regarding that.</p> <p>The code from helm config is as follows:</p> <pre><code>storage: storageClass: aws-efs provisioner: someCustomName pvc: logs: ......... </code></pre> <p>I'm una...
Navjot Singh
<p>If the <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#provisioner" rel="nofollow noreferrer">provisioner</a> is prefixed with <code>kubernetes.io/</code> like <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#azure-file" rel="nofollow noreferrer">azure-file</a> it means tha...
Jonas
<p>I am trying to expose a service to the outside world using the <code>loadBalancer</code> type service.</p> <p>For that, i have followed this doc </p> <p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/" rel="noreferrer">https://aws.amazon.com/premiumsupport/knowledge...
shamon shamsudeen
<p>By default AWS EKS only attaches load balancers to public subnets. In order to launch it in a private subnet you need to not only label your subnets (which it looks like you did) but also annotate your load balancer-</p> <blockquote> <p>service.beta.kubernetes.io/aws-load-balancer-internal: "true"</p> </blockquot...
Robert Hafner
<p>Is it safe/secure to have intra-service communication in http and external routes in https in OpenShift / Kubernetes. If not what are the risks?</p>
Fabry
<p>This depends on your security requirements. You probably use a cluster with multiple nodes, so there are network links that the traffic cross. Do you use multiple data centers, and how is the network secured between data centers? Is there another organization that operate e.g. network or hardware parts, that perhaps...
Jonas
<p>Could someone help me please and point me what configuration should I be doing for my use-case?</p> <p>I'm building a development k8s cluster and one of the steps is to generate security files (private keys) that are generated in a number of pods during deployment (let's say for a simple setup I have 6 pods that eac...
Sniady
<p>It is correct that there is a 1:1 relation between a <code>PersistentVolumeClaim</code> and a <code>PersistentVolume</code>.</p> <p>However, Pods running on the same Node can concurrently mount the same volume, e.g. use the same <code>PersistentVolumeClaim</code>.</p> <p>If you use Minikube for local development, yo...
Jonas
<p>Some background: I have set up Airflow on Kubernetes (on AWS). I am able to run DAGs that query a database, send emails or do anything that doesn't require a package that isn't already a part of Airflow. For example, if I try to run a DAG that uses the Facebook-business SDK the DAG will obviously break because the d...
Jesus Garcia
<p>The init container is a separate docker instance. Unless you rig up some sort of shared storage for your python libraries (which is quite dubious) any pip installs in the init container won't impact the running container of the pod. </p> <p>I see two options:</p> <p>1) Modify the docker image that you're using t...
Laizer
<p>I have the following deployment config. The test-worker-health and health endpoints are both unreachable as the application is failing due to an error. The startup probe keeps restarting the container after failing as restartPolicy: Always. The pods enter CrashLoopBackoff state. Is there a way to fail such startup p...
Ruchika Salwan
<blockquote> <p>The startup probe keeps restarting the container after failing</p> </blockquote> <p>The startupProbe does not restart your container, but the <em>livenessProbe</em> does.</p> <blockquote> <p>The pods enter CrashLoopBackoff state. Is there a way to fail such startup probe?</p> </blockquote> <p>If you rem...
Jonas
<p>I have a docker image in my local machine which I have pushed to Google Cloud Containers. Now I want to deploy this image in Google Kubernetes Engine.</p> <p>I am following the steps in below link -</p> <p><a href="https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-gke#deploying_a_pre-built_container_...
Hershika Sharma
<p>You need to use the full image name, that usually includes the image registry and repository.</p> <p>From the example:</p> <pre><code>&quot;gcr.io/cloud-builders/gke-deploy&quot; </code></pre> <p>Usually, the GCP format is</p> <pre><code>&lt;docker registry host&gt;/&lt;gcp-project-name&gt;/&lt;image-name&gt; </code...
Jonas
<p>On GKE, I set a statefulset resource as</p> <pre><code>--- apiVersion: apps/v1 kind: StatefulSet metadata: name: redis spec: serviceName: &quot;redis&quot; selector: matchLabels: app: redis updateStrategy: type: RollingUpdate replicas: 3 template: metadata: labels: app: re...
iooi
<p>What you have done, should work. Make sure that the <code>PersistentVolumeClaim</code> and the <code>StatefulSet</code> is located in the same namespace.</p> <hr /> <p>Thats said, this is an easier solution, and that let you easier scale up to more replicas:</p> <p>When using StatefulSet and PersistentVolumeClaim, u...
Jonas
<p>I use a kubernetes manifest file to deploy my code. My manifest typically has a number of things like Deployment, Service, Ingress, etc.. How can I perform a type of &quot;rollout&quot; or &quot;restart&quot; of everything that was applied with my manifest?</p> <p>I know I can update my deployment say by running</p>...
alex
<p>I would recommend you to store your manifests, e.g. <code>Deployment</code>, <code>Service</code> and <code>Ingress</code> in a directory, e.g. <code>&lt;your-directory&gt;</code></p> <p>Then use <code>kubectl apply</code> to &quot;apply&quot; those files to Kubernetes, e.g.:</p> <pre><code>kubectl apply -f &lt;dire...
Jonas
<p>I have a deployment in Kubernetes. In this deployment, I can specify a persistent volume claim as follows:</p> <pre><code> volumes: - name: my-volume persistentVolumeClaim: claimName: my-claim </code></pre> <p>I have a disk (an Azure disk to be precise) with lots of preprocessed data, which I can expose...
Stephan
<blockquote> <p>I have a disk (an Azure disk to be precise) with lots of preprocessed data, which I can expose in Kubernetes as PVC with name my-claim. In the next step I link it to the deployment as shown above. The problem with this approach is, that I cannot scale the deployment to more than one pod.</p> </blockquot...
Jonas
<p>I'm trying to understand how kubernetes works, so I tried to do this operation for my minikube:</p> <pre><code>~ kubectl delete pod --all -n kube-system pod &quot;coredns-f9fd979d6-5n4b6&quot; deleted pod &quot;etcd-minikube&quot; deleted pod &quot;kube-apiserver-minikube&quot; deleted pod &quot;kube-controller-mana...
Василий Никпуп
<p>The control plane pods are run as <a href="https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/" rel="noreferrer">static Pods</a> - static Pods are not managed by the control plane controllers like e.g. DaemonSet and ReplicaSet. <em>Static pods</em> are instead managed by the Kubelet daemon on the lo...
Jonas
<p>Assume that there are some pods from Deployments/StatefulSet/DaemonSet, etc. running on a Kubernetes node.</p> <p>Then I restarted the node directly, and then start docker, start kubelet with the same parameters.</p> <p>What would happen to those pods?</p> <ol> <li>Are they recreated with metadata saved locally from...
Li Ziyan
<p>Good questions. A few things first; a Pod is not pinned to a certain node. The nodes is mostly seen as a &quot;server farm&quot; that Kubernetes can use to run its workload. E.g. you give Kubernetes a set of nodes and you also give a set of e.g. <code>Deployment</code> - that is desired state of applications that sh...
Jonas
<p>I want to expose a tcp-only service from my Fargate cluster to the public internet on port 80. To achieve this I want to use an AWS Network Load Balancer</p> <p>This is the configuration of my service:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Service metadata: name: myapp labels...
Daniel Müller
<p>The <em>in-tree</em> Kubernetes <code>Service</code> LoadBalancer for AWS, can not be used for AWS Fargate.</p> <blockquote> <p>You can use NLB instance targets with pods deployed to nodes, but not to Fargate.</p> </blockquote> <p>But you can now install <a href="https://github.com/kubernetes-sigs/aws-load-balancer-...
Jonas
<p>This is my kubernetes.yml</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: servicetwo labels: name: servicetwo namespace: sock-shop spec: replicas: 1 template: metadata: labels: name: servicetwo spec: containers: - name: servicetwo ...
gANDALF
<p>In addition to change to <code>apps/v1</code> you also need to add the <strong>new required field</strong> <code>selector:</code> in the <code>spec:</code></p> <p>something like this should work for you:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: servicetwo labels: name: servicetwo ...
Jonas
<p>I have microsevices and SPA app. All of them run on docker with docker compose. I have ocelot api gateway. But gateway knows ip address or container names of microservices for reaching . I add a aggregater service inside ocelot app. And I can reach to all services from aggregator service with ips.</p> <p>But I wan...
eren arslan
<p>It sounds like your question is related to <a href="https://kubernetes.io/docs/concepts/services-networking/service/#motivation" rel="nofollow noreferrer">Service Discovery</a>.</p> <p>In Kubernetes, the native way an &quot;API Gateway&quot; is implemented, is by using <a href="https://kubernetes.io/docs/concepts/se...
Jonas
<p>When I run <code>shutdown -h now</code> command to shutdown a node in kubernetes cluster, endpoint update its state after about 40 seconds, but when I run command <code>kubectl delete pod POD-NAME</code>, endpoint update its state very quick. Can anyone explain why?</p>
Ren
<p>When you &quot;shutdown&quot; a node, you should do it gracefully with <a href="https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/" rel="nofollow noreferrer">kubectl drain</a>. This will evict the pods in a controlled manner and this should be more friendly to your traffic.</p> <p>The article <a ...
Jonas
<p>After creating the pod-definition.yml file.</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app: myapp type: server spec: containers: - name: nginx-container image: nginx </code></pre> <p>The linter is giving this warning.</p> <p><code>One or more ...
Rushikesh Sabde
<p>It is a good practice to declare resource requests and limits for both <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/" rel="noreferrer">memory</a> and <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/" rel="noreferrer">cpu</a> for each c...
Jonas
<p>We have setup with two Kubernetes VMs on Ubuntu Server, a master and a worker. The cluster appears healthy, I'm still learning my way around. I know you can build an image and push it to docker hub and then pull that image down from the Kubernetes server.</p> <p>My trouble is everything I'm learning says you use a...
Lucas
<blockquote> <p>when I ssh into the Kubernetes master it doesn't know how to find files on my local machine nor do I know how to tell it</p> </blockquote> <p>The prober way to interact with your Kubernetes cluster, is to send your requests to the API-Server. The API Server is a REST API, but it is easiest to use <code>...
Jonas
<p>I want to use serving api which is the part of the knative serving repo to create serving application. Since i'm writing a custom controller, i need to make use of Go client. I'm finding it difficult to generate boiler plate code using the code-generator. I'm following the below mentioned blog on how to do it.</p> <...
coders
<p>Yes, code generation for controllers is not the most easy thing. And it has changed over the years.</p> <p>To start writing a controller with code generation, I would recommend to use Kubebuilder and follow the <a href="https://kubebuilder.io/" rel="nofollow noreferrer">Kubebuilder guide</a>. And perhaps do custom t...
Jonas
<p>I have a service using Azure Kubernetes cluster and AKS load balancer. I want to forward some HTTP(client) requests to all instances. is there any way to configure this behavior using AKS or Kubernetes in general?</p> <p>Say I have XYZ API running two replicas/instances.</p> <ul> <li>XYZ-1 pod instance</li> <li>XYZ-...
vkt
<blockquote> <p>if it is possible to forward a request to both instances (XYZ-1 and XYZ-2) when the request endpoint is testendpoint</p> </blockquote> <p>This is not a feature in the HTTP protocol, so you need a purpose built service to handle this.</p> <blockquote> <p>The use case to refresh a service in-memory data v...
Jonas
<p>Complex AWS EKS / ENI / Route53 issue has us stumped. Need an expert.</p> <p>Context:</p> <p>We are working on dynamic game servers for a social platform (<a href="https://myxr.social" rel="nofollow noreferrer">https://myxr.social</a>) that transport game and video data using WebRTC / UDP SCTP/SRTP via <a href="http...
Liam Collins
<p>The native way for receiving <a href="https://aws.amazon.com/about-aws/whats-new/2020/08/amazon-eks-now-supports-udp-load-balancing-with-network-load-balancer/" rel="nofollow noreferrer">UDP traffic on Amazon EKS</a> is by using a Kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/service/#l...
Jonas
<p>Assume I have a web application (Apache httpd server) deployed in AWS using EC2 instances (VM). Application deployment is performed using EC2 userdata.</p> <p>Alternatively I could dockerize my web application. Deploy a Kubernetes cluster on EC2 instances using EKS, or custom setup. We could also use AWS Fargate for...
scoulomb
<h1>EC2 - more responsibilty for Developers</h1> <p>If you as a developer deploy your application to EC2 machines, you usually also is responsible for maintaining and patching the EC2 instances. The problem is that this is things that developers not usually are good at, and commonly not are so interested in. It is not ...
Jonas
<h1>Problem</h1> <ul> <li>We write config files using Terraform for both our Kubernetes Cluster or Apps</li> <li>Some of these files must be pushed to different git repos <ul> <li>Just following GitOps for kubernetes and dynamic config repos</li> </ul> </li> </ul> <h1>Question</h1> <ul> <li>How can I perform a git clon...
Marcello DeSales
<blockquote> <p>How can I perform a git clone, commit, push using terraform?</p> </blockquote> <blockquote> <p>Should we just use shell?</p> </blockquote> <p>Terraform is a good tool - it is best for <em>provisioning immutable infrastructure</em>. Shell script might also have its place, but when you can, it is preferab...
Jonas
<p>I am Dockerizing the Asp.net core application and how do I read configmap &amp; secret in asp.net core application?</p>
One Developer
<p>When designing an app for Kubernetes, you should usually follow the <a href="https://12factor.net/" rel="nofollow noreferrer">12 factor app</a> guidelines.</p> <p>It is common that the app read config-values as Environment variables, but sometimes also as files. The Kubernetes documentation has good examples on how ...
Jonas
<p>Is there a way to get the replica count at runtime within a pod that belongs to a StatefulSet? I have verified that the following answer <a href="https://stackoverflow.com/a/54306021/5514015">https://stackoverflow.com/a/54306021/5514015</a> gives you the hostname of the pod, which includes the pod ordinal number, at...
jim
<p>Unfortunately, the number of replicas is not available through the <a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#capabilities-of-the-downward-api" rel="nofollow noreferrer">Downward API</a>. But in a <code>StatefulSet</code>, as you say, it is common to...
Jonas
<p>I have TS application that uses kubernetes-client library to connect to kubernetes in Google Cloud.</p> <pre><code>import { KubeConfig, CoreV1Api } from &quot;@kubernetes/client-node&quot;; const kc = new KubeConfig(); kc.loadFromDefault(); const kbsCoreApi = kc.makeApiClient(CoreV1Api); </code></pre> <p>When runnin...
Gus G
<p>Use <code>kc.loadFromCluster();</code> instead of the <code>kc.loadFromDefault();</code> used in your code.</p> <p>See <a href="https://github.com/kubernetes-client/javascript/blob/master/examples/in-cluster.js" rel="noreferrer">in-cluster example</a></p> <p>When starting the client with the in-cluster authenticatio...
Jonas
<p>Both server POD and client POD runs in a K8S cluster. I have configured my Server POD to Scale up when its memory usage reaches a threshold.</p> <p>Now I want to increase number of threads in my client POD whenever a new server POD is spawned. How to catch this auto scale scaleUp event in the client POD ?</p>
Chandu
<blockquote> <p>Now I want to increase number of threads in my client POD whenever a new server POD is spawned. How to catch this auto scale scaleUp event in the client POD ?</p> </blockquote> <p>An application typically should not know that it is running within Kubernetes, e.g. it should be agnostic to this kind of in...
Jonas
<p>From the document, it can be found there is a <code>Stable Network ID</code> feature to use for <code>Pod NDS</code>:</p> <p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/statefuls...
iooi
<p>Also note from the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id" rel="nofollow noreferrer">StatefulSet documentation</a>:</p> <blockquote> <p>As mentioned in the limitations section, you are responsible for creating the Headless Service responsible for the network...
Jonas
<p>Let's suppose that I have such code to generate new pod</p> <pre><code>req := &amp;api.Pod{ TypeMeta: unversioned.TypeMeta{ Kind: &quot;Pod&quot;, APIVersion: &quot;v1&quot;, }, ObjectMeta: api.ObjectMeta{ GenerateName: &quot;name-, // need to get tha...
xaos_xv
<p>The generated name seem to be created in conjunction with the apiServer. See <a href="https://github.com/kubernetes/kubernetes/issues/44501#issuecomment-294255660" rel="nofollow noreferrer">Issue comment</a> and <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#generated-values" rel="nofollow nor...
Jonas
<p>I would like to enable mTLS between services in one K8S namespace. I wonder if I can do it without using service mesh? I considered cert-manager but all the examples I've seen involved Ingress resource which I do not need as my services are not exposed outside of the cluster.Thanks</p>
Revital Eres
<p>Using <em>Service Mesh</em> like <a href="https://istio.io/" rel="nofollow noreferrer">Istio</a> or <a href="https://linkerd.io/" rel="nofollow noreferrer">Linkerd</a> for this is currently the only general solution for this.</p> <p>It should be possible to do this using a library for you app as well, the library ty...
Jonas
<p>I created a StatefulSet for running my NodeJS with 3 replicas and want to attach to a gce disk that can become a data storage for user to upload files.</p> <p>My project naming: carx; Server name: car-server</p> <p><strong>However I got an error while creating the second pod.</strong></p> <pre><code>kubectl describe...
potato
<p>The <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">Access Mode</a> field is treated as a <em>request</em>, but it is not sure that you get what you requests. In your case, <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access...
Jonas
<p>Is it possible to mount disk to gke pod and compute engine at the same time.</p> <p>I have a ubunut disk of 10 gb</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: pv-demo spec: capacity: storage: 10G accessModes: - ReadWriteOnce claimRef: name: pv-claim-demo gcePersistentDis...
pythonhmmm
<blockquote> <p>The other challenge is multiple pod will be writing to same PV.</p> </blockquote> <p>Yes, this does not work well, unless you have a storage class similar to NFS. The default <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">storageClass</a> in Google Kuber...
Jonas