prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I used the following guide to set up my chaostoolkit cluster: <a href="https://chaostoolkit.org/deployment/k8s/operator/" rel="nofollow noreferrer">https://chaostoolkit.org/deployment/k8s/operator/</a></p> <p>I am attempting to kill a pod using kubernetes, however the following error:</p> <pre><code>HTTP response bo...
<p>Error which is shared is using default service account &quot;choastoolkit&quot;. Look like the role associated might not proper permissions.</p> <p>The service account &quot;test-user&quot; which is been used in ChaosToolkitExperiment defintion should have proper role access to delete pod.</p> <p>Please specify pr...
<p>I have a google kubernetes cluster running and I am trying to manually scale some pods with the python-client kubernetes SDK. I use the following command on my terminal to get my google account credentials:</p> <pre><code>gcloud auth login </code></pre> <p>Next, I connect to my cluster using the default command to ...
<p>To resolve it, you should refresh the token before calling the API. This <a href="https://github.com/kubernetes-client/python-base/blob/474e9fb32293fa05098e920967bb0e0645182d5b/config/kube_config.py#L625" rel="nofollow noreferrer">doc</a> is useful to check if the token expired, the function <code>load_gcp_token</co...
<p>I want to create a cluster of RESTful web APIs in AWS EKS and be able to access them through a single IP (allowing kubernetes to load balance requests to each). I have followed the procedure explained the this <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-typ...
<p><code>ClusterIP</code> is an IP that is only accessible inside the cluster. You cannot hit it from outside cluster unless you use <code>kubectl port-forward</code></p>
<p>I have a NGINX Ingress controller and multiple ingress resources attached to each pod in GKE. I want to know if I can attach more than one ingress resource to a single pod.</p> <p>For example I have a Java application running on a pod and I have attached an ingress resource to it. The application can be accessed at ...
<p>Yes you can do it.</p> <blockquote> <p>For example I have a Java application running on a pod and I have attached an ingress resource to it. The application can be accessed at example.dev.com and it already has a ssl cert attached to it which I don't want to touch. I want the same application to be accessed via exam...
<p>Here, I have a python file with the name main.py that I want to execute.</p> <p>The main.py file contains:</p> <pre><code>import time import sys def hello(): for i in range(10): print(β€œ\n”*4, β€œHello from AMAN!”, β€œ\n”*4) time.sleep(2) sys.exit(0) if __name__ == β€œ__main__”: hello() </code></...
<p>You can use the command</p> <pre><code>kubectl logs &lt;POD name&gt; </code></pre> <p>it show you the output.</p> <p>If POD running on an EKS you can use different ways to get the logs, write to file, push logs to AWS cloud watch other external logging systems like ELK, using kubectl check logs.</p> <p>K8s by defaul...
<p>I am new to elastic search. I have a 3 data node and 3 master node elastic cluster deployed in Kubernetes. It was working well until recently there is a large intake of data. Now, I am in a stage where I need to apply index refresh interval configuration to 120s to allow optimal usage of the cluster. I am able to do...
<p>The recommended way is to create an index template that applies default settings when an index is created. <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html</a><...
<p>I am trying to start a pod in privileged mode using the following manifest but it doesn't work for me.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code> ...
<p><strong><code>privileged: true</code></strong> needs to be in <strong><code>securityContext</code></strong> in the spec section of the pod template.</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: ftp spec: hostNetwork: true containers: - name: ftp image: 84d3f7ba5876/ftp-run securityContext:...
<p>I want to create a cluster of RESTful web APIs in AWS EKS and be able to access them through a single IP (allowing kubernetes to load balance requests to each). I have followed the procedure explained the this <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-typ...
<blockquote> <p>What's the purpose of that cluster ip then and how can I use it to achieve what I need?</p> </blockquote> <p><code>ClusterIP</code> is local IP that is used internally in the cluster, you can use it to access the application.</p> <p>While i think Endpoint IP that you got, is might be external and you ca...
<p>I logged in using docker login command in my machine.</p> <p>then I tried to run the <code>kubectl</code> command to apply a <code>yaml</code> file:</p> <p><code>kubectl apply -f manifests/1_helloworld_deploy.yaml</code></p> <p>but this failed with error :</p> <blockquote> <p>Warning Failed 20s (x2 over 35s) k...
<ul> <li>When you login to docker on a machine , its credentials will be saved in a file named <code>~/.docker/config.json</code></li> <li>We need need to explicitly instruct these credentials to be used while pulling images .</li> <li>For that we need to create a secret with contents of <code>~/.docker/config.json</co...
<p>I'm trying to upgrade some GKE cluster from 1.21 to 1.22 and I'm getting some warnings about deprecated APIs. Am running Istio 1.12.1 version as well in my cluster</p> <p>One of them is causing me some concerns:</p> <p><code>/apis/extensions/v1beta1/ingresses</code></p> <p>I was surprised to see this warning because...
<p>we have also upgraded cluster/Node version from 1.21 to 1.22 directly from GCP which have successfully upgraded both node as well as cluster version.</p> <p>even after upgrading we are still getting ingresslist</p> <pre><code>/apis/extensions/v1beta1/ingresses </code></pre> <p>we are going to upgrade our cluster ver...
<p>I'm using Fluent-Bit to ship kubernetes container logs into cloudwatch. <a href="https://github.com/fluent/fluent-bit-kubernetes-logging/blob/master/output/elasticsearch/fluent-bit-configmap.yaml" rel="nofollow noreferrer">This config</a> is working fine. Instead of <code>output-elasticsearch.conf</code> I have foll...
<p>I had a same issue and I used this raw file to extract the necessary Application.* inputs and filters that would allow You to use $(tag['0') as a log_stream key.</p> <p><a href="https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode...
<p>I want to my backend service which is deployed on kubernetes service to access using ingress with path /sso-dev/, for that i have deployed my service on kubernetes container the deployment, service and ingress manifest is mentioned below, but while accessing the ingress load balancer api with path /sso-dev/ it throw...
<p>You need to change the pathType to Prefix as follows, in your ingress:</p> <pre><code>pathType: Prefix </code></pre> <p>Because I noted that you are using the <code>pathType: ImplementationSpecific</code> . With this value, the matching depends on the <code>IngressClass</code>, so I think for your case the <code>pa...
<p>I have a scenario and was wondering the best way to structure it with Kustomize.</p> <p>Say I have multiple environments: <code>dev</code>, <code>qa</code>, <code>prod</code></p> <p>and say I have multiple DCs: <code>OnPrem</code>, <code>AWS</code>, <code>GCP</code></p> <p>Let's say each DC above has a <code>dev</co...
<p>I recommend having an overlay for each combination you want to build. e.g:</p> <pre><code>└── overlays β”œβ”€β”€ aws-dev β”œβ”€β”€ aws-qa └── gcp-dev </code></pre> <p>Then you can structure in different ways, such as using components:</p> <pre><code>└── components β”œβ”€β”€ environments β”‚ β”œβ”€β”€ dev β”‚ └── qa ...
<p>I want to deploy an ASP.NET application with MongoDB on Kubernetes locally. Currently the application is working fine with the <code>docker-compose</code>.</p> <p>In the case of Kubernetes YAML file, I have created a <code>StatefulSet</code> for the MongoDB and a Deployment for the ASP.NET app and also, I have creat...
<p>Pretty sure you need the change the name of mongo db connectionstring. Check out the DNS for services section: <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/</a></p> <p>In your case ...
<p>I use Windows and I've just downloaded kubectl using link from this instruction: <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/</a></p> <p>But when I check the version I see a warning:</p> <pre><code>...
<p>Server version is the version of Kubernetes the control plane is running.</p> <p>Client version is the version of your <code>kubectl</code>.</p> <p>The recommendation is that you keep the two as close as possible to prevent discrepancies between API versions.</p> <p>For example, if you did a <code>kubectl create --d...
<pre><code>{&quot;code&quot;:&quot;DeploymentFailed&quot;,&quot;message&quot;:&quot;At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.&quot;,&quot;details&quot;:[{&quot;code&quot;:&quot;ResourceDeploymentFailure...
<p>The Error you are getting beacuse issue with the NSGS [acls] of subnet that are restricting the traffic flow to the Azure management network to let the AKS creation work.</p> <p>These NSGs are associated with the Subnet in Vnet that you are trying to create an AKS for.</p> <blockquote> <p>Apparently, when we created...
<p>I did kubeadm init on one machine. I followed all the instructions on network etc and end up with this:</p> <p><code>kubectl get nodes</code>:</p> <pre class="lang-bash prettyprint-override"><code>NAME STATUS ROLES AGE VERSION slchvdvcybld001 Ready control-plane 140m v1.24.2 slch...
<p>Labelling of master node is deprecated. That's where when using <code>kubectl get nodes</code> its showing role as &quot;control-plane&quot; instead of &quot;control-plane,master&quot;</p> <p>More details are in following link Kubeadm: <a href="http://git.k8s.io/enhancements/keps/sig-cluster-lifecycle/kubeadm/2067...
<p>Im trying to get all the external IPs that the pods from kubernetes can use, its possible consult this in console?</p>
<p>Pods have no external IP as the nodes are responsible for communication with the Internet. You can check this diagram for more details[1].</p> <p>It seems what you're referring here is the internal IP address range that the pods can use.</p> <p>You can get this information by navigating to <code>☰</code> &gt; <code>...
<p>I have a multi-tenant Kubernetes cluster. On it I have an nginx reverse proxy with load balancer and the domain <code>*.example.com</code> points to its IP.</p> <p>Now, several namespaces are essentially grouped together as project A and project B (according to the different users).</p> <p>How, can I ensure that any...
<p>Alternative to other answer, you may use validation webhook to enfore by any parameter present in the request. Example, name,namespace, annotations, spec etc.</p> <p>The validation webhook could be a service running in the cluster or External to cluster. This service would essentially make a logical decision based o...
<p>NOTE: I tried to include screenshots but stackoverflow does not allow me to add images with preview so I included them as links.</p> <p>I deployed a web app on AWS using kOps. I have two nodes and set up a Network Load Balancer.</p> <p><a href="https://i.stack.imgur.com/DBOsC.png" rel="nofollow noreferrer"><img src=...
<p>I had exactly the same problem before and this should be documented somewhere on AWS or Kubernetes. The answer is copied from <a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-unhealthy-worker-node-nginx/" rel="nofollow noreferrer">AWS Premium Support</a></p> <h3>Short description</h3> <p>The NGINX...
<p>i installed nginx ingress with the yaml file</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.0/deploy/static/provider/cloud/deploy.yaml </code></pre> <p>when deploy i can see that the endpoints/externalIPs by default are all the ip of my nodes <a href="https...
<blockquote> <p>but I only want 1 external IPs to be access able to my applications</p> </blockquote> <p>If you wish to &quot;control&quot; who can access your service(s) and from which ip/subnet/namesapce etc you should use <code>NetworkPolicy</code></p> <hr /> <p><a href="https://kubernetes.io/docs/concepts/services-...
<p>I have ingress controller nginx with basic_auth</p> <p>In my yaml I have:</p> <pre><code> annotations: nginx.ingress.kubernetes.io/auth-type: basic nginx.ingress.kubernetes.io/auth-secret: basic-auth nginx.ingress.kubernetes.io/auth-realm: "Authentication Required" </code></pre> <p>Everything works f...
<p>You want to use custom server snippet and use allow/deny. I find it more elegant solution then the <code>if</code> recommentation in the comment above.</p> <pre><code> annotations: nginx.ingress.kubernetes.io/server-snippet: | satisfy any; allow 66.220.144.0/20; deny all; </code></pre> <p>T...
<p>Is there a way to tell cassandra to: &quot;listen to the port 7000 for intra node connection but when you try to connect to other cassandra hosts use another port like 443?&quot;</p> <p>Basically same as Elasticsearch where you have <code>http.port</code> and <code>http.publish_port</code> <a href="https://www.elast...
<p>Cassandra nodes use the gossip protocol for internode communications and by default uses port <code>7000</code>:</p> <pre><code>storage_port: 7000 </code></pre> <p>This port is exclusively used for <strong>private communications</strong> between nodes which is typically configured on a private address/network (<code...
<p>We deploy some application in different namespaces with node selectors on different node such as Dev &amp; QA in 1 k8s cluster. Now what issue is, the application deploy in dev node is also accessible using qa ip or qa node name. which shouldn't be, because application expose using node port and running only on dev ...
<p>Use ingress &amp; a LoadBalancer service instead of NodePort, that should fix your issue.</p>
<p>I am installing linkerd helm verison with flux and cert mananger for tls rotation</p> <p>cert manager holds default config so there isnt much to talk there</p> <p>flux and linkerd with this config:</p> <p>release.yaml</p> <pre><code>apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: name: linke...
<p>The problem lies here:</p> <pre><code>values: identity.issuer.scheme: kubernetes.io/tls </code></pre> <p>It should be:</p> <pre><code>values: identity: issuer: scheme: kubernetes.io/tls </code></pre> <p>Otherwise, helm wont recognize it and linkerd will think the schema is linkerd.io/tls, which...
<p>How can I define my networkpolicy so that both pods (test-server and test-server2) that are in the same namespace are reachable from outside the cluster but cannot reach each other?</p> <pre><code>$ kubectl get pods NAME READY STATUS RESTARTS AGE test-server-7555d49f48-sfzv9 ...
<blockquote> <p>How can I define my <code>network policy</code> so that both pods (test-server and test-server2) that are in the same namespace are reachable from outside the cluster but cannot reach each other?</p> </blockquote> <p>Your <code>NetworkPolicy</code> should be something similar to this one, based upon you...
<p>I developed service which listen 0.0.0.0:8080. When I run app local it works and i can connect by browser. I push it in image to dockerhub. By this image I created pod and service in my mini kube cluster. By command &quot;minicube service --url&quot; i get url like 192.168.49.2:30965, but I can't connect to this ur...
<p>You would need, as <a href="https://stackoverflow.com/q/71175415/6309">illustrated here</a> to:</p> <ul> <li>create a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a> and apply it</li> <li>then expose the port:<br /> <code>kubectl expose -f lara...
<p>We have a data visualization server hosted in Kubernetes pods. The dashboards in that data viz are displayed in the browser of different monitors/terminals for near-real time operational reporting. Sometimes the pods fail, and when they come alive again, the browser redirects to Single Sign-On page instead of going ...
<p>If I understand the use case correctly, you might want to use <code>kubectl scale</code> command. This will give you the flexibility to make the replica count to zero to N by running a simple <code>kubectl scale</code> command. See examples. Also, if you are using deployment, you can just do the <code>kubectl dele...
<p>I am getting the below error when installing the latest stable Rancher Desktop in my Virtual Machine.</p> <p>Could someone please help?</p> <p><strong>Error:</strong></p> <blockquote> <p>Error: wsl.exe exited with code 4294967295</p> </blockquote> <p><strong>Command:</strong></p> <pre><code>wsl --distribution ranche...
<p>I met the same issue in Windows 10.</p> <p>Below solution helped me:</p> <h2>1. Quit Rancher Desktop</h2> <p><a href="https://i.stack.imgur.com/U8kpt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U8kpt.png" alt="Quit Rancher" /></a></p> <h2>2. Run below command in Windows command line:</h2> <pre class="l...
<p>I am running a Kubernetes cluster in AWS EKS and I set up the autoscaler. I tested the autoscaler and it worked as when the number of pods in a node exceeded 110 then new nodes were automatically added to the cluster and the pending pods entered running state.</p> <p>After that, I deleted the deployment. It's been a...
<p>Although scaling down is a slow process the default scan interval is <strong>10 seconds</strong> if you are using the autoscaler to scale the nodes in EKS.</p> <p>You can check the status of autoscaler using <strong>configmap</strong> and its a decision.</p> <p>There could be a possibility that on the new node you h...
<pre><code>apiVersion: projectcalico.org/v3 kind: NetworkPolicy apiVersion: networking.k8s.io/v1 kind: NetworkPolicy </code></pre> <p>By using <code>kubectl get networkpolicy</code>, I can see only the policies created by <code>networking.k8s.io/v1</code> and not those created by <code>projectcalico.org/v3</code>. Any...
<p><code>kubectl get XXX</code> does not display all the resources in the cluster, in your case you cannot see CRD</p> <ul> <li>You can find your object with <code>kubectl get crds</code></li> <li>Then <code>kubectl get &lt;crd name&gt; -A</code></li> </ul> <hr /> <p>In your case it would be:</p> <pre class="lang-bash ...
<p>I have a kubeadm cluster and i am trying to deploy to static websites using ingress (after installing the metalLB and nginx-ingress controller )</p> <p>After deploying the ingress, i find that the ingress don't load the website assets (the html file only) Please any help !</p> <pre class="lang-yaml prettyprint-overr...
<p>Make sure your routing working properly with ingress</p> <p>Example and it's not 404 for css:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress-service annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - ht...
<p>From &quot;Extending kubectl with plugins&quot;:</p> <blockquote> <p>It is currently not possible to create plugins that overwrite existing <code>kubectl</code> commands. [...] Due to this limitation, it is also not possible to use plugins to add new subcommands to existing <code>kubectl</code> commands. For example...
<p>It does not look like that in source code, all sub-commands are currently registered explicitly (<a href="https://github.com/kubernetes/kubernetes/blob/db8d77cfeb0593b0accc17804df43834cc7f9917/staging/src/k8s.io/kubectl/pkg/cmd/create/create.go#L142-L160" rel="nofollow noreferrer">cf.</a>):</p> <pre class="lang-gola...
<p>We are running a terraform to create a GKE Cluster and using the below to create a local kubeconfig file after the creation of the cluster.</p> <pre><code>module &quot;gke_auth&quot; { source = &quot;terraform-google-modules/kubernetes-engine/google//modules/auth&quot; depends_on = [module.gke] project_id ...
<p>We have this issue with the setup below.</p> <p>For the first module, we added an output block.</p> <pre><code>module &quot;gke_auth&quot; { source = &quot;terraform-google-modules/kubernetes-engine/google//modules/auth&quot; depends_on = [module.gke] project_id = var.project_id location = module.gke...
<p>I have a pod with multiple init containers and one main container. One of the init container create a sh file with some export commands like:</p> <pre><code>export Foo=Bar </code></pre> <p>I want to source the file so it creates the env variable like this:</p> <pre><code> containers: - name: test command: ...
<p>If you are looking for create the <code>sh</code> in the init container with the variables and then use in the &quot;main container&quot; here is a quick example:</p> <p><strong>manifest</strong></p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Pod metadata: name: mypod labels: name...
<p>I have simple web application deployed to Kubernetes cluster (EKS) with <a href="https://github.com/kubernetes-sigs/aws-load-balancer-controller" rel="nofollow noreferrer">aws load balancer controller</a> ingress</p> <p><a href="https://i.stack.imgur.com/MmFF9.png" rel="nofollow noreferrer"><img src="https://i.stack...
<ol> <li>Try and run kubernetes networking benchmark on both the clusters (bare-metal and EKS) - <a href="https://github.com/InfraBuilder/k8s-bench-suite" rel="nofollow noreferrer">https://github.com/InfraBuilder/k8s-bench-suite</a></li> </ol> <p>This shows how pod2pod and pod2svc latencies are on both clusters. If dra...
<p>I have this</p> <pre><code>kubectl version WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version. Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;24&quot;, GitVersion:&quot;v1.24.2&quot;, GitCom...
<p>As you asked how to upgrade K8s : This document contains a step by step process to <a href="https://www.golinuxcloud.com/kubernetes-upgrade-version/" rel="nofollow noreferrer">update K8’s</a></p> <p>When your cluster is using the version 1.18.6, you could upgrade to 1.18.p where p &gt;= 7 and to 1.19.x (whatever the...
<p>I am trying to run kubectl commands in offline mode but it keeps saying&gt;</p> <pre><code> kubectl cordon hhpsoscr0001 The connection to the server localhost:8080 was refused - did you specify the right host or port? </code></pre> <p>I fail to understand what can be the issue. Can anyone help me on this?</p>
<p>Please execute : kubectl get svc to see if you get a ClusterIP type output. If you don't, please configure your kube config properly as @David Maze suggested earlier.</p>
<h2>Issue Description</h2> <p>I am getting an error in fluent-bit basically saying it cant resolve host</p> <pre><code>getaddrinfo(host='&lt;My Elastic Cloud Instance&gt;.aws.elastic-cloud.com:9243', err=4): Domain name not found </code></pre> <p>I suspect it has something to do with the port getting appended in the dn...
<p>Also, if you are using Elastic Cloud, try to decode the value of ${CLOUD_ELASTICSEARCH_ID} variable, remove the <code>:443</code> and encode it again.</p> <p>I was getting this error and it was solved after doing this.</p>
<h1>Goal</h1> <p>Build a CI/CD pipeline multiple GitLab repositories with a certain project structure can make use of. For this, a Docker container with Python code is built and subsequently securely pushed to Google Cloud's Container Registry.</p> <h1>Set up</h1> <ul> <li>KubernetesExecutor is installed on Kubernet...
<p>You can add <code>DOCKER_AUTH_CONFIG</code> CI/CD variable with auth values from <code>~/.docker/config.json</code>. The variable will look like this:</p> <pre><code>{ &quot;auths&quot;: { &quot;northamerica-northeast1-docker.pkg.dev&quot;: { &quot;auth&quot;: &quot;{JSON key here}&quot; ...
<p>I am trying to setup EFK (ElasticSearch 8, FluentD and Kibana) stack on K8S cluster (on-premises)</p> <p>I followed this <a href="https://phoenixnap.com/kb/elasticsearch-helm-chart" rel="nofollow noreferrer">link</a> to install elasticsearch and installed it using helm charts and followed this <a href="https://medi...
<p>I faced similar errors when I tried to use elasticsearch 8.2.3 with fluentBit 1.9.5. I could see elastic was sending logs but could not see any data in kibana webpage due to which could not create indices and saw the above error in fluent-bit pod logs. I followed <a href="https://github.com/fluent/fluent-bit/issues/...
<p>I'm trying to run in kubernetes mern application (<a href="https://github.com/ibrahima92/fullstack-typescript-mern-todo/" rel="nofollow noreferrer">https://github.com/ibrahima92/fullstack-typescript-mern-todo/</a>). I have a client and a server container, and I need to replace the path to the url client in the backe...
<p>You can create a <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">config map</a>, giving your container run time variables, Or alternatively, build your own docker image using the <code>ENV</code></p> <p>You can also acheive that using kustomization.</p> <ul> <li>kusto...
<p>I want to know the Object(<code>Deployment/Statefulset/..</code>) which is using a secret. Is there a way to find this out from a secret? Is there a tool in Kubernetes community to do this?</p>
<p>Seems like there is nothing built in, but you can use <code>kubectl</code> in conjuction with <code>jq</code> to figure it out. Here is the example for <code>deployments</code></p> <pre><code>kubectl get deployment -o json | jq '.items[] | select(.spec.template.spec.volumes[]? | .secret.secretName==&quot;&lt;secret ...
<p>I am having an issue when trying to setup <strong>Virtual Nodes</strong> for <strong>Azure Kubernetes cluster</strong> using <strong>Terraform</strong>.</p> <p>When I check the pod for the aci-connector-linux, I get the below error:</p> <pre><code>Events: Type Reason Age From Message ...
<p>I finally fixed it.</p> <p>The issue was caused by the Outdated documentation for <code>aci-connector-linux</code> here - <a href="https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/examples/kubernetes/aci_connector_linux/main.tf" rel="nofollow noreferrer">https://github.com/terraform-prov...
<p>I am trying to deploy an application with k3s kubernetes. Currently I have two master nodes behind a load-balancer, and I have some issues connecting worker nodes to them. All nodes and the load-balancer runs in seperate vms.</p> <p>The load balancer is a nginx server with the following configuration.</p> <pre><code...
<p>Using the IP Address instead of the hostname in <code>k3s-agent.service.env</code> works for me. Not really a solution as much as a workaround.</p> <p><code>/etc/systemd/system/k3s-agent.service.env</code></p> <pre><code>K3S_TOKEN='&lt;token&gt;' K3S_URL='192.168.xxx.xxx:6443' </code></pre>
<p>I am using a GKE cluster with Ubuntu nodes &amp; containerd as CRI. I am not able to see any pause containers the way we used to see in docker. Are they no more exists in containerd? Anything changed or I am not aware of?</p> <p>cluk_ti4@gke-cluster-1-default-pool-b897ab15-7kzn:~$ sudo -i</p> <pre><code>&gt; root@gk...
<p><a href="https://i.stack.imgur.com/fjhVr.png" rel="nofollow noreferrer">enter image description here</a></p> <pre><code>ctr -n k8s.io c ls </code></pre> <p>you can do like this</p>
<p>I'm deploying my application in the cloud, inside a cluster on 03 pods:</p> <ol> <li>one pod: backend - Quarkus</li> <li>one pod: frontend - Angular</li> <li>one pod: DB - Postgres</li> </ol> <p><strong>The backend has 03 endpoints:</strong></p> <ol> <li>One endpoint: GraphQL</li> <li>Two endpoints: Rest</li> </ol> ...
<p>I thinks that I managed to make another Diagnotic method wiht the help for Ryan Dawson. I did PortForaward the backend pod and request from the locally, then I found that there is a 500 error code --&gt; meaning that the request was not matching the api requirements: in the frontend I was sendign the wrong context t...
<pre><code>lifecycle: preStop: exec: command: [&quot;sh&quot;, &quot;-c&quot;, &quot;curl -v -X PUT -d '\&quot;SHUTTING_DOWN\&quot;' http://localhost:8080/v1/info/state&quot;] </code></pre> <p>I am expecting this will produce a curl url like</p> <pre><code>curl -v -X PUT -d '&quot;SHUTTING_DOWN&quot;' ht...
<p>I'd suggest getting rid of as many layers of quotes as you can. In the original example you have a layer of quotes from YAML, plus a layer of quotes from the <code>sh -c</code> wrapper. Since you need the HTTP PUT body itself to have both single and double quotes – you need to send the string <code>'&quot;SHUTTING...
<p>I'm new to nextflow. We would like to build our workflow using nextflow and have nextflow deploy the workflow to a large mulit-institution Kubernetes cluster that we use.</p> <p>In this cluster we don't have admin permission, we have a namespace we work in. Also, pods in our cluster have limited resources, but jobs ...
<p>There might be a new feature with nextflow 22.04. Quoting Ben Sherman's <a href="https://github.com/seqeralabs/nf-k8s-best-practices/blob/master/feature-evaluation.md" rel="nofollow noreferrer">nextflow k8s best practices</a> page:</p> <blockquote> <p>In Nextflow v22.04 and later, the <code>k8s</code> executor can b...
<p>Given a bash function in .bashrc such as</p> <pre><code>kgp () { kubectl get po -n $1 $2 } </code></pre> <p>Is it possible to have kubectl auto complete work for k8s resources such as namespaces/pods? As an example if I use</p> <pre><code>kubectl get po -n nsprefix podprefix </code></pre> <p>I can tab auto complet...
<p>Yes, that's because bash-completion only understands <em>known commands</em>, not aliases or new functions that you have made up. You will experience the same thing with a trivial example of <code>alias whee=/bin/ls</code> and then <code>whee &lt;TAB&gt;</code> will do nothing because it doesn't &quot;recurse&quot; ...
<p>In the yaml file, I have configure the auto-scaling and in this block I've set minimum and maximum replica count, But few deployments are still having 1 pod. I know this might be due to traffic that those deployments having 1 pod might have less traffic. Here's the code of the yaml file:</p> <pre><code> autoscaling:...
<p>You can use:</p> <pre><code>kubectl get hpa -A -w </code></pre> <p>with the <code>-A</code> option it gives you all your hpa from all <code>namespaces</code> if you want to specify a <code>namespace</code>, you can use <code>-n</code> option. And the <code>-w</code> argument is for watch so you have a refreshed inte...
<p>I run <code>kubent</code> and identify an outdated apiVersion</p> <pre><code>&gt; kubent ... KIND NAMESPACE NAME API_VERSION REPLACE_WITH (SINCE) PodDisruptionBudget mynamespace ...
<p>Here is a solution for you.</p> <pre class="lang-bash prettyprint-override"><code>kubent ### output: (⎈ |minikube:default)[23:23:23] [~/repositories/KubernetesLabs] git(master) πŸ”₯ ❱❱❱ kubent 11:23PM INF &gt;&gt;&gt; Kube No Trouble `kubent` &lt;&lt;&lt; 11:23PM INF version 0.5.1 (git sha a762ff3c6b5622650b86dc98265...
<p>I am currently implementing a CI Pipeline using Tekton. I was wondering if there is a way to use some kind of <code>valueFromEnv</code> for pipeline params.</p> <p>For example to authenticate a Task for sonarqube analysis with my company's sonar host i need the login token, which I would rather want to insert via re...
<p>Your first Idea is not impossible, but in my eyes ugly as well. You can set the desired ENV in your image via DockerFile and use it later in the task:</p> <p>Docker file (example):</p> <pre><code>FROM gradle:7.4-jdk11 USER root RUN apt-get update &amp;&amp; apt-get install -y npm YOUR_VARIABLE_KEY=&quot...
<p>The goal is to monitor the flowable project deployed on Kubernetes using Prometheus/Grafana</p> <p>Install kube-prometheus-stack using helm charts:</p> <pre><code>helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update helm install prometheus prometheus-community/kube-p...
<p>Flowable (as a Spring Boot application) uses Micrometer that will provide metrics in prometheus format as soon as you add the <code>micrometer-registry-prometheus</code> dependency. Endpoint is then <code>actuator/prometheus</code>.</p> <p>Creating your own prometheus metric is actually not that difficult. You can c...
<p>I was passing one of the sample tests for CKA and one question says this:</p> <p>&quot;Configure a LivenessProbe which simply runs <code>true</code>&quot;</p> <p>This is while creating simple nginx pod(s) in the general question, then they ask that as one of the items. What does that mean and how to do it?</p>
<p><code>...Configure a LivenessProbe which simply runs true...while creating simple nginx pod...</code></p> <pre><code>apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - image: nginx:alpine name: nginx ports: - containerPort: 80 livenessProbe: exec: command: [&quot;t...
<p>I'm facing this such error in kubernetes( <em>0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/unreachable:</em> <em>}, that the pod didn't tolerate.)</em>. My application server is down. First, I just add one file in daemon set , due to memory allocation (we are having one node), all pods are failed...
<p>You need to configure autoscaling (it doesn't work by default) for the cluster <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html</a> Or, you can manually change the desire...
<p>We are using helm provider in Terraform to provision istio ingress gateway which in backend use this <a href="https://artifacthub.io/packages/helm/istio-official/gateway" rel="nofollow noreferrer">chart</a></p> <p>Below is the terraform code snippet to provision the same. Please help to override the default chart va...
<p>You can either use the <code>set</code> argument block (<a href="https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#set" rel="nofollow noreferrer">https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#set</a>) or the <code>values</code> argument (<a hr...
<pre><code>apiVersion: v1 kind: Pod spec: serviceAccountName: &lt;service account name in kubernetes&gt; containers: - name: spark-submit image: &lt;image arn&gt; command: - cat tty: true - name: kube-tools image: &lt;image arn&gt; command: - cat tty: true </code></pre> <p>this i...
<p>Please note that these are two different settings. With <code>tty: true</code> you enable a TTY which is required for execution of a shell.</p> <p>The second is <code>cat</code> as argument for the container <code>command</code>. It means that the <code>cat</code> executable is run without further arguments. If you ...
<p>I am working on integrating a few Laravel PHP applications into a new Kubernetes architecture, and still struggling on how I can run <code>php artisan schedule:run</code> in a nice manner.</p> <p>In the official Laravel manual, we are advised to set up the cronjob like this.</p> <pre><code>* * * * * cd /path-to-your...
<p>Instead of running <code>schedule:run</code> use K8s kind: Deployment (not Job) and run scheduler as a daemon:</p> <pre><code>php artisan schedule:work </code></pre> <p><a href="https://laravel.com/docs/9.x/scheduling#running-the-scheduler-locally" rel="nofollow noreferrer">https://laravel.com/docs/9.x/scheduling#ru...
<p>I am trying to use google cloud for my pubsub event driven application. Currently, I am setting up Cloud Run for Anthos following the below tutorials</p> <ul> <li><a href="https://codelabs.developers.google.com/codelabs/cloud-run-events-anthos#7" rel="nofollow noreferrer">https://codelabs.developers.google.com/codel...
<p>I encountered the same issue. The reason might be the given cluster setup does not have enough CPU resources.</p> <p>You can check it by</p> <pre><code>kubectl describe pod/default-brokercell-retry-6f4f9696d6-tg898 -n cloud-run-events </code></pre> <p>If the output is <a href="https://i.stack.imgur.com/DeIul.png" re...
<p>We are using a node js application along with Kubernetes with auto-scaling. My requirement is to log a few things wrt the current instance (pod, IP or anything unique for that instance).</p> <p>Is there any way in the node js and typescript to get such identifiers in the backend application?</p>
<p>The hostname will contain the unique (per namespace) pod name. So just get the current hostname of the backend and you have a unique identifier.</p> <p>For example</p> <pre><code>const os = require(&quot;os&quot;); const hostName = os.hostname(); </code></pre>
<p>Now i have Pods as Kubernetes structs wiht the help of the command</p> <pre><code>pods , err := clientset.CoreV1().Pods(&quot;namespace_String&quot;).List(context.TODO(), metav1.ListOptions{}) </code></pre> <p>now i do i get it as individual yaml files which command should i use</p> <pre><code>for i , pod := range p...
<p>The <code>yaml</code> is just a representation of the Pod object in the kubernetes internal storage in etcd. With your <code>client-go</code> what you have got is the <code>Pod</code> instance, of the type <code>v1.Pod</code>. So you should be able to work with this object itself and get whatever you want, for examp...
<p>I am trying to create a k8s pod with a docker container image from a private insecure registry. With the latest K8s, I get ErrImagePull as it complains of http vs https for the insecure registry.</p> <pre><code> Type Reason Age From Message ---- ------ ---- ---- ----...
<p>I faced a similar problem recently about not being able to pull images from an insecure private docker registry using containerd only. I will post my solution here in case it works for your question too. Steps below show the details of how I solved it on Ubuntu Server 20.04 LTS:</p> <pre><code>$ containerd --version...
<p>I have set up the <code>Nginx-Ingress</code> controller as per the documentation (<a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">Installation guide</a>)and followed the steps using the example provided. When I try to access the service us...
<p>I was able to resolve the issue after adding the following annotations.</p> <pre><code>nginx.ingress.kubernetes.io/backend-protocol: HTTPS nginx.ingress.kubernetes.io/ssl-redirect: true nginx.ingress.kubernetes.io/force-ssl-redirect: true </code></pre>
<p>Trying to update the resources of my Deployment using <code>kubectl patch</code> command:</p> <pre><code>kubectl patch statefulset test -n test --patch '{&quot;spec&quot;: {&quot;template&quot;: {&quot;spec&quot;: {&quot;containers&quot;: [{&quot;resources&quot;: [{&quot;limits&quot;: [{&quot;cpu&quot;: &quot;4000m&...
<p>It needs to know which container you want to patch in the statefulset. You indicate this by including the name of the container.</p> <p>Also, the json structure of your resources field is incorrect. See the example below for a complete working example:</p> <p>(replace <strong>???</strong> with the name of the contai...
<p>I just created a new AKS cluster that has to replace an old cluster. The new cluster is now ready to replace the old one, except for one crucial thing, it's outbound ip address. The address of the old cluster must be used so that our existing DNS records do not have to change.</p> <p><strong>How do I change the publ...
<p>You have to create a static public IP address for the AKS cluster. Once you delete the old cluster, the public IP address and load balancer associated with it will be deleted as well. You can check and try this documentation[1] for a detailed guide.</p> <p>[1] <a href="https://learn.microsoft.com/en-us/azure/aks/sta...
<p>I am creating k8s cluster from digital ocean but every time I am getting same warning after I create cluster and open that cluster in lens ID.</p> <p>Here is the screenshot of warning:</p> <p><a href="https://i.stack.imgur.com/6lZvD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6lZvD.png" alt="s...
<p>Check first if <a href="https://github.com/k3s-io/k3s/issues/1857#issuecomment-950154218" rel="noreferrer"><code>k3s-io/k3s</code> issue 1857</a> could help:</p> <blockquote> <p>I was getting the same error when I installed kubernetes cluster via <code>kubeadm</code>.</p> <p>After reading all the comments on the sub...
<p>I have a K8s job that spins up a pod with two containers. Those containers are client and a server. After the client did all it needs to, it sends a special stop signal to the service after which the service exits; then client exits. The job succeeds.</p> <p>The client and the service containers use <a href="https:/...
<p>Yes, enable <code>shareProcessNamespace</code> on the pod, for example:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: app spec: shareProcessNamespace: true </code></pre> <p>Your containers can now send signals to one another. They will no longer use PID 1 anymore though.</p> <p>Here are the docs that e...
<p>I have a container where I used a bitnami/kubectl image.<br /> Now I want to run a few kubectl commands inside that container.</p> <p>How kubectl container aware of my kubeconfig file?<br /> I know that I can mount the local kubeconfig file into containers and use it.</p> <p>But is there any other way possible to ac...
<blockquote> <p>Now I want to run a few kubectl commands inside that container.</p> </blockquote> <ul> <li>Why do you need it inside the container?</li> </ul> <p><code>kubectl</code> is your CLI to &quot;communicate&quot; with the cluster, the commands are passed to the <code>kube-api</code>, parsed, and executed usual...
<h1>Problem encountered</h1> <p>When deploying a cluster with <strong>Kubespray</strong>, <strong>CRI-O</strong> and <strong>Cilium</strong> I get an error about having multiple CRI socket to choose from.</p> <p><em>Full error</em></p> <pre><code>fatal: [p3kubemaster1]: FAILED! =&gt; {"changed": true, "cmd": " mkdir...
<p>This worked for me for multiple cri sockets</p> <pre><code>kubeadm init --pod-network-cidr=10.244.0.0/16 --cri-socket=unix:///var/run/cri-dockerd.sock </code></pre> <p>Image pull command before initialization for multiple cri:</p> <pre><code>kubeadm config images pull --cri-socket=unix:///var/run/cri-dockerd.sock </...
<p>I am trying to mount a remote webdav:</p> <p><code>sudo mount -t davfs https://files.isric.org/soilgrids/latest/data/ ~/webdav</code></p> <p>But I only get the following error: <code>/sbin/mount.davfs: mounting failed; the server does not support WebDAV</code></p> <p>This server is a <a href="https://github.com/mar...
<p>The problem lies on the k8s ingress that has:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot; nginx.ingress.kubernetes.io/cors-allow-methods: &quot;GET, OPTIONS, HEAD&quot; nginx.ingress.kubernetes.io/cors-a...
<p>When trying to use scaled objects it fails with the error</p> <blockquote> <p>Failed to create the scaledobject 'azure-monitor-scaler'. Error: (400) : ScaledObject is currently not yet supported in the portal.</p> </blockquote> <p>I am using the following code as per their documentation. Still seem it is not suppor...
<p>It appears that the LA scaler is broken by changes in keda version 2.7.0.</p> <p>You can try to run an older version of keda with LA scaler it should work for you.</p> <p>You can do it by running the following command: <code>helm install keda kedacore/keda --version 2.0.0 --namespace keda</code></p>
<p>I am trying to deploy an admission controller / mutating webhook</p> <p>Image: <a href="https://hub.docker.com/layers/247126140/aagashe/label-webhook/1.2.0/images/sha256-acfe141ca782eb8699a3656a77df49a558a1b09989762dbf263a66732fd00910?context=repo" rel="nofollow noreferrer">https://hub.docker.com/layers/247126140/aa...
<p>The error seems pretty clear: the code is looking for a <code>CERTIFICATE</code> block in a PEM-encoded file, but it is only find a <code>CERTIFICATE REQUEST</code> block. It looks like you're passing a certificate signing request (csr) where the code expects to find an actual SSL certificate. And in fact, looking ...
<p>In this case, I have multiple Kubernetes clusters and want to work on different clusters at the same time. (Will keep it as 2 clusters to make it simple)</p> <p>As described in <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/" rel="nofollow noreferrer">Kubernet...
<p>The standard Kubernetes client libraries support a <a href="https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable" rel="noreferrer"><code>$KUBECONFIG</code> environment variable</a>. This means that pretty much every tool supports it, including Hel...
<p>My aspired tekton usecase is simple:</p> <ul> <li>successful pipelineruns should be removed after x days</li> <li>failed pipelineruns shouldn't be removed automatically.</li> </ul> <p>I plan to do the cleanup in an initial cleanup-task. That seems better to me than annotation- or cronjob-approaches. As long as nothi...
<p>Until a better solution is there, I'll post my current solution (and its drawbacks):</p> <p>Our cleanup-task is now built around the following solution, evaluating the table returned by <code>tkn pipelineruns list</code>:</p> <pre><code>tkn pipelineruns list --show-managed-fields -n e-dodo-tmgr --label tekton.dev/pi...
<p>In a Kubernetes cluster on Oracle cloud, I have a pod with an Apache server.</p> <p>This pod needs a persistent volume so I used a persistentVolumeClaim and the cloud provider is able to automatically create an associated volume (Oracle Block Volume).</p> <p>The access mode used by the PVC is readWriteOnce and there...
<p>As per documentation:</p> <blockquote> <p>ReadWriteOnce: the volume can be mounted as read-write by a single node. ReadWriteOnce access mode still can allow multiple pods to access the volume when the pods are running on the same node.</p> </blockquote> <p>That means if you make a strict rule for deploying your pod...
<p>My AKS cluster and storage account are in the same Region: East US 2. I have created secret: <code>kubectl create secret generic fa-fileshare-secret --from-literal=azurestorageaccountname=fastorage --from-literal=azurestorageaccountkey='OWd7e9Ug' secret/fa-fileshare-secret created</code></p> <p>In that storage accou...
<p>Thank You <a href="https://stackoverflow.com/users/12990185/andreys">AndreyS</a> for confirming you resolve your issue. Here is few more additional details that can help to know cause of your issue.</p> <p>As Per Microsoft <a href="https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/fail-to-mount-a...
<p>I'm trying to use client-go informers to get the replica count on deployments. Whenever autoscaling changes the number of replicas, I need to retrieve this in order to handle some other logic. I was previously using the Watch() function, but there are a few inconsistencies with timeouts and connection drops.</p> <p>...
<p>A few things to note:</p> <ul> <li>Before calling <code>informerFactory.Start()</code>, ensure that the Informer is called directly(<code>informer := factory.Apps().V1().Deployments().Informer()</code>) or <code>Start()</code> wont start anything.</li> <li>Using a goroutine to start theΒ SharedInformerFactoryΒ is mean...
<p>How can I tell with <code>kubectl</code> how much <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#local-ephemeral-storage" rel="noreferrer">ephemeral storage</a> a pod is currently using?</p> <p>In a Kubernetes pod spec, I can specify resource requests and limits for C...
<p>You can do this through the raw command.</p> <p><code>kubectl get --raw &quot;/api/v1/nodes/(your-node-name)/proxy/stats/summary&quot;</code></p> <p>There is also this</p> <p><code>kubectl get --raw &quot;/api/v1/nodes/(your-node-name)/proxy/metrics/cadvisor&quot;&quot;</code></p> <p>EDIT:</p> <p>I've created a Prom...
<p>I'm running a mongodb instance as a kubernetes pod in a single node cluster (bare metal ubuntu machine). The volume is configured <code>ReadWriteOnce</code> as the mongodb pod is accessed only by pods in one node.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: mongo spec: replicas: 1 selec...
<p>If you set <code>securityContext</code> then according to the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod" rel="nofollow noreferrer">official documentation</a>:</p> <blockquote> <p>the runAsUser field specifies that for any Containers in the ...
<p>I experienced slow response of any kubectl command at my test environment. I don't have this issue in the production and at minikube in my dev. For example I run:</p> <pre><code>kubectl get deployments </code></pre> <p>And I have to wait even one minute. If I break with <em>Ctrl + C</em>, and start again sometime...
<p>I had also slow response of any kubectl command at one of my testing environment. I checked API response timings by using</p> <pre><code>kubectl get deployments -v=6 </code></pre> <p>and encounter the following error</p> <pre><code>Error loading discovery information: unable to retrieve the complete list of server A...
<p>Envoy is using all the memory and the pods are getting evicted. Is there a way to set limit to how much memory envoy proxy can use in the envoy configuration file?</p>
<p>You can probably do that by configuring the <code>overload-manager</code> in the <code>bootstrap</code> configuration for Envoy. Here's a <a href="https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/overload_manager/overload_manager#overload-manager" rel="nofollow noreferrer">documentation</a> link ...
<p>I was trying to run my pod as non root and also grant it some <a href="https://linux.die.net/man/7/capabilities" rel="nofollow noreferrer">capabilities</a>.<br /> This is my config:</p> <pre class="lang-yaml prettyprint-override"><code> containers: - name: container-name securityContext: capabi...
<p>This is the expected behavior. The capabilities are meant to divide the privileges traditionally associated with superuser (root) into distinct units; a non-root user cannot enable/disable such capabilities, that could create a security breach.</p> <p>The <code>capabilities</code> feature in the <code>SecurityContex...
<p>I need to run sudo minikube start --memory=4096 --cpus=2 for my use case. However it is running with 1 cpu already. Somehow I started it w/o creating an entry in ~/kube/config so &quot;kubectl config delete-cluster minikube&quot; returns, &quot;error: cannot delete cluster minikube, not in /home/ec2-user/.kube/co...
<p>To change cpus or memory you want to get the profile name like mentioned before:</p> <pre><code>minikube profile list </code></pre> <p>And then delete the profile you want to change, in my case it was minikube:</p> <pre><code>minikube delete --profile minikube </code></pre> <p>Then you can start minikube again creat...
<p>I'd like to launch a clustered Socket IO application in Kubernetes. When I create a service (whether NodePort or LoadBalancer) the client application keeps getting disconnected and it reconnects again with the following logs:</p> <pre><code>undefined oah4g28zZCw36g1MAAAm undefined undefined oac4g28zZCw36g1MFAAAx und...
<p>You can use the <code>sessionAffinity: ClientIP</code>, which will manage the session from K8s service.</p> <pre><code>kind: Service apiVersion: v1 metadata: name: example spec: selector: app: example ports: - name: http protocol: TCP port: 80 targetPort: 80 sessionAffinity: ClientIP sess...
<p>I'm trying to upgrade some GKE cluster from 1.21 to 1.22 and I'm getting some warnings about deprecated APIs. Am running Istio 1.12.1 version as well in my cluster</p> <p>One of them is causing me some concerns:</p> <p><code>/apis/extensions/v1beta1/ingresses</code></p> <p>I was surprised to see this warning because...
<p>In our case, use of old version of <a href="https://github.com/kubernetes/kube-state-metrics" rel="nofollow noreferrer">kube-state-metrics</a> seems to cause the beta version of API calls. Some days after updating kube-state-metrics, the deprecated API calls was stopped so far.</p>
<p>I have Gitlab Kubernetes integration in my <code>Project 1</code> and I am able to access the <code>kube-context</code> within that project's pipelines without any issues.</p> <p>I have another project, <code>Project 2</code> where I want to use the same cluster that I integrated in my <code>Project 1</code>.</p> <p...
<p>Have you ensured that the agent configuration file <code>config.yaml</code> is present in your <code>project2</code> at the specified directory?</p> <p>If you have, you should be able to choose the agent from the list and setup Gitlab with it. Having the configuration file in both projects is <a href="https://docs.g...
<p>I have created an EKS using AWS ALB Ingress Controller and also created a ingress for the same. But after creating the ingress, I am getting <strong>404</strong> while accessing some file extension. Ex: main.css. Following is my ingress code.</p> <pre><code>--- apiVersion: networking.k8s.io/v1 kind: Ingress metada...
<p>Your ingress endpoint <code>/</code> is of type <code>ExactMatch</code>. Therefore, the files matching <code>/*</code> will <em>not be matched</em>. You can change this to type <code>Prefix</code> and it should work.</p> <p>Additionally, consider moving your files away from the root of the path to somewhere like <co...
<p>hey guys i’m trying to setup datadog as custom metric for my kubernetes hpa using the official guide:</p> <p><a href="https://docs.datadoghq.com/agent/cluster_agent/external_metrics/?tab=helm" rel="nofollow noreferrer">https://docs.datadoghq.com/agent/cluster_agent/external_metrics/?tab=helm</a></p> <p>running on <s...
<p>For the record i got this sorted.</p> <p>According to the helm default values file you must set the app key in order to use metrics provider:</p> <pre><code> # datadog.appKey -- Datadog APP key required to use metricsProvider ## If you are using clusterAgent.metricsProvider.enabled = true, you must set ## a Da...
<p>I accidentally deleted kube-proxy daemonset by using command: <code>kubectl delete -n kube-system daemonset kube-proxy</code> which should run kube-proxy pods in my cluster, what the best way to restore it? <a href="https://i.stack.imgur.com/AChcS.png" rel="nofollow noreferrer">That's how it should look</a></p>
<p>Kubernetes allows you to <a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy/" rel="nofollow noreferrer">reinstall kube-proxy</a> by running the following command which install the kube-proxy addon components via the API server.</p> <pre><code>$ kubeadm ini...
<p>I'm running the redis chart (<a href="https://artifacthub.io/packages/helm/bitnami/redis/15.7.0" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/bitnami/redis/15.7.0</a>) as a dependency of a custom chart. I enabled sentinel, then the pods are running two containers (redis and sentinel). I'm using the...
<p>You need to update the <code>podAntiAffinity</code> section of the pod template to add a certain k/v pair. This will ensure that for a node, if a pod with that k/v pair already exists, the schedular will attempt to schedule the pod on another node that doesn't have a pod with that k/v pair. I say attempt, because an...
<p>Developing CRDs for Kubernetes, using VScode as an IDE. Want to provide autocompletion and Intellisense in IDE.</p> <p>It needs a JSON schema to do so. I have a huge number of CRDs to support. I want to do it in an easy way to convert CRDs to JSON schema.</p>
<p>You can have CRD IntelliSense thanks to <a href="https://github.com/vscode-kubernetes-tools/vscode-kubernetes-tools/" rel="nofollow noreferrer">vscode-kubernetes-tools</a> extension. It will fetch CRD from the active cluster. Here is the relevant merged <a href="https://github.com/vscode-kubernetes-tools/vscode-kube...
<p>I am trying to set up Postgres cluster using CrunchyData Postgres operator. I am facing issue where the pod <code>backrest-shared-repo</code> is always in <code>Pending</code> state.</p> <pre><code>NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE postgres-ha-1 Pen...
<p>You need to create a <code>PersistentVolume</code> in the cluster before you can use it with a <code>PersistentVolumeClaim</code>. The error simply means you do not have any PVs that can be matched with your PVC.</p> <p>Here's the official <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-p...
<p>I have deployment with volumes and limits presented above. The problem is that kubernetes reject create pod with such error:</p> <pre><code> pods &quot;app-app-96d5dc969-2g6zp&quot; is forbidden: exceeded quota: general-resourcequota, requested: limits.ephemeral-storage=1280Mi, used: limits.ephemeral-s...
<p>You namespace has a quota set to cap at 1Gi:</p> <p><code>limits.ephemeral-storage 0 1Gi</code></p> <p>The messaging said that the namespace will exceed the limit and reach 1.28Gi (1280Mi) with your deployment.</p> <p>Reduce your limit to 700Mi to stay within the 1Gi limit and your pod will be schedule accordin...
<p>Currently I use <strong>Traefik IngressRoute</strong> to expose the Traefik dashboard. I am using this configuration:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: traefik-dashboard namespace: my-namespace spec: routes: - mat...
<p>It is not possible to reference api@internal from an Ingress.</p> <p>There is a workaround I think, which could be:</p> <ul> <li>expose the api as insecure, it exposes the dashboard by default on an entrypoint called traefik on port 8080.</li> <li>update the entrypoint manually in the static conf: <code>entrypoints....
<p>I'm trying to build a Kubernetes job on the fly by using the Kubernetes client in C# (<a href="https://github.com/kubernetes-client/csharp" rel="nofollow noreferrer">https://github.com/kubernetes-client/csharp</a>). I get an error when the job is trying to pull the image from the repo.</p> <p>The image I'm trying to...
<p>Found the solution. The image resides in the local repo of Docker Desktop. Because of this the image doesn't have to be pulled. To avoid the image pull, the parameter <strong>ImagePullPolicy</strong> of the Container object should be equal to <strong>&quot;Never&quot;</strong>.</p> <pre><code>new V1Container { Imag...
<p>I'm trying to deploy a simple nginx ingress object in my local kubernetes (Docker-Desktop) but I noticed that the class name is showing as &quot;none&quot; when I do:</p> <pre><code>➜ localk8 k get ingress NAME CLASS HOSTS ADDRESS PORTS AGE ingress-resource none * localhost 80 ...
<p>I am not sure what version of kubernetes you're using, but that annotation was <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation" rel="noreferrer">deprecated in 1.18</a>.</p> <p>Also, you need to <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#d...
<p>Well, I'm using <code>minikube v1.26.0</code> and <code>kubectl</code> to manage <code>Kubernetes</code> on my local machine, when I decide to create a <code>ConfigMap</code> with <code>kubectl apply -f ConfigMapFile.yaml</code> I'm getting error <code>no matches for kind &quot;configmap&quot; in version &quot;apps/...
<p>you need to use <code>apiVersion: v1</code> for configmap. You can also check the version of any resource using:</p> <pre><code>kubectl api-resources |grep -i configmap configmaps cm v1 true ConfigMap </code></pre>
<p>I have put neo4j community edition(v3.2.2) into kubernetes. But the community edition do not support hot backup so I have to shut it down for backup/restore data. </p> <p>I tried:</p> <pre><code>kubectl exec neo4j-0 /var/lib/neo4j/bin/neo4j stop </code></pre> <p>but it shows:</p> <pre><code>Neo4j not running </c...
<p>For now, <code>offlineMaintenanceModeEnabled</code> is available for Neo4j's Helm chart.</p> <p><a href="https://neo4j.com/docs/operations-manual/current/kubernetes/maintenance/#put-offline-mode" rel="nofollow noreferrer">https://neo4j.com/docs/operations-manual/current/kubernetes/maintenance/#put-offline-mode</a></...
<p>I have setup a kubernetes cluster with kubeadm with a 3 node vagrant setup. I have installed ArgoCD and when I use vagrant ssh into the kubemaster vm, I can run:</p> <pre><code>kubectl port-forward svc/argocd-server -n argocd 8080:443 </code></pre> <p>And I can curl it in the ssh session successfully with:</p> <pre>...
<p>It turns out I needed to add the address flag to the port forwarding command</p> <pre><code>// from kubectl port-forward svc/argocd-server -n argocd 8080:443 // to kubectl port-forward --address 0.0.0.0 svc/argocd-server -n argocd 8080:443 </code></pre>