prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>For <code>imagePullPolicy: Always</code>, If the kubelet has a container image with that exact digest cached locally, the kubelet uses its cached image; otherwise, the kubelet pulls the image with the resolved digest, and uses that image to launch the container.</p> <p>How long will these locally cached images exist...
<p>Kubelet have a Garbage collector for local images, you can read all the configuration you can change in the official <a href="https://kubernetes.io/docs/concepts/architecture/garbage-collection/#containers-images" rel="nofollow noreferrer">docs</a></p>
<p>I am trying to deploy python fastApi in EKS cluster (I am able to test this code in my local system), whenever I am deploying the docker image, its failing with error as</p> <blockquote> <p>&quot;</p> <pre><code>INFO: Will watch for changes in these directories: ['/app'] INFO: Uvicorn running on http://0.0.0...
<p>Add the directory name in front of filename i.e; if your directory name is <code>app</code></p> <p>change <code>main:app</code> to <code>app.main:app</code> so in <code>CMD</code> of Dockerfile this will be</p> <pre><code>CMD [&quot;uvicorn&quot;, &quot;app.main:app&quot;, &quot;--reload&quot;, &quot;--host&quot;, &...
<p>I'm running locally a statefulset replica of MongoDB on Minikube and I'm trying to connect to this one using Spring Mongo DB.</p> <p>In the configuration properties I have:</p> <p><code>spring.data.mongodb.uri=mongodb://mongod-0.mongo:27017/test</code></p> <p>The problem is that, when I try to deploy the application...
<p>it's due to your service name is : <strong>mongodb-service</strong></p> <p>You have to use always <strong>service name</strong> in connection strings everywhere mostly.</p> <p>Traffic flow goes like :</p> <pre><code>Service -&gt; deployment or statefulsets -&gt; PODs </code></pre> <p>now you have exposed the service...
<p>currently busy learning kubernetes and running configs on the command line, and I'm using an M1 MacOS running on version 11.5.1, and one of the commands I wanted to run is <code>curl &quot;http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy&quot;</code> but I get the below error message <code>curl: ...
<p>First, <code>curl</code> command should receive only 1 host, not multiple hosts. Therefore pod should be single.</p> <p>Then, you need to save POD's name to a variable without any special characters.</p> <p>Last, when you're using <code>kubectl proxy</code>, you need to add <code>-L</code> option to the <code>curl</...
<p>I want to create nodegroup selector which contain only primary pod and exclude backup pod in kubernates. How to achieve that using helm chart ?</p> <pre><code>appVersion: version1 kind: StatefulSet metadata: name: statefulname label: .... .... .... spec: replica: 2 ..... container: ..... ...
<p>You have not shared the K8s version details however you can look for the using the <strong>Node affinity</strong> with <strong>statefulset</strong> or else <strong>topologySpreadConstraints</strong></p> <pre><code>topologySpreadConstraints: - maxSkew: &lt;integer&gt; topologyKey: &lt;string&gt; whenU...
<p>We are considering to use HPA to scale number of pods in our cluster. This is how a typical HPA object would like:</p> <pre><code>apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: hpa-demo namespace: default spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: hpa-deplo...
<p><code>Can we have multiple targets (scaleTargetRef) for HPA ?</code></p> <p>One <code>HorizontalPodAutoscaler</code> has only one <code>scaleTargetRef</code> that hold one referred resource only.</p>
<p>I had successfully deployed MySQL router in Kubernetes as described in <a href="https://stackoverflow.com/questions/63149618/mysql-router-in-kubernetes-as-a-service">this</a> answer.</p> <p>But recently I noticed mysql router was having overflow issues after some time.</p> <pre><code>Starting mysql-router. 2022-03-0...
<blockquote> <p>Why router service overflow after working few hours?</p> </blockquote> <p>From what I know, you would modify the <code>max_connection</code> setting at <code>mysqld</code> section in your MySQL configuration file. You could determine where the location of the configuration file is by running command:</p...
<p>I'm following the <a href="https://gateway.dask.org/install-kube.html" rel="nofollow noreferrer">instructions</a> to setup Dask on K8s Cluster. I'm on MacOS, have K8s running on Docker Desktop, <code>kubectl</code> version <code>1.22.5</code> and <code>helm</code> version <code>3.8.0</code>. After adding the reposit...
<p><strong>Posting community wiki answer for better visibility:</strong></p> <p>This is fixed in the repo main. You could grab the CRDs from there, or wait for a release, which we are hoping to do soon. Otherwise, yes, you would need an older version of kubernetes for dask-gateway to work.</p>
<p>I'm using k3s v1.22.7 on Ubuntu 20.04. I want <code>/bar/xyz</code> to be <code>/xyz</code> to the pods. Without the middleware I'm properly routed to the pods, with it I get <code>404</code> from Traefik as though the stripping from <code>replacePathRegex</code>/<code>stripPrefix</code> happens before the Ingress p...
<p>Looks like the middleware needs the namespace prefixed, so either</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: traefik.containo.us/v1alpha1 kind: Middleware metadata: name: strip-prefix # No namespace defined spec: stripPrefixRegex: regex: - ^/[^/]+ --- kind: Ingress metadata: an...
<p>I would like to have a way to centralize the logs of multiple applications running in a Kubernetes cluster.</p> <p>The cherry on top would be if there could be a way to query them so I can display them on a UI.</p> <p>Any ideas / suggestions?</p>
<p>As suggested by the <code>Jordanm</code> you can use the flientd + ES and Kibana (Display log).</p> <p>i would also suggest checking the same stack Graylog, Elasticsearch and MongoDb.</p> <p>You are on Kubernetes so this way it would be easy to integrate the Graylog also and it's open-source tool. You can use the of...
<p>docker desktop on mac is getting error:</p> <pre><code>Unable to connect to the server: x509: certificate signed by unknown authority </code></pre> <p>The <a href="https://stackoverflow.com/questions/46234295/kubectl-unable-to-connect-to-server-x509-certificate-signed-by-unknown-authori">following answers</a> didn't...
<p>Posting the answer from comments</p> <hr /> <p>As appeared after additional questions and answers, there was a previous installation of <code>rancher</code> cluster which left its traces: certificate and context in <code>~/.kube/config</code>.</p> <p>The solution in this case for local development/testing is to dele...
<p>I have few CRDs, but I am not exactly sure how to query kube-apiserver to get list of CRs. Can anyone please provide any sample code?</p>
<p>my sample code for an out of cluster config</p> <pre><code> var kubeconfig *string kubeconfig = flag.String(&quot;kubeconfig&quot;, &quot;./config&quot;, &quot;(optional) relative path to the kubeconfig file&quot;) flag.Parse() // kubernetes config loaded from ./config or whatever the flag was set to...
<p>I experiencing some issues when scale down/up ec2 of my k8s cluster. It might happen that sometimes I have new nodes, and old are terminated. k8s version is 1.22</p> <p>Sometimes some pods are in ContainerCreating state. I am trying to describe pod and see something like this:</p> <pre><code>Warning FailedAttachVolu...
<p>Well, as you found out in <a href="https://github.com/kubernetes/kubernetes/issues/100485" rel="nofollow noreferrer">volume.kubernetes.io/selected-node never cleared for non-existent nodes on PVC without PVs #100485</a> - this is a known issue, with no available fix yet.</p> <p>Until the issue is fixed, as a workaro...
<p>A new version of MLFlow (1.23) provided a <code>--serve-artifacts</code> option (via <a href="https://github.com/mlflow/mlflow/pull/5045" rel="nofollow noreferrer">this</a> pull request) along with some example code. This <em>should</em> allow me to simplify the rollout of a server for data scientists by only needin...
<p>Just in case anyone stumbles upon this, I had same issue based on your description. However the problem on my side was that I was that I tried to test this with a preexisting experiment (default), and I did not create new one, so the old setting carried over, thus resulting in MLFlow trying to use s3 trough credenti...
<p><code>uname -srm</code></p> <p>THis gives Linux kernel version.</p> <p>How to find Linux kernel version of all the containers running inside my EKS deployments? CAn we do it using <code>kubectl</code> command?</p>
<p>You can check with kubectl if your pod support bash: <code> kubectl exec --namespace &lt;if not default&gt; &lt;pod&gt; -- uname -srm</code></p>
<p>I'm using EKS, Route53 and External-dns for my DNS records.</p> <p>Here is the nginx-ingress I'm currently using</p> <pre class="lang-yaml prettyprint-override"><code>nginx-ingress: controller: config: use-forwarded-headers: &quot;true&quot; service: annotations: external-dns.alpha.kube...
<p>I'm now using annotations filter</p> <p>I have two external-dns one for the private zone one for the public</p> <p>I add this to my external-dns helm chart:</p> <pre><code>set { name = &quot;annotationFilter&quot; value = &quot;company.com/dns-type in (private)&quot; } </code></pre> <p>And after in my nginx...
<p>When trying to execute profiling on a kubernetes cluster with JProfiler (13.0 build 13073) for macOS</p> <p>&quot;Could not execute kubectl executable&quot; is thrown</p> <p>Cannot run program &quot;&quot;/usr/local/Cellar/kubernetes-cli/1.23.4/bin/kubectl&quot;&quot;: error=2, No such file or directory (kubectl ins...
<blockquote> <p>This is a bug in 13.0 and will be fixed in 13.0.1.</p> </blockquote> <p>13.0.1 download link: <a href="https://download-gcdn.ej-technologies.com/jprofiler/jprofiler_macos_13_0_1.dmg" rel="nofollow noreferrer">https://download-gcdn.ej-technologies.com/jprofiler/jprofiler_macos_13_0_1.dmg</a></p>
<p>I have a simple ingress configuration file-</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/rewrite-target: /link2/link3/ name: tut-ingress namespace: default spec: rules: - host: tutorial.com ...
<p>The answer is posted in the comment:</p> <blockquote> <p>Well, <code>/link1/</code> is not a prefix of <code>/link1</code> because a prefix must be the same length or longer than the target string</p> </blockquote> <p>If you have</p> <pre class="lang-yaml prettyprint-override"><code>- path: /link1/ </code></pre> <p>...
<p>I need to add a label to all default rules that come with the Helm chart. I tried setting the label under <code>commonLabels</code> in the values file, to no avail. I also tried putting it as <code>external_labels</code> within the <code>defaultRules</code> stanza, again didn't do the trick. When I add the label to ...
<p>You can upgrade your values.yaml file for Prometheus with the necessary labels in the <code>additionalRuleLabels</code> section for <code>defaultRules</code>.</p> <p>Below is an example based on the <a href="https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L70" r...
<p>I was reading about Kubernetes events and it seems the only way to process events is to create a Watch over http call, which in turn processes the response and becomes Iterator of events. But that is finite and you have to recreate the event watch constantly... Is there a way to simply tail events with some callback...
<p>As a native watching method for Kubernetes, you can watch events in real-time with <code>--watch</code> <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes" rel="nofollow noreferrer">flag</a> - it is a part of API server, allowing to fetch the current state of resour...
<p>I have kubernetes pods running as shown in command <em>&quot;kubectl get all -A</em>&quot; :</p> <p><a href="https://i.stack.imgur.com/zvcJh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zvcJh.png" alt="enter image description here" /></a></p> <p>and same pods are shown in command <em>&quot;kubectl get p...
<p>In addition to Jonas' answer above; If you have more than one namespace, you need to specify the namespace your pod is currently using i.e <code>kubectl exec -n &lt;name space here&gt; &lt;pod-name&gt; -it -- /bin/sh</code></p> <p>After successfully accessing your pod, you can go ahead and navigate through your con...
<p>I'm using a HPA based on a custom metric on GKE.</p> <p>The HPA is not working and it's showing me this error log:</p> <blockquote> <p>unable to fetch metrics from custom metrics API: the server is currently unable to handle the request</p> </blockquote> <p>When I run <code>kubectl get apiservices | grep custom</cod...
<p>First of all, confirm that the Metrics Server POD is running in your <code>kube-system</code> namespace. Also, you can use the following manifest:</p> <pre><code>--- apiVersion: v1 kind: ServiceAccount metadata: name: metrics-server namespace: kube-system --- apiVersion: extensions/v1beta1 kind: Deployment metad...
<p>I'm trying to add preexisting volume to one of my deployment to use persistent data to jenkins. I'm using hetzner cloud as cloud provider and also using sci drivers to point the preexisting volume. But I'm getting below error,</p> <p><a href="https://i.stack.imgur.com/whS0b.png" rel="nofollow noreferrer"><img src="h...
<p>I have found <a href="https://stackoverflow.com/questions/53238832/persistentvolumeclaim-jenkins-volume-claim-not-found">this similar question</a>.</p> <p>Your error:</p> <pre class="lang-yaml prettyprint-override"><code>Events: Type Reason Age From Message ---- ...
<p>The use case is such that I need both JDK and Mongo images in a single container, the java process starts up the Mongo daemon process.</p>
<p>Here's the minimum Dockerfile that bake JRE 11 to the mongo image.</p> <pre><code>FROM mongo:latest # Replace the version if desired RUN apt-get update -y &amp;&amp; apt-get install openjdk-11-jre-headless -y # Install your app and stuffs here... # Override for your own command CMD [&quot;java&quot;,&quot;-versio...
<p><strong>Backstory First:</strong></p> <p>We have a deployment running that encounters intermittent 502s when trying to load test it with something like JMeter. It's a container that logs POST data to a mysql DB on another container. It handles around 85 requests per second pretty well, with no to minimal errors in J...
<p>I assume the setup is Ingress --&gt; Service --&gt; Deployment. From here <a href="https://cloud.ibm.com/docs/containers?topic=containers-ingress-types" rel="nofollow noreferrer">https://cloud.ibm.com/docs/containers?topic=containers-ingress-types</a> I conclude you are using nginx ingress controller since there is ...
<p>I'm having an issue with volumes on Kubernetes when I'm trying to mount hostPath volumes. (i also tried with PVC, but no success)</p> <p>Dockerfile:</p> <pre><code>FROM node:16 WORKDIR /usr/src/app COPY package.json /usr/src/app RUN yarn install COPY . /usr/src/app EXPOSE 3000 ENTRYPOINT [&quot;yarn&quot;, &quot;sta...
<blockquote> <p>A <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer"><code>hostPath</code></a> volume mounts a file or directory from the host node's filesystem into your Pod.</p> </blockquote> <p>To the required <code>path</code> property, you can also specify a <cod...
<p>The use case is such that I need both JDK and Mongo images in a single container, the java process starts up the Mongo daemon process.</p>
<p>You are not needed to use two base images. just use one of the base image jdk/mongo and then using binaries install mongo/jdk on top of the chosen base image.</p>
<p>I have yaml file which use to deploy my application in all the environments. I want to add some JVM args only for test environment . is there anyway i can do it in YAML file?</p> <p>here is the yaml</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: rss-site labels: app: web spec: containers: - na...
<p><code>helm</code> will do that. In fact, the syntax is almost identical to what you've put, and would be something like this:</p> <pre class="lang-yaml prettyprint-override"><code> env: - name: JAVA_OPTS value: &quot; -Dlog4j.configurationFile=log4j2.xml {{- if e...
<p>I have deployed a Pod with several containers. In my Pod I have certain environment variables that I can access in Python script with <code>os.getenv()</code>. However, if I try to use <code>os.getenv</code> to access the Container's environment variables I get an error stating they don't exist (NoneType). When I wr...
<p>The issue was in creating helm tests. In order to get the environment variables from the containers in a helm test then the environment variables need to be duplicated in the test.yaml file or injected from a shared configmap.</p>
<p>What is usually preferred in Kubernetes - having a one pod per node configuration, or multiple pods per node?</p> <p>From a performance standpoint, what are the benefits of having multiple pods per node, if there is an overhead in having multiple pods living on the same node?</p> <p>From a performance standpoint, wo...
<p>The answer to your question is heavily dependent on your workload.</p> <p>There are very specific scenarios (machine learning, big data, GPU intensive tasks) where you might have a one pod per node configuration due to an IO or hardware requirement for a singular pod. However, this is normally not a efficient use of...
<p>Using KubeEdge and I'm attempting to prevent my edgenode from getting kube-proxy deployed.</p> <p>When I attempt to add fields to daemonsets.apps with the following command:</p> <pre><code> sudo kubectl edit daemonsets.apps -n kube-system kube-proxy </code></pre> <p>With the following values</p> <pre><code>affinity:...
<p><code>affinity</code> should be placed under the pod template. Try:</p> <pre><code>spec: ... template: ... spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: node-role.kube...
<p>I am looking for a programmatic way to get available Kubernetes versions in AWS EKS. Something similar to the following Azure CLI command:</p> <pre><code>az aks get-versions --location eastus --output table </code></pre>
<p>As mentioned earlier, there is no API that explicitly returns the list of available Kubernetes versions available in AWS EKS. However, there is a somewhat hacky way to get this by describing all add-on versions available and getting the K8s versions they are compatible with.</p> <p>I guess it would be a fair assumpt...
<p>I want to set-up liveness and readiness probes for Celery worker pods. Since these worker pods doesn't have a specific port associated to them I am finding it difficult. Main Django app nginx server was easier to set-up.</p> <p>I am very new to k8s so not much familiar to the different ways to do it.</p>
<p>liveness probe for celery worker: This command only works when remote control is enabled.</p> <pre><code>$ celery inspect ping -d &lt;worker_name&gt; --timeout=&lt;timeout_time&gt; </code></pre> <p>When a celery worker uses a solo pool, healthcheck waits for the task to finish. In this case, you must increase the ti...
<p>While this question might seem duplicate at first, I would ask people to go through it once. I have checked SO, for all similar questions before posting this.</p> <p>I have an ALB ingress controller which has a registered Target Group for an application that I am trying to access via the ALB. However the target grou...
<p>I seem to have figured out the solution to the issue.</p> <p>As mentioned in the question, the ALB ingress controller sits in front of a MANY services.</p> <p>Let's name them service A and service B, service B being the one having issues with target group binding.</p> <p>For service A there were below errors from th...
<p>I have found a strange behavior in Keycloak when deployed in Kubernetes, that I can't wrap my head around.</p> <p>Use-case:</p> <ul> <li>login as admin:admin (created by default)</li> <li>click on Manage account</li> </ul> <p>(<a href="https://i.stack.imgur.com/n3wuZ.png" rel="nofollow noreferrer">manage account dia...
<p>Try to set <code>ssl_required = NONE</code> in <strong>realm</strong> table in Keycloak database to your realm (master)</p>
<p>I need to read a Kubernetes key and value from NodeJs. But am getting an undefined error.</p> <p>Please find the below code.</p> <p><strong>deployment.yaml</strong></p> <pre><code>containers: - name: server env: -name: CLIENT_DEV valueFrom: secretKeyRef: name: dev1-creds...
<p>Check the indentation in your deployment.yaml, it should be like this:</p> <pre class="lang-yaml prettyprint-override"><code>containers: - name: server env: - name: CLIENT_DEV valueFrom: secretKeyRef: name: dev1-creds-config key: clientId </code></pre> <p>In your question the ...
<p>I have a currently functioning Istio application. I would now like to add HTTPS using the Google Cloud managed certs. I setup the ingress there like this...</p> <pre><code>apiVersion: networking.gke.io/v1 kind: ManagedCertificate metadata: name: managed-cert namespace: istio-system spec: domains: - mydomai...
<p>Pointing k8s ingress towards istio ingress would result in additional latency and additional requirement for the istio gateway to use <a href="https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-sni-passthrough/" rel="nofollow noreferrer">ingress sni passthrough</a> to accept the HTTPS (already TLS...
<p>I have a .Net Core Console Application which I have containerized. The purpose of my application is to accept a file url and return the text. Below is my Dockerfile.</p> <pre class="lang-sh prettyprint-override"><code>FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:5...
<p>The <code>read-all-data</code> template looks to me like invalid YAML. I think you're missing the <code>command</code> field name. I think the path also needs either a leading <code>/</code> (for an absolute path), or to start with <code>bin/</code> (for a relative path with <code>/app</code> as the working director...
<p>I'm writing a utility script to retrieve and parse some kubernetes config maps, and typically I'll be authenticated using an oidc token.</p> <p>In the event when I'm not authenticated, how can I make my <code>kubectl</code> command exit with a failure rather than prompt for a username and password?</p> <p>Here's my ...
<p>You may use <code>&lt;/dev/null</code> in your command to <a href="https://stackoverflow.com/a/19955494/6309601">close the std input for the command</a>. Check the example below, where <code>kubectl</code> would print the result normally if things are fine(not prompted), else it will print error text.</p> <p>Using a...
<p>There is this example how to use git with kaniko image build :</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: kaniko spec: # automountServiceAccountToken: false containers: - name: kaniko image: gcr.io/kaniko-project/executor:latest args: [ &quot;--dockerfile=kaniko/dockerfile/Dockerfil...
<p><a href="https://github.com/GoogleContainerTools/kaniko/issues/1064" rel="nofollow noreferrer">https://github.com/GoogleContainerTools/kaniko/issues/1064</a></p> <p>spec.containers.args:</p> <ol> <li>give &quot;--context=git://github.com/... (root of git repo)</li> <li>give <em><strong>&quot;--context-sub-path=path...
<p>We deployed OpenSearch using Kubernetes according documentation instructions on 3 nodes cluster (<a href="https://opensearch.org/docs/latest/opensearch/install/helm/" rel="nofollow noreferrer">https://opensearch.org/docs/latest/opensearch/install/helm/</a>) , after deployment pods are on Pending state and when check...
<blockquote> <p>...no storage class is set...</p> </blockquote> <p>Try upgrade your deployment with storage class, presumed you run on AWS EKS: <code>helm upgrade my-deployment opensearch/opensearch --set persistence.storageClass=gp2</code></p> <p>If you are running on GKE, change <code>gp2</code> to <code>standard</co...
<p>I upgraded the ELK stack to version 8.0.0 and this is the error I am getting in the logs of my Kibana pod: &quot;FATAL Error: [config validation of [monitoring].enabled]: definition for this key is missing&quot;. How should I fix this? <a href="https://i.stack.imgur.com/EKQqi.png" rel="nofollow noreferrer">kibana.y...
<p>From 8.x.x, the general monitoring settings (monitoring.enabled) is no longer supported. Take a look at the settings that are at different levels in <a href="https://www.elastic.co/guide/en/kibana/current/monitoring-settings-kb.html" rel="nofollow noreferrer">Kibana's monitoring settings page</a>. For you, removing ...
<p>What is usually preferred in Kubernetes - having a one pod per node configuration, or multiple pods per node?</p> <p>From a performance standpoint, what are the benefits of having multiple pods per node, if there is an overhead in having multiple pods living on the same node?</p> <p>From a performance standpoint, wo...
<p>Running only a single pod per node has its cons as well. For example each node will need its own &quot;support&quot; pods such as metrics, logs, network agents and other system pods which most likely will not have its all resources fully utilized. Which in terms of performance would mean that selecting the correct n...
<p>Currently, I am facing an issue with my application: it does not become healthy due to the kubelet not being able to perform a successful health check.</p> <p>From pod describe:</p> <pre><code> Warning Unhealthy 84s kubelet Startup probe failed: Get &quot;http://10.128.0.208:7777/he...
<p>Issue looks to be that the istio-cni plugin changes the iptables and a re-direct of the health probe check happens towards the application. However, the re-direct happens to the localhost: and the application is not listening there for the health probes ... only on the : ...</p> <p>After changing the iptables to a m...
<p>I'm experimenting with kubernetes and a minio deployment. I have a k3s 4 node cluster, each one with 4 50GB disk. Following the instructions <a href="https://docs.min.io/minio/k8s/tenant-management/deploy-minio-tenant-using-commandline.html" rel="nofollow noreferrer">here</a> I have done this:</p> <ol> <li><p>First ...
<p>Guided by information at the <a href="https://docs.min.io/docs/how-to-secure-access-to-minio-server-with-tls.html" rel="nofollow noreferrer">Minio documentation</a>. You have to generate a public certificate. First of all generate a private key use command:</p> <pre><code>certtool.exe --generate-privkey --outfile Na...
<p>I have the ssl certificate zip file and the <code>privatekey.key</code> file. In total I have the certificate file <code>.crt</code> and another <code>.crt</code> with the name <code>bundle.crt</code> and a <code>.pem</code> file along with the private key with an extension <code>.key</code>.</p> <p>Now I am trying ...
<p>Your config files looks good. I have found very similar problem on <a href="https://discuss.istio.io/t/postman-ssl-error-unable-to-verify-the-first-certificate/12471" rel="nofollow noreferrer">discuss.istio.io</a>. The problem is resolved by following:</p> <blockquote> <p>Two servers was an error too but the importa...
<p>I have created an ingress controller using Helm with default configuration</p> <pre><code>default nginx-ingress-controller LoadBalancer 10.0.182.128 xx.xxx.xx.90 80:32485/TCP,443:31756/TCP 62m default nginx-ingress-default-backend ClusterIP 10.0.12.39 &lt;none&gt; ...
<p>For my case the issue was with ingressclass existed already. I have simply deleted the ingresclass and it worked like a charm.</p> <pre><code># kubectl get ingressclass --all-namespaces </code></pre> <p>This will return the name of already existing ingressclass. For my case, it was nginx. Delete that ingressclass.</...
<p><strong>I would like to have 100k tcp connections with single pod on google container engine.</strong></p> <p><strong>Below is my test.</strong> </p> <blockquote> <ol> <li>create 2 cluster : cluster-1( at asia-east1-c ), cluster-2( at us-central1-b ) </li> <li>cluster-1 : service, rc with replicas 1, so on...
<p>As mentioned by Alex in this <a href="https://stackoverflow.com/questions/36464890/how-to-access-client-ip-of-an-http-request-from-google-container-engine">article</a> ,</p> <p>As per your requirement, I assume you set up your service by setting the service's type to LoadBalancer? It's an unfortunate limitation of t...
<p>A node on my 5-node cluster had memory usage peak at ~90% last night. Looking around with <code>kubectl</code>, a single pod (in a 1-replica deployment) was the culprit of the high memory usage and was evicted.</p> <p>However, logs show that the pod was evicted about 10 times (AGE corresponds to around the time when...
<p>The simplest steps are to run the following commands to debug and read the logs from the specific Pod.</p> <p>Look at the <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-pod-replication-controller/#debugging-pods" rel="nofollow noreferrer">Pod's states and last restarts</a>:</p> <pre><code>...
<p>As I know the way to create a configMap in Kubernetes from a file is to use:<br /> <code>--from-file</code> option for <code>kubectl</code></p> <p>What I am looking for is a way to only load part of the yaml file into the configMap.<br /> Example: Let's say I have this yml file:</p> <pre><code>family: Boys: - ...
<p>The ConfigMap uses a key and value for its configuration. Based on your example, you get multiple arrays of data where there are multiple values with their own keys. But you can create multiple ConfigMap from different file for these issues.</p> <ol> <li>First you need to create .yaml files to create a ConfigMap gu...
<p>i installed the community kubernetes collection (<a href="https://galaxy.ansible.com/community/kubernetes" rel="nofollow noreferrer">https://galaxy.ansible.com/community/kubernetes</a>)</p> <p>run <code>ansible-galaxy collection install community.kubernetes</code> on my ansible machine and have this task to use the ...
<p>I had this issue as well. Tracked it down to having not very well documented dependencies. The new <a href="https://github.com/ansible-collections/kubernetes.core" rel="nofollow noreferrer">kubernetes.core</a> ansible package has a number of dependencies. The error you are getting is because of the AnsibleTurbo pack...
<p>I have 5M~ messages (total 7GB~) on my backlog gcp pub/sub subscription and want to pull as many as possible of them. I am using synchronous pull with settings below and waiting for 3 minutes to pile up messages and sent to another db.</p> <pre><code> defaultSettings := &amp;pubsub.ReceiveSettings{ MaxExt...
<p>If you are using synchronous pull, I suggest using <a href="https://cloud.google.com/pubsub/docs/pull#streamingpull" rel="nofollow noreferrer"><code>StreamingPull</code></a> for your scale Pub/Sub usage.</p> <blockquote> <p>Note that to achieve low message delivery latency with synchronous pull, it is important to h...
<p>As I know the way to create a configMap in Kubernetes from a file is to use:<br /> <code>--from-file</code> option for <code>kubectl</code></p> <p>What I am looking for is a way to only load part of the yaml file into the configMap.<br /> Example: Let's say I have this yml file:</p> <pre><code>family: Boys: - ...
<p>Configmaps cannot contain rich yaml data. Only key value pairs. So if you want to have a list of things, you need to express this as a multiline string.</p> <p>With that in mind you could use certain tools, such a yq to query your input file and select the part you want.</p> <p>For example:</p> <pre class="lang-sh p...
<p>I have a docker image in AWS ECR which is in my secondary account. I want to pull that image to the Minikube Kubernetes cluster using AWS IAM Role ARN where MFA is enabled on it. Due to this, my deployment failed while pulling the Image.</p> <p>I enabled the registry-creds addon to access ECR Image but didn't work o...
<p>While the <code>minikube addons</code> based solution shown by @DavidMaze is probably cleaner and generally preferable, I wasn't able to get it to work.</p> <p>Instead, I <a href="https://stackoverflow.com/questions/55223075/automatically-use-secret-when-pulling-from-private-registry">found out</a> it is possible to...
<p>Im running a pipeline that creates a kubernetes namespace but when I run it I get:</p> <pre><code>Error from server (Forbidden): namespaces is forbidden: User &quot;system:serviceaccount:gitlab-runner:default&quot; cannot create resource &quot;namespaces&quot; in API group &quot;&quot; at the cluster scope </code></...
<ul> <li>[&quot;&quot;] in clusterrole manifest it should be just <code>&quot;&quot;</code>. because [&quot;&quot;] will be array where apiGroups expects a string.</li> <li>under <code>resources</code> it should be <code>namespaces</code> not <code>namespace</code> because :</li> </ul> <pre><code>kubectl api-resources ...
<p>I am trying to find a solution to run a cron job in a Kubernetes-deployed app without unwanted duplicates. Let me describe my scenario, to give you a little bit of context.</p> <p>I want to schedule jobs that execute once at a specified date. More precisely: creating such a job can happen anytime and its execution d...
<p>After thinking about a solution for a rather long time I found it.</p> <p>The solution is to take the scheduling of the jobs to a central place. It is as easy as building a job web service that exposes endpoints to create jobs. An instance of a backend creating a job at this service will also provide a callback endp...
<p>Few pods in my openshift cluster are still restarted multiple times after deployment.</p> <p>with describe output:<br /> <code>Last State: Terminated</code> <code>Reason: OOMKilled</code><br /> <code>Exit Code: 137</code></p> <p>Also, memory usage is well below the memory limits. Any other parameter whi...
<p>„OOMKilled“ means your container memory limit was reached and the container was therefore restarted.</p> <p>Especially Java-based applications can consume a large amount of memory when starting up. After the startup, the memory usage often drops considerably.</p> <p>So in your case, increase the ‚requests.limit.memo...
<p>I'm following a tutorial <a href="https://docs.openfaas.com/tutorials/first-python-function/" rel="nofollow noreferrer">https://docs.openfaas.com/tutorials/first-python-function/</a>,</p> <p>currently, I have the right image</p> <pre class="lang-sh prettyprint-override"><code>$ docker images | grep hello-openfaas wm...
<p>If your image has a <code>latest</code> tag, the Pod's <code>ImagePullPolicy</code> will be automatically set to <code>Always</code>. Each time the pod is created, Kubernetes tries to pull the newest image.</p> <p>Try not tagging the image as <code>latest</code> or manually setting the Pod's <code>ImagePullPolicy</c...
<p>The problem: I have a spring boot service running on K8s. Generally API calls can be served by any pod of my service, but for a particular use case we have a requirement to propagate the call to all instances of the service.</p> <p>A bit of googling led me to <a href="https://discuss.kubernetes.io/t/how-to-broadcast...
<p>Seems like your spring boot service should be listening to a message queue, and when one service receives a specific HTTP request message to the <code>/propagateme</code> endpoint, it sends an event to the topic to all other clients listening to the <code>Propagation topic</code>, when the instances receive a messag...
<p>What would be the best way to set up a <a href="https://cloud.google.com/monitoring/docs" rel="nofollow noreferrer">GCP monitoring alert policy</a> for a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">Kubernetes CronJob</a> failing? I haven't been able to fin...
<p>First of all, confirm the <strong>GKE’s</strong> version that you are running. For that, the following commands are going to help you to identify the <a href="https://cloud.google.com/kubernetes-engine/versioning#use_to_check_versions" rel="nofollow noreferrer"><strong>GKE’s</strong> default version</a> and the avai...
<p>In one of our helm charts we have a values file per environment e.g.</p> <pre><code>app-helm-chart: dev-values.yaml test-values.yaml Chart.yaml templates deployment.yaml service.yaml ingress.yaml Readme.md </code></pre> <p>We have packaged up the helm chart using helm package and are then tryin...
<p>There are two answers to this question.</p> <p>First one, using your current package and repo setup, you would need to download and extract the package then call the values file from the chart folder</p> <pre><code>helm repo add test-repo http://url/to/your repo helm repo update helm fetch test-repo/my-chart-name --...
<p>I have an EKS cluster running a StatefulSet using EC2 nodes and EBS volumes for the storageclass. I want to move a pod of the StatefulSet from node 1 to node 2. I drain node 1 like so:</p> <pre><code>kubectl drain --ignore-daemonsets --delete-emptydir-data node1 </code></pre> <p>The problem is the pod doesn't come...
<p>What you need to do is</p> <ol> <li>is labels on your nodes per zone (you do that using the autoscaling group tags)</li> <li>on statefulset that requires PV you use a node selector for a specific zone: i.e. us-east-1</li> </ol> <p>That statefulset will be locked to a specific AZ but you will avoid this problem in th...
<p>I wonder if there is a way to have a deployment stop recreating new pods, when those failed multiple times. In other, given that we can't for instance have a restartPolicy never in a pod template of a Deployment, i am wondering, how can i consider a service failed and have in a stopped state. </p> <p>We have a use ...
<p>In my case I had a deployment that was in a fail and restart loop where the pod and its logs didn't stay around long enough for me to work out what had gone wrong.</p> <p>As a workaround I temporarily changed the start up command so that even if the intended start up command failed the pod would be kept alive. This...
<p>I have a kubernetes cluster with a kafka zookeeper statefulset that works fine with one pod. However, when for performance reasons I try to scale the statefulset to three pods with the following command:</p> <pre><code>kubectl scale statefulset &lt;my_zookeper_statefulset&gt; --replicas=3 </code></pre> <p>The two ne...
<p>When do you use Kafka you can't go to this way. To do this, you need to configure replicas parameter in your file. Example of <code>spec</code> properties for the <code>Kafka</code> resource:</p> <pre><code>apiVersion: YourVersion kind: Kafka metadata: name: my-cluster spec: kafka: replicas: 3 </code></...
<p>We use Terraform to create all of our infrastructure resources then we use Helm to deploy apps in our cluster.</p> <p>We're looking for a way to streamline the creation of infra and apps, so currently this is what we do:</p> <ul> <li>Terraform creates kubernetes cluster, VPC network etc and a couple of static publi...
<p>I suggest creating a static public IP in GCP using terraform by specifying the name you want like this:</p> <pre class="lang-json prettyprint-override"><code>module &quot;address&quot; { source = &quot;terraform-google-modules/address/google&quot; version = &quot;3.0.0&quot; project_id = &quot;you...
<p>Does anyone know the pros and cons for installing the CloudSQL-Proxy (that allows us to connect securely to CloudSQL) on a Kubernetes cluster as a service as opposed to making it a sidecar against the application container?</p> <p>I know that it is mostly used as a sidecar. I have used it as both (in non-production ...
<p>The sidecar pattern is preferred because it is the easiest and more secure option. Traffic to the Cloud SQL Auth proxy is not encrypted or authenticated, and relies on the user to restrict access to the proxy (typically be running local host).</p> <p>When you run the Cloud SQL proxy, you are essentially saying &quot...
<p>We keep in our Flux repo our HelmReleases. We use Kustomize to edit some of the keys in the HelmReleases. I tried using Strategic Merge patch in order to append a value into a list but instead the list was overwritten (which is the default it seems..)</p> <p>Is there a way to use <a href="https://github.com/kubernet...
<p>Personally, I prefer the solution @The Fool suggested. However, in my case that solution didn't work, might be related to Kustomize's version or the apiVersion I used (v4.4.1).</p> <p>The following is the solution I used (json patches) :</p> <p>My <code>base/servicex.yaml</code> is kept the same as i posted.</p> <p>...
<p>I got this alert:</p> <pre><code>Alert: PrometheusRuleFailures - critical Description: Prometheus monitoring/prometheus-prometheus-kube-prometheus-prometheus-0 has failed to evaluate 30 rules in the last 5m. Details: • alertname: PrometheusRuleFailures • container: prometheus • endpoint: web • instance: 1...
<p>Your best starting point is the rules page of the Prometheus UI (:9090/rules).<br /> It will show the error on specific rule(s).</p>
<p>I have a jenkins service deployed in EKS v 1.16 using helm chart. The PV and PVC had been accidentally deleted so I have recreated the PV and PVC as follows:</p> <p>Pv.yaml</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: jenkins-vol spec: accessModes: - ReadWriteOnce awsElasticBlockStore...
<p>Add following labels to the PersistentVolume.</p> <pre><code> labels: failure-domain.beta.kubernetes.io/region: us-east-2b failure-domain.beta.kubernetes.io/zone: us-east-2b </code></pre> <p>example:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: annotations: pv.beta.kubernetes.io/gid:...
<p>I'm trying deploy kubernetes ingress with terraform. As described here <a href="https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/ingress#example-using-nginx-ingress-controller" rel="nofollow noreferrer">link</a> and my own variant:</p> <pre><code>resource &quot;kubernetes_ingress&qu...
<p>The issue here is that the example in YML is using the proper API version, i.e., <code>networking.k8s.io/v1</code>, hence it works as you probably have a version of K8s higher than 1.19. It is available since that version, the <code>extensions/v1beta1</code> that Ingress was a part of was deprecated in favor of <cod...
<p><strong>Architecture</strong><br> Our web-applications are being deployed to our kubernetes cluster which are being integrated in our application gateway via the ingress extension (Azure Gateway ingress). If you navigate to the web-application, you need to sign-in and authenticate via configured app registration in ...
<p>I have found the solution via <a href="https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-6.0" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-6.0</a></p> <p>I added to my application the follow...
<p>I'm trying to deploy a simple REST API written in Golang to AWS EKS.</p> <p>I created an EKS cluster on AWS using Terraform and applied the AWS load balancer controller Helm chart to it.</p> <p>All resources in the cluster look like:</p> <pre><code>NAMESPACE NAME RE...
<p>Posting this as Community wiki for better visibility. Feel free to expand it.</p> <hr /> <p>Thanks to @David Maze, who pointed to the solution. There is an article <strong>'Build Intel64-compatible Docker images from Mac M1 (ARM)'</strong> (by Beppe Catanese) <a href="https://medium.com/geekculture/from-apple-silico...
<p>I am working on a NextJS project to create a Kubernetes Job. To create a Job on minikube, I am using config.yaml that is generally generated whenever we start the minikube. So I am using the same file to make connection with Kubernetes API. Now to make connection with kubernetes(minikube), I am using following code:...
<p>It seems there is no default export, so when using ES6 module imports, you need to either use named imports:</p> <pre><code>import { KubeConfig, CoreV1Api } from '@kubernetes/client-node'; </code></pre> <p>or import everything:</p> <pre><code>import * as k8s from '@kubernetes/client-node'; new k8s.KubeConfig(); </c...
<p>I installed Microk8s on a local physical Ubuntu 20-04 server (without a GUI):</p> <pre><code> microk8s status --wait-ready microk8s is running high-availability: no datastore master nodes: 127.0.0.1:19001 datastore standby nodes: none addons: enabled: ha-cluster # Configure high availability on t...
<p>Searching for solution for your issue, I have found <a href="https://stackoverflow.com/questions/45914420/why-tiller-connect-to-localhost-8080-for-kubernetes-api/59547001#59547001">this one</a>. Try to run:</p> <pre class="lang-yaml prettyprint-override"><code>[microk8s] kubectl config view --raw &gt; ~/.kube/config...
<p>I am currently attempting to use the lookup function via Helm 3.1 to load a variable during installation.</p> <pre><code>{{ $ingress := (lookup &quot;v1&quot; &quot;Ingress&quot; &quot;mynamespace&quot; &quot;ingressname&quot;).status.loadBalancer.ingress[0].hostname }} </code></pre> <p>Of course, this returns, &quo...
<p>You are attempting to use &quot;normal&quot; array indexing syntax, but helm charts use &quot;golang templates&quot; and thus array indexing is done via <a href="https://helm.sh/docs/chart_template_guide/function_list/#index" rel="nofollow noreferrer">the <code>index</code> function</a></p> <pre class="lang-yaml pre...
<p>Is there a way we can share the GPU between multiple pods or we need some specific model of NVIDIA GPUS?</p>
<blockquote> <p>Short answer, yes :)</p> </blockquote> <p>Long answer below :)</p> <p>There is no &quot;built-in&quot; solution to achieve that, but you can use many tools (plugins) to control GPU. First look at the <a href="https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/#v1-8-onwards" rel="nofollow noref...
<p>I am doing testing which includes the <a href="https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster" rel="nofollow noreferrer">Redis Cluster Bitnami Helm Chart</a>. However, some recent changes to the chart means that I can no longer set the <code>persistence</code> option to <code>false</code>. This ...
<p>As Franxi mentioned in the comments above and provided the PR, there is no way doing a dummy volume. Closest solution for you is to use <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir" rel="nofollow noreferrer">emptyDir</a></p> <p>Note this:</p> <blockquote> <p>Depending on your environment, e...
<p>I developed a k8s Operator, after I deploy the first Operator in first namespace, it works well. Then I deploy the 2nd Operator in second namespace, I saw the 2nd controller to get the request that's namespace still is the first name, but the expected namespace should be second.</p> <p>Please see the following code,...
<p>We are seeing a similar issue. The issue is about getting the wrong namespace. Might be a bug in controller-runtime.</p> <p>request.NamespacedName from controller-runtime is returning the wrong namespace.</p>
<p>Context: We have multiple processes that are watching the same feature flag to determine whether a restart is required, and trying to determine if we need to ensure that exactly one process calls <code>kubectl rollout restart</code>.</p> <p>Suppose <code>n</code> processes simultaneously call <code>kubectl rollout r...
<p>I didn't find the official documentation explaining how Kubernetes will behave as presented in your question.</p> <p>However, I wrote a script that will spawn the 5 rollout restart command in parallel and used the deployment.yaml below for testing, with rollingUpdate as strategy and maxSurge = maxUnavailable = 1.</p...
<p>I want to install the new cluster on 3 machines. I ran this command:</p> <pre><code>ansible-playbook -i inventory/local/hosts.ini --become --become-user=root cluster.yml but the installation failed: TASK [remove-node/pre-remove : remove-node | List nodes] ************************************************************...
<p>There could be a couple of ways how can you solve your problem. First look at <a href="https://github.com/kubernetes-sigs/kubespray/issues/8396" rel="nofollow noreferrer">this github issue</a>. Probably you can manually copy the missing file and it should work:</p> <blockquote> <p>I solved it myself.</p> <p>I copied...
<p>I am working on a requirement wherein we want to update a specific kernel parameter &quot;net.ipv4.tcp_retries2&quot; to &quot;5&quot; in the Kubernetes POD.</p> <p><strong>We are using AKS cluster v1.21.7</strong></p> <p>I tried using securityContext to set the above sysctl parameters but it failed</p> <pre><code> ...
<p>Use an init container to set:</p> <pre><code>... template: metadata: labels: app.kubernetes.io/name: weather-forecast-api app.kubernetes.io/instance: RELEASE-NAME spec: serviceAccountName: RELEASE-NAME-weather-forecast-api initContainers: - name: sysctl image: busybox secu...
<p>I am using azure AKS for Mechine learning model deployment and it automatiaclly deploys models weekly</p> <p>Now AKS produces more costs for log analytics data ingestion</p> <p>We are working to optimize the data ingestion to the log analytics</p> <p>i have two nodes in AKS</p> <p>Somehow we can reduce some data ing...
<p>The value you are getting <code>http://aka</code> is probably part of a link to some microsoft documentation. You are truncating it though when you do <code>tolower(tostring(split(Computer, '.')[0]))</code>.</p> <p>Try add <code>Computer</code> to your summarize clause so that you can get the full link:</p> <pre><co...
<p>I am trying to query <code>kubernetes secret</code> using APIs and I provided required permission to account <code>&quot;default:default&quot;</code> using the following command</p> <pre><code>kubectl create rolebinding default-viewer \ --clusterrole=view \ --serviceaccount=default:default \ --namespace=defau...
<p>You have provided access to Service account <code>default</code> of default namespace using cluster role <code>view</code>. It seems(at least in my cluster) like the cluster role <code>view</code> does not provide any permissions related to secret.</p> <pre><code> kubectl describe clusterrole view |grep -iEw 'secr...
<p>I have a couple of overlays (dev, stg, prod) pulling data from multiple bases where each base contains a single service so that each overlay can pick and choose what services it needs. I generate the manifests from the dev/stg/prod directories.</p> <p>A simplified version of my Kubernetes/Kustomize directory structu...
<p>You can try using <a href="https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/replacements/" rel="nofollow noreferrer">https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/replacements/</a></p> <p>For your scenario, if you want to reference the <code>aws-region</code> into your Se...
<p>I executed followign command</p> <pre><code>gcloud container clusters get-credentials my-noice-cluter --region=asia-south2 </code></pre> <p>and that command runs successfully. I can see the relevant config with <code>kubectl config view</code></p> <p>But when I try to kubectl, I get timeout</p> <p>kubectl config vie...
<p>If it's work from your VPC and not from outside, it's because you created a <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters" rel="nofollow noreferrer">private GKE cluster</a>. The master is only reachable through the private IP or through the autorized network.</p> <p>Speaking about ...
<p>I have a mysqldb pod and need to add a log when we run a script restorebackup.sh. The script is inside the pod and i need this log in the general logs of the pod (to access it with kubectl get logs services/mysqldb).</p> <p>There is any way to do this?</p>
<p>Generally the <code>kubectl logs</code> shows the first process's stdout (pid=1). So you could try put logs to /proc/1/fd/1 in you pod.</p> <p>An example command in pod:</p> <pre><code>echo hello &gt;&gt; /proc/1/fd/1 </code></pre> <p>Then you will able to see this <code>hello</code> by <code>kubectl logs</code>.</p...
<p>I have a kubernetes cluster with calico. I want to prevent routing through external interfaces to reach the internal <code>clusterIPs</code> of the cluster. I am planning to use <a href="https://docs.projectcalico.org/security/tutorials/protect-hosts" rel="nofollow noreferrer">this</a>.</p> <p>For which interfaces s...
<p>You should define a HostEndpoint for every network interface that you want to block/filter traffic on, and for every node in your cluster as well, since a given HostEndpoint of this type only protects a single interface on a single node.</p> <p>Also, since defining a HostEndpoint in Calico will immediately block ALL...
<p>I have an azure aks cluster and a local kubeconfig:</p> <pre><code>apiVersion: v1 kind: Config clusters: - name: my-cluster cluster: certificate-authority-data: LS0...0tCg== server: https://api-server:443 contexts: - name: my-context context: cluster: my-cluster namespace: samples user: my-co...
<p>All clients (pods, normal users using kubeconfigfile, service accounts, component clients: kubelet to kube-apiserver etc.) are suing <em>ca.crt</em> in order to recognize self-signed certificates.</p> <p>As we can see in the <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#x509-client...
<p>Trying to filter out some services with a <code>relabel_config</code>. On the target I have a label <code>app.kubernetes.io/name</code> with a value of <code>kube-state-metrics</code>.</p> <p>When I set up my <code>relabel-configs</code> I realized the <code>.</code> and the <code>/</code> are not valid according to...
<p>Prometheus changes dots <code>.</code> and slashes <code>/</code> to underscores <code>_</code> during service discovery, so you need to replace them as well: <code>app_kubernetes_io_name</code>. But this isn't the end, you may also need to add <code>__meta_kubernetes_pod_label_</code> prefix to it:</p> <pre class="...
<p>I am trying to create a Kubernetes Job with a <code>backofflimit</code> value set to <code>4</code>. So I would want to know that if there's a Pod in the Job that is failed, I would want to wait for n minutes or n seconds before the second pod is created. Is there a way how I can do it?</p> <pre><code>apiVersion: ba...
<p>You can achieve this by using <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request" rel="nofollow noreferrer">liveness probe</a></p> <p>See this example <code>Yaml</code> and <code>#you can change as per your need.</code></p> <p...
<p>I'm a newbie on K8s, and now i have some questions about his best practices.</p> <p>I'm creating a Secret to save my sensitive data and i came across kubernetes docs saying something about <code>data:</code>, where the content must be saved on base64 string and <code>stringData:</code> where is not needed, what is t...
<p>In general the &quot;stringData&quot; is more comfortable so in the &quot;stringData&quot; property you can put your data in plain text and kubernetes then writes it base64 encoded for you into the &quot;data&quot; property of the secret. If you directly want to set the &quot;data&quot; property you need to manually...
<p>I am learning the headless service of kubernetes.</p> <p>I understand the following without question (please correct me if I am wrong):</p> <ul> <li>A headless service doesn't have a cluster IP,</li> <li>It is used for communicating with stateful app</li> <li>When client app container/pod communicates with a databas...
<p>A normal Service comes with a load balancer (even if it's a ClusterIP-type Service). That load balancer has an IP address. The in-cluster DNS name of the Service resolves to the load balancer's IP address, which then forwards to the selected Pods.</p> <p>A headless Service doesn't have a load balancer. The DNS na...
<p>I checked the previous question about this topic: <a href="https://stackoverflow.com/questions/58561682/minikube-with-ingress-example-not-working">Minikube with ingress example not working</a><br> But it doesn't solve my issue, since the solution doesn't work with newer version of <strong>Kubernetes</strong>. <em>Ve...
<blockquote> <p>Well, I tried coupal of things but none of them worked out well with <code>docker driver</code></p> </blockquote> <p>As of now, there is a going issue with <a href="https://github.com/kubernetes/ingress-nginx/issues/7686" rel="nofollow noreferrer">ingress doesn't work on docker desktop kubernetes</a></p...
<p>I am an absolute beginner to Kubernetes, and I was following this <a href="https://www.youtube.com/watch?v=s_o8dwzRlu4" rel="noreferrer">tutorial</a> to get started. I have managed writing the yaml files. However once I deploy it, I am not able to access the web app.</p> <p>This is my webapp yaml file</p> <pre><code...
<p>Try these 3 options</p> <ol> <li><p>can you do the <code>kubectl get node -o wide</code> and get the ip address of node and then open in web browser <code>NODE_IP_ADDRESS:30200</code></p> </li> <li><p>Alternative you can run this command <code>minikube service &lt;SERVICE_NAME&gt; --url</code> which will give you di...
<p>I'm following a tutorial <a href="https://docs.openfaas.com/tutorials/first-python-function/" rel="nofollow noreferrer">https://docs.openfaas.com/tutorials/first-python-function/</a>,</p> <p>currently, I have the right image</p> <pre class="lang-sh prettyprint-override"><code>$ docker images | grep hello-openfaas wm...
<p>When you specify an image to pull from without a url, this defaults to <a href="https://hub.docker.com/" rel="nofollow noreferrer">DockerHub</a>. When you use <code>:latest</code> tag, it will always pull the latest image regardless of what pull policy is defined.</p> <p>So to use local built images - <em>don't use ...
<p>I have AKV integrated with AKS using CSI driver (<a href="https://learn.microsoft.com/en-us/azure/aks/csi-secrets-store-driver" rel="nofollow noreferrer">documentation</a>).</p> <p>I can access them in the Pod by doing something like:</p> <pre><code>## show secrets held in secrets-store kubectl exec busybox-secrets-...
<p>The CSI Driver injects the secrets in the pod by placing them as files on the file system. There will be one file per secret where</p> <ul> <li>The filename is the name of the secret (or the alias specified in the secret provider class)</li> <li>The content of the file is the value of the secret.</li> </ul> <p>The C...
<p>I want to start a server and a client using <code> docker run rancher/k3s:latest server</code> and <code> docker run -e K3S_TOKEN=xyz -e K3S_URL=https://&lt;server_container_name&gt;:6443 rancher/k3s:latest agent</code></p> <p>But for some reason, the server and the client aren't able to communicate with each other ...
<p>Starting your first server, you would want to expose ports. Eg:</p> <pre><code>docker run -p 6443:6443 ranger/k3s:latest server </code></pre> <p>Then, make sure the other container can resolve the FQDN for your K3S_URL, sending this to the host address where your initial server was started on. Eg:</p> <pre><code>doc...
<p>My requirement is that in my POD multiple processes are running and I want to collect the metrices for all the processes i.e (CPU AND MEMORY and other details OF all Process). Now , I want to write the output of any command I run inside my pod to stout .</p>
<blockquote> <p>A container engine handles and redirects any output generated to a containerized application's <code>stdout</code> and <code>stderr</code> streams. For example, the Docker container engine redirects those two streams to a logging driver, which is configured in Kubernetes to write to a file in JSON forma...
<p>I want to declare in yaml file command line that uses the kubectl image, for any command of `kubectl', i.e. waiting to another pod to be for ready state.</p> <p>If I run in command:</p> <pre><code>kubectl wait pod/mypod --for=condition=ready --timeout=120s </code></pre> <p>I get a true message of:</p> <blockquote> <...
<p>Your <code>kubectl run</code> command is wrong. The <code>--image=bitnami/kubectl get pods</code> part is incorrect. You need to specify just the image, not the command.<br /> Proper, working command would be</p> <pre class="lang-text prettyprint-override"><code>kubectl run test -it --rm --image=bitnami/kubectl --re...
<p>I'm following a Kubernetes tutorial, and cannot run first command (<code>minikube start --vm-driver=hyperkit</code>). I'm using a MacBook Pro Intel on macOs Monterey. I cannot make it work because of TLS error.</p> <pre><code>$ minikube start --vm-driver=hyperkit 😄 minikube v1.25.2 on Darwin 12.2.1 🆕 Kubernetes ...
<p>The <code>kubectl version</code> error helped : <a href="https://stackoverflow.com/questions/49260135/unable-to-connect-to-the-server-dial-tcp-i-o-time-out">Unable to connect to the server: dial tcp i/o time out</a></p> <p>It seems I had already played with k8s :</p> <pre class="lang-sh prettyprint-override"><code>$...