prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have a requirement where I want to publish the same kafka message to 2 replicas of kubernetes pods so that I can keep both the replicas in sync. As our nodes get repaved frequently I don't want us to lose any data. On the other hand we need our pod to be highly available and scalable. Any help on above would be ap...
<p>You should be able to achieve resilience by just having one of the pods consume each message. To achieve this you setup your kafka library in a way that your consumers are in the same consumer group.</p> <p>If you really want to consume each message twice or more, you can have 2 or more consumer groups and assign a...
<p>When I am running the below command to record the change cause -</p> <pre><code>kubectl set image deployment.v1.apps/deploy1 nginx=nginx:1.16.0 --record </code></pre> <p>Then it is recording the change cause but showing that --record has been deprecated.</p> <pre><code>Flag --record has been deprecated, --record wi...
<p>Not sure if it's deprecated or will be fully.</p> <p>You can use the <strong><a href="https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_annotate/" rel="noreferrer">annotate</a></strong> to manage the history same way.</p> <ol> <li><p><strong>Create the deployment</strong></p> <p>kubectl create deploymen...
<p>While testing SSH from one container to another in a K8s environment, I'm getting this strange issue of &quot;matching key found&quot; but ended up with error &quot;Failed publickey..&quot;</p> <p>Have tried with securityCapability of &quot;SYS_CHROOT&quot; and with privileged as true in pod and container.</p> <p>ss...
<p>After adding AUDIT_WRITE capability to the container, it started working. Apparently both SYS_CHROOT and AUDIT_WRITE are required for the container running sshd to work</p>
<p>I am using a containerized Spring boot application in Kubernetes. But the application automatically exits and restarts with exit code 143 and error message &quot;Error&quot;.</p> <p>I am not sure how to identify the reason for this error.</p> <p>My first idea was that Kubernetes stopped the container due to too high...
<blockquote> <p>Exit Code 143</p> </blockquote> <ol> <li><p>It denotes that the process was terminated by an <code>external signal</code>.</p> </li> <li><p>The number 143 is a sum of two numbers: 128+x, <code># where x is the signal number sent to the process that caused it to terminate.</code></p> </li> <li><p>In the ...
<p>I am trying to install Kubernetes on my CentOS machine, when I intialize the cluster, I have the following error.</p> <p>I specify that I am behind a corporate proxy. I have already configured it for Docker in the directory: /etc/systemd/system/docker.service.d/http-proxy.conf Docker work fine.</p> <p>No matter how ...
<p>I had this issue on version <code>version.Info{Major:&quot;1&quot;, Minor:&quot;25&quot;, GitVersion:&quot;v1.25.2&quot;</code> when i tried joining a second control panel.</p> <pre><code>error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR ImagePull]: failed to pull image k8s.gcr.io/...
<pre><code>{{- $root := . -}} apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: {{ include &quot;ingress.name&quot; . }} namespace: demo annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: /$2 spec: rules: - host: &quot;*.{{ .Values.host }}...
<p>You can add the annotation like</p> <pre><code>nginx.ingress.kubernetes.io/server-snippet: | location ~ / { rewrite / https://&lt;example.com to use $host&gt;/login permanent; } </code></pre> <p>if want to use the configuration snippet</p> <pre><code>nginx.ingress.kubernetes.io/configuration-sni...
<p>I have a ClusterIssuer that is expecting <code>secretName</code>, I see in the <code>ClusterIssuer</code> <code>spec</code>, I can specify the <code>secretName</code>:</p> <pre><code>apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: postgres-operator-ca-certificate-cluster-issuer spec: ca: s...
<p>Typically it will look for the secret in the namespace <code>cert-manager</code> by default. Which namespace it looks in can be changed by your cert-manager installation by using the <code>--cluster-resource-namespace</code> argument, but not by individual ClusterIssuer.</p> <p>From the documentation:</p> <blockquot...
<p>We're trying to set up a spot node group in EKS with lower and higher capacity instance types, (e.g. <code>instance_types = [&quot;t3.xlarge&quot;, &quot;c5.4xlarge&quot;]</code>), but ... only the t3 is used, even if we specify more CPU than it has to offer. Pods still try to use it and just hang.</p> <p>How do we ...
<p>An AWS AutoScalingGroup has the ability to put weights on the instance types, but that functionality isn't built into EKS. So what's happening is that the ASG is designed to create the first instance type if possible, and doesn't get impacted by your K8s workload requests, and therefor will always be the first type ...
<p>I am trying to apply ingress rule in minikube but I am getting this error</p> <pre><code>error: resource mapping not found for name: &quot;dashboard-ingress&quot; namespace: &quot;kubernetes-dashboard&quot; from &quot;Desktop/minikube/dashboard-ingress.yaml&quot;: no matches for kind &quot;Ingress&quot; in version &...
<p>I have found the solution</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: dashboard-ingress namespace: kubernetes-dashboard spec: rules: - host: dashboard.com http: paths: - pathType: Prefix path: &quot;/&quot; backend: service: ...
<p>I have a multistage pipeline with the following</p> <p>Stage build:</p> <ol> <li>build docker image</li> <li>push image to ACR</li> <li>package helm chart</li> <li>push helm chart to ACR</li> </ol> <p>Stage deployment:</p> <ol> <li>helm upgrade</li> </ol> <p><strong>Push helm chart to AKS:</strong></p> <pre><code> t...
<p>The answer from @sshepel actually helped somewhat, you need to login to the registry before being able to pull. However, it is sufficient with a simple AzureCLI login.</p> <pre><code> - task: AzureCLI@2 displayName: Login to Azure Container Registry inputs: azureSubscription: &lt;Azure Resourc...
<p>A common requirement when deploying Kubernetes manifests to a cluster is to prefix the container names with a trusted registry prefix that mirrors the allowed images. Usually used along with an admission controller.</p> <p>Is there a sensible way to do this using Kustomize without having to list every single image b...
<p>This answer is probably too late to help the original asker, but maybe it will help others who stumble upon this question through Google, like I did.</p> <p>Kustomize has a built-in <code>PrefixTransformer</code> that can add a prefix to all your images, or indeed to any arbitrary field in your specs.</p> <p>Create ...
<p>database-deployment.yaml</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: labels: app: postgres name: postgres-db spec: replicas: selector: matchLabels: app: postgres-db template: metadata: labels: app: postgres-db spec: containers: - name: pos...
<p>updated my-configMap.yaml (database_url)</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: classroom-configmap data: database_url: jdbc:postgresql://database-service.default.svc.cluster.local:5432/classroom </code></pre> <p>expected URL - jdbc:{DATABASE}://{DATABASE_SERVICE with NAMESPACE}:{DATABASE...
<p>I'm using <a href="https://www.conftest.dev/" rel="nofollow noreferrer">conftest</a> for validating policies on Kubernetes manifests.</p> <p>Below policy validates that images in StatefulSet manifests have to come from specific registry <code>reg_url</code></p> <pre><code>package main deny[msg] { input.kind == &q...
<p>You <em>could</em> do this using something like the <a href="https://www.openpolicyagent.org/docs/latest/policy-reference/#builtin-graph-walk" rel="nofollow noreferrer">walk</a> built-in function. However, I would recommend against it, because:</p> <ul> <li>You'd need to scan every attribute of every request/resourc...
<p>I am getting this error in the logs. <code>[error] 117#117: *16706 upstream timed out (110: Operation timed out) while reading response header from upstream</code>.I have tried every possible way to check from where i am getting this exact 60s timeout.</p> <p>I'll add more detail of how i am producing this error in ...
<p>Found the problem. May be i have missed something but seems these</p> <pre><code>proxy-read-timeout: &quot;7200&quot; proxy-send-timeout: &quot;7200&quot; </code></pre> <p>headers doesn't effect the timeouts for the backend GRPC communication. I had to add the &quot;server-snippet&quot; to add these</p> <pre><code>g...
<p>I have tried to list pods based on labels</p> <pre><code> // Kubernetes client - package kubernetes clientset := kubernetes.NewForConfigOrDie(config) // create a temp list for storage var podslice []string // Get pods -- package metav1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot; pods, ...
<p>You may just be able to set using the <code>ListOptions</code> parameter.</p> <pre><code>listOptions := metav1.ListOptions{ LabelSelector: &quot;app=foo&quot;, } pods, _ := clientset.CoreV1().Pods(&quot;&quot;).List(listOptions) </code></pre> <p>If you have multiple labels, you may be able to perform thi...
<p>In Kubernetes container repository I have my permission set to Private: <a href="https://i.stack.imgur.com/K1iNY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K1iNY.png" alt="enter image description here" /></a></p> <p>When I create a pod on my cluster I get the the pod status ending in <code>Im...
<p>If your GKE version is &gt; 1.15, and the Container Registry is in the same project, and GKE uses the default Compute Engine service account (SA) it should work out of the box.</p> <p>If you are running the registry in another project, or using a different service account, you should give to the SA the right permiss...
<p>I've set up an ingress to route traffic to my http server, however I would like to leave some routes inaccessible from outside of the cluster.</p> <p>Example routes:</p> <pre><code>/status -&gt; end point to determine service status /users/names -&gt; returns users /users/ages -&gt; returns ages </code></pre> <p>c...
<p>Just specify the path that you want to expose via the ingress like this:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: namespace: my-namespace name: my-app-ingress annotations: kubernetes.io/ingress.class: nginx spec: rules: - host: local...
<p>I tried to install mongodb in EKS cluster by following the given links. (using mongodb-kubernetes-operator)</p> <p><a href="https://www.youtube.com/watch?v=VqeTT0NvRR4&amp;t=1s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=VqeTT0NvRR4&amp;t=1s</a></p> <p><a href="https://github.com/mongodb/mongodb-kuber...
<p>When contacted with AWS support team, got the following response.</p> <blockquote> <p>From your correspondence, I understand that you are facing issues while creating the mongodb pods in your EKS cluster, and after creating the pod, your pod is going to pending status.</p> <p>Please let me know if I misunderstood yo...
<p>In Kubernetes container repository I have my permission set to Private: <a href="https://i.stack.imgur.com/K1iNY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K1iNY.png" alt="enter image description here" /></a></p> <p>When I create a pod on my cluster I get the the pod status ending in <code>Im...
<p>GKE uses the service account attached to the node pools to grant access to the registry, however, you must be sure that the OAuth scope for your cluster is set to <code>https://www.googleapis.com/auth/devstorage.read_only</code> as well.</p>
<p>It's currently possible to allow a single domain or subdomain but I would like to allow multiple origins. I have tried many things like adding headers with snipets but had no success.</p> <p>This is my current ingress configuration:</p> <pre><code>kind: Ingress apiVersion: extensions/v1beta1 metadata: name: nginx-...
<p>Ingress-nginx doesn’t support CORS with multiple origins.</p> <p>However, you can try to use annotation: <strong>nginx.ingress.kubernetes.io/configuration-snippet</strong></p> <pre><code>nginx.ingress.kubernetes.io/configuration-snippet: | if ($http_origin ~* &quot;^https?://((?:exactmatch\.com)|(?:regexmatch\.com...
<p>My deployment had a readinessProbe configured like:</p> <pre><code> readinessProbe: port: 8080 path: /ready initialDelaySeconds: 30 failureThreshold: 60 periodSeconds: 10 timeoutSeconds: 15 </code></pre> <p>I want to remove the probe for some reason. However, after removing it from my YML fil...
<p>You need to set readinessProbe to null value like that:</p> <pre><code>readinessProbe: null </code></pre>
<p>I have Ingress</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress labels: app.kubernetes.io/managed-by: Helm annotations: kubernetes.io/ingress.class: nginx meta.helm.sh/release-name: ingress nginx.ingress.kubernetes.io/configuration-snippet: | location ...
<p>As you are getting the error &quot;ERR_TOO_MANY_REDIRECTS&quot; follow this <a href="https://kinsta.com/blog/err_too_many_redirects/" rel="nofollow noreferrer">link</a> it helps in clearing this error. Follow this <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">Link</...
<p>I have currently deployed a small java application to my local Kubernetes cluster. I'm currently trying to test my application by port-forwarding the pod and then using postman to test my Controllers.</p> <p>However, when I am testing I am getting a read timeout exception. No matter how long I set my timeout to be i...
<p>Some k8s deployments allow k8s pods to have only 1 CPU. In this circumstance it is not possible for the client and server to share an event loop (which is the default since it is more efficient to share an event loop if possible). The result is you get read timeouts. So you should configure a separate event loop for...
<p>I want to create a crone in the cluster which should have access to all of the namespaces, I don't want to configure that job in each and every namespace as I have multiple namespaces. Is this possible? Edit: I want to run same cronjob in all namespace</p>
<p>You can use helm to achieve this, either <strong>static</strong> namespaces or <strong>dynamic</strong> all namespaces.</p> <pre><code>{{- range $namespaces := .Values.namespaces }} apiVersion: batch/v1 kind: CronJob metadata: name: hello namespace: {{ $namespaces }} spec: schedule: &quot;* * * * *&quot; job...
<p>I'm trying to set up a cluster Autoscaler for my kubernetes cluster and when I'm looking at the autoscaler logs im seeing these error messages:</p> <pre><code>1 reflector.go:138] k8s.io/client-go/informers/factory.go:134: Failed to watch *v1.CSIDriver: failed to list *v1.CSIDriver: csidrivers.storage.k8s.io is forbi...
<p>Just make sure <strong>cluster-autoscaler</strong> has permission to use the resource <strong>csidrivers</strong> you can edit the RBAC and add the access for <code>storage.k8s.io</code></p> <p>Edit cluster role with this</p> <pre><code>- apiGroups: - storage.k8s.io resources: - storageclasses - csinodes -...
<p>Looks like there is no support to delete HorizontalPodAutoscaler using fabric8's K8S Java client ver:6.0.0.</p> <p>Although It is straightforward to create HorizontalPodAutoscaler using fabric8's K8S Java client ver:6.0.0.</p> <p>E.g.</p> <pre><code> HorizontalPodAutoscalerStatus hpaStatus = k8sClient.resource(creat...
<p>First, Need to identify which API group <code>(v1, v2beta1, v2beta2)</code> was used during deployment creation based on the same API group the autoscaling function need to be call to get the HPA instance and then go ahead to perform any action on that HPA instance.</p> <p>In my case the deployment was created with...
<p>I am trying to set up Kubernetes in my instance on a ubuntu 22.04 virtual machine. While in the installation process i am trying to add a gpg key for intra cluster communication. After running the command:</p> <p><code>sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add</code></p> <...
<p>I share this link.</p> <p><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management" rel="nofollow noreferrer">Install using native package management</a></p> <ol> <li>Update the apt package index and install packages needed to use the Kubernetes apt repository:</...
<p>Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole &quot;prometheus-kube-state-metrics&quot; in namespace &quot;&quot; exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key ...
<p>It was not enough just to delete the role binding. I had to also delete the role itself.</p> <pre><code>kubectl delete clusterrole prometheus-kube-state-metrics </code></pre> <p>Furthermore I deleted all other prometheus-relevant role bindings and roles, too:</p> <ul> <li>prometheus-alertmanager</li> <li>prometheus-...
<p>On this document.</p> <p><a href="https://github.com/bitnami/charts/tree/master/bitnami/kafka" rel="nofollow noreferrer">https://github.com/bitnami/charts/tree/master/bitnami/kafka</a></p> <p>it mentioned following:</p> <pre><code>Note: the deployed ingress must contain the following block: tcp: 9094: &quot;{{ .R...
<p>I resolved this by referring to this guide.</p> <p><a href="https://minikube.sigs.k8s.io/docs/tutorials/nginx_tcp_udp_ingress/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/tutorials/nginx_tcp_udp_ingress/</a></p> <p>I was missing this step</p> <pre><code>kubectl patch deployment ingress-nginx-control...
<p>I am using bitnami/rabbitmq image in kubernetes pod. Seems the image don`t have a root. May I know how to add the root user in the kubernetes.</p> <p><a href="https://i.stack.imgur.com/ne7Q4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ne7Q4.png" alt="enter image description here" /></a></p>
<p>From <code>3.7.7-r19</code> the RabbitMQ container has been migrated to a <strong>non-root user approach</strong>. Previously the container ran as the root user and the RabbitMQ daemon was started as the rabbitmq user. From now on, both the container and the RabbitMQ daemon run as user 1001. As a consequence, the da...
<p>I have created a secret.yaml file as follows:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: my-secret data: truststore.jks: {{ (.Files.Glob &quot;../trust.jks&quot;).AsSecrets | b64enc }} </code></pre> <p>I am calling this as part of template .yaml file in HELM.</p> <p>.yaml</p> <pre><code>apiVersio...
<p>There's a couple of things going on here:</p> <ul> <li><code>.Files.Glob</code> is intended to retrieve multiple files, <em>e.g.</em> <code>.Files.Glob &quot;credentials/*.jks&quot;</code>. For a single file <code>.File.Get</code> will retrieve its contents directly.</li> <li>You can only access files inside the ch...
<p>Why does the strimzi kafka operator have supported kafka versions; why do I care about this, if the version of kafka is being managed by the operator?</p> <p>Is this only mentioned for client support?</p>
<p>The Apache Kafka versions supported by the different Strimzi versions are listed on the <a href="https://strimzi.io/downloads/" rel="nofollow noreferrer">Strimzi website</a>. Supported in this case means <em>the versions for which we ship container images and which were tested</em>. There are several reasons why we ...
<p><strong>CONTEXT:</strong> I am trying to setup fluent bit for logging activities in pods in a number of node groups included in a cluster. And so it requires that each node group have an IAM role assigned to it with all the required policies so, fluent bit's daemonset could record and save logs into log groups in cl...
<p>The error message states that you are attempting to create the same role twice, which would cause the AWS API to error. This is consistent with your config given the argument value:</p> <pre><code>create_iam_role = true </code></pre> <p>for two different EKS node groups. You would need to change the value to <code>f...
<p>My Kubernetes ingress has the following:</p> <pre><code> ingress: enabled: true annotations: kubernetes.io/ingress.class: alb ... ... # -- Defines which ingress controller will implement the resource ingressClassName: &quot;&quot; </code></pre> <p>I'm a bit confused about the diff...
<p>Actually, both refer to the same thing, but <code>kubernetes.io/ingress.class</code> is deprecated from Kubernetes v1.22+. and <code>ingressClassName</code> is introduced in <code>1.18</code>, so if you are using higher version you can <code>ingressClassName</code></p> <blockquote> <p>Before the <code>IngressClass</...
<p>I have 3 services in 3 different namespaces I want my ingress rules to map to these backends, on path based routes. Can someone please guide on the same. I am using nginx ingress inside azure Kubernetes cluster.</p>
<p>A basic example with an assumption that your <code>nginx ingress</code> is working correctly inside your <code>AKS</code> would be following:</p> <p>List of <code>Pods</code> with their <code>Services</code>:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Pod</th> <th>Namespace</th> <th...
<p>I tried to use <code>microk8s add-node</code> in first machine. and second machine, I tried to <code>microk8s join &lt;&gt;:&lt;&gt;/&lt;&gt; --worker</code> but it returns this:</p> <blockquote> <p>the host name of the joining node does not resolve to the IP Refusing join (400)</p> </blockquote>
<p>You need to make sure the control plane node can also resolve the hostname of the workers.</p> <p>Add on the <code>/etc/hosts</code> of the control plane node: e.g.:</p> <pre><code>192.168.0.10 workerName </code></pre>
<p>I have tried to deploy Kafka in k8s, so I need to persist its volume with hostpath, but when the volume configuration adds to the deployment file, this error shows in Kafka pod, and the pod state becomes Crashloopbackoff:</p> <pre><code>mkdir: cannot create directory ‘/bitnami/config’: Permission denied </code></pre...
<p>I have solved the problem by changing the path (where I mount the pod data )ownership on the worker servers with this command:</p> <pre><code>sudo chown -R 1001:1001 /data/kafka-data </code></pre> <p>But I think this solution is not bestpractice.</p>
<p>I am looking for disk space usage metrics for EKS cluster that can be monitored. I came across three different metric alerts : <br> 1.</p> <pre><code>k8s-high-filesystem-usage: name: &quot;(k8s) High Filesystem Usage Detected&quot; type: metric alert query: | avg(last_10m):avg:kubernetes.filesystem.usage_p...
<p>This is a confusing area that is poorly documented. I'm glad you asked the question.</p> <p>First, some background on each metric.</p> <h3><code>system.disk.used</code></h3> <p>This metric is the most straightforward: disk space used, in bytes, of the disk partitions on the k8s host. This is a core check collected b...
<p>I just switched from ForkPool to gevent with concurrency (5) as the pool method for Celery workers running in Kubernetes pods. After the switch I've been getting a non recoverable erro in the worker:</p> <p><code>amqp.exceptions.PreconditionFailed: (0, 0): (406) PRECONDITION_FAILED - delivery acknowledgement on chan...
<p>The accepted answer is the correct answer. However, if you have an existing RabbitMQ server running and do not want to restart it, you can dynamically set the configuration value by running the following command on the RabbitMQ server:</p> <p><code>rabbitmqctl eval 'application:set_env(rabbit, consumer_timeout, 3600...
<p>I have a question related to Kubernetes Ingress-nginx, I want to use <a href="http://nginx.org/en/docs/http/ngx_http_map_module.html" rel="nofollow noreferrer">ngx_http_map_module</a> to define a new attribute for <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/" rel="no...
<p><a href="https://stackoverflow.com/a/49440631">Related answer</a>: Surround the regex in double-quotes; Nginx uses <code>{</code> and <code>}</code> for defining blocks.</p> <p>For example:</p> <pre><code> map $uri $uri_category { &quot;~[0-9]{3,}&quot; 'FOO'; } server { location / { try_files $u...
<p>Turning the mtls mode to Strict in Istio is giving error : msg=&quot;Error performing http GET at <a href="http://172.xx.xx.xx:xxxx" rel="nofollow noreferrer">http://172.xx.xx.xx:xxxx</a> read: connection reset by peer&quot; But turning the mtls mode to Permissive works fine.</p> <p>Is there any solution so that the...
<p>To resolve, ensure that istio-injection is turned on for all pods that are trying to communicate with each other so that they have the istio sidecar proxy running. This is because when the Istio Envoy proxies talk with each other they will automatically encrypt their communication. An Istio sidecar proxy will reject...
<p>I am wondering if there is anyway to schedule pods according to the node CPU utilization. Most of our pods in eks are scheduled on single node even though rest of the nodes have lot of CPU left. Our cron-jobs are trying to spin up the new pods in that same node and failing to start because of the low CPU. I believe ...
<p>The scheduler relies on the CPU request set for the pod and not the CPU usage.</p> <p>You need to set a CPU request that is high enough so that the scheduler knows that the node already containing a pod is not sufficient and will schedule it on another node that is able to host it.</p> <p><strong>EDIT:</strong></p> ...
<p>I'm looking into a new update to my kubernetes cluster in Azure. However, I'm not sure how to do this. I have been able to build an ingress controller like this one:</p> <pre><code>{{- if .Values.ingress.enabled -}} {{- $fullName := include &quot;test.fullname&quot; . -}} {{- if and .Values.ingress.className (not (s...
<p>In Kubernetes you have <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress Controllers</a> and <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a> resources. What you have is the definiti...
<p>I would like to scale my deployment based on a custom logging metric, but I'm not able to make that work, I created already the custom metric and I'm also able to see it in the metric explorer but for some reason the stackdriver adapter is not able to get the metric values.</p> <p><a href="https://i.stack.imgur.com/...
<p>Not sure you have created the service account and granted access to the adapter however there is two models of custom metrics adapter. Legacy adapter and new resource version.</p> <p>If adapter is up and running did you check the logs of POD ?</p> <p>New resource model to install :</p> <pre><code>kubectl apply -f ht...
<p>We have an k8s operator (based on kubebuilder) which works as expected, now we need support for listening to secrets on the cluster.</p> <p>The following code is working however I got event for <strong>all the secrets</strong> in the cluster which is <strong>not efficient</strong>,</p> <p>I WANT to get the event <st...
<p>According to this <a href="https://github.com/operator-framework/operator-sdk/issues/694" rel="nofollow noreferrer">github</a> source, you should be able to select specific objects (e.g. secrets) with <code>EnqueueRequestForObject</code>. However, it is <strong>not</strong> possible (yet) to watch only for specific ...
<p>This output says that I'm running kubernetes with <code>containerd</code> as the container runtime:</p> <pre><code>k get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME k8s-worker3 Ready &lt;...
<p>Try <strong>crictl images list</strong> as shown below</p> <p><a href="https://i.stack.imgur.com/pEtOK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pEtOK.png" alt="enter image description here" /></a></p>
<p>I'll need to monitor java springboot containers on kubernetes.</p> <p>I'll probably use the <a href="https://docs.datadoghq.com/fr/containers/kubernetes/installation/?tab=helm" rel="nofollow noreferrer">installation process using helm</a> to deploy the agent on the nodes.</p> <p>I'll probably use the <a href="https:...
<p>Datadog come with deployment and daemonset</p> <ul> <li>cluster agent (for Kubernetes metrics) deployment</li> <li>daemonset (for traching and logs) daemonset</li> </ul> <pre><code>helm repo add datadog https://helm.datadoghq.com helm repo update helm install &lt;RELEASE_NAME&gt; -f values.yaml --set datadog.apiKey...
<p>I'm using <code>Kubernetes version: 1.19.16</code> on bare metal <code>Ubuntu-18.04lts</code> server. When i tried to deploy the <code>nginx-ingress</code> yaml file it always fails with below errors.</p> <p>Following steps followed to deploy nginx-ingress,</p> <pre><code>$ git clone https://github.com/nginxinc/kube...
<p>I think you missed to install ingress-controller &quot;NGINX&quot; that is why it is not able to identify the same <a href="https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments/common/ingress-class.yaml#L4" rel="nofollow noreferrer">https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments...
<p>What's the best method to enforce/block root containers running in an EKS cluster running managed nodes and applied to all namespaces (except kube-system) v1.22+ ? I tried the below but root containers are still able to run. Is this the latest method <a href="https://kubernetes.io/docs/tutorials/security/cluster-l...
<p>The answer is use a tool like kyverno or datree and enforce policies and audit them from the cluster build point</p> <p><a href="https://kyverno.io/policies/pod-security/baseline/disallow-privileged-containers/disallow-privileged-containers/" rel="nofollow noreferrer">https://kyverno.io/policies/pod-security/baselin...
<p>I'm using the following Airflow version inside my Docker container and I am currently having some issues related to a broken DAG</p> <pre><code>FROM apache/airflow:2.3.4-python3.9 </code></pre> <p>I have other DAGs running with the same argument 'request_cpu' and perfectly functional, I'm not sure what the issue cou...
<p>First <code>resources</code> is <a href="https://github.com/apache/airflow/blob/6b75be43171eafc45825d043ef051638aa103ccd/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py#L222-L223" rel="nofollow noreferrer">deprecated</a> so you should use only <code>container_resources</code>.</p> <p>The <code>containe...
<p>Are the resources in a kubernetes YAML manifest created in sequence?</p> <p>Say I have a manifest file like so</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: app-config namespace: default data: prop.value: 1 ---- apiVersion: v1 kind: Pod metadata: name: test-pod spec: containers: - name:...
<p>Yes: <a href="https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/" rel="noreferrer">Manage Deployment</a></p> <blockquote> <p>The resources will be created in the order they appear in the file.</p> </blockquote> <p>But this should not matter too much in kubernetes. If the Deployment is crea...
<p>I am a beginner who is using Prometheus and Grapana to monitor the value of REST API. Prometheus, json-exporrter, and grafana both used the Helm chart, Prometheus installed as default values.yaml, and json-exporter installed as custom values.yaml. I checked that the prometheus set the service monitor of json-exporte...
<p>Firstly you can check the targets page on the Prometheus UI to see if a) your desired target is even defined and b) if the endpoint is reachable and being scraped.</p> <p>However, you may need to troubleshoot a little if either of the above is not the case:</p> <p>It is important to understand what is happening. You...
<p>I get the following warning/message when I run some k8s related commands</p> <blockquote> <p>Kubeconfig user entry is using deprecated API version client.authentication.k8s.io/v1alpha1. Run 'aws eks update-kubeconfig' to update</p> </blockquote> <p>and then I know I should run the command like so:</p> <p><code>aws e...
<p>Yes, <code>update-kubeconfig</code> does not make any changes to the cluster. It will only update your local <code>.kube/config</code> file with the cluster info. Note that with the <code>--dry-run</code> flag, no change will be made at all - the resulting configuration will just be printed to <code>stdout</code>.</...
<p>My DigitalOcean kubernetes cluster is unable to pull images from the DigitalOcean registry. I get the following error message:</p> <pre><code>Failed to pull image &quot;registry.digitalocean.com/XXXX/php:1.1.39&quot;: rpc error: code = Unknown desc = failed to pull and unpack image &quot;registry.digitalocean.com/X...
<p>The problem that you have is that you do not have an <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">image pull secret</a> for your cluster to use to pull from the registry.</p> <p>You will need to add this to give your cluster a way to author...
<p>I'm trying to deploy a custom pod on minikube and I'm getting the following message regardless of my twicks:</p> <pre><code>Failed to load logs: container &quot;my-pod&quot; in pod &quot;my-pod-766c646c85-nbv4c&quot; is waiting to start: image can't be pulled Reason: BadRequest (400) </code></pre> <p>I did all sorts...
<p>You should set the <a href="https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy" rel="nofollow noreferrer">imagePullPolicy</a> to <code>IfNotPresent</code>. Changing that will tell kubernetes to not pull the image if it does not need to.</p> <pre class="lang-yaml prettyprint-override"><code> .....
<p>I'm contemplating using Hashicorp vault in my Kubernetes, to store some dynamic secrets. I did find out that I can set the sidecar injector to periodically retrieve the secret and app can look for file changes etc... all fine.</p> <p>But after solid research, I could not find out how to update the key/pair from sche...
<p>You can use the <a href="https://www.vaultproject.io/api-docs/secret/kv/kv-v2#patch-secret" rel="nofollow noreferrer">http API</a> to interact with the vault.</p> <p>Given the assumption that your service account has permission to update the secret, you could run a container with a small script.</p> <pre class="lang...
<p>I created a token for my service account using the command 'kubectl create token admin-user'. But after a while it becomes unusable and I have to create it again. How can I generate a token for my service account without expire time?</p>
<p>Try the token for one year using the below command. You can define duration as appropriate, say <strong>--duration=87600h for 10 years</strong> and so on</p> <pre><code>kubectl create token admin-user --duration=8760h </code></pre>
<p>I am trying to be able to deploy an image from a space repository to AWS EKS. So far I managed to successfully save my docker image to Space. But I stuck at finding a way to upload my image to my cluster.</p> <p>So far I've created the following to save my docker image to the registy. Does someone know how I could p...
<p>It is not currently possible out-of-the-box to push to private registries via the <code>docker</code> top-level DSL. The feature will be added soon, as most of the puzzle pieces have been put in place now. You can track <a href="https://youtrack.jetbrains.com/issue/SPACE-9234/Authentication-to-private-registries" re...
<p>In the Rancher I can see the amount of pods I have in the cluster and the total amount I can have. How can I get this maximum amount of pods that my cluster is able to have with prometheus?</p> <p><a href="https://i.stack.imgur.com/UELoO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UELoO.png" a...
<p>You can use visualise based on these two queries</p> <p><strong>Total allocable pods:</strong></p> <pre><code>sum(kube_node_status_allocatable {resource=&quot;pods&quot;}) </code></pre> <p>you can also cross-verify the result</p> <pre><code>capacity=$(k get node $(k get node | awk '{if (NR==2) print $1}') -ojsonpath...
<p>I've been trying to deploy a small API using FastAPI(and uvicorn to serve) framework on GKE. I made a deployment and an associated service that are working well but I have trouble understanding how https should be implemented.</p> <p>Is it internal to FastAPI? Or is it on GKE's side?</p>
<p>it's more depends on the requirement you are looking for.</p> <p><strong>Option 1</strong> : HTTPS termination at LB level</p> <p>If you are using the <strong>LB</strong> with the <strong>GKE</strong> and don't want <strong>End to end</strong> <strong>HTTPS</strong> connection you can add the <strong>SSL/TLS</strong...
<p>I am creating a statefulset in kubernetes initially with 0 replicas and I will change the replicas value to a number(ex 6 or 7). Does the replicas will be updated or is it possible to create statefulset with 0 replicas?</p>
<p>I have tried the above use case and able to create StatefulSet with 0 replica and scale out. Please try and follow the document for more info: <a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateful-application/ba...
<p>We followed <a href="https://github.com/DataDog/datadog-operator/blob/main/docs/getting_started.md" rel="noreferrer">these instructions</a> to set up DataDog in our Kubernetes 1.22 cluster, using their operator. This was installed via helm with no customisations.</p> <p>The operator, cluster-agent, and per-node agen...
<p>if you are able to see metrics, then for logs I can see two possible reason</p> <ul> <li>enable logs collection during helm installation</li> </ul> <pre><code>helm upgrade -i datadog --set datadog.apiKey=mykey datadog/datadog --set datadog.logs.enabled=true </code></pre> <ul> <li>Wrong region configuration, by defau...
<p>I have already deployed Spark on Kubernetes, below is the deployment.yaml,</p> <pre><code>apiVersion: &quot;sparkoperator.k8s.io/v1beta2&quot; kind: SparkApplication metadata: name: pyspark-pi namespace: default spec: type: Python pythonVersion: &quot;3&quot; mode: cluster image: &quot;user/pyspark-app:...
<ul> <li><p>You have the runner environment that instantiates the <code>Beam</code> job : <code>Kubernetes</code></p> </li> <li><p>In the execution phase your <code>Beam</code> job uses the <code>Docker</code> image : <code>environment_config=docker.io/apache/beam_python3.7_sdk:2.33.0&quot;</code></p> </li> </ul> <p>To...
<p>I'm following this <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">Link</a> to install <code>nginx-ingress-controller</code> on my bare metal server <code>Kubernetes-v.1.19.16</code></p> <p>The below commands i have executed as part of ins...
<p>I'd recommend installing it using <code>helm</code></p> <p>See <a href="https://github.com/nginxinc/kubernetes-ingress/tree/main/deployments/helm-chart" rel="nofollow noreferrer">https://github.com/nginxinc/kubernetes-ingress/tree/main/deployments/helm-chart</a></p> <pre class="lang-bash prettyprint-override"><code>...
<p>I'm following this <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">Link</a> to install <code>nginx-ingress-controller</code> on my bare metal server <code>Kubernetes-v.1.19.16</code></p> <p>The below commands i have executed as part of ins...
<p>With the below branch i could able to see all <code>nginx-ingress</code> pods are in running.</p> <pre><code>git clone https://github.com/nginxinc/kubernetes-ingress/ cd kubernetes-ingress/deployments git checkout v1.10.0 </code></pre>
<p>I have a kubernetes application using AWS EKS. With the below details:</p> <p>Cluster: + Kubernetes version: 1.15 + Platform version: eks.1</p> <p>Node Groups: + Instance Type: t3.medium + 2(Minimum) - 2(Maximum) - 2(Desired) configuration </p> <p>[Pods] + 2 active pods</p> <p>[Service] + Configured Type:...
<p>solution fitted my case is adding ingressClassName in ingress.yaml or configure default ingressClass.</p> <blockquote> <p>add ingressClassName in ingress.yaml</p> </blockquote> <pre><code>#ingress.yaml metadata: name: ingress-nginx ... spec: ingressClassName: nginx &lt;-- add this rules: ... </code></pr...
<p>We have a OpenShift 4.8 cluster with 3 master nodes and 10 worker nodes in Azure. All the worker and master nodes are added under the same load balancer. I am a bit confused about how ingress traffic reaches the cluster. When someone accesses the DNS of their application, traffic comes through the load balancer over...
<blockquote> <p>How exactly traffic reaches to the correct ingress controller pods? Also once the traffic reaches the node how exactly it identifies the correct ingress host to forward traffic to?</p> </blockquote> <p>The ingress controller doesn't need to deploy on every compute node because it knows all the way to yo...
<p>I am trying to merge some data to delta table in a streaming application in k8s using spark submit in cluster mode</p> <p>Getting the below error, But its works fine in k8s local mode and in my laptop, none of the operations related to delta lake is working in k8s cluster mode,</p> <p>Below is the library versions i...
<p>Finaly able to resolve this issue , issue was due to some reason dependant jars like delta, kafka are not available in executor , as per the below SO response</p> <p><a href="https://stackoverflow.com/questions/73473309/cannot-assign-instance-of-scala-collection-immutable-listserializationproxy-to">cannot assign ins...
<p>I have .Net Core 3.1 web api which is deployed to AKS. I have created Azure App Insights instance to write the logs. I followed <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core?tabs=netcore6" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-co...
<p>Microsoft.ApplicationInsights.AspNetCore was not working when using Connection String. When I changed to InstrumentKey the logs started flowing. Weird as MSFT recommendation is to use connection string</p>
<p>i'm triyng to do one Helm Chart for different environments. In many tutorials such scheme should works, but my structure does not read value from dependency repository. Helm just ignores it.</p> <p>I have following folder structure</p> <pre><code>helm - charts - core-web - Chart.yaml ...
<p>Try to replicate the issue, seems like a cache issue</p> <p>you can verify that helm dependency on which path it's looking for <code>charts</code>.</p> <pre><code>helm template test ./prod #output Error: found in Chart.yaml, but missing in charts/ directory: backend, web-app </code></pre> <p>then I tried to verify t...
<p>I was checking Kubernetes <a href="https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy" rel="nofollow noreferrer">documentation</a> for pulling images. In that, I saw two policies IfNotPresent and Always. In &quot;Always&quot; its stated that</p> <blockquote> <p>If the kubelet has a container im...
<p><code>Always</code> at the name suggests will cause the container runtime to attempt to pull a new version of the image from the repository every time it tries to create the container.</p> <p>In docker, this is like doing:</p> <p><code>docker run --pull=always nginx</code></p> <p><code>IfNotPresent</code> will pull ...
<p>I am unsure what the difference between &quot;plain calico&quot;</p> <pre><code>kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml </code></pre> <p>and the &quot;calico tigera&quot; (operator) is.</p> <pre><code>helm repo add projectcalico https://projectcalico.docs.tigera.io/charts helm install ...
<p>CNI is a small network plugin that is used for allocating IP address, but calico tigera is responsible for whole kubernetes networking and connecting nodes and services</p>
<p>We're using kubernetes with ingresses, cert-manager (v1.9.1) and the letsencrypt issuer. Our use case is the following: We have a multitenant solution with 3 services that allows people to change their domain names (1 for each service). Each time someone is changing a domain name, it triggers the update of the ingre...
<blockquote> <p>The order created seems to regenerate all the letsencrypt certificates from the ingress and not only the one changed</p> </blockquote> <p>Based on the discussion, This is because you are using the same secret name for all the ingress, you need to have a different secret name for each host in TLS in the ...
<p>I am unsure what the difference between &quot;plain calico&quot;</p> <pre><code>kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml </code></pre> <p>and the &quot;calico tigera&quot; (operator) is.</p> <pre><code>helm repo add projectcalico https://projectcalico.docs.tigera.io/charts helm install ...
<p>Tigera is a Cloud-Native Application Protection Platform (CNAPP).</p> <p>For sure, you just want the first copy, Calico CNI.</p>
<p>I am trying to run a beam application on spark on kubernetes.</p> <p>beam-deployment.yaml</p> <pre><code>apiVersion: apps/v1 kind: StatefulSet metadata: name: spark-beam-jobserver spec: serviceName: spark-headless selector: matchLabels: app: spark-beam-jobserver template: metadata: labels: ...
<p>I suppose this is based on <a href="https://github.com/cometta/python-apache-beam-spark" rel="nofollow noreferrer">https://github.com/cometta/python-apache-beam-spark</a>?</p> <p><code>spark-beam-jobserver</code> is using service type <code>NodePort</code>. So, if running in a local (minikube) cluster, you won't nee...
<p>I have an Ansible task almost identical to the top answer here: <a href="https://stackoverflow.com/questions/53198576/ansible-playbook-wait-until-all-pods-running">Ansible playbook wait until all pods running</a></p> <pre class="lang-yaml prettyprint-override"><code>- name: Wait for all control-plane pods become cre...
<blockquote> <p><em>How can I only print 'FAILED - RETRYING' once all the retries have been used up?</em></p> </blockquote> <p>I understand that you are referencing to <code>until</code> <code>retries</code> and like to <a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#retrying-a-task-unt...
<p>I am trying to run .net core application with Azure SignalR services(free tier). The .net core app is deployed in Azure Kubernetes Service. I have an Angular frontend app that tries to connect to the WebSocket. Below are my configurations in Program.cs file:</p> <pre><code> services.AddCors(options =&gt; options....
<p>I was able to figure out what went wrong here. We are using Kong API gateway 2.7.1 for our organization. This version of Kong does not support WS/WSS protocol. This explains the errors like:</p> <blockquote> <p>Status Code: 503 WebSocket request made to a site where WebSockets are disabled.</p> </blockquote> <p>Or</...
<p>I have already deployed Spark on Kubernetes, below is the deployment.yaml,</p> <pre><code>apiVersion: &quot;sparkoperator.k8s.io/v1beta2&quot; kind: SparkApplication metadata: name: pyspark-pi namespace: default spec: type: Python pythonVersion: &quot;3&quot; mode: cluster image: &quot;user/pyspark-app:...
<p>There's a couple of requirements to be met to use the <code>PortableRunner</code> with Spark:</p> <ul> <li>You have to also run a Spark job-server alongside your cluster. It takes care of submitting the application to spark (and will function as driver). Note, the Spark version of the job-server should closely match...
<p>We have a k8s cluster and postgres pods are running in it. Our backend services connect to postgres K8s service. I am trying to introduce PgBouncer as proxy when connecting to postgres pods. Postgres has ssl mode enabled and we have our own ROOT_CA, and an intermediate CA that is signed by the ROOT_CA. We create cer...
<p>You are using client certs. I don't know if you intend to be doing that, as client certs are kind of rare, and your files containing the client cert and client key have odd names for such use.</p> <p>Maybe you meant to use client_tls_key_file and client_tls_cert_file in your config, rather than the corresponding se...
<p>this is my service information</p> <p><code>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</code></p> <p><code>k8s-demo NodePort 10.103.77.121 192.168.96.10 80:32236/TCP 24h</code></p> <p>when I <code>curl 192.168.96.10:32236</code>,returns <code>curl: (56) Rec...
<p>To have an external access to a NodePort service the node should have a public ip address assigned to it. 192.168.96.10 is a private ip address.</p> <p>IANA has assigned the following 3 ip ranges for private network -</p> <pre><code>Address ranges to be use by private networks are: Class A: 10.0.0.0 to 10.255.2...
<p>I have Kubernetes version 1.24.3, and I created a new service account named &quot;deployer&quot;, but when I checked it, it shows it doesn't have any secrets.</p> <p>This is how I created the service account:</p> <pre><code>kubectl apply -f - &lt;&lt; EOF --- apiVersion: v1 kind: ServiceAccount metadata: name: dep...
<p>Should the roleRef not reference the developer Role which has the name deployer role. Inwould try to replace</p> <pre><code>roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: sdr </code></pre> <p>with</p> <pre><code>roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: ...
<p>I have Kubernetes version 1.24.3, and I created a new service account named &quot;deployer&quot;, but when I checked it, it shows it doesn't have any secrets.</p> <p>This is how I created the service account:</p> <pre><code>kubectl apply -f - &lt;&lt; EOF --- apiVersion: v1 kind: ServiceAccount metadata: name: dep...
<p>Base on the change log, the auto-generation of tokens is no longer available for every service account.</p> <blockquote> <p>The LegacyServiceAccountTokenNoAutoGeneration feature gate is beta, and enabled by default. <strong>When enabled, Secret API objects containing service account tokens are no longer auto-generat...
<p>I was trying to uninstall a helm release in my AKS cluster using <code>helm uninstall RELEASE_NAME</code> but seems like it failed. The failure happened because for some reason all of the nodes in my cluster went in a not ready state when I used <code>helm uninstall</code>.</p> <p>Since then, I got all the nodes to ...
<p>Based on the discussion, the following steps resolve the issue.</p> <pre><code>helm hist releasename helm rollback releasename versionnumber-with-status-deployed </code></pre> <p>if this did not help, then delete secret for each version</p> <pre><code>helm hist releasename kubectl get secrets k delete secrets sh.hel...
<p>I want to know how label can be set while namespace is getting created in e2e. This line of code simply creates a namespace <a href="https://github.com/kubernetes/kubernetes/blob/v1.25.0/test/e2e/framework/framework.go#L239" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/v1.25.0/test/e2e/fra...
<p>This label is set by an admission controller. Setting it manually will cause the controller to reject your pod.</p> <p>To get the correct Pod Security Policy (PSP) assigned you need RBAC rules that allows <code>use</code> on that PSP: <a href="https://v1-24.docs.kubernetes.io/docs/concepts/security/pod-security-poli...
<p>Does anyone know why <code>restartPolicy</code> field is defined on the Pod level instead of the container level?</p> <p>It would seem that this setting is more closely related to the container, not the Pod.</p> <p>Then how to controll restart policy of single container in multi-container Pod?</p>
<p>I think <strong>restart policy</strong> is part of the <strong>POD</strong> spec.</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: test spec: containers: - name: 1st image: image-1 command: [&quot;./bash&quot;, &quot;-test1&quot;] - name: 2nd image: image-2 command: [&quot;./bash&quot;...
<p>When trying to use the helm function: lookup, I do not get any result at all as expected.</p> <p>My Secret that I try to read looks like this</p> <pre><code>apiVersion: v1 data: adminPassword: VG9wU2VjcmV0UGFzc3dvcmQxIQ== adminUser: YWRtaW4= kind: Secret metadata: annotations: sealedsecrets.bitnami.com/clu...
<p>This error is the result of two parts <em>working</em> together:</p> <p>First, helm's <code>lookup</code> only works in a running cluster, not when running <code>helm template</code> (without <code>--validate</code>). If run in that manner it returns nil. (It is usually used as <code>lookup ... | default dict {}</co...
<p>I'm using <code>kubectl</code> to access the api server on my minikube cluster on ubuntu but when try to use <code>kubectl</code> command I got an error certificate expired:</p> <pre><code>/home/ayoub# kubectl get pods Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2...
<p>minikube delete - deletes the local Kubernetes cluster - worked for me</p> <p>reference: <b> <a href="https://github.com/kubernetes/minikube/issues/10122#issuecomment-758227950" rel="nofollow noreferrer">https://github.com/kubernetes/minikube/issues/10122#issuecomment-758227950</a> </b></p>
<p>I created HPA on our k8s cluster which should auto-scale on 90% memory utilization. However, it scales UP without hitting the target percentage. I use the following config:</p> <pre><code>apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: namespace: {{ .Values.namespace }} name: {{ include &...
<p>The horizontal pod autoscaler has a <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#algorithm-details" rel="nofollow noreferrer">very specific formula</a> for calculating the target replica count:</p> <pre class="lang-none prettyprint-override"><code>desiredReplicas = ceil[current...
<p>How to patch "db.password" in the following cm with kustomize?</p> <p>comfigmap:</p> <pre><code>apiVersion: v1 data: dbp.conf: |- { "db_properties": { "db.driver": "com.mysql.jdbc.Driver", "db.password": "123456", "db.user": "root" } } kind: ConfigMap metadata: labe...
<p>create a placeholder in your file and replace it with real data while applying kustomize</p> <p>your code will be like this:</p> <pre><code>#!/bin/bash sed -i &quot;s/PLACE-HOLDER/123456/g&quot; db_config.yaml kustomize config.yaml &gt;&gt; kustomizeconfig.yaml kubectl apply -f kustomizeconfig.yaml -n foo </code></p...
<p>I have a cluster and set up kubelet on a node (name is <code>myNode</code>) with the <code>static</code> CPU Manager Policy. So I've started kubelet with <code>--cpu-manager-policy=static</code> (to set the static policy) and <code>--reserved-cpus=1</code> (to make sure kubelet has one core to run on exclusively) as...
<p>You also need to provide memory request and limit in order to qualify for the <em>Guaranteed</em> tier and exclusive cores:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: wl labels: app: wl spec: containers: - name: wl image: docker.io/polinux/stress:latest imagePullPolicy: IfNotPresent ...
<p>I have Kubernetes running (K3s on TrueNAS scale). I've deployed Prometheus and Grafana and am able to access the metrics in Grafana. I now want to create a stacked line chart that shows memory usage by namespace and total memory used by Kubenetes.</p> <p>I got it working without the total with this query: <code>sum ...
<p>I think I figured it out. I still have the query <code>sum (container_memory_working_set_bytes {namespace!=&quot;&quot;} ) by(namespace)</code>.</p> <p>Then added a transformation &quot;Add field from calculation&quot;, again with the defaults. I thought this would only work for the properties listed at the time of ...
<p>I created an operator for my application and want to create a service monitor for it. The Prometheus operator was created. The monitoring Prometheus library was imported and the service monitor CRD was created in my k8s cluster. Here is the Go code for this object:</p> <pre class="lang-go prettyprint-override"><code...
<p>In your <code>main.go</code>, you need to add <code>monitoring/v1</code> to the <code>scheme</code> injected into <code>controller-runtime</code> i.e.:</p> <pre class="lang-golang prettyprint-override"><code>// main.go package main import ( &quot;os&quot; ctrl &quot;sigs.k8s.io/controller-runtime&quot; ...
<p>I'm currently trying to add ArgoCD to my project and am struggling with pulling an image from my GitLab container registry.</p> <p>Here's my values yaml:</p> <pre class="lang-yaml prettyprint-override"><code># Default values for oc-backend. # This is a YAML-formatted file. # Declare variables to be passed into your ...
<p>Solution: I'd removed the user, password and email before encoding it. It's now working!</p>
<p>i am trying to create a Kubernetes cluster with the intention of hosting a docker registry, but after installing kubectl (via homebrew on Mac) along with minikube i am getting <code>The connection to the server localhost:8080 was refused - did you specify the right host or port?</code> when i run <code>kubectl versi...
<p><a href="https://discuss.kubernetes.io/t/the-connection-to-the-server-localhost-8080-was-refused-did-you-specify-the-right-host-or-port/1464/9" rel="nofollow noreferrer">This thread</a> mentions:</p> <blockquote> <p>That error should only come up if you have no contexts configured in your client.<br /> If you run <c...
<p>I need to run powershell as an container in kubernetes</p> <p>I am using following deployment file <code>sample.yaml</code></p> <pre><code>apiVersion: v1 kind: Pod metadata: name: powershell spec: containers: - name: powershell image: mcr.microsoft.com/powershell:latest </code></pre> <p>When I run <code>ku...
<p>If you want to keep a container for running, you should write like this yaml..</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: powershell spec: containers: - name: powershell image: mcr.microsoft.com/powershell:latest command: [&quot;pwsh&quot;] args: [&quot;-Command&quot;, &quot;Start-Slee...
<p>Currently I run a curl container and directly connect with its terminal to verify connectivity to services and check we can can connect on some port to an external service or a service maintained by some other team.</p> <pre><code>kubectl run curl -it --rm --image=curlimages/curl -- sh </code></pre> <p>Now the probl...
<p>You can do something like this, if you need to run it on a specific node that is tainted (it will run despite any taints):</p> <pre><code>kubectl run curl -it --rm --image=curlimages/curl --overrides \ '{&quot;spec&quot;:{&quot;tolerations&quot;:[{&quot;operator&quot;:&quot;Exists&quot;}]},&quot;nodeName&quot;:&qu...
<p>When we perform Tekton trigger API using an eventlistener, I am getting following response while in the background, pipeline runs for certain period of time.</p> <p>Is there any API to fetch the status of this pipelineRun using the given <code>eventID</code> or <code>eventListenerUID</code>?</p> <pre><code>{ &quot...
<p>You can use that eventID resolving your pipelinerun:</p> <pre><code>kubectl -n &lt;your-namespace&gt; get pr -l triggers.tekton.dev/tekton-eventid=&lt;your-event-id&gt; </code></pre> <p>Then, extract the status column, or use jsonpath to access <code>status.conditions[0].type</code>.</p>
<p>I am using azure kubernetes for backend deployment. I have 2 URLs one is API URL(api.project.com) and other one is BFF URL(bff.project.com).</p> <p>From Web application, instead of calling API URL(api.project.com) they use BFF URL(bff.project.com) which internally calls the API URL(api.project.com) and sends the res...
<p>You want to keep your api private, only accessible from another K8S service, so don't expose it using your ingress controller and it simply won't be accessible outside K8S to any client.</p> <p>This means that you lose the api.project.com address (although you can get that back if you really want to, it seems unnece...
<p>There is no terminal coming in the Lens. Lens terminal just showing <strong>connecting...</strong></p>
<p><strong>Root Cause</strong></p> <p>Bydefault lens uses the powershell but Lens need wsl shell. By changing the shell to wsl this issue can be solve also we have to add the path for wsl in lens application.</p> <p>In the backend Lens call the <strong>WSL</strong> shell. But Lens unable to find it.</p> <p><strong>Solu...
<p>After researching the topic I found <a href="https://cloud.google.com/kubernetes-engine/docs/reference/rest#rest-resource:-v1beta1.projects.locations.clusters" rel="nofollow noreferrer">this</a> documentation for retiring k8 clusters from GCP. However, I could not find any code examples of utilizing those API's and ...
<p>This is confusing.</p> <p>There are 2 distinct APIs that you must use:</p> <ol> <li>Google's Kubernetes Engine API (see <a href="https://cloud.google.com/kubernetes-engine/docs/reference/rest/" rel="nofollow noreferrer">link</a>). This API is used to create, read, update and delete Kubernetes clusters. Google provid...