prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>when I change the <code>replicas: x</code> in my .yaml file I can see GKE autopilot boots pods up/down depending on the value, but what will happen if the load on my deployment gets too big. Will it then autoscale the number of pods and nodes to handle the traffic and then reduce back to the value specified in repli...
<p>GKE autoscale only <strong>Nodes</strong> by default, while you have to take care of your HPA deployment scaling.</p> <blockquote> <p>Autopilot: GKE provisions and manages the cluster's underlying infrastructure, including nodes and node pools, giving you an optimized cluster with a hands-off experience.</p> </block...
<p>Application is deployed on K8s using StatefulSet because of stateful in nature. There is around 250+ pods are running and HPA has been implemented on it too that can scale upto 400 pods.</p> <p>When new deployment occurs, it takes longer time (~ 10-15m) to update all pods in Rolling Update fashion.</p> <p><strong>Pr...
<p>The solution is to do a <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/statefulset#partitioning_rolling_updates" rel="nofollow noreferrer">partitioning rolling update</a> along with a <a href="https://cloud.google.com/architecture/implementing-deployment-and-testing-strategies-on-gke#perform_a_can...
<p>when I change the <code>replicas: x</code> in my .yaml file I can see GKE autopilot boots pods up/down depending on the value, but what will happen if the load on my deployment gets too big. Will it then autoscale the number of pods and nodes to handle the traffic and then reduce back to the value specified in repli...
<p>GKE autopilot by default will not scale the replicas count beyond what you specified. This is the default behavior of Kubernetes in general.</p> <p>If you want automatic autoscaling you have to use Horizental Pod Autoscaler (<a href="https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling" ...
<p>I installed <a href="https://github.com/kubernetes-sigs/kind" rel="nofollow noreferrer">kind</a> to play around with Kubernetes.</p> <p>If I use <code>top</code> and sort by CPU usage (key <code>C</code>), then I see that <code>kube-apiserver</code> is constantly consuming 5 to 10% CPU.</p> <p>Why?</p> <p>I don't ha...
<p>Even in an empty cluster with just one master node, there are at least 5 components that reach out to the API server on a regular basis:</p> <ul> <li>kubelet for the master node</li> <li>Controller manager</li> <li>Scheduler</li> <li>CoreDNS</li> <li>Kube proxy</li> </ul> <p>This is because API Server acts as the on...
<p>I'm using Google Cloud Load Balancer as the ingress controller to my GCP Kubernetes application. I want all requests to <code>www.my_domain.com</code> to be redirected to <code>my_domain_.com</code>. </p> <p>Note: My GCLB is configured with an SSL certificate that is valid for both <code>www.my_domain.com</code> ...
<p>Redirect rules are supported when you switch your &quot;Host and path rules&quot; from the &quot;Simple host and path rule&quot; to the &quot;Advanced host and path rule&quot; option now. This advanced option allows for URL redirect and URL rewrite.</p> <p>Edit your Load Balancer, go to &quot;Host and path rules&quo...
<p>I am trying to create a network policy for the following conditions but does not seem to work. What am I doing wrong? Any help is much appreciated</p> <ul> <li>create a network policy namespace project-e</li> <li>the policy should allow all pods in namespace <strong>project-app</strong> to connect to <strong>port 8...
<ul> <li><p>since you want to allow all the pods from namespace which has a label &quot;name: project-app&quot; to namespace <code> project-e</code>.</p> </li> <li><p>You can remove the the <code> matchLables:{}</code> in <code>podSelector</code> as following :</p> </li> </ul> <pre><code>kind: NetworkPolicy metadata: ...
<p>I'm learning Kubernetes and below are the yaml configuration files: mongo-config.yaml</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: mongo-config data: mongo-url: mongo-service </code></pre> <p>mongo-secret.yaml:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: mongo-secret type: Opaqu...
<p>You have <code>secretKeyRef</code> in:</p> <pre><code>- name: DB_URL valueFrom: secretKeyRef: name: mongo-config key: mongo-url </code></pre> <p>You have to use <code>configMapKeyRef</code></p> <pre><code> - name: DB_URL valueFrom: configMapKeyRef: name: mongo-config ...
<p>I have a 3-node OKE cluster setup in Oracle cloud.</p> <p>I deployed an nginx ingress controller in the cluster. I'm mapping the FQDN test.myapp.com to the EXTERNAL_IP of that nginx ingress controller service.</p> <p>Whenever I re-install the ingress controller during the time of testing, it gets different EXTERNAL_...
<p>Oracle cloud Infrastructure(OCI) supports creating <code>LoadBalancer</code> services in kubernetes clusters, and allows setting the <code>LoadBalancerIP</code> parameter too.</p> <p>But first, you have to create a <strong>Reserved Public IP address</strong> in OCI, and then specify that IP address as <code>LoadBala...
<p>I have several secrets that are mounted and need to be read as a properties file. It seems kubernetes can't mount them as a single file so I'm trying to concatenate the files after the pod starts. I tried running a cat command in a postStart handler but it seems execute before the secrets are mounted as I get this e...
<p>You need a shell session for your command like this:</p> <pre><code>... lifecycle: postStart: exec: command: [&quot;/bin/sh&quot;,&quot;-c&quot;,&quot;cat /properties/S3Secret /properties/S3Key &gt;&gt; /properties/dbPassword&quot;] ... </code></pre>
<p>While running a spark job with a Kubernetes cluster, we get the following error:</p> <pre><code>2018-11-30 14:00:47 INFO DAGScheduler:54 - Resubmitted ShuffleMapTask(1, 58), so marking it as still running. 2018-11-30 14:00:47 WARN TaskSetManager:66 - Lost task 310.0 in stage 1.0 (TID 311, 10.233.71.29, executor 3...
<p>This is because of your spark job do not have enough storage to store temporary cache data</p> <p>First you need to inspect your pod deployment, to identify the volume name that will be used for mounting such as <code>spark-local-dir-1</code> Then dive into your spark executor pod, print out <code>$SPARK_LOCAL_DIR</...
<p>I have the following file:</p> <pre><code># HELP container_cpu_usage_seconds_total [ALPHA] Cumulative cpu time consumed by the container in core-seconds # TYPE container_cpu_usage_seconds_total counter container_cpu_usage_seconds_total{container=&quot;coredns&quot;,namespace=&quot;kube-system&quot;,pod=&quot;coredns...
<p>You could convert your file to JSON using <a href="https://github.com/prometheus/prom2json" rel="nofollow noreferrer">https://github.com/prometheus/prom2json</a></p> <p>Then it's jq all the way down, if you wish. E.g. with your input:</p> <pre><code>prom2json sample.prom | jq ' .[] | .metrics |= map(select(.label...
<p>Trying to use Varnish operator to setup Varnish cache in Kubernetes, added Helm chart and deployed repo but pod status is still pending.</p> <p>Here is the link I followed <a href="https://ibm.github.io/varnish-operator/quick-start.html" rel="nofollow noreferrer">https://ibm.github.io/varnish-operator/quick-start.ht...
<p>Thanks @Eugene i had look for events in namespace</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>LAST SEEN</th> <th>TYPE</th> <th>REASON</th> <th>OBJECT</th> <th>MESSAGE</th> </tr> </thead> <tbody> <tr> <td>2m29s</td> <td>Warning</td> <td>FailedScheduling</td> <td>pod/varnish-operator-5...
<p>We are thinking about migrating our infrastructure to Kubernetes. All our Source-code is in GitHub, Docker containers are in Docker Hub.</p> <p>I would like to have a CI/CD pipeline for Kubernetes only using GitHub and Docker Hub. Is there a way?</p> <p>If not, what tools (as few as possible) should we use?</p>
<p>You can go it as per need using the Github Action and Docker hub only.</p> <p>You should also checkout the keel with GitHub :<a href="https://github.com/keel-hq/keel" rel="nofollow noreferrer">https://github.com/keel-hq/keel</a></p> <p><strong>Step: 1</strong></p> <pre><code>name: Stable Build on: push: tags: ...
<p>I got an alert while configuring the monitoring module using <code>prometheus/kube-prometheus-stack 25.1.0</code>.</p> <p><strong>Alert</strong></p> <pre><code>[FIRING:1] KubeProxyDown - critical Alert: Target disappeared from Prometheus target discovery. - critical Description: KubeProxy has disappeared from Prome...
<p>There was a change in <code>metrics-bind-address</code> in <code>kube-proxy</code>. Following the issues posted <a href="https://stackoverflow.com/questions/60734799/all-kubernetes-proxy-targets-down-prometheus-operator">here</a>, <a href="https://github.com/helm/charts/issues/16476" rel="noreferrer">here</a> and <a...
<p>Per Flink's doc, we can deploy a standalone Flink cluster on top of Kubernetes, using Flink’s standalone deployment, or deploy Flink on Kubernetes using native Kubernetes deployments.</p> <p>The document says</p> <blockquote> <p>We generally recommend <strong>new</strong> users to deploy Flink on Kubernetes using na...
<p>Posted community wiki based on other answers - <a href="https://stackoverflow.com/questions/63270800/how-different-is-the-flink-deployment-on-kubernetes-and-native-kubernetes/63272753#63272753">David Anderson answer</a> and <a href="https://stackoverflow.com/questions/67142140/flink-on-kubernetes/67154143#67154143">...
<p>I would like to provide secrets from a Hashicorp Vault for the Apache Flink jobs running in a Kubernetes cluster. These credits will be used to access a state-backend for checkpointing and savepoints. The state-backend could be for example Minio S3 storage. Could someone provide a working example for a <a href="http...
<p>Once you have vault variables set</p> <p>You can add the annotation in deployment to get variables out of the vault to deployment</p> <pre><code>annotations: vault.hashicorp.com/agent-image: &lt;Agent image&gt; vault.hashicorp.com/agent-inject: &quot;true&quot; vault.hashicorp.com/agent-injec...
<p>I have generated a list of keyspaces along with their size and ttl (715 keyspaces) and trying to analyze which keyspace is consuming huge memory. I can see that total memory occupied by the keyspaces is 1.2 MB but my Redis PVC is filled up to 13 GB. So, what is occupying so much memory in Redis container ?</p> <p>Re...
<p>Documentation of what is stored in GitLab's redis cache can be found <a href="https://docs.gitlab.com/ee/development/redis.html#redis-instances" rel="nofollow noreferrer">here</a> and <a href="https://gitlab.com/gitlab-com/runbooks/-/blob/master/docs/redis/redis-survival-guide-for-sres.md#what-do-we-store" rel="nofo...
<p>Is there any existing ansible module I can use for the following. I can wait for <code>kubectl get nodes</code> <code>STATUS</code>=<code>Ready</code>?</p> <pre><code>$ kubectl get nodes NAME STATUS ROLES AGE VERSION master1 NotReady master 42s v1.8.4 </code></pre>
<h2> The <code>kubectl wait</code> command </h2> <p>Kubernetes supports the use of <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait" rel="noreferrer">kubectl wait</a> from version v1.11.<br> It waits for a specific condition on one or many resources.</p> <p>Using the kubectl wait co...
<p>I'm following the quickstart guide <a href="https://kubernetes.github.io/ingress-nginx/deploy/#aws" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#aws</a> to install it on an aws eks cluster. The cluster runs in a private subnet and will receive traffic via a cloudflare argo tunnel.</p...
<p>what worked for me was to download the installation file (<a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/aws/deploy.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/aws/dep...
<p>I use aws-load-balancer-eip-allocations assign static IP to LoadBalancer service using k8s on AWS. The version of EKS is v1.16.13. The doc at <a href="https://github.com/kubernetes/kubernetes/blob/v1.16.0/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go#L208-L211" rel="nofollow noreferrer">https://github.com/kub...
<p>have in mind that you need 1 EIP per subnet/zone and by default EKS uses a minimum of 2 zones.</p> <p>This is a working example you may found useful:</p> <pre><code>metadata: annotations: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp service.beta.kubernetes.io/aws-load-balancer-cross-z...
<p>I generated a private key and and a new certificate from SSL.com and now I want to use these to sign the certificates in my Kubernetes cluster. I followed the below method to create the new issuer.</p> <p><a href="https://cert-manager.io/docs/configuration/ca/" rel="nofollow noreferrer">https://cert-manager.io/docs/...
<p>CA certificates have a <strong>basicConstraint</strong> extension which is set to <strong>CA:True</strong>. Your normal, run of the mill, end-entity certificate does not have this extension set as above, which is why you are seeing this error. That is, you cannot sign other certificates with an end-entity certific...
<p>What is the default value for the allowVolumeExpansion? I create my volumes through a statefulset from apiVersion: apps/v1 volumeClaimTemplates In the case that the answer is false, how can I change it to true?</p> <p>Potentially relevant info: the cluster running on GKE autopilot.</p>
<p>You can find out by looking into the StorageClass that your claim is using <code>kubectl describe StorageClass &lt;name&gt;</code></p> <pre><code>volumeClaimTemplates: - ... spec: storageClassName: &lt;name&gt; # &lt;-- check using this name </code></pre> <p>Recent version of GKE the default is true. More abo...
<p>I have some kubernetes applications that log to files rather than stdout/stderr, and I collect them with Promtail sidecars. But since the sidecars execute with &quot;localhost&quot; target, I don't have a <code>kubernetes_sd_config</code> that will apply pod metadata to labels for me. So I'm stuck statically declari...
<p>You can do the following:</p> <p>In the sidecar container, expose the pod name, node name and other information you need as environment variables, then add the flag <code>'-config.expand-env'</code> to enable environment expansion inside promtail config file, e.g.:</p> <pre class="lang-yaml prettyprint-override"><co...
<p>we are testing out the Ambassador Edge Stack and started with a brand new GKE private cluster in autopilot mode.</p> <p>We installed from scratch following the quick start tour to get a feeling of it and ended up with the following error</p> <pre><code>Error from server: error when creating &quot;mapping-test.yaml&q...
<p>I think i found the solution, posting here if someone come across this later on.</p> <p>So i followed <a href="https://www.getambassador.io/docs/edge-stack/latest/tutorials/getting-started/" rel="noreferrer">this</a> to deploy Ambassador Edge Stack in a Autopilot private cluster. I was getting the same error when i ...
<p>How can I configure internode encryption (i.e., TLS) for Cassandra in K8ssandra?</p>
<p>K8ssandra 1.4.0 included some changes that should make it possible to configure TLS. For reference this is the <a href="https://github.com/k8ssandra/k8ssandra-operator/issues/235" rel="nofollow noreferrer">ticket</a>, and this is the corresponding <a href="https://github.com/k8ssandra/k8ssandra/pull/1180" rel="nofol...
<p>In one of our customer's kubernetes cluster(v1.16.8 with kubeadm) RBAC does not work at all. We creating a ServiceAccount, read-only ClusterRole and ClusterRoleBinding with the following yamls but when we login trough dashboard or kubectl user can almost do anything in the cluster. What can cause this problem?</p> <...
<p>What you have defined is only control the service account. Here's a tested spec; create a yaml file with:</p> <pre><code>apiVersion: v1 kind: Namespace metadata: name: test --- apiVersion: v1 kind: ServiceAccount metadata: name: test-sa namespace: test --- kind: ClusterRoleBinding # &lt;-- REMINDER: Cluster w...
<p>We want to fetch cost at namespace level in a K8S cluster Azure (AKS), we are using a tool called kubecost to get cost incurred by each namespace, kubecost is an efficient tool which provides these information. I have setup the secrets for kubecost to access the Rate API, so will the cost of resources be fetched bas...
<p>I have used Kubecost and have found that it is best out there for namespace level cost reporting.</p> <blockquote> <p>Kubecost provides accurate Spot pricing using the AWS Spot Instance data feed. It can also assist with pod right-sizing. It tracks the declared requests for containers and provides recommendations ba...
<p>I am running spark 3.1.1 on kubernetes 1.19. Once job finishes executor pods get cleaned up but driver pod remains in completed state. How to clean up driver pod once it is completed? any configuration option to set?</p> <pre><code>NAME READY STATUS RESTARTS AGE my-...
<p>Concerning the initial question &quot;Spark on Kubernetes driver pod cleanup&quot;, it seems that there is no way to pass, at spark-submit time, a TTL parameter to kubernetes for avoiding the never-removal of driver pods in completed status.</p> <p>From Spark documentation: <a href="https://spark.apache.org/docs/lat...
<p>I'm following the quickstart guide <a href="https://kubernetes.github.io/ingress-nginx/deploy/#aws" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#aws</a> to install it on an aws eks cluster. The cluster runs in a private subnet and will receive traffic via a cloudflare argo tunnel.</p...
<p>i would suggest try applying this changes,</p> <p><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-0.32.0/deploy/static/provider/aws/deploy.yaml</code></p> <p>The change that you have is for <strong>internal</strong> load balancer that wont give you a public exposed IP or ...
<p>I have a microservice application in one repo that communicates with another service that's managed by another repo. This is not an issue when deploying to cloud, however, when devving locally the other service needs to be deployed too.</p> <p>I've read this documentation: <a href="https://skaffold.dev/docs/design/c...
<p>Profiles can be <a href="https://skaffold.dev/docs/environment/profiles/#activation" rel="nofollow noreferrer">automatically activated</a> based on criteria such as environment variables, kube-context names, and the Skaffold command being run.</p> <p>Profiles are processed after resolving the config dependencies tho...
<p>my containers run in kubernetes and I saw lots of OOM from kubernetes Node log. All the logs only have process id information. it's hard to dig what containers OOM. I don't know how to find container id by the host process Id.</p> <p>Is there any way i can get host process id within container so that i can get a m...
<p>How to find pod name by the host process Id?</p> <blockquote> <p>nsenter -t $PID -u hostname</p> </blockquote> <p>Then you can find container id easily, I think.</p>
<h3>What I'm trying to achieve</h3> <p>I'm trying to deploy an elixir (phoenix) application in a microk8s cluster namespace with TLS using let's encrypt. The cluster is hosted on an AWS EC2 instance.</p> <h3>The problem I'm facing</h3> <ul> <li>The ingress is created in the namespace</li> <li>ingress routes to the corr...
<p>I found out that you can actually check for certificates with kubectl: <code>kubectl get certificate -n production</code></p> <p>The status of this certificate was READY = FALSE.</p> <p>I checked the description: <code>kubectl describe certificate &lt;certificate_name&gt; -n production</code></p> <p>At the bottom it...
<p>I want to create a Kubernetes CronJob that deletes resources (Namespace, ClusterRole, ClusterRoleBinding) that may be left over (initially, the criteria will be &quot;has label=Something&quot; and &quot;is older than 30 minutes&quot;. (Each namespace contains resources for a test run).</p> <p>I created the CronJob, ...
<p>You need to change your ClusterRole like this :</p> <pre><code>apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: my-app labels: app: my-app rules: - apiGroups: [&quot;&quot;] resources: - namespaces verbs: [list, delete] - apiGroups: [&quot;rbac.authorization.k8s.io...
<p>Evening!</p> <p>I'm wondering if anyone could share the steps for updating the certificates on OpenShift + Kubernetes 4.6? I've checked using the below command and some are expired.</p> <p><code>find /etc/kubernetes/ -type f -name &quot;*.crt&quot; -print|egrep -v 'ca.crt$'|xargs -L 1 -t -i bash -c 'openssl x509 ...
<p>Did you check the official doc on that subject?<br /> It may help you<br /> <a href="https://docs.openshift.com/container-platform/4.6/backup_and_restore/control_plane_backup_and_restore/disaster_recovery/scenario-3-expired-certs.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/4.6/backu...
<p>I want to set up a EKS cluster, enabling other IAM users to connect and tinker with the cluster. To do so, <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">AWS recommends patching a config map</a>, which I did. Now I want to enable the same “feature” using terra...
<p>I use 17.24.0 and have no idea what is new with 18.0.3.</p> <p>In my case, I follow this example: <a href="https://github.com/terraform-aws-modules/terraform-aws-eks/blob/v17.24.0/examples/complete/main.tf" rel="nofollow noreferrer">https://github.com/terraform-aws-modules/terraform-aws-eks/blob/v17.24.0/examples/co...
<p>Has anyone tried out nested kubernetes cluster inside kubernetes, I want to emulated sandboxed a small kubernetes cluster inside my running kubernetes cluster and not again use VM's again and again for new cluster. </p> <p>New clusters I want to used for testing and trail of various features of kubernetes, has anyo...
<p>I realize this question is way old and the landscape has changed dramatically, but just in case anyone else ends up here in 2022, make sure you look into Kubernetes-in-Docker (KinD) for this kind of situation: <a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">https://kind.sigs.k8s.io/</a></p> <p>This all...
<p>I want to edit my <code>Nginx.conf</code> file present inside Nginx controller pod in AKS, but the edit command is not working using the exec command, is there any way else I could edit my <code>nginx.conf</code>.</p> <p>the command which I tried:</p> <pre><code>kubectl exec -it nginx-nginx-ingress-controller -n ngi...
<p>yh, seems this is also working. tried an alternative way:</p> <p><code>Edit/add</code> the properties to change in <code>ingress.yaml</code> and redeploy it. the changes will then reflect in <code>nginx.conf</code></p>
<p>I have an Argo workflow with dynamic fan-out tasks that do some map operation (in a Map-Reduce meaning context). I want to create a reducer that aggregates their results. It's possible to do that when the outputs of each mapper are small and can be put as an output parameter. See <a href="https://stackoverflow.com/q...
<p>Artifacts are more difficult to aggregate than parameters.</p> <p>Parameters are always text and are generally small. This makes it easy for Argo Workflows to aggregate them into a single JSON object which can then be consumed by a &quot;reduce&quot; step.</p> <p>Artifacts, on the other hand, may be any type or size...
<p>my problem is why ingress doesnt assigne an Address for the services?</p> <p>first of all i create 3 deployments:</p> <pre><code>kubectl create deployment cheddar --image=errm/cheese:cheddar kubectl create deployment stilton --image=errm/cheese:stilton kubectl create deployment wensleydale --image=errm/cheese:wensle...
<p>If you're using this cluster bare-metal, you'll have to use something like metallb. Kubernetes does not implement network load balancers and therefore will not be able to assign an ip address to your ingress.</p> <p>Since you're using microk8s, you can use <code>microk8s enable metallb</code></p> <p>If you're using ...
<p>How do I have to specify the comments like <code>+kubebuilder:printcolumn</code> to add columns to the output of the command <code>kubectl get my-crd.my-group.my-domain.com</code>?</p> <p>I've a CRD (Custom Resource Definition) with the usual <code>struct</code>s for the specs and the status (similar to what's expla...
<p>The solution was to add the code to update the resource status in the <strong>reconciler method</strong> of the controller - <code>Reconcile(ctx context.Context, req ctrl.Request)</code>, like this:</p> <pre class="lang-golang prettyprint-override"><code> // Update the status for &quot;last deploy time&quot; of a...
<p>I was wondering if is possible to get resources from <a href="https://kustomize.io/" rel="noreferrer">kustomize</a> in a private GitHub repository, I already tried something like this without success</p> <pre><code>apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - git@github.com:gituser/...
<p>Your remote resource needs to resolve to a <em>directory</em> that contains a <code>kustomization.yaml</code> file. That is, instead of:</p> <pre><code>apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - git@github.com:gituser/kustomize.git/kustomize/main/nginx.yaml </code></pre> <p>You need...
<p>I have created a k8s cluster with kops (1.21.4) on AWS and as per the <a href="https://kops.sigs.k8s.io/addons/#cluster-autoscaler" rel="nofollow noreferrer">docs on autoscaler</a>. I have done the required changes to my cluster but when the cluster starts, the cluster-autoscaler pod is unable to schedule on any nod...
<p>Posting the answer out of comments.</p> <hr /> <p>There are <code>podAffinity</code> rules in place so first thing to check is if any errors in scheduling are presented. Which is the case:</p> <pre><code>0/4 nodes are available: 1 Too many pods, 3 node(s) didn't match Pod's node affinity/selector. </code></pre> <p>S...
<p>AWS supports <a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html" rel="noreferrer">IAM Roles for Service Accounts (IRSA)</a> that allows cluster operators to map AWS IAM Roles to Kubernetes Service Accounts.</p> <p>To do so, one has to create an <a href="https://eksctl.io/us...
<p>I am adding my answer here because I stumble upon the same issue, and accepted answer (and other answers above), do not provide full resolution to the issue - no code examples. They are just guidelines which I had to use to research much deeper. There are some issues which is really easy to miss - and without code e...
<p>I'm trying to add a Container Insight to my EKS cluster but running into a bit of an issue when deploying. According to my logs, I'm getting the following:</p> <pre><code>[error] [output:cloudwatch_logs:cloudwatch_logs.2] CreateLogGroup API responded with error='AccessDeniedException' [error] [output:cloudwatch_logs...
<p>For anyone running into this issue: within the quickstart yaml, there is a fluent-bit service account that must be removed from that file and created manually. For me I created it using the following command:</p> <pre><code>eksctl create iamserviceaccount --region ${env:AWS_DEFAULT_REGION} --name fluent-bit --namesp...
<p>My kubernetes application is made of several flavors of nodes, a couple of “schedulers” which send tasks to quite a few more “worker” nodes. In order for this app to work correctly all the nodes must be of exactly the same code version.</p> <p>The deployment is performed using a standard ReplicaSet and when my CICD ...
<p>I also had such a situation. Kubernetes alone cannot satisfy your requirement, I was also not able to find any tool that allows to coordinate multiple deployments together (although <a href="https://flagger.app/" rel="nofollow noreferrer">Flagger</a> looks promising).</p> <p>So the only way I found was by using CI/C...
<p>I have just set up a kubernetes cluster on bare metal using kubeadm, Flannel and MetalLB. Next step for me is to install ArgoCD.</p> <p>I installed the ArgoCD yaml from the &quot;Getting Started&quot; page and logged in.</p> <p>When adding my Git repositories ArgoCD gives me very weird error messages: <a href="https...
<p>I solved my problem!</p> <p>My /etc/resolv.conf had two lines that caused trouble:</p> <pre><code>domain &lt;my domain&gt; search &lt;my domain&gt; </code></pre> <p>These lines were put there as a step in the installation of my host machine's OS that I did not realize would affect me in this way. After removing thes...
<p>It looks like Docker Desktop for Mac is using a 1.22+ version of Kubernetes which introduces a number of breaking changes specifically to the <code>ingress-nginx</code> controller <code>apiVersion</code>. This is causing issues with our local development cluster.</p> <p>There are couple options:</p> <ol> <li>Rolling...
<p>As best as I could determine, there is not a way to do this. (Please correct me if I'm wrong).</p> <p>The options appear to just be:</p> <ol> <li>Downgrade Docker Desktop for Mac to a version that has the version of Kubernetes that you want. Can find previous versions here: <a href="https://docs.docker.com/desktop/m...
<p>I'd like to edit my secrets. The only way I'm aware of is <code>kubectl edit secret mysecret</code> which gets me yaml blob to edit. However, all secrets are base64 encoded which isn't an easy way to edit them.</p> <p>Can I mount secrets to local volume somehow? Can I extract secrets to my localhost and edit them t...
<p><strong>I would highly recommend on using</strong> <a href="https://github.com/derailed/k9s" rel="nofollow noreferrer">k9s</a> (not only for this purpose, but also as a lightweight k8s CLI management tool).</p> <p>As you can see below (ignore all white placeholders), when your cluster's context is set on terminal yo...
<p>I am trying to migrate a socket io service from GCP (App Engine) to a kubernetes cluster. Everything works fine on the GCP side (we have one instance of the server without replicas). The migration to k8s is going very well, except that when connecting the client socket to the server, it does not receive some informa...
<p>I found the solution in the day.and share it.</p> <p>In fact, the problem is not due to the kubernetes Cluster but due to the socket io and socket io redis adapter version.</p> <p>I was using <code>socket.io: 3.x.x</code> and using <code>socket.io-redis: 5.x.x</code> In fact, i need to use the <code>socket.io-redis:...
<p>I am new to the world of Spark and Kubernetes. I built a Spark docker image using the official Spark 3.0.1 bundled with Hadoop 3.2 using the docker-image-tool.sh utility.</p> <p>I have also created another docker image for Jupyter notebook and am trying to run spark on Kubernetes in client mode. I first run my Jupyt...
<p>Applying the solution provided here...</p> <p><a href="https://stackoverflow.com/questions/42978976/how-do-we-specify-maven-dependencies-in-pyspark">How do we specify maven dependencies in pyspark</a></p> <p>We can start a Spark session and include the required Jar from Maven.</p> <pre><code>from pyspark.sql import ...
<p>I would like to set the value of <code>terminationMessagePolicy</code> to <code>FallbackToLogsOnError</code> by default for all my pods.</p> <p>Is there any way to do that?</p> <p>I am running Kubernetes 1.21.</p>
<p><code>terminationMessagePolicy</code> is a field in container spec, currently beside set it in your spec there is no cluster level setting that could change the default value (&quot;File&quot;).</p>
<p>I have created a YAML file its only job is: <code>It should immediately redirect to google.com</code></p> <p>but it just doesn't work...</p> <p>my <code>localhost</code> still returns <code>404-nginx</code></p> <p>I'm on docker-desktop and my cluster version is <code>v1.21.5</code></p> <p>here is my <code>redirect.y...
<p>I guess you forgot the ingress class name.</p> <pre class="lang-yaml prettyprint-override"><code>spec: ingressClassName: nginx ... </code></pre> <p>Apart from that, you can create an <a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="nofollow noreferrer">external service...
<p>I am trying to run my node application (which successfully runs on my PC with Docker Desktop) through Kubernetes. This is a raspberry pi multi-node ubuntu kubeadm server (everything is latest stable version). I do have successful pods running on this server. I followed <a href="https://kubernetes.io/docs/tasks/confi...
<p>The secret key must be in the same place as the distribution namespace.</p> <p>If you want to connect your docker secret to kubernetes you can use below method.</p> <p><strong>Create a Secret based on existing Docker credentials</strong> (<a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-p...
<p>I was looking for a solution but I couldn't find any.</p> <p>I have a bash script which executes something like this:</p> <pre class="lang-sh prettyprint-override"><code>kubectl get services -o=json | \ jq '.items[].metadata.annotations | '\ 'select (.&quot;my-ingress/enabled&quot; == &quot;true&quot;) | '\ '{...
<p>You may use <a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#using-the-lookup-function" rel="nofollow noreferrer">HELM's lookup function</a> to query the cluster</p> <blockquote> <p>The lookup function can be used to look up resources in a running cluster. The synopsis of the lookup functi...
<p>I've installed ArgoCD on my kubernetes cluster using</p> <pre><code>kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml </code></pre> <p>Now, how to remove it from the cluster totally?</p>
<p>You can delete the entire installation using this - <code>kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</code></p> <p><a href="https://www.reddit.com/r/kubernetes/comments/kayu97/how_to_uninstall_argocd/gfdlufl/" rel="noreferrer">Reference</a></p>
<p>I would like to set the value of <code>terminationMessagePolicy</code> to <code>FallbackToLogsOnError</code> by default for all my pods.</p> <p>Is there any way to do that?</p> <p>I am running Kubernetes 1.21.</p>
<p>Community wiki answer to summarise the topic.</p> <p>The answer provided by the <a href="https://stackoverflow.com/users/14704799/gohmc">gohm'c</a> is good. It is not possible to change this value from the cluster level. You can find more information about it <a href="https://kubernetes.io/docs/tasks/debug-applicati...
<p>We are using Istio Envoy based Rate limiting (with Kubernetes &amp; Docker) as specified in <a href="https://istio.io/latest/docs/tasks/policy-enforcement/rate-limit/" rel="nofollow noreferrer">this documentation</a>.</p> <p>Although I was able to set it up for local and global rate limiting in the Kubernetes cluste...
<p>I will try to answer both of your questions below.</p> <h4>1. Rate limit a Service only for a specific request method</h4> <p>We can use the <a href="https://www.envoyproxy.io/docs/envoy/v1.14.5/api-v2/api/v2/route/route_components.proto#envoy-api-msg-route-ratelimit-action-headervaluematch" rel="nofollow noreferrer...
<p>I'm trying to setup a ingress network for my Google GKE, I have tested locally on Minikube and its working as I expect.</p> <p>When I hit the domain with the prefix /test-1 or /test-2 its sending me to the root of the my service /.</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: api-t...
<p>GKE Built-in Ingress supports wildcard but with some <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress#multiple_backend_services" rel="nofollow noreferrer">conditions</a>. From the doc:</p> <pre><code>The only supported wildcard character for the path field of an Ingress is the * character. T...
<p>I am trying to use Kubernetes volumes for Nginx, but am facing an issue with it. After volumes are set Nginx is unable to serve the HTML page. Also am tried with PV and PVS this time also got the same error.</p> <p>nginx.yml</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment lab...
<p>First, create folder that you want to mount inside minikube:</p> <pre><code>dobrucki@minikube:~$ minikube ssh Last login: Tue Jan 11 13:54:50 2022 from 192.168.49.1 docker@minikube:~$ ls -l total 4 drwxr-xr-x 2 docker docker 4096 Jan 11 13:56 nginx-mount </code></pre> <p>This folder is what is mapped to <code>/usr/...
<p>I’m trying to set some environment variables in k8s deployment and use them within the <code>application.properties</code> in my spring boot application, but it looks like I'm doing something wrong because spring is not reading those variables, although when checking the <code>env vars</code> on the pod, all the var...
<p>The DockerFile was wrong. Everything is working fine after changing the DockerFile to this:</p> <pre><code>FROM maven:3.6.3-openjdk-11-slim as builder WORKDIR /app COPY pom.xml . COPY src/ /app/src/ RUN mvn install -DskipTests=true FROM adoptopenjdk/openjdk11:jre-11.0.8_10-alpine COPY --from=builder /app/target/...
<p>I have a problem with minikube when I want to create deployment manifest files, I receive an error when I write this code: <code>minikube kubectl create -f .</code> I got this Error:</p> <p>Error: unknown shorthand flag: 'f' in -f See 'minikube kubectl --help' for usage.</p> <p>but not only this, I try to write anot...
<p>AFAIK, --all is not a valid flag. Valid flag is --all-namespaces or just -A.</p> <p>However, &quot;kubectl delete&quot; does not take -A as it needs the resource name for deletion.</p> <p>To accomplish what you are trying to do you will have to write a loop to delete the objects 1 by one using</p> <pre><code>kubectl...
<p>I am trying to access my microservice &quot;externalforum-api-svc&quot; inside my kubernetes cluster using ocelot gateway. I`ve followed the docs but it does not seem to be working.</p> <p>Can someone please tell me whats wrong with it?</p> <p>I want to deploy the ocelot api gateway as clusterIP and use Ingress to a...
<p>Try to change &quot;type : kube&quot; to &quot;type : KubernetesServiceDiscoveryProvider&quot; in GlobalConfiguration section.</p>
<p>I'm trying to add a custom function In Go template for parsing the time in PodStatus and getting the absolute time for it.</p> <p>Example for the custom function:</p> <pre><code>PodScheduled, _ := time.Parse(time.RFC3339, &quot;2021-12- 23T20:20:36Z&quot;) Ready, _ := time.Parse(time.RFC3339, &quot;2021-12-31T07:36:...
<p>IIUC you have (at least) 3 options:</p> <ol> <li>Discouraged: Write your own client (instead of <code>kubectl</code>) that provides the functionality;</li> <li>Encouraged: Use the shell to post-process the output from e.g. <code>kubectl get pods --output=json</code>) by piping the result through: <ul> <li>Either you...
<p>I feel like I am misunderstanding RAM based <code>emptyDir</code> volumes in Kubernetes.</p> <ol> <li><p>Let's suppose my Kubernetes node has a total of 100GB. If I have 4 different emptyDirs that have <code>emptyDir.medium</code> set to &quot;Memory&quot;, by default will they all have 50GBs of memory? In that case...
<p><code>...by default will they all have 50GBs of memory?</code></p> <p>Yes. You can exec into the pod and check with <code>df -h</code>. If your cluster has <code>SizeMemoryBackedVolumes</code> feature enabled, you can specify the size.</p> <p><code>...what happens when the total amount of memory used in my 4 emptyDi...
<p>I would love to list deployments having <code>mongodb</code> environment value along with their phase status. Is there anyway to do so?</p> <p>With this command, I get the deployments name which carries a specific environment value</p> <pre><code>kubectl get deploy -o=custom-columns=&quot;NAME:.metadata.name,SEC:.sp...
<p>I had a go at a solution using <code>kubectl</code> but was unsuccessful.</p> <p>I suspect (!?) you'll need to use additional tools to parse|process the results to get what you want. Perhaps using <a href="https://stedolan.github.io/jq/" rel="noreferrer"><code>jq</code></a>?</p> <p>For Deployments, you can filter th...
<p>I am creating a new Operator with Kubebuilder to deploy a Kubernetes controller to manage a new CRD Custom Resource Definition.</p> <p>This new CRD (let's say is called <code>MyNewResource</code>), needs to list/create/delete CronJobs.</p> <p>So in the Controller Go code where the <code>Reconcile(...)</code> method ...
<p>You need to create new Role or ClusterRole (depending if you want your permissions to be namespaced or cluster-wide) and bind that to your <code>system:serviceaccount:myrepo-system:myrepo-controller-manager</code> user using RoleBinding/ClusterRoleBinding. I will provide examples for cluster-wide configuration.</p> ...
<p>Currently I'm facing the issue:</p> <pre><code>ERROR: Job failed (system failure): prepare environment: setting up credentials: secrets is forbidden: User &quot;system:serviceaccount:default:gitlab-runner&quot; cannot create resource &quot;secrets&quot; in API group &quot;&quot; in the namespace &quot;gitlab&quo...
<p>For me adding all necessary roles was the only solution that actually helped.</p> <p>Here the corresponding runner-chart-values.yaml file:</p> <pre><code>## GitLab Runner Image gitlabUrl: http://example.domain/ runnerRegistrationToken: &quot;&lt;token&gt;&quot; rbac: create: true rules: - apiGroups: [&quot;...
<p>We have an application deployed on GKE with a total of 10 pods running and serving the application. I am trying to find the metrics using which I can create an alert when my Pod goes down or is there a way to check the status of Pods so that I can set up an alert based on that condition?</p> <p>I explored GCP and lo...
<p>That metric is the same you are right it will the count of POD restart.</p> <blockquote> <p>Number of times the container has restarted. Sampled every 60 seconds. After sampling, data is not visible for up to 120 seconds.</p> </blockquote> <p>Read more at : <a href="https://cloud.google.com/monitoring/api/metrics_ku...
<p>I get the below error when I try to push the chart to ACR. Can you suggest the steps to be done here?</p> <p>&quot;This command is implicitly deprecated because command group 'acr helm' is deprecated and will be removed in a future release. Use 'helm v3' instead.&quot;</p> <p>I followed this article to create helm c...
<p>Azure has deprecated the support managing Helm charts using the Az Cli. So you will need Helm client version <code>3.7.1</code> to push the Helm charts to ACR.</p> <p>To push the Helm charts to ACR, follow the next steps:</p> <ol> <li><p>Enable OCI support</p> <pre><code>export HELM_EXPERIMENTAL_OCI=1 </code></pre> ...
<p>Question is straightforward, but I've not been able to quite figure out which steps a request follows when it reaches kubernetes system.</p> <ol> <li>Who first handle a received request? <code>Ingress Controller</code>, <code>LoadBalancer</code>, <code>ClusterIP</code>...</li> </ol> <p>So, I know there are several w...
<blockquote> <p>Ingress is in front of a ClusterIP Service mandatory?</p> </blockquote> <p>If you want the service accessible externally, then you will need an externally accessible service. This can be a LoadBalancer service or an Ingress. A ClusterIP service is not accessible outside the cluster.</p> <blockquote> <p>...
<p>I have attached AWS ACM provided SSL certificate to NLB. NLB will forward request to nginx ingress. Nginx is giving me the following error. <code>The plain HTTP request was sent to HTTPS port</code>. I have set the following annotation in nginx ingress.</p> <ul> <li>nginx.ingress.kubernetes.io/force-ssl-redirect: fa...
<p>For this error :</p> <blockquote> <p>The plain HTTP request was sent to HTTPS port</p> </blockquote> <p>Change your port configuration in <strong>Nginx</strong> service like, your <strong>target port</strong> in <em>HTTPS</em> section should be <strong>http</strong> instead of <strong>https</strong></p> <pre><code>p...
<p>I have been trying to figure out how to consume a ConfigMap created using a ConfigMap generator via Kustomize.</p> <p>When created using Kustomize generators, the configMaps are named with a special suffix. See here:</p> <p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#c...
<p>You don't reference it yourself. Kustomize recognizes where the configMap is used in the other resources (like a Deployment) and changes those references to use the name+hash.</p> <p>The reason for this is so that if you change the configMap, Kustomize generates a new hash and updates the Deployment, causing a rolli...
<p>Here is the issue: We have several microk8s cluster running on different networks; yet each have access to our storage network where our NAS are.</p> <p>within Kubernetes, we create disks with an nfs-provisionner (nfs-externalsubdir). Some disks were created with the IP of the NAS server specified. Once we had to ch...
<p><code>...we could create storage resources with the nfs provisionner based on a name an not an IP, and we could alter the DNS record when needed...</code></p> <p>For this you can try headless service without touching coreDNS:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: my-nas namespace: kube-syst...
<p>I'd like to do all k8s installation, configuration, and maintenance using Helm v3 (v3.7.2).</p> <p>Thus I have setup yaml templates for:</p> <ul> <li>deployment</li> <li>configmap</li> <li>service</li> <li>ingress</li> </ul> <p>Yet I can't find any information in the Helm v3 docs on setting up an HPA (<em>Horizontal...
<p>Yes. Example, try <code>helm create nginx</code> will create a template project call &quot;nginx&quot;, and inside the &quot;nginx&quot; directory you will find a templates/hpa.yaml example. Inside the values.yaml -&gt; autoscaling is what control the HPA resources:</p> <pre><code>autoscaling: enabled: false # &l...
<p>In some cases after a node reboot the Kubernetes cluster managed by MicroK8S cannot start pods.</p> <p>With a describe of the pod failing to be ready I could see that the pod was stuck in a &quot;Pulling image&quot; state during several minutes without any other event, as following:</p> <pre><code>Events: Type ...
<p>Running a <code>sudo microk8s inspect</code> gives no error/warning, everything seemed to work perfectly.</p> <p>As a Docker pull did work locally, it's really the Kubelet app which is communicating with Docker that seemed stuck.</p> <p>Even with a <code>sudo service docker stop &amp;&amp; sudo service docker start<...
<p>K8s network policies allow specifying CIDRs, but I'd like to specify DNS name.</p> <p>On a high level I'd see it working the following way:</p> <ul> <li>There's a whitelist of allowed hosts</li> <li>k8s intercepts IP resolution requests and checks whether host is whitelisted</li> <li>if yes, resolved IPs are tempora...
<p>vpc-cni does not implement k8s network policies. You need to replace vpc-cni with one of the EKS compatible CNI of your choice <a href="https://docs.aws.amazon.com/eks/latest/userguide/alternate-cni-plugins.html" rel="nofollow noreferrer">here</a> that support using FQDN in the policy. Note upgrade may be required (...
<p>In Kubernetes <code>CustomResourceDefinitions</code> (CRDs), we can specify <code>additionalPrinterColumns</code>, which (for example) are used for <code>kubectl get</code> with a CRD. The value for a column is usually extracted from the status of a CRD using a <code>jsonPath</code>. From the <a href="https://kubern...
<p>I will answer on your question partially so you have some understanding and ideas on what/how/where.</p> <hr /> <p><strong>kubectl get</strong></p> <p>When <code>kubectl get jobs</code> is executed, <code>kubernetes API server</code> decides which fields to provide in response:</p> <blockquote> <p>The <code>kubectl<...
<p>I am attempting to setup a multi-node k8s cluster as per this <a href="https://techviewleo.com/deploy-kubernetes-cluster-on-debian-using-k0s/" rel="nofollow noreferrer">kOS Setup Link</a>, but I face the error below when I try to join one of the nodes to the master node:</p> <pre><code> k0s token create --role=w...
<p>I've got the same error as you when I tried to run <code>k0s token create --role=worker</code> on the <strong>worker</strong> node.</p> <p>You need to run <a href="https://techviewleo.com/deploy-kubernetes-cluster-on-debian-using-k0s/" rel="nofollow noreferrer">this command on the <strong>master</strong> node</a>:</...
<p>Our system runs on GKE in a VPC-native network. We've recently upgraded from v1.9 to v1.21, and when we transferred the configuration, I've noticed the spec.template.spec.affinity.nodeAffinity in out kube-dns deployment is deleted and ignored. I tried manually adding this with &quot;kubectl apply -f kube-dns-deploym...
<p><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/kube-dns" rel="nofollow noreferrer">kube-dns</a> is a service discovery mechanism within GKE, and the default DNS provider used by the clusters. It is managed by Google and that is why the changes are not holding, and most probably that part of the code...
<p>I installed kubectl and tried enable shell autocompletion for zsh. When I'm using <code>kubectl</code> autocompletion works fine. Howewer when I'm trying use autocompletion with alias <code>k</code> then shell return me</p> <pre><code>k g...(eval):1: command not found: __start_kubectl ...
<p>add the following to the beginning of your ~/.zshrc file:</p> <pre><code>autoload -Uz compinit compinit </code></pre> <p>then restart your terminal.</p>
<p>I'm trying to run/set up ingress in Minikube. But it is not happening. Here are the steps Environment:</p> <ul> <li>Windows 10 professional</li> <li>minikube version: v1.24.0</li> </ul> <br> <p><strong>Ingress enabled:</strong></p> <p>| ingress | minikube | enabled ✅ | unknown (third-party) | <...
<p>I believe there's 2 issues at play here after testing various scenarios.</p> <ol> <li>An issue with the current latest minikube, v1.24.0, which messes with the minikube ingress addon and makes the address for the ingress be localhost instead of being the same as the <code>minikube ip</code></li> <li>An issue with th...
<p>I want do some device initiation by using Daemonset(K8s resource).</p> <p>Actually the deivce has been formated(inside container) and mounted(inside container) successfully to a container path <code>/hostmnt/lvpmem/</code> which is mapped of <code>/mnt/</code> which is a host path.</p> <p><code>mountpoint</code> wor...
<ul> <li>add /mnt as a volume to pod on directory /hostmnt. So that whatever being written under /hostmnt directory (insisde the container) will be seen on host under directory /mnt .</li> </ul> <pre><code>Example of a pod with hostpath : apiVersion: v1 kind: Pod metadata: name: test-pd spec: containers: - imag...
<p>We have a setup where we want to run 3 replicas of our Image. Each replica will be run in independent node and corresponding pods inside it. So to summarize we will have 3 nodes in 3 separate JVMs and 3 corresponding pods. Please provide following details,</p> <ol> <li>Can we fix POD IP and hostName always?</li> <li...
<p><code>Can we fix POD IP and hostName always?</code></p> <p>There is a <code>hostname</code> field for Pod that you can use. Using static IP for Pod is possible if the CNI plugin that you used support it. For example, Calico does <a href="https://projectcalico.docs.tigera.io/networking/use-specific-ip" rel="nofollow ...
<p>When I read the k8s source code, I found that both <strong>dockerService</strong> located in <code>pkg/kubelet/dockershim/docker_service.go</code> and <strong>DockerServer</strong> located in <code>pkg/kubelet/dockershim/remote/docker_server.go</code> seem to implement the interface of the <code>CRI shim server</cod...
<ul> <li>DockerServer simply creates <strong>dockershim grpc server</strong></li> </ul> <pre><code>// DockerServer is the grpc server of dockershim. type DockerServer struct { // endpoint is the endpoint to serve on. endpoint string // service is the docker service which implements runtime and image service...
<p>I'm deploying an <code>AKS</code> k8s cluster with terraform.</p> <p>The cluster has rbac enabled with azure active directory.</p> <p>The cluster creation goes fine and after that terraform tries to perfom some taks on the cluster like creating <code>k8s-roles</code> <code>storage classes</code>...., and fails there...
<p>An answer could be to change kubernetes provider configuration from</p> <pre class="lang-hcl prettyprint-override"><code>provider &quot;kubernetes&quot; { load_config_file = &quot;false&quot; host = azurerm_kubernetes_cluster.main.kube_config.0.host username = azurerm_kube...
<p>I'm on a windows machine in a powershell prompt. I don't have the Linux commands like <code>grep</code>, <code>awk</code>.</p> <p>I have a couple of jobs that I want to delete</p> <p><a href="https://i.stack.imgur.com/80yY2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/80yY2.png" alt="enter imag...
<p>Try:</p> <pre><code>$Pattern=&quot;mailmigrationjob-id699&quot;; &amp; kubectl get job | % {&quot;$_&quot; -Split &quot; &quot;} | Select-String -Pattern $Pattern | %{ &amp; kubectl delete job $_ } </code></pre> <p>Taken from: <a href="https://gist.github.com/IAmStoxe/37f84f0898e10e1a5da23793aada3e30" rel="nofollow ...
<p>I'm trying to get logs from mysql container. I have to set the variable :</p> <blockquote> <p>&quot;SET GLOBAL general_log= 1&quot;</p> </blockquote> <p>I'm trying to set the variable by using kubernetes poststart but it's not working . Here is my config :</p> <pre><code>apiVersion: apps/v1 kind: StatefulSet metadat...
<p>The command is excuted too early, right after the container is created and before mysqld is ready to accept commands.</p> <p>You can use a different method to achieve your goal:</p> <ul> <li>proivde a container command and use &quot;--general-log=1&quot;</li> <li>create a custom custom.cnf file with the settings and...
<p>I'm trying to monitor my app using helm prometheus <a href="https://github.com/prometheus-community/helm-charts" rel="nofollow noreferrer">https://github.com/prometheus-community/helm-charts</a>. I've installed this helm chart successfully.</p> <pre><code>prometheus-kube-prometheus-operator-5d8dcd5988-bw222 1/1 ...
<p>I found <a href="https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/troubleshooting.md#troubleshooting-servicemonitor-changes" rel="nofollow noreferrer">this guide</a> very helpful.</p> <p>Please keep in mind that depending on the prometheus stack you are using labels and names can ha...
<p>This is my configMap. I'm trying to specify [mysqld] config, but when I use this file alone with</p> <pre><code>helm upgrade -i eramba bitnami/mariadb --set auth.rootPassword=eramba,auth.database=erambadb,initdbScriptsConfigMap=eramba,volumePermissions.enabled=true,primary.persistence.existingClaim=eramba-storage --...
<p>If you look at <a href="https://github.com/bitnami/charts/blob/master/bitnami/mariadb/values.yaml" rel="nofollow noreferrer">values.yaml</a> file for MariaDB helm chart, you can see 3 types of ConfigMap:</p> <ul> <li>initdbScriptsConfigMap - to supply Init scripts to be run at first boot of DB instance</li> <li>prim...
<p>! StartHost failed, but will try again: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory</p> <p>I am getting this issue when I am executing the [minikube start --driver=virtualbox] command in my windows machine. I have already enable the VT-X/AMD-v...
<p>minikube start --no-vtx-check</p> <p>This command create the kubertenes cluster with out any error.</p>
<p>I'm attempting to read the contents of a Kubernetes Secret using <code>kube-rs</code>. The secret contains a key named &quot;apiKey&quot;.</p> <p>I seem to be able to pull the secret from the kube-apiserver (debug logging shows the correct contents of the secret) but I can't get to the value itself as it's returned ...
<p>I faced the same issue. I saw that it had some serialization traits at <a href="https://docs.rs/k8s-openapi/0.13.1/src/k8s_openapi/lib.rs.html#482-506" rel="nofollow noreferrer">https://docs.rs/k8s-openapi/0.13.1/src/k8s_openapi/lib.rs.html#482-506</a>, so I resorted to using the <code>serde_json</code> crate which ...
<p>I have deployment my kubernetes cluster v1.23.1 with kubeadm and configured it with the keycloak identity provider for authentication.</p> <p>API server configuration for keycloak IDP</p> <pre><code>... - --oidc-issuer-url=https://kubemaster:8443/auth/realms/local - --oidc-client-id=gatekeeper - --oidc-u...
<p>I was finally able to resolve my issue with some updates to my yaml definition files.</p> <p>Assuming you have a kubernetes cluster installed v1.23.1 with kubeadm on Ubuntu 20.04 and setup networking with flannel networking --pod-network-cidr=10.244.0.0/16. Also you have the keycloak oidc service setup (image - quay...
<p>I'm trying to use pod's lifecycle event. Problem is that command from <code>preStop</code> doesn't run at all. Is there any way to monitor if it was started? Log of the container is empty. </p> <pre><code> lifecycle: preStop: exec: command: [ "/bin/sh", "-c", "/clean.sh" ] </code>...
<p>I was looking for something, so I added some logging that help to see the logs of the script in the pod's stdout/stderr logs.</p> <p>so for me, this approach help me</p> <ul> <li>To write logs to the centralized logging system (help me to check logs in datadog)</li> <li>Verify the script is executed properly</li> </...
<p>I am looking for a way to do something like that</p> <pre><code>kubectl get pods -l app=foo | kubectl delete </code></pre> <p>I think this would be a great way to deal with multiple ressources at once, but I cannot find a reasonably easy way to do this.</p>
<p>You may use command substitution:</p> <pre><code>Kubectl delete $(kubectl get pod -l app=foo -o name) </code></pre>
<p>I have Kubernetes cluster set up and managed by AKS, and I have access to it with the python client.</p> <p>Thing is that when I'm trying to send patch scale request, I'm getting an error.</p> <p>I've found information about scaling namespaced deployments from python client in the GitHub docs, but it was not clear w...
<p>The <code>body</code> argument to the <code>patch_namespaced_deployment_scale</code> can be a <a href="http://jsonpatch.com/" rel="noreferrer">JSONPatch</a> document, as @RakeshGupta shows in the comment, but it can also be a partial resource manifest. For example, this works:</p> <pre><code>&gt;&gt;&gt; api_respon...
<p>Background: Have approx 50 nodes &quot;behind&quot; a namespace. Meaning that a given Pod in this namespace can land on any of those 50 nodes.</p> <p>The task is to test if an outbound firewall rule (in a FW outside the cluster) has been implemented correctly. Therefore I would like to test a command <strong>on each...
<p>The underlying node firewall settings is NOT control by K8s network policies. To test network connectivity in a namespace you only need to run 1 pod in that namespace. To test firewall settings of the node you typically ssh into the node and execute command to test - while this is possible with K8s but that would r...
<p>I was following a guide to connect a database to kubernetes: <a href="https://itnext.io/basic-postgres-database-in-kubernetes-23c7834d91ef" rel="nofollow noreferrer">https://itnext.io/basic-postgres-database-in-kubernetes-23c7834d91ef</a></p> <p>after installing Kubernetes (minikube) on Windows 10 64 bit: <a href="h...
<p>The <code>base64</code> cli found in Mac OS and some *nix distros is not available on Windows.</p> <p>You <em>could</em> write a small function named <code>base64</code> that mimics the behavior of the <code>base64</code> unix tool though:</p> <pre><code>function base64 { # enumerate all pipeline input $input |F...
<p>I'm new with Prometheus and I have simple flask app in Kubernetes cluster also I have Prometheus-Monitoring-Grafana services in cluster too in namespace calles <code>prometheus-monitoring</code>. But the problem is when I create ServiceMonitor via .yaml file to connect my app to monitor with Prometheus I see that ta...
<p>Finally i figured it out. The issue was port name. Please find workable solution below</p> <p><code>deployment.yaml</code></p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: webapp labels: component: backend instance: app name: containers-my-app namespace: default spec: selector:...
<p>I have a .pfx file that a Java container needs to use.</p> <p>I have created a tls secret using the command</p> <p><code>kubectl create secret tls secret-pfx-key --dry-run=client --cert tls.crt --key tls.key -o yaml</code></p> <pre><code>apiVersion: v1 kind: Secret type: kubernetes.io/tls metadata: name : secr...
<p>You can <a href="https://www.sslshopper.com/ssl-converter.html" rel="nofollow noreferrer">convert</a> to pfx first, then <code>kubectl create secret generic mypfx --from-file=pfx-cert=&lt;converted pfx file&gt;</code></p> <p>Mount the secret as a volume in your pod:</p> <pre><code>apiVersion: v1 kind: Pod metadata: ...
<pre><code>$ helm version version.BuildInfo{Version:&quot;v3.3.0&quot;, GitCommit:&quot;8a4aeec08d67a7b84472007529e8097ec3742105&quot;, GitTreeState:&quot;dirty&quot;, GoVersion:&quot;go1.14.6&quot;} </code></pre> <p>So I have my template:</p> <pre class="lang-yaml prettyprint-override"><code> minAvailable: {{ mul .Va...
<p>Helm and its templates support the default Go <a href="https://pkg.go.dev/text/template?utm_source=godoc#hdr-Functions" rel="noreferrer">text/template</a> functions and the function provided by the <a href="https://masterminds.github.io/sprig/" rel="noreferrer">Sprig</a> extension. Since Sprig version <a href="https...