prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have some CDC data in Kafka. Now I am trying to sink from Kafka to Elasticsearch. Here is what I have done so far:</p> <h2>Step 1 - Deploy Elasticsearch in Kubernetes (succeed)</h2> <p>I deployed Elasticsearch in Kubernetes by following this tutorial using Elastic Operator:</p> <ol> <li>Deploy ECK in your Kubernet...
<p>First add more background. The way I deployed Kafka is using <a href="https://strimzi.io/quickstarts/" rel="noreferrer">Strimzi</a>:</p> <pre><code>kubectl create namespace kafka kubectl apply --filename=&quot;https://strimzi.io/install/latest?namespace=kafka&quot; --namespace=kafka kubectl apply --filename=https://...
<p>I'm using the kubebuilder framework in my controller and I want to completely ignore events from a list of given system namespaces. I think predicates must be the best option for this, hence I have the following code</p> <pre><code>... WithEventFilter(predicate.Funcs{ GenericFunc: func(e event.GenericEv...
<p>According to <a href="https://github.com/kubernetes-sigs/controller-runtime/blob/1e4d87c9f9e15e4a58bb81909dd787f30ede7693/pkg/handler/eventhandler.go#L52" rel="nofollow noreferrer">controller-runtime</a></p> <blockquote> <p>Generic is called in response to an event of an unknown type or a synthetic event triggered a...
<p>We have application with huge configuration (this is just a part):</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: my-app data: application.yaml: |- config: app: MY-APP my-custom-map: KEY1: value1 KEY2: value2 KEY3: value3 KEY4: value4 something...
<p><strong>Option : 1</strong></p> <p>You can Use the Lens : <a href="https://k8slens.dev/kubernetes.html" rel="nofollow noreferrer">https://k8slens.dev/kubernetes.html</a></p> <p>It's UI for monitoring and Managing K8s clusters. Using this you can also edit the configmap.</p> <p><strong>Option : 2</strong></p> <p>You ...
<p>I am trying to use <code>kubernetes</code> for local deployment using <code>minikube</code>, I want to mount a share a directory between host machine and pods. For this, I am trying to mount directory to <code>minikube</code>. But I already had minikube running on which few deployments were running. I deleted them. ...
<p>You will have to delete the minikube container first using <code>minikube delete</code> , after that recreate the container with the new mount path <code>minikube start --mount-string=&quot;/var/log:/log&quot; --mount</code><br /> Check this Github <a href="https://github.com/kubernetes/minikube/issues/11084" rel="n...
<p>I have packed the software to a container. I need to put the container to cluster by Azure Container Service. The software have outputs of an directory <code>/src/data/</code>, I want to access the content of the whole directory. </p> <p>After searching, I have to solution.</p> <ol> <li>use Blob Storage on azure, ...
<p>As I've explained <a href="https://frank.sauerburger.io/2021/12/01/inspect-k8s-pvc.html" rel="noreferrer">here</a> and <a href="https://k8s.sauerburger.com/t/pvc-inspect" rel="noreferrer">here</a>, in general, if you can interact with the cluster using <code>kubectl</code>, you can create a pod/container, mount the ...
<p>I am setting <code>KUBECONFIG</code> variable, but kubectl is not using this variable and instead using the default config file.</p> <p>Setting variable as below -</p> <pre><code>$export KUBECONFIG=./my-k8s-token.config </code></pre> <p>next am running get pods as below -</p> <pre><code>$ kubectl.exe get pods -v 8 ...
<p>I could solve the issue by using <code>kubectl</code> which i installed using offical documentation - <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-n...
<p>I am testing something out on my local minikube cluster on a Windows10 machine. I deployed my test deployment on my local minikube cluster and added a service to it to access over NodePort, but I cannot access it.</p> <pre><code>PS C:\Users\Admin&gt; kubectl get all -n web -o wide NAME ...
<p>I found the solution.</p> <p>Unlike on Linux, accessing NodePort using the specified port on the service definition yaml file is not a straightforward thing on Windows10.</p> <p>On Windows10, it has to be done as follows:</p> <pre><code>PS C:\Users\Admin&gt; minikube service nginx-webserver-service -n web |---------...
<p>I'm very new to Ansible and I'm trying to install kubectl on an EC2 instance (Ubuntu 18.04) for a class.</p> <p>I have ran the playbook and it went well until it hit task 4 then threw the following error:</p> <blockquote> <p>fatal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Failed...
<p>Regarding the part</p> <pre><code>- name: 3. Get APT Key shell: cmd: curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - cmd: echo &quot;deb https://apt.kubernetes.io/ kubernetes-xenial main&quot; | sudo tee -a /etc/apt/sources.list.d/kubernetes.list </code></pre> <p>Th...
<p>I am trying to delete (and recreate) the Argo namespace, but it won't fully delete because I tried launching an eventsource and eventbus there. Now these will not delete.</p> <p>I have tried to delete them via yaml and individually - no success yet.</p> <p>The frustrating result is that I cannot re-launch argo</p> <...
<p>For anyone who stumbles onto this question, it is a permissions issue. Make certain your service account has permissions to work in both namespaces (argo and argo-events).</p>
<p>I was trying to setup an elasticsearch cluster in AKS using helm chart but due to the log4j vulnerability, I wanted to set it up with option <code>-Dlog4j2.formatMsgNoLookups</code> set to <code>true</code>. I am getting unknown flag error when I pass the arguments in helm commands. Ref: <a href="https://artifacthub...
<p>First of all, here's a good source of knowledge about mitigating <a href="https://xeraa.net/blog/2021_mitigate-log4j2-log4shell-elasticsearch/" rel="nofollow noreferrer">Log4j2 security issue</a> if this is the reason you reached here.</p> <p>Here's how you can write your <code>values.yaml</code> for the Elasticsear...
<p>I have a Problem with the Kubernetes Dashboard. I use actually the Managed Kubernetes Service AKS and created a Kubernetes Cluster with following Setup:</p> <ul> <li>Kubernetes-Version 1.20.9</li> <li>1 Worker Node with Size Standard_DS2_v2</li> </ul> <p>It starts successfully with the automatic configuration of <st...
<p><code>... I used the instruction which is described on https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard.</code></p> <p>The dashboard needs a way to &quot;cache&quot; a small window of metrics collected from the metrics server. The instruction provided there doesn't have this enabled. You can r...
<p>I find it &quot;a bit&quot; boring to create K8s manifests for services that I want to deploy. Typically, for an app, a set of manifests as follows is needed:</p> <ul> <li>deployment</li> <li>service</li> <li>ingress</li> <li>configMap</li> <li>secret</li> </ul> <p>I think there must be some tool that automates the ...
<h2>Solution 1</h2> <p>Kubernetes supports generating manifests for some resource types. Here is the full list: <a href="https://kubernetes.io/docs/reference/kubectl/conventions/#generators" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/kubectl/conventions/#generators</a></p> <p>You can get the usage o...
<p>When an application needs to call events API to get all events of its cluster, as a programmer I may define a role like this:</p> <pre><code>apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: namespace: default name: pod-reader rules: - apiGroups: [&quot;&quot;] # &quot;&quot; indicates the core API g...
<blockquote> <p>Why there are named groups and core groups</p> </blockquote> <p>The reason is historical. Kubernetes first considered some resources part of a core group, meaning the core of Kubernetes is constituted by these resources (resources in the core group includes Pods, Events).</p> <p>The purposes of the name...
<p>I'm sporting a fresh <strong>Minikube</strong> install on an <strong>ArchLinux</strong> box, using <strong>Docker</strong> as the <strong>Minikube</strong> driver.</p> <p>I started the <strong>minikube</strong> &quot;cluster&quot; using the <code>minikube start</code> command. <code>docker container ls</code> tells ...
<p>The problem got resolved by one of these actions (not sure by which exactly):</p> <ul> <li>terminating my VPN connection</li> <li>deleting the <strong>minikube</strong> container and image</li> <li>rebooting my computer</li> <li>starting anew with <code>minikube start</code></li> </ul>
<p>I am working with kubernetes for a long time and I have a question that I am not sure what the answer is.</p> <p>If I create a <code>PersistentVolume</code> and couple of <code>PersistentVolumeClaims</code> that uses that <code>PersistentVolume</code>. I mapped different <code>PersistentVolumeClaims</code> to differ...
<p><strong>TL;DR:</strong> By mistake - no. By a chain of mistakes - yes.</p> <p>First, PV <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">Access Mode</a> need to be set to <code>ReadWriteMany</code>.</p> <p>Then, a specific Volume Plugin have to be used....
<p>I'm trying to setup my Jenkins instance in our On-premise Kubernetes cluster v1.18.6. Went thru multiple posts on the internet explaining the steps but using nodeport IP and not using the ingress.</p> <p>I'm looking for</p> <ol> <li>Domain under which I want to access Jenkins: <code>jenkins.BU.org.com/jenkins</code>...
<p>So starting out from bare bones I assume following things:</p> <ul> <li>You have a configured Kubernetes cluster available to you</li> <li>You have the Ingress controller installed in your cluster</li> </ul> <p>First thing to make clear:</p> <blockquote> <p>Workloads which run within the Kubernetes cluster should co...
<p>We'd like to use <a href="https://github.com/tektoncd/experimental" rel="nofollow noreferrer">Tekton experimental features</a> such as the <a href="https://github.com/tektoncd/experimental/tree/main/pipelines-in-pipelines" rel="nofollow noreferrer">Pipelines In Pipelines feature</a>. We already <a href="https://gith...
<p>A simple combination of <code>curl</code> which downloads the file and pipes it into <code>sed</code>, which substitutes the <code>stable</code> to <code>alpha</code> works like a charm - especially since this flag is the only line including <code>stable</code> (except of the commentary line directly above). <code>s...
<p>I have a Kubernetes cluster (v. 1.22) and inside it I have Nginx ingress controller deployed. I have found I could <a href="https://kubernetes.github.io/ingress-nginx/how-it-works/#when-a-reload-is-required" rel="noreferrer">reload my ingress</a> in several situations: The next list describes the scenarios when a re...
<blockquote> <p><strong>What should I exactly do to reload my ingress?</strong></p> </blockquote> <p>You just need to update the ingress, in your case you just need to add the TLS section is to existing Ingress.</p> <p>Then (automatically) the ingress controller should find the differences (as <a href="https://stackove...
<p>I am following <a href="https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html</a> to link EFS to EKS. I have two namespace under my k8s clusters: <code>dev</code> and <code>stage</code>, and from I understand, I'd need t...
<p>To resolve the error that you are seeing, re-apply your StorageClass with:</p> <pre><code>... parameters: provisioningMode: efs-ap fileSystemId: &lt;ID of the file system created on EFS&gt; ... </code></pre> <p>If multiple pods going to read/write to the file system, re-apply PersistentVolume with:</p> <pre><cod...
<p>There is a kubernetes cluster with 100 nodes, I have to clean the specific images manually, I know the kubelet garbage collect may help, but it isn't applied in my case. After browsing the internet , I found a solution - docker in docker, to solve my problem.</p> <p>I just wanna remove the image in each node one tim...
<p>If you want to run you job on single specific Node you can us the <strong>Nodeselector</strong> in POD spec</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: test spec: schedule: &quot;*/1 * * * *&quot; jobTemplate: spec: template: spec: containers: - ...
<p>I am trying to use Ansible to put a pause in my playbook, since I am installing an operator from the Operator Hub and don't want to continue, until I know the CRDs I require in the following steps are installed. I have the following task but can't get it working yet.</p> <pre><code>- name: Wait for CRDs to be availa...
<p>There is a small detail that is tripping up the condition. In the JSON output, the status is a string <code>&quot;True&quot;</code> and not a boolean which we are comparing.</p> <p>Note: <code>&quot;status&quot;: &quot;True&quot;</code></p> <p>Changing the condition to match the string <code>True</code>...</p> <pre>...
<p>Hey I'm trying to get a pipeline to work with kubernetes but I keep getting <code>ErrImagePull</code></p> <p>Earlier I was getting something along the lines <code>authentication failed</code>. I created a secret in the namespace of the pod and referring to it in the deployment file:</p> <pre><code> imagePullSec...
<p>OP has posted in the comment that the problem is resolved:</p> <blockquote> <p>I found the error. So I had a typo and my secret was in fact not created in the correct namespace.</p> </blockquote>
<p>I have an <code>EKS cluster</code> with two <code>nodegroups</code> each in different <code>AZ</code>. One <code>deployment</code> <code>Deployment1</code> is running on 2 <code>namespaces</code> for redundancy, one copy per <code>namespace</code> and each of them run in separate <code>AZs</code>/<code>nodegroup</co...
<p>If you're using Kubernetes 1.19 or later you can use <code>topologySpreadConstraints</code>, adding this to the pod template:</p> <pre><code>topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: ScheduleAnyway labelSelector: matchLabels: foo: ...
<p>I managed to install kubernetes 1.22, longhorn, kiali, prometheus and istio 1.12 (profile=minimal) on a dedicated server at a hosting provider (hetzner).</p> <p>I then went on to test httpbin with an istio ingress gateway from the istio tutorial. I had some problems making this accessible from the internet (I setup ...
<p>Posted community wiki answer for better visibility based on the comment. Feel free to expand it.</p> <hr /> <p>The solution for the issue is:</p> <blockquote> <p>I setup HAProxy in combination with Istio gateway and now it's working.</p> </blockquote> <p>The reason:</p> <blockquote> <p>I think the reason why SSL was...
<p>Is there a way we can alter the resource names of the resources provisioned by AKS itself (screenshot below). I know I can change the node resource group name as per the documentation but cannot find any reference (or documentation) if we can change the AKS managed resource names. The resources for which I want to h...
<p>You cannot change the resource names of the resources provisioned by AKS itself. Because it is managed by AKS only. you can give your own name of <code>node resource group</code> at the time of creation using IAC tool like <code>Terraform</code>, <code>Biceps</code> etc. But you can’t change the <code>node resource ...
<p>We have a k8s cluster with 10 workers. we run hundreds of pods in the cluster. we want to avoid running pods with default service account. Need to find out the pods that are running with default service account. am able to find the number of pods using default service account with grep command but also need the pod ...
<ul> <li>In Case if you want to use just kubectl without jq :</li> </ul> <p>needed to print both namespace and the pod name</p> <pre><code>kubectl get pods --all-namespaces -o jsonpath='{range .items[?(@.spec.serviceAccountName == &quot;default&quot;)]}{.metadata.namespace} {.metadata.name}{&quot;\n&quot;}{end}' 2&gt;/...
<p>Currently, I have one Kubernetes with 2 namespaces: NS1 and NS2. I’m using <code>jboss/keycloak</code> Docker image.</p> <p>I am operating 2 Keycloak instances in those 2 namespaces and I expect that will run independently. But it is not true for Infinispan caching inside Keycloak. I got a problem that all sessions ...
<p>Posting comment as the community wiki answer for better visibility</p> <hr /> <p>I would use <code>JDBC_PING</code> for discovery, so only nodes which are using the same DB will be able to discover each other</p>
<p>I installed Rancher on my Kubernetes cluster on Azure as described <a href="https://rancher.com/docs/rancher/v2.5/en/installation/install-rancher-on-k8s/aks/" rel="nofollow noreferrer">here</a>. I ran the following command:</p> <pre><code>helm install rancher rancher-latest/rancher --namespace cattle-system --set ho...
<p>@Mar Chal</p> <p>Try below command to reset password it will work.</p> <pre><code>[]$ kubectl -n cattle-system exec $(kubectl -n cattle-system get pods -l app=demo-rancher | grep '1/1' | head -1 | awk '{ print $1 }') -- reset-password W1214 11:55:25.230447 127 client_config.go:615] Neither --kubeconfig nor --mas...
<p>I'm using Terraform <code>helm_release</code> resource to install <code>bitnami/redis</code> instance in my K8s cluster.</p> <p>The code looks like this:</p> <pre class="lang-js prettyprint-override"><code>resource &quot;helm_release&quot; &quot;redis-chart&quot; { name = &quot;redis-${var.env}&quot; repository...
<p>Maybe you were just using the wrong <code>attribute</code> to get that information. Checking the documentation at the <a href="https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service" rel="nofollow noreferrer">Terraform Registry Website</a> we can use the <code>cluster_ip</code>...
<p>I created a <code>WorkflowTemplate</code> in which I want to pass result of a script template as an input parameter to another task</p> <p>Here is my <code>WorkflowTemplate</code></p> <pre><code>apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: dag-wft spec: entrypoint: whalesay templates...
<p><strong>1. Fully define your output parameters</strong></p> <p>Your output parameter spec is incomplete. You need to specify <em>where</em> the output parameter comes from.</p> <p>Since you have multiple output parameters, you can't just use standard out (<code>{{tasks.prepare-lst.outputs.parameters.result}}</code>)...
<p>I have created a cluster on GCE and I am trying to register that in GKE console. </p> <p>I have created a service account with the roles:</p> <p><strong>roles/owner, roles/editor, roles/gkehub.connect</strong></p> <p>But, when I try to register my remote-cluster on GKE console, I am getting below error. Cloud s...
<p>Install this sdk plugin solved my problem.</p> <pre><code>sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin </code></pre>
<p><strong>skaffold.yaml</strong></p> <pre><code>apiVersion: skaffold/v2alpha3 kind: Config deploy: kubectl: manifests: - ./infra/k8s/* build: local: push: false artifacts: - image: karan346/auth context: auth docker: dockerfile: Dockerfile sync: manual: ...
<p>Error you're facing is:</p> <pre><code>line 10: field des not found in type v2alpha3.SyncRule </code></pre> <p>There's no field <code>des</code> in these <code>api</code> and <code>kind</code>.</p> <p>Based on the <a href="https://skaffold.dev/docs/pipeline-stages/filesync/#manual-sync-mode" rel="nofollow noreferrer...
<div class="s-table-container"> <table class="s-table"> <thead> <tr> <th></th> <th>version</th> </tr> </thead> <tbody> <tr> <td>Java</td> <td>1.8.0_242-b08</td> </tr> <tr> <td>Spark</td> <td>2.4.5</td> </tr> <tr> <td>Zeppelin</td> <td>0.10.0</td> </tr> </tbody> </table> </div> <p>Inside a k8s Pod, with above set, web u...
<p>Found out Zeppelin has a parameter ZEPPELIN_RUN_MODE. By default it is set as &quot;auto&quot;. If you are running Zeppelin in a Pod and don't want to run within k8s sidecar, you should set it &quot;local&quot;.</p>
<p>I use <strong>Kubernetes</strong> in my project, specially <strong>HPA</strong>. So, every minute in project we started <code>check-status</code> request for checking if all microservices are available. Availability is defined by simple response from one of replicas (not all) each microservice. <br /> But I have one...
<p>It is not related to HPA in this case but more on how you graceful shut down your pods.</p> <p>In short, your service/LB is not aware if your pod is ready to accept new requests, so on a <code>SIGTERM</code> signal, your pod should set your <code>readiness probe</code> to false, and give some time for the app to shu...
<p>Creating a mongodb from the below <strong>minikube</strong> deployment, I am not able to authenticate from the command line.</p> <p>Basically I'd just want to list all databases because I suspect there is an issue with the connectivity to mongo-express.</p> <p>I exec into the pod using <code>kubectl exec -it mongodb...
<p>managed to connect using</p> <pre><code>mongosh --port 27017 --authenticationDatabase \ &quot;admin&quot; -u &quot;myUserAdmin&quot; -p </code></pre> <p>from <a href="https://docs.mongodb.com/manual/tutorial/authenticate-a-user/#std-label-authentication-auth-as-user" rel="nofollow noreferrer">https://docs.mongo...
<p>I'm building an API than enable users to stream (push) large content through HTTP and I would like to be able to process the request from a nodejs express server <strong>while the client is still pushing</strong>.</p> <p><em>client.js</em></p> <pre class="lang-js prettyprint-override"><code>const request = require('...
<p><strong>Answering to my own question</strong> since it may help others</p> <p>All you have to do is to add <code>nginx.ingress.kubernetes.io/proxy-request-buffering: &quot;off&quot;</code> annotation</p> <p><em>New Ingress configuration</em></p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networkin...
<p>I am able to mount different directories to the same container at different mount points using <code>volumeMounts.subPath</code> attribute.</p> <p>Is it OK to use this in production environment? I am using <code>AWS EFS</code> as my persistent storage.</p> <p><a href="https://kubernetes.io/docs/concepts/storage/volu...
<h2>Short answer</h2> <p>It's absolutely fine to use the <code>subPath</code> in production</p> <h2>Detailed answer</h2> <p><strong>Kubernetes example with <code>subPath</code> used.</strong></p> <p>What this phrase &quot;This sample subPath configuration is not recommended for production use.&quot; means is exactly th...
<h3>Setup</h3> <p>I'm playing around with K8s and I set up a small, single-node, bare metal cluster. For this cluster I pulled the NGINX Ingress Controller config <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/cloud/deploy.yaml" rel="nofollow noreferrer">fro...
<p>Make sure your Nginx ingress configmap have enabled user IP <code>real-ip-header: proxy_protocol</code> try updating this line into configmap.</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: labels: app.kubernetes.io/component: controller name: ingress-nginx-controller namespace: ingress-nginx data...
<p>I want to write a script to health check our elasticsearch cluster (deploy on kubernetes)</p> <ol> <li>I go inside pod which run elasticsearch master container and run below commands:</li> </ol> <pre><code>[elasticsearch@elasticsearch-master-0 ~]$ curl localhost:9200/frontend-dev-2021.12.03/_count {&quot;count&quot;...
<p>Could you please show us your nginx config?</p> <ol> <li><p>I think the problem come from your nginx because I see the output you show that nginx return 403 for you, not the elasticsearch.</p> </li> <li><p>Could you please try another command start with <code>_</code> like <code>_template</code> or something like th...
<p>How would I start a specific number of replicas of the same image, when that number is defined at startup?</p> <p>On startup I need to call an API endpoint which returns a number. I then want to use this number to deploy that number of replicas of a pod (with each pod being aware of what order it was started in, eve...
<p>Your problem can be solved in several ways. You can use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">Statefulset</a> to <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-identity" rel="nofollow noreferrer">identify your p...
<p>I am running a GPU intensive workload on demand on GKE Standard, where I have created the appropriate node pool with minimum 0 and maximum 5 nodes. However, when a Job is scheduled on the node pool, GKE presents the following error:</p> <pre><code>Events: Type Reason Age From ...
<p><code>1 node(s) had taint {nvidia.com/gpu: present}, that the pod didn't tolerate...</code></p> <p>Try add <code>tolerations</code> to your job's pod spec:</p> <pre><code>... spec: containers: - name: ... ... tolerations: - key: nvidia.com/gpu value: present operator: Exists </code></pre>
<p>This is from <a href="https://kubernetes.io/docs/concepts/overview/components/#etcd" rel="nofollow noreferrer">Kubernetes documentation</a>:</p> <blockquote> <p><strong>Consistent</strong> and <strong>highly-available</strong> key value store used as Kubernetes' backing store for all cluster data.</p> </blockquote> ...
<p>When it comes to going into etcd details, it is best to use the <a href="https://etcd.io/" rel="noreferrer">official etcd documentation</a>:</p> <blockquote> <p><strong>etcd</strong> is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distri...
<p>&quot;Failed to scrape node&quot; `</p> <pre><code>err=&quot;GET \&quot;https://10.128.0.17:10250/stats/summary? only_cpu_and_memory=true\&quot;: bad status code \&quot;403 Forbidden\&quot;&quot; node=&quot;gke-zipydev-cluster-zipy-pool-b4bfa53a-t575&quot; I1215 10:33:03.405180 1 server.go:188] &quot;Failed ...
<p>The privileges for the metrics server are not correctly added as the “403“ error is because access to the requested resource is forbidden.</p> <p>The Metrics Server requires the <strong>“CAP_NET_BIND_SERVICE”</strong> capability in order to bind to a privileged ports as non-root as this applies even if you use the <...
<p>I'm using simple pattern where one Node had one Pod in it, and that Pod is controlled by a Deployment with one replicas set.</p> <p>Deployment is there to ensure Pod restarts when it gets evicted by <code>DiskPressureEviction</code>. The problem I'm facing is caused by Deployment retrying to restart the Pod too fast...
<p>First I'd suggest updating to the newest, supported Kubernetes version. The maintenance support for version 1.17 that you are using <a href="https://endoflife.date/kubernetes" rel="nofollow noreferrer">ended 11 months ago</a>. <a href="https://kubernetes.io/blog/2021/12/07/kubernetes-1-23-release-announcement/" rel=...
<p>I created a service account user and got the token for the user. However, ever time I try to access the names spaces I get the following error:</p> <pre><code>{ &quot;kind&quot;: &quot;Status&quot;, &quot;apiVersion&quot;: &quot;v1&quot;, &quot;metadata&quot;: {}, &quot;status&quot;: &quot;Failure&qu...
<p>To clarify I am posting a Community Wiki answer.</p> <p>You solved this problem using YAML file to configure the service account and roles.</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: ServiceAccount metadata: name: svcacc namespace: default --- # Create ClusterRoleBinding apiVersio...
<p>I want to expose k8s api's using a service. My issue is that the api only respond on port 6443 on https. Any attempt on http return status 400 bad request. How can I &quot;force&quot; the service to user https ?</p> <pre><code>apiVersion: v1 kind: Service metadata: name: k8s-api namespace: kube-system labels: ...
<p>If you are using the Nginx ingress by default it does <strong>SSL</strong> <strong>off load</strong> and sends plain <strong>HTTP</strong> in the background.</p> <p>Changing port <strong>6443</strong> might be helpful if you request direct connecting to the <strong>service</strong>.</p> <p>If you are using the Nginx...
<p>The Node JS app that I'm trying to deploy in Kubernetes runs on <code>express js</code> as a backend framework.The repository is managed via <code>Bitbucket</code>. The application is a microservice and the pipeline manifest file for building the Docker image is written this way:</p> <pre><code>options: docker: tr...
<p>Eventually, I could resolve the issue. The issue was trivial yet bothering. In the <code>Dockerfile</code>, there was a missing script, i.e., <code>npm run build</code>. So, here is the final <code>Dockerfile</code> I used it for building the <code>dist</code> directory along with other requirements:</p> <pre><code>...
<p>I am using prisma, postgres, docker, kubernets.</p> <p><strong>npx prisma migrate dev</strong> working.</p> <p>and <strong>npx prisma generate</strong> produce below output:</p> <pre><code>✔ Generated Prisma Client (2.23.0) to ./node_modules/@prisma/client in 68ms You can now start using Prisma Client in your code. ...
<p>I know that this has been marked as solved, but I just wanted to share my setup for anyone interested.</p> <p>Dockerfile</p> <pre><code># Build image FROM node:16.13-alpine as builder WORKDIR /app # Not sure if you will need this # RUN apk add --update openssl COPY package*.json ./ RUN npm ci --quiet COPY ./prism...
<p>The following example would expose the services externally. So why is <code>NodePort</code>/<code>LB</code> allowed in this context, would not that be redundant?</p> <pre><code> rules: - host: lab.example.com http: paths: - path: /service-root backend: serviceName: clusterip-svc ...
<p>Services are a way to define logical set of Pods and a policy to access them. The Pods are ephemeral resources, so Services make it possible to connect to them regardless of their IP addresses. They usually use selectors to do so. There are different types of Services in Kubernetes and these are the main differences...
<p>We need to send large (very) amount of logs to <code>Splunk</code> server from only <strong>one k8s pod</strong>( pod with huge traffic load), I look at the docs and found this:</p> <p><a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/#sidecar-container-with-a-logging-agent" rel="nofollow n...
<p>There's an official solution to get Kubernets logs: Splunk Connect for Kubernetes. Under the hood it also uses fluentd for the logging part.</p> <p><a href="https://github.com/splunk/splunk-connect-for-kubernetes" rel="nofollow noreferrer">https://github.com/splunk/splunk-connect-for-kubernetes</a></p> <p>You will f...
<p>I am trying to setup a local cluster using minikube in a Windows machine. Following some tutorials in <code>kubernetes.io</code>, I got the following manifest for the cluster:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: external-nginx-deployment labels: app: external-nginx spec: sel...
<p>Almost always by default <code>minikube</code> uses <code>docker</code> driver for the <code>minikube</code> VM creation. In the host system it looks like a big docker container for the VM in which other kubernetes components are run as containers as well. Based on tests <code>NodePort</code> for services often does...
<p>I am trying to make an nginx deployment and during the container creation, I want to create multiply symbolic links. But for some reason, it doesn't work and the container crashes.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: labels: app: tcc component: nginx name: tcc-nginx-deployment ...
<p>The container is not running, because after the <code>command</code> block is executed, container is exiting, which is expected behaviour.</p> <p>Instead of playing with symbolic links in <code>command</code> in yaml template (which is not the best practice solution), why just don't use solution builtin Kubernetes a...
<p>I have a kubernetes cluster in google cloud. Due to the resource limit, I could not run a app that would take a large amount of memory. So I run the app in another cloud machine, and using <code>kubectl</code> to forward the service port, this is my <code>kubectl</code> forward script:</p> <pre><code>#!/usr/bin/env ...
<p>Following the GitHub <a href="https://github.com/kubernetes/kubernetes/issues/74551" rel="nofollow noreferrer">issue</a> you posted I stumbled upon a solution that might help you. First, let kubectl decide which host port to use by running:</p> <pre><code>kubectl port-forward ${POD} :6379 -n ${namespace} </code></pr...
<p>I'm developing a Java application that creates some Kubernetes Jobs using the official Kubernetes Java client. Each Job uses its configuration directory, which already exists as a configMap in the cluster. (This configMap was created using <code>kubectl create configmap {name} --from-file=/... </code>)</p> <p>Using ...
<p>As stated into the <a href="https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/V1ConfigMapVolumeSource.md" rel="nofollow noreferrer">documentation</a> for <code>V1ConfigMapVolumeSource</code>, there is a <code>name</code> parameter (type <code>String</code>) which is the <a href="https://kubernete...
<p>I am following <a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/" rel="nofollow noreferrer">this official k8 ingress tutorial</a>. However I am not able to <code>curl</code> the minikube IP address and access the &quot;web&quot; application.</p> <pre><code>minikube addons enable ...
<p>OK so apparently this is a <a href="https://minikube.sigs.k8s.io/docs/drivers/docker/#known-issues" rel="nofollow noreferrer">known issue with minikube</a>, Ingress works properly on linux only.</p> <blockquote> <p>The ingress, and ingress-dns addons are currently only supported on Linux. See #7332</p> </blockquote>...
<p>I dig everywhere to see why we don't have DNS resolution for static pods and couldn't find a right answer. Most basic stuff and couldn't find appealing answer.</p> <p>Like you create a static pod, exec into it, do a &quot;nslookup pod-name&quot; or like &quot;nslookup 10-44-0-7.default.pod.cluster.local&quot;, I kno...
<p>You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minik...
<p>I dig everywhere to see why we don't have DNS resolution for static pods and couldn't find a right answer. Most basic stuff and couldn't find appealing answer.</p> <p>Like you create a static pod, exec into it, do a &quot;nslookup pod-name&quot; or like &quot;nslookup 10-44-0-7.default.pod.cluster.local&quot;, I kno...
<ul> <li>DNS Lookup &amp; Reverse lookups does not work for pods/podIPs (<em><strong>By Design!</strong></em>).</li> <li>Why ? I also had the similar question , After spending a lot of time exploring following are reasons that convinced me :</li> </ul> <ol> <li>Pods &amp; and its IPs are ephemeral. even static pods whe...
<p>I am following a very simple tutorial where it spawns a simple pod with an http endpoint and a service to expose that app using kubernetes.</p> <p>The setup is very simple:</p> <p>app-pod.yml</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: hello-pod labels: app: web spec: containers: - name: we...
<p>In Kubernetes Kind cluster, by default, <code>NodePort</code> may not be bound to <code>localhost</code>. Please check the following resources:</p> <ul> <li><a href="https://kind.sigs.k8s.io/docs/user/quick-start/#mapping-ports-to-the-host-machine" rel="nofollow noreferrer">https://kind.sigs.k8s.io/docs/user/quick-s...
<p>I am trying to setup google kubernetes engine and its pods has to communicate with cloud sql database. The cloud sql database credentials are stored on google cloud secret manger. How pods will fetch credentials from secret manager and if secret manager credentials are updated than how pod will get update the new se...
<p>You can find information regarding that particular solution in this <a href="https://cloud.google.com/secret-manager/docs/using-other-products#google-kubernetes-engine" rel="nofollow noreferrer">doc</a>.<br /> There are also good examples on medium <a href="https://medium.com/google-cloud/consuming-google-secret-man...
<p>I'm trying to expose a port 8080 on a pod, so I can wget directly from server. With port-forward everything works fine (<code>kubectl --namespace jenkins port-forward pods/jenkins-6f8b486759-6vwkj 9000:8080</code>) , I'm able to connect to 127.0.0.1:9000</p> <p>But when I try to avoid port-forward and open ports per...
<p>I see that you are running your k8s cluster locally, in this case, LoadBalancer ServiceType is not recommended as this type uses cloud providers' load balancer to expose services externally. You might use a self-hosted or hardware load balancer but I suppose it's a bit overkill for minikube cluster.</p> <p>In your m...
<p>I am trying to setup google kubernetes engine and its pods has to communicate with cloud sql database. The cloud sql database credentials are stored on google cloud secret manger. How pods will fetch credentials from secret manager and if secret manager credentials are updated than how pod will get update the new se...
<p>You can make your deployed application get the secret (password) programmatically, from Google Cloud Secret Manager. You can find and example in many languages in the following link: <a href="https://cloud.google.com/secret-manager/docs/samples/secretmanager-access-secret-version" rel="nofollow noreferrer">https://c...
<p>I'm trying to deploy a Flask python API to Kubernetes (EKS). I've got the Dockerfile setup, but with some weird things going on.</p> <p><code>Dockerfile</code>:</p> <pre><code>FROM python:3.8 WORKDIR /app COPY . /app RUN pip3 install -r requirements.txt EXPOSE 43594 ENTRYPOINT [&quot;python3&quot;] CMD [&quot...
<p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p> <p><strong>Problem</strong></p> <p>Output for <code>kubectl describe service &lt;name_of_the_service&gt;</code> command contains <code>Endpoints: &lt;none&gt;</code></p> <p><strong>Some theory</strong></p> <p>From Kube...
<p>I have an application running on Kubernetes that needs to access SMB shares that are configured dynamically (host, credentials, etc) within said application. I am struggling to achieve this (cleanly) with Kubernetes.</p> <p>I am facing several difficulties:</p> <ul> <li>I do not want &quot;a&quot; storage, I want ex...
<p>For sure your current solution using HostPath on the nodes is not flexible, not secure thus it is not a good practice.</p> <p>I think you should consider using one of the custom drivers for your SMB shares:</p> <ul> <li><a href="https://github.com/fstab/cifs#cifs-flexvolume-plugin-for-kubernetes" rel="nofollow noref...
<p>Assuming I have a Kubernetes Deployment object with the <code>Recreate</code> strategy and I update the Deployment with a new container image version. Kubernetes will:</p> <ol> <li>scale down/kill the existing Pods of the Deployment,</li> <li>create the new Pods,</li> <li>which will pull the new container images</li...
<p>Via <a href="https://www.reddit.com/r/kubernetes/comments/oeruh9/can_kubernetes_prepull_and_cache_images/" rel="nofollow noreferrer">https://www.reddit.com/r/kubernetes/comments/oeruh9/can_kubernetes_prepull_and_cache_images/</a>, I've found these ideas:</p> <ul> <li>Implement a DaemonSet that runs a &quot;sleep&quo...
<p>Promtail, Grafana, Loki version is 2.4.1. running is Kubernetes.</p> <p>I was following the <a href="https://grafana.com/docs/loki/latest/clients/promtail/stages/multiline/#custom-log-format" rel="nofollow noreferrer">documentation</a>.</p> <ul> <li>The exception in the log matches the regular expression. (ZeroWidth...
<p>It turned out that the logs look different than what we see in lens pod logs or <code>kubectl logs {pod}</code>.</p> <p>The original logs consumed by promtail can be found on the host machine:</p> <pre><code>minikube ssh cat /var/log/pods/{namespace}_{pod}/{container}/0.log </code></pre> <p>They look something like ...
<p>Assuming I have a Kubernetes Deployment object with the <code>Recreate</code> strategy and I update the Deployment with a new container image version. Kubernetes will:</p> <ol> <li>scale down/kill the existing Pods of the Deployment,</li> <li>create the new Pods,</li> <li>which will pull the new container images</li...
<p>Implement a &quot;blue-green&quot; deployment strategy. For instance, the service might be running and active in the &quot;blue&quot; state. A new deployment is created with a new container image, which deploys the &quot;green&quot; pods with the new container image. When all of the &quot;green&quot; pods are read...
<p>I have a deployment file with replicas set to 1. So when I do 'kubectl get ...' I get 1 record each for deployment, replicaset and pod.</p> <p>Now I set replicas to 2 in deployment.yaml, apply it and when I run 'kubectl get ..' command, I get 2 records each for deployments, replicaset and pods each.</p> <p>Shouldn't...
<p><code>...Now I set replicas to 2 in deployment.yaml, apply it and when I run 'kubectl get ..' command, I get 2 records each for deployments, replicaset and pods each.</code></p> <p>Can you try <code>kubectl get deploy --field-selector metadata.name=nginx-deployment</code>. You should get just 1 deployment. The numbe...
<p>I have created kubernetes ingress with frontend config and the ECDSA P-384 TLS cert on Google Cloud Platform, after few seconds of creating process i received the followind error:</p> <blockquote> <p>Error syncing to GCP: error running load balancer syncing routine: loadbalancer <em><strong><strong><strong>-default-...
<p>The gcp <a href="https://cloud.google.com/load-balancing/docs/ssl-certificates/self-managed-certs#private-key" rel="nofollow noreferrer">load balancer</a> supports <strong>RSA-2048 or ECDSA P-256</strong> certificates. Also DownstreamTlsContexts support multiple TLS certificates. These may be a mix of RSA and <a hr...
<p>In a Deployment, under what circumstances would the matchLabels in the selector not precisely match the template metadata labels? If they didn't match, any pod created wouldn't match the selector, and I'd imagine K8s would go on creating new pods until every node is full. If that's true, why does K8s want us to spec...
<p><code>...In a Deployment, under what circumstances would the matchLabels in the selector not precisely match the template metadata labels?</code></p> <p>Example when doing <a href="https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#canary-deployments" rel="nofollow noreferrer">canary deplo...
<p>When using <a href="https://docs.gitlab.com/ee/topics/autodevops/" rel="nofollow noreferrer">GitLab Auto DevOps</a> to build and deploy application from my repository to <a href="https://microk8s.io/" rel="nofollow noreferrer">microk8s</a>, the build jobs often take a long time to run, eventually timing out. The iss...
<p>This seems to be a networking problem caused by incompatbile MTU settings between the Calico network layer and Docker's network configuration (and an inability to autoconfige the MTU correctly?) When the MTU values don't match, network packets get fragmented and the Docker runners fail to complete TLS handshakes. As...
<p>How to upgrade an existing running deployment with yaml deployment file without changing the number of running replicas of that deployment? So, I need to set the number of replicas on the fly without changing the yaml file.</p> <p>It is like running kubectl apply -f deployment.yaml along with kubectl scale --replica...
<p>Use the kubectl edit command</p> <pre><code>kubectl edit (RESOURCE/NAME | -f FILENAME) E.g. kubectl edit deployment.apps/webapp-deployment </code></pre> <p>It will open an editor. You can update the value for number of replicas in the editor and save.</p> <p>Refer the documentation section - Editing resources <a hre...
<p>I am deploying a k8s cluster locally using Kind. The image gets deployed ok and when I view the list of services I see the following</p> <p><a href="https://i.stack.imgur.com/m27JG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m27JG.png" alt="enter image description here" /></a></p> <p>the serv...
<p>for Loadbalancer service type you will not able to get public ip because you're running it locally and you will need to run it in a cloud provider which will provide the LB for you like ALB in aws or LoadBalancer in Digital ocean. however, you can access this service locally using the Kubectl proxy tool.</p> <p>.</p...
<p>I have deploy my application in kubernetes using deployment.</p> <ol> <li>Whenever user gets login to application pod will generate session for that user.</li> <li>To maintain session stickiness I have set session cookie using Nginx ingress annotations.</li> <li>When hpa scale down pods application user is phasing a...
<blockquote> <p>What i want is some sort of graceful termination of connection. when pod is in terminating state it should serve existing sessions until grace period.</p> </blockquote> <p>You can use the key in POD spec : <strong>terminationGracePeriodSeconds</strong></p> <p>this will wait for the mentioned second and ...
<p>I am trying to install loki with helm</p> <pre><code>$ helm upgrade --install loki grafana/loki-stack </code></pre> <p>I got the following error msg:</p> <pre><code>Release &quot;loki&quot; does not exist. Installing it now. Error: rendered manifests contain a resource that already exists. Unable to continue with i...
<p>It seems that your User has insufficient privileges to create policies. You need to ask your cluster administrator for more privileges, unless you can assign them yourself to this user. I'm providing example yaml below to achieve that. First, create ClusterRole with proper privileges:</p> <pre><code>apiVersion: rbac...
<p>I have deploy my application in kubernetes using deployment.</p> <ol> <li>Whenever user gets login to application pod will generate session for that user.</li> <li>To maintain session stickiness I have set session cookie using Nginx ingress annotations.</li> <li>When hpa scale down pods application user is phasing a...
<p>The answer <a href="https://stackoverflow.com/users/5525824/harsh-manvar">Harsh Manvar</a> is great, However, I want to expand it a bit :)</p> <p>You can of course use <strong>terminationGracePeriodSeconds</strong> in the POD spec. Look at the example yaml:</p> <pre class="lang-yaml prettyprint-override"><code>apiVe...
<p>Unable to mount a Kubernetes secret to <code>${HOME}/.ssh/id_rsa</code> path.</p> <p>Following are my secrets.yaml created using</p> <pre><code> kubectl create secret generic secret-ssh-auth --type=kubernetes.io/ssh-auth --from-file=ssh-privatekey=keys/id_rsa </code></pre> <pre><code>apiVersion: v1 data: ssh-priv...
<p>K8s Secret <a href="https://kubernetes.io/docs/concepts/configuration/secret/#ssh-authentication-secrets" rel="nofollow noreferrer">type: kubernetes.io/ssh-auth</a> (i.e. ssh-key-secret) does not work out of the box as mount point for <code>SSH</code>, since it mounts it under the filename <code>ssh-privatekey</code...
<p>I'm trying kubernetes and making some progress, but I'm running into an issue with ingress when trying to make my hello world app publicly available.</p> <p><strong>SUCCESS WITH DEPLOYMENT AND SERVICE</strong></p> <p>I created a simple <code>hello world</code> type of nodejs app and pushed the image to my docker hub...
<p>The behaviour you have is expected. Let me explain why. Going point through point, and at the end I will present my tips.</p> <p>First I think it's worth to present minikube architecture. I'm assuming you have installed minikube using default driver <code>docker</code> as you have address <code>192.168.49.2</code> w...
<p>I set up K3s on a server with:</p> <pre><code>curl -sfL https://get.k3s.io | K3S_TOKEN={token} INSTALL_K3S_EXEC=&quot;server --cluster-init --disable=traefik --write-kubeconfig-mode 644&quot; sh -s - </code></pre> <p>Then I grabbed the kube config from <code>/etc/rancher/k3s/k3s.yaml</code> and copy it to my local m...
<p>I figured out an approach that works for me by reading through the <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">Kubernetes Authenticating Guide</a> in more detail. I settled on the <a href="https://kubernetes.io/docs/reference/access-authn-authz/authenti...
<p>For example, a defer function is implemented within a webhook's logic (the webhook is written in Golang). The webhook times out after taking too long to complete. In this case, will the defer function still get executed?</p> <p>The request timeout is set via <a href="https://pkg.go.dev/context#WithTimeout" rel="nofo...
<p>It's usually a good idea to clearly mention what programming language you're talking about, although I can figure it out.</p> <p>In Go, the defer functor (whatever you want to call it) will be executed when the method returns, no matter how it completes, unless you manage to kill the executing process in a drastic m...
<p>I hope it's ok to ask for your advice.</p> <p>The problem in a nutshell: my pipeline cannot pull private images from GHCR.IO into Okteto Kubernetes, but public images from the same private repo work.</p> <p>I'm on Windows 10 and use WSL2-Ubuntu 20.04 LTS with kinD for development and tried minikube too.</p> <p>I get...
<p>I was able to pull a private image by doing the following:</p> <ol> <li>Create a personal token in GitHub with <code>repo</code> access.</li> <li>Build and push the image to GitHub's Container registry (I used <code>okteto build -t ghcr.io/rberrelleza/go-getting-started:0.0.1</code>)</li> <li>Download my <a href="ht...
<p>can someone help? I am trying to inject a helm value on a config map, but it breaks the format. If I use the value directly instead of .Values, it works fine.</p> <p>What I have:</p> <pre><code>data: application.instanceLabelKey: argocd.argoproj.io/instance oidc.config: | name: Okta issuer: https://mycom...
<p>it should be with the values.yaml . it worked for me in both ways :</p> <ol> <li>using the values in values.yaml</li> </ol> <hr /> <p>Values.yaml:</p> <pre><code>okta: clientSecret: test1233 clientID: testnew </code></pre> <p>configmap</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: test-config ...
<p>I have created a kubernetes cluster using Vagrant. I created a Nginx pod and a Cluster IP service for it. I can curl both the pod and the service getting a successful result. I have now installed an Nginx Ingress Controller from: <a href="https://kubernetes.github.io/ingress-nginx/deploy/#bare-metal-clusters" rel="n...
<p>Try adding the ingress class annotation to the ingress configuration. <code>kubernetes.io/ingress.class: &quot;nginx&quot;</code></p> <p>use below YAML as reference and try to update the configuration.</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-myserviceb annotations: ...
<p>I can create a PostgresSQL deployment in Kubernetes with volumes with no problems. The question I have is how to create the database tables.</p> <p>I can easily exec in the pod and create the tables but I want it to be automatically createded.</p> <p>I don't want to build in into the docker image as a want a gener...
<p>this may help (here I have added configmap, persistent volume, persistent volume-claim, and Postgres deployment yaml. This yaml will automatically create a table named <code>users</code> in the Postgres database inside the Postgres-container. Thanks</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: pos...
<p>I am running Node JS with Express JS in Kubernetes cluster as service using Deployment YML file with 2 replicas. I am using HELM for deployment.</p> <p>Now I am having the requirement to execute the scheduler to run a particular task at a given interval.</p> <p>If I am running it as single instance, I can implement ...
<p>In Kubernetes, you can find an Object named <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/" rel="nofollow noreferrer">CronJob</a>.</p> <p>This will achieve a scheduler role, as a Linux cron would.</p> <p>You can use the same image as your express JS app, but start a different script th...
<p>I'm trying to share a cephfs volumes between namespaces within k8s cluster. I'm using ceph-csi with cephfs.</p> <p>Followed <a href="https://github.com/ceph/ceph-csi/blob/devel/docs/static-pvc.md#cephfs-static-pvc" rel="nofollow noreferrer">https://github.com/ceph/ceph-csi/blob/devel/docs/static-pvc.md#cephfs-static...
<p>Having <code>volumeHandle: xyz</code> unique for each pv done the trick. Tested deploying 3xdaemonsets in 3 different namespaces.</p>
<p>Kubernetes (v1.10.8) installed on my cloud by kismatic (v1.12.0). How I can update kubernetes to the latest version with <code>kubeadm</code>?</p>
<p>With such version difference - we currently have <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md#v1231" rel="nofollow noreferrer">v1.23</a> (<a href="https://kubernetes.io/releases/" rel="nofollow noreferrer">see official supported releases</a>) - I would consider creating t...
<p>In <strong>kubernetes</strong>, if a pod go down for some reason, the admission controller will restart it.</p> <p>We call this mecanism self healing.</p> <p>I have never worked with <strong>docker-compose</strong>, but I wonder : is it the same ?</p>
<p>When deployed with <code>docker-compose</code> or now <code>docker compose</code> (with a space) you are deploying to a single node. You can define the service to automatically restart with a <a href="https://docs.docker.com/compose/compose-file/compose-file-v3/#restart_policy" rel="nofollow noreferrer">restart poli...
<p>I am new to movetokube tool. I am struggling to understand how the move2kube collect command works. The <a href="https://move2kube.konveyor.io/" rel="nofollow noreferrer">web site</a> doesn't have any documentation on this command which is very surprising. I want to get all the applications installed in the Cloud Fo...
<p>From <a href="https://github.com/konveyor/move2kube/blob/main/USAGE.md#usage" rel="nofollow noreferrer">the move2kube GitHub page</a>:</p> <blockquote> <p><strong>Usage</strong></p> <p><strong>One step Simple approach</strong></p> <p><code>move2kube transform -s src</code></p> <p><strong>Two step involved approach</...
<p>How does one go about setting resource limits in EMR on EKS? My driver pod is failing to launch because it is requesting more CPU than it is allowed. This doesn't make sense to me. I am running the getting started code from the docs below.</p> <p>I have added <code>--conf spark.driver.limit.cores=2</code> in order t...
<p>I was able to figure it out.</p> <pre><code>aws emr-containers start-job-run \ --virtual-cluster-id=blahblah \ --name=pi-4 \ --execution-role-arn=arn:aws:iam::blahblahaccount:role/balblah_role_name \ --release-label=emr-6.4.0-latest \ --job-driver='{ &quot;sparkSubmitJobDriver&quot;: { &quot;entr...
<p>I want to fetch the list (if any) of <code>kubernetes</code> nodes that <strong>do not</strong> contain a label.</p> <p>I have managed to do the opposite using <code>client-go</code></p> <pre><code> labelSelector := metav1.LabelSelector{ MatchLabels: map[string]string{ &quot;somelabel&quot;: &...
<p>I think one has to use the <code>Requirement</code> <a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Requirement" rel="nofollow noreferrer">type</a> of the <code>apimachinery</code>'s <code>labels</code> package and create <code>Selector</code> <a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Sel...
<p>Assuming I have two services: customerService and orderService. Both are Springboot applications contained in its own dockerfile.</p> <p>In production they should be managed using Kubernetes. So there could be mutliple instances of each service. As the services should be able to call each other via REST I want to us...
<p>I think you should be looking into <strong>Kubernetes services</strong> instead of using an injected Discovery client.</p> <p>For Service discovery and load-balancing, you can use Services in Kubernetes. From Kubernetes documentation:</p> <blockquote> <p>An abstract way to expose an application running on a set of P...
<p>A graph is always better than the last sentences, so here is what I would like to do :</p> <p><a href="https://i.stack.imgur.com/A9eCa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A9eCa.png" alt="enter image description here" /></a></p> <p>To sum up:</p> <ul> <li>I want to have a Redis master i...
<p>i remember we had a discussion on this topic previously <a href="https://stackoverflow.com/questions/70257094/redis-master-slave-on-gcp-memorystore">here</a>, no worries adding more here.</p> <p>Read more about the Redis helm chart : <a href="https://github.com/bitnami/charts/tree/master/bitnami/redis#choose-between...
<p>I have a monorepo nodejs/react app that I want to deploy to GKE using Helm charts. I added two Dockerfiles one for the frontend and the other for the back.</p> <p>I'm using Helm Charts to deploy my microservices to the Kubernetes cluster but this time I don't know how to configure it so that I can deploy both back a...
<p>Posting this as an answer for better visibility since it's a good solution:</p> <p><a href="https://stackoverflow.com/questions/70436517/deploy-both-front-and-backend-using-helm-charts#comment124510627_70436517">David suggested</a> that you can</p> <blockquote> <p>probably put both parts into the same Helm chart, pr...
<p>I wouldd to create a persistent volume on my kubernetes (gcp) cluster and use it in my django app as , for example, media folder. On my kubernetes side i do:</p> <p>First create a volumes claim:</p> <pre><code>apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pvc-zeus namespace: ctest spec: accessMode...
<p>You need to have one of two Kubernetes objects in place in order to make a PVC: a <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">PersistentVolume</a>(PV) or a <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">StorageC...
<p>I deployed prometheus and adapter. I want to get custom metrics, but can't find resource</p> <pre><code>$ kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 Error from server (NotFound): the server could not find the requested resource $ kubectl get --raw /metrics Error from server (NotFound): the server could ...
<p>This is EKS related <a href="https://github.com/kubernetes-sigs/metrics-server/issues/45" rel="nofollow noreferrer">known issue</a>.</p> <p>To resolve it, you should <a href="https://github.com/kubernetes-sigs/metrics-server/issues/45#issuecomment-421345121" rel="nofollow noreferrer">update the kubernetes nodes secu...
<p>I have a aws <strong>EC2</strong> (EC2-A) and <strong>Amazon Managed Blockchain</strong> running in <strong>VPC (VPC-A)</strong></p> <ul> <li>This EC2-A instance has some files and certificates (required for executing transactions in the blockchain)</li> <li>EC2-A has EBS storage which can be mounted on only one EC2...
<p>Mount a folder/files on an EC2 instance to a pod running in EKS is not supported. For your use case, you can easily share folder/files using EFS if not S3. If you are only allow to do pod to EC2 communication, you need a way for these resources to reach each other either by public IP if not VPC peering. Then you can...
<p>I'm new with Kubernetes and Azure. I want to Deply my application and I am floowing the microsoft tutorial about kubernetes. At first I have created the resouce group and ACR instance. When I try to login in ACR console show this error: <code>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the...
<p>You can try below options to connect ACR :</p> <p>run az acr login first with the --expose-token parameter. This option exposes an access token instead of logging in through the Docker CLI.</p> <pre><code>az acr login --name &lt;acrName&gt; --expose-token </code></pre> <p>Output displays the access token, abbreviat...
<p>In Kubernetes configuration, for external service component we use:</p> <pre><code>type: LoadBalancer </code></pre> <p>If we have k8s cluster running inside a cloud provider like AWS, which provides it own loadbalancer, how does all this work then? Do we need to configure so that one of these loadbalancers is not ac...
<p>AWS now takes over the open source project: <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller" rel="nofollow noreferrer">https://kubernetes-sigs.github.io/aws-load-balancer-controller</a></p> <p>It works with EKS(easiest) clusters as well as <a href="https://kubernetes-sigs.github.io/aws-load-b...
<p>I accidentally was checking if my pod had the right <code>ServiceAccount</code> and its Bindings. Out of curiosity I wanted to check if the token created from this service account is bound with the certain <code>ClusterRole</code> and <code>ClusterRoleBinding</code> which are read only. I tried few things from <a hr...
<p>Summary of <a href="https://github.com/docker/for-mac/issues/3694" rel="nofollow noreferrer">issue</a> from <a href="https://www.portainer.io/blog/docker-desktop-kubernetes-not-enforcing-rbac-rules" rel="nofollow noreferrer">Neil Cresswell on portainer.io</a></p> <p>By default, Docker Desktop and their embedded Kube...
<p><strong>Cannot install the helm chart but when I use raw file generated by helm, I am able to install via kubectl apply.</strong></p> <p>Following error is displayed when i use <code>helm install myChart . --debug</code></p> <pre><code>Error: cannot re-use a name that is still in use helm.go:88: [debug] cannot re-us...
<p>Use upgrade instead install:</p> <pre><code>helm upgrade -i myChart . </code></pre> <p>The <code>-i</code> flag install the release if it doesn't exist.</p>