prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I am following the book Kubernetes for developers and seems maybe book is heavily outdated now. Recently I have been trying to get prometheus up and running on kubernetes following the instruction from book. That suggested to install and use HELM to get Prometheus and grafana up and running.</p> <pre><code> helm ins...
<p>Unless you configure your cluster with <a href="https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/" rel="nofollow noreferrer">dynamic volume provisioning </a>, you will have to make the PV manually each time. Even if you are not on a cloud, you can setup dynamic storage providers. There are a number o...
<p>I have an application which consists of a backend (spring boot) and a search engine (elasticsearch). After I deployed it into OCP, Initially I tested the connection between the two using the command &quot;curl&quot; to elasticsearch service <code>(https://service-name.namespace.svc.cluster.local:9200)</code> from ba...
<p>I think the elasticsearch builder <code>.connectedTo</code> method requires the format <code>host:port</code>, i.e. without the protocol. So try:</p> <pre><code>.connectedTo(&quot;elasticsearch-siol-es-http.siolbca-dev.svc.cluster.local:9200&quot;) </code></pre>
<p>Hy folks, I'm using Vagrant box provisioned with Ansible and provider Oracle virtualbox, it was working fine for me. But one day i installed Android Studio and it's Emulator and Minicube wit KVM. </p> <p>Afterwards vagrant with virtual-box just stop working. Now whenever i run <code>vagrant up</code> i get below e...
<p>I had a gurumeditation issue with a fresh debian/buster64 and a reboot of my laptop fixed it (Virtualbox was only tellig me that the state was invalid in the log).</p> <p>Some time lost for nothing. If ever it can help</p>
<p>today while trying to run my pod , I discovered this error which we see in the describe events:</p> <pre><code># kubectl describe pod monitor-prometheus-alertmanager-c94f7b6b7-tg6vc -n monitoring Name: monitor-prometheus-alertmanager-c94f7b6b7-tg6vc Namespace: monitoring Priority: 0 Node: kube...
<p>Because <code>docker.io</code> does not respond to pings, from anywhere.</p>
<p>After a pod crashes and restarts, is it possible to retrieve the IP address of the pod prior to the crash?</p>
<p>This is a very wide question as not possible to identify where exactly and why pod crashes. However I'll show what's possible to do with in different scenarios.</p> <ul> <li>Pod's container crashes and then restarts itself:</li> </ul> <p>In this case pod will save its IP address. The easiest way is to run <code>kube...
<p>I like <a href="https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/configmapgenerator/" rel="nofollow noreferrer">configMapGenerator</a> with suffix hashes because it forces redeployment of pod that are consuming particular config. But the diff output after changing config is just delete and creat...
<p>You can do something like this</p> <ul> <li><p>Get the current version of the ConfigMap and write it to a file <code>current.yaml</code></p> <p><code>kubectl get configmap nginx-conf-aaaa -o=yaml &gt; ./current.yaml</code></p> </li> <li><p>After making the changes get the new version of the ConfigMap in <code>new.ya...
<p>I have a Openshift Route of type :</p> <pre><code>- apiVersion: route.openshift.io/v1 kind: Route metadata: name: &lt;Route name&gt; labels: app.kubernetes.io/name: &lt;name&gt; spec: host: &lt;hostname&gt; port: targetPort: http tls: termination: passthrough to: ...
<p>TLS passthrough is not officially part of the Ingress spec. Some specific ingress controllers support it, usually via non-standard TCP proxy modes. But what you probably want is a LoadBalancer-type service.</p>
<p>Our application uses RabbitMQ with only a single node. It is run in a single Kubernetes pod.</p> <p>We use durable/persistent queues, but any time that our cloud instance is brought down and back up, and the RabbitMQ pod is restarted, our existing durable/persistent queues are gone.</p> <p>At first, I though that ...
<p>What helped in our case was to set <code>hostname: &lt;static-host-value&gt;</code></p> <pre><code>apiVersion: apps/v1 kind: Deployment spec: replicas: 1 ... template: metadata: labels: app: rabbitmq spec: ... containers: - name: rabbitmq image: rabbitmq:3-manage...
<p>I have defined the <code>values.yaml</code> like the following:</p> <pre><code>name: custom-streams image: streams-docker-images imagePullPolicy: Always restartPolicy: Always replicas: 1 port: 8080 nodeSelector: nodetype: free configHocon: |- streams { monitoring { custom { ur...
<p>I was able to resolve the issue. The issue was using <code>configmap</code> in place <code>configMap</code> in <code>deployment.yaml</code>:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Values.name }} spec: replicas: {{ default 1 .Values.replicas }} strategy: {} template: spec:...
<p>I have created a docker image ( java web application ), created a kubernetes cluster with 1 master and 1 worker, created a deployment and a service. All the resources seem to run fine as I have checked by 'kubectl describe resource resourcename'. At last, I used Ingress in order to expose the services outside the cl...
<p>Apparently, I had configured the incorrect containerPort in the deployment. There is nothing wrong with ingress configuration. But, kubernetes did not actually show any errors in logs which made debugging pretty difficult.</p> <p>Just a tip for beginners, before trying to expose your services, test the service by co...
<p>I see there are 2 separate metrics <code>ApproximateNumberOfMessagesVisible</code> and <code>ApproximateNumberOfMessagesNotVisible</code>.</p> <p>Using number of messages visible causes processing pods to get triggered for termination immediately after they pick up the message from queue, as they're no longer visib...
<p>We used a lambda to fetch two metrics and publish a custom metric that is sum of messages in-flight and waiting, and trigger this lambda using cloudwatch events at whatever frequency you want, <a href="https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#rules:action=create" rel="nofollow noreferrer">http...
<p>I am running my JMeter on Azure Kubernetes for load testing. JMeter uses HTTP sampler to call Azure function( HTTP endpoint) to generate load. I am getting error message <strong>Response code:Non HTTP response code: java.net.UnknownHostException Response message:Non HTTP response message: abcd.azurewebsites.net.</st...
<p>I doubt that this is a JMeter problem, most probably your pod doesn't have the Internet access for some reason, you might want to get familiarized with the following materials:</p> <ul> <li><a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#check-required-ports" rel="nofo...
<p>I am trying to run local development kubernetes cluster which runs in Docker Desktop context. But its just keeps having following taint: <code>node.kubernetes.io/not-ready:NoSchedule</code>.</p> <p>Manally removing taints, ie <code>kubectl taint nodes --all node.kubernetes.io/not-ready-</code>, doesn't help, because...
<p>In my case the problem was some super resource-hungry pods. Thus I had to downscale some deployments to be able to have a stable environment</p>
<p>I am trying to set the two <code>env</code> variables of mongo namely - <code>MONGO_INITDB_ROOT_USERNAME</code> and <code>MONGO_INITDB_ROOT_PASSWORD</code> using <code>kubernetes</code> <strong>ConfigMap</strong> and <strong>Secret</strong> as follows:</p> <p>When I don't use the config map and password, i.e. I har...
<p>Finally I was able to find the solution after hours, it is not something I did from kubernetes side, it is when I did <code>base64</code> encode.</p> <p>The correct way to encode is with following command:</p> <pre><code>echo -n 'admin' | base64 </code></pre> <p>and this was the issue with me.</p>
<p>I am creating a fresh private node in GCloud where i have a deployment.yml with:</p> <pre><code>... containers: - name: print-logs image: busybox command: &quot;sleep infinity&quot; </code></pre> <p>When i review the corresponding POD, I always get this error: &quot;failed to do request: Head <a href="htt...
<p>First connect into the cluster using[link]</p> <pre><code>gcloud container clusters get-credentials NAME [--internal-ip] [--region=REGION | --zone=ZONE, -z ZONE] [GCLOUD_WIDE_FLAG …] </code></pre> <p>And then try to pull the docker image for docker.</p> <p>For more information you can refer <a href="https://clo...
<p>When I'm running following code:</p> <pre class="lang-sh prettyprint-override"><code>minikube addons enable ingress </code></pre> <p>I'm getting following error:</p> <pre class="lang-sh prettyprint-override"><code>▪ Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0 ▪ Using image docker.io/jettech/kube-webh...
<p>As <strong>@Brian de Alwis</strong> pointed out in the comments section, this PR <a href="https://github.com/kubernetes/minikube/pull/11189" rel="nofollow noreferrer">#11189</a> should resolve the above issue.</p> <p>You can try the <a href="https://github.com/kubernetes/minikube/releases/tag/v1.20.0-beta.0" rel="no...
<p>I'm running Kubeflow in a local machine that I deployed with multipass using <a href="https://yann-leguilly.gitlab.io/post/2020-03-04-kubeflow-on-laptop/" rel="nofollow noreferrer">these steps</a> but when I tried running my pipeline, it got stuck with the message ContainerCreating. When I ran <code>kubectl describe...
<p>You don't need to use docker. In fact the problem is with <code>workflow-controller-configmap</code> in kubeflow name space. You can edit it with</p> <pre><code>kubectl edit configmap workflow-controller-configmap -n kubeflow </code></pre> <p>and change <code>containerRuntimeExecutor: docker</code> to <code>contai...
<p>Im using the helm <a href="https://pkg.go.dev/helm.sh/helm/v3" rel="nofollow noreferrer">SDK</a> and it works great, for my testing using the fake option which works(for kubeconfig),</p> <p>Now when I update the <code>kubeconfig</code> to my cluster I notice that during installation the chart is <strong>stuck</stron...
<p>Looking at the example, I don't know what the <code>installation</code> package is but I feel like you would need to use a <code>Loader</code> (maybe you are using it in that pkg)</p> <p>from a quick search over the <a href="https://github.com/helm/helm/issues/6910#issuecomment-557106092" rel="nofollow noreferrer">g...
<p>It looks like Helm 3 is making this more difficult: <a href="https://github.com/databus23/helm-diff/issues/176" rel="nofollow noreferrer">https://github.com/databus23/helm-diff/issues/176</a></p> <p>But I'm finding that using the helm-diff plugin OR just doing this: <code>helm template releaseName chart | kubectl di...
<p>did you try:</p> <pre class="lang-sh prettyprint-override"><code>helm template \ --namespace derps --no-hooks --skip-tests \ -f helm/deploy-values.yaml \ --set 'parentChart.param1=sdfsdfsdfdsf' \ --set 'parentChart.param2=sdfsdfsdfdsf' \ --set 'parentChart.param3=sdfsdfsdfdsf' \ --set 'parent...
<p>I am trying to build docker image with postgres data included.I am following below link.</p> <pre><code>https://sharmank.medium.com/build-postgres-docker-image-with-data-included-489bd58a1f9e </code></pre> <p>It is built with data as below.</p> <pre><code>REPOSITORY TAG ...
<p>In the many years since that post came out, it looks like the <code>postgres</code> community container image has been tweaked to automatically provision a volume for the data when running under Docker (via the <code>VOLUME</code> directive). This means your content was stored outside the running container and thus ...
<p>What is the default cpu and memory allocated to a Pod in a custom (not default) namespace when NO limit OR request is specified?</p> <p>Thanks</p>
<p>I think <a href="https://kubernetes.io/docs/concepts/policy/limit-range/" rel="nofollow noreferrer">Kubernetes Limit Ranges</a> docs answers your question</p> <blockquote> <p><em>&quot;By default, containers run with <strong>unbounded</strong> compute resources on a Kubernetes cluster...&quot;</em></p> </blockquote>...
<p>I try to run my web application with two backend containers.</p> <ul> <li>/ should be routed to the frontend container</li> <li>everything starting with /backend/ should go to the backend container.</li> </ul> <p>So fare, so good, but now the css &amp; js files from the /backend are not loaded because the files are ...
<p>You can add another path if all files are located in /bundles/* path. I have given an example manifest file below.</p> <pre><code>apiVersion: networking.k8s.io/v1 # for versions before 1.14 use extensions/v1beta1 kind: Ingress metadata: name: example namespace: example annotations: kubernetes.io/ingress.class:...
<p>I can create ingress with basic auth. I followed the template from kubernetes/ingress-nginx:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress-with-auth annotations: # type of authentication nginx.ingress.kubernetes.io/auth-type: basic # name of the secret that cont...
<p>I just encountered the same problem. I solved it by using a configuration-snippet.</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-cors-auth-ingress annotations: nginx.ingress.kubernetes.io/configuration-snippet: | # fix cors issue...
<p>I am trying to set TCP idleTimeout via an Envoy Filter, so that outbound connections external domain <code>some.app.com</code> will be terminated if they are idle for 5s:</p> <pre><code>apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: listener-timeout-tcp namespace: istio-system spec: ...
<p>This is a community wiki answer. Feel free to expand it.</p> <p>As already discussed in the comments, the <code>EnvoyFilter</code> was not yet supported in Istio version 1.2 and actually that version is no longer in support since Dec 2019.</p> <p>I strongly recommend upgrading to the latest Istio and Envoy versions....
<p>I have mounted two tar files as secrets. I would like to mount them to my container and then unpack the contents. The commands that created the secrets are as follows:</p> <pre><code>kubectl create secret generic orderer-genesis-block --from-file=./channel-artifacts/genesis.block kubectl create secret generic crypt...
<p>When you create an initContainer and execute this command:</p> <p><code>command: ['sh', '-c', 'tar -xvf /hlf/channel-artifacts/channel-artifacts.tar']</code></p> <p>it runs in default for this container path. I checked this by adding <code>pwd</code> and <code>ls -l</code> commands.</p> <p>Whole line is:</p> <p><cod...
<p>Does anyone know how to use SSL on Spring Boot application to connect with ElasticSearch which is deployed at Openshift in the form of https? I have a config.java in my Spring Boot application like the following:</p> <pre><code>@Configuration @EnableElasticsearchRepositories(basePackages = &quot;com.siolbca.reposito...
<p>I solved my problem by ignoring SSL certificate verification while connecting to elasticsearch from my Backend (Spring Boot). I followed some instruction from website below:</p> <p><a href="https://stackoverflow.com/questions/62270799/ignore-ssl-certificate-verfication-while-connecting-to-elasticsearch-from-spring">...
<h3>What happened:</h3> <p>When I performed a stress test on nginx, the nginx deployment scaled, but the newly created nginx pod did not have any load. If I stop the stress test for two minutes, all pods will start working normally. As shown in the picture below: <a href="https://i.stack.imgur.com/bWVsg.png" rel="nofol...
<p>I am not familiar with http_load and the documentation is quite sparse. From your observation I assume that http_load uses HTTP keepalive, therefore reusing TCP connections. Kubernetes does loadbalancing on the TCP level, so only new connections will reach the added replicas.</p> <p>You can either configure nginx to...
<p>Running <code>kubectl get all</code> returns Throttling request errors</p> <p>How can I debug and fix this issue?</p> <pre><code>I0223 10:28:04.717522 44883 request.go:655] Throttling request took 1.1688991s, request: GET:https://192.168.64.2:8443/apis/apps/v1?timeout=32s I0223 10:28:14.913541 44883 request.go:6...
<p>To diagnose kubectl commands, you select a level of verbosity when running the command. If you run <code>kubectl -v=9</code> you'll get a load of debug output.</p> <p>If you look in there you may find the permissions for your cache directory within .kube are invalid.</p> <pre><code>I0511 09:28:13.431116 260204 cach...
<p>I am using an external TCP/UDP network load balancer (Fortigate), Kubernetes 1.20.6 and Istio 1.9.4. I have set set externalTrafficPolicy: Local and need to run ingress gateway on every node (as said <a href="https://istio.io/latest/docs/tasks/security/authorization/authz-ingress/#source-ip-address-of-the-original-c...
<p>As brgsousa mentioned in the comment, the solution was redeploy as DaemonSet.</p> <p>Here is working yaml file:</p> <pre><code>apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: meshConfig: accessLogFile: /dev/stdout components: ingressGateways: - name: istio-ingressgateway enabled...
<p>AWS seems to be hiding my NVMe SSD when an r6gd instance is deployed in Kubernetes, created via the config below.</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># eks...
<p>Solved my issue, here are my learnings:</p> <ol> <li><p>NVMe will not show up in the instance by default (either in AWS web console or within terminal of the VM), but is accessible as /dev/nvme1. Yes you need to format and mount them. For a single VM, that is straightforward, but for k8s, you need to deliberately fo...
<p>I'm just getting started with kubebuilder and Golang to extend our Kubernetes-cluster with a custom resource. I would love to do different things in the reconciler-function based on the event, that actually called it.</p> <p>Was the resource created? Was it updated? Was it deleted?</p> <p>Each of those events trigge...
<p>You won't be able to to that because this system was designed as level-based and it's not being triggered by individual events changes but rather by the actual cluster state that is being fetch from the apiserver.</p> <p>Looking at <code>reconcile.go</code> you will notice in line <a href="https://github.com/kuberne...
<p>We are looking to use OPA gatekeeper to audit K8s PodDisruptionBudget (PDB) objects. In particular, we are looking to audit the number of <code>disruptionsAllowed</code> within the <code>status</code> field.</p> <p>I believe this field will not be available at point of admission since it is calculated and added by t...
<p>This is actually quite reasonable, and is one of the use cases of <a href="https://open-policy-agent.github.io/gatekeeper/website/docs/audit" rel="nofollow noreferrer">Audit</a>. You just need to make sure audit is enabled and <code>spec.enforcementAction: dryrun</code> is set in the Constraint.</p> <p>Here is an ex...
<p>I would like <code>kubectl config get-contexts</code> to show all, or any arbitrary subset, of the columns shown in default output.</p> <p>Currently, <code>kubectl config get-contexts</code> shows <code>CURRENT NAME CLUSTER AUTHINFO</code> and <code>NAMESPACE</code>. On my terminal, that's a total of 221 columns, wi...
<p>As indicated by the error message:</p> <pre><code>error: output must be one of '' or 'name' </code></pre> <p>and described in <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-strong-getting-started-strong-" rel="nofollow noreferrer">the docs</a>:</p> <pre><code>output o Output...
<p>The following error is being prompted when it is tried to add a new cluster in 'CMAK' in the K8s cluster.</p> <pre><code>Yikes! KeeperErrorCode = Unimplemented for /kafka-manager/mutex Try again. </code></pre> <p>My cluster configurations are as follows,</p> <pre><code>zookeeper: wurstmeister/zookeeper kafka-manager...
<p>I could resolve it by following the steps.</p> <ol> <li><p>Connect to the 'zookeeper' container in k8s</p> <p>k exec -it podid -- bash</p> </li> <li><p>Connect with zookeeper cli,</p> <p>./bin/zkCli.sh</p> </li> <li><p>Make sure that it has created the 'kafka-manager' path already. if it does not exist, then try to ...
<p>I am unable to scale vertical my AKS cluster. Currently, I have 3 nodes in my cluster with 2 core and 8 ram, I am trying to upgrade it with 16 code and 64 RAM, how do I do it? I tried scaling the VM scale set, on Azure portal it shows it is scaled but when I do &quot;kubectl get nodes -o wide&quot; it still shows th...
<p>Vertical scaling or changing the node pool VM size is not supported. You need to create a new node pool and schedule your pods on the new nodes.</p> <p><a href="https://github.com/Azure/AKS/issues/1556#issuecomment-615390245" rel="nofollow noreferrer">https://github.com/Azure/AKS/issues/1556#issuecomment-615390245<...
<p>I am setting up a cluster of Artemis in Kubernetes with 3 group of master/slave:</p> <pre><code>activemq-artemis-master-0 1/1 Running activemq-artemis-master-1 1/1 Running activemq-artemis-master-2 1/1 Running activ...
<p>First, it's important to note that there's no feature to make a client reconnect to the broker from which it disconnected after the client crashes/restarts. Generally speaking the client shouldn't really care about what broker it connects to; that's one of the main goals of horizontal scalability.</p> <p>It's also w...
<p>I have a reccuring problem with container in different pods can't communicate with each other. To make things simple, I created a cluster with only 2 containers in different pods:</p> <ol> <li>app that does only one thing: connecting to redis server.</li> <li>redis-server container</li> </ol> <p>To make long story s...
<p>Posting an answer out of comments since David Maze found the issue (added as a community wiki, feel free to edit)</p> <p>It's very important to match labels between pods, deployments, services and other elements.</p> <p>In the example above, there are different labels used for <code>redis</code> service:</p> <p><cod...
<p>I'm trying to run an automation job in Python that restarts a deployment in Kubernetes cluster. I cannon install <code>kubectl</code> on the box due to limited permissions. Does anyone have a suggestion or solution for this?</p> <p>Thank you.</p>
<p>For configuration follow - <a href="https://github.com/kubernetes-client/python/blob/master/examples/remote_cluster.py" rel="noreferrer">https://github.com/kubernetes-client/python/blob/master/examples/remote_cluster.py</a></p> <pre><code># This is equivalent to `kubectl rollout restart deployment/dashboard-kubernet...
<p>I'm trying to deploy a Quarkus app to a Kubernetes cluster, but I got the following stacktrace:</p> <pre><code>exec java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/quarkus-run.jar __ ____ __ _____ ___ __ ____ ____...
<p>It's due to the <a href="https://github.com/kubernetes/kubernetes/blob/v1.20.0/pkg/kubelet/envvars/envvars.go#L87-L90" rel="noreferrer">docker link variables</a> that kubernetes mimics for <code>Service</code> names in scope; it bites people a lot when they have generically named services such as <code>{ apiVersion:...
<p>I am running on prem kubernetes. I have a release that is running with 3 pods. At one time (I assume) I deployed the helm chart with 3 replicas. But I have since deployed an update that has 2 replicas.</p> <p>When I run <code>helm get manifest my-release-name -n my-namespace</code>, it shows that the deployment y...
<blockquote> <p>What is needed (from a helm point of view) to get the number of replicas down to the limit I set?</p> </blockquote> <p>Your pods need to be in a &quot;healthy&quot; state. Then they are in your desired number of replicas.</p> <p>First, you deployed 3 replicas. This is managed by a ReplicaSet.</p> <p>The...
<p>With the following code, I'm able to fetch all the Pods running in a cluster. How can I find the Pod Controller (Deployment/DaemonSet) using the Kubernetes go-client library?</p> <pre class="lang-golang prettyprint-override"><code>var kubeconfig *string if home := homedir.HomeDir(); home != &quot;&quot; { kubeco...
<p>By following @Jonas suggestion I was able to get Pod's manager. Here's a fully working sample:</p> <pre class="lang-golang prettyprint-override"><code>package main import ( &quot;context&quot; &quot;flag&quot; &quot;fmt&quot; metav1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot; &quot;k8s.io/c...
<p>As per kubectl documentation, kubectl apply is possible by using a file or stdin. My usecase is that there would be service/deployment json strings in runtime and I have to deploy those in clusters using nodejs. Of course, I can create files and just do kubectl apply -f thefilename. But, I don't want to create files...
<pre><code>echo 'your manifest' | kubectl create -f - </code></pre> <p>Reference:</p> <ul> <li><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply</a></li> </ul>
<p>I would like to route traffic to pods based on headers - with a fallback.</p> <p>The desired result would be a k8s cluster where multiple versions of the same service could be deployed and routed to using header values.</p> <p>svcA svcB svcC</p> <p>each of these services (the main branch of git repo) would be deploy...
<p>You can do that using Istio <code>VirtualService</code></p> <pre><code>apiVersion: networking.istio.io/v1beta1 kind: VirtualService ... spec: hosts: - reviews http: - match: - headers: end-user: exact: jason route: - destination: host: reviews subset: v2 - rout...
<p>I'm using the AKS cluster with version 1.19, and I found that this version of K8s using <a href="https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd" rel="nofollow noreferrer">Containerd</a> instead of Dockershim as the container runtime. I also use Fluentd to collect logs from my ...
<p>I found a solution here: <a href="https://github.com/fluent/fluentd-kubernetes-daemonset#use-cri-parser-for-containerdcri-o-logs" rel="nofollow noreferrer">use-cri-parser-for-containerdcri-o-logs</a></p> <blockquote> <p>By default, these images use json parser for /var/log/containers/ files because docker generates ...
<p>Can anybody please tell me how to use the claim as volumes in kubernetes?</p> <p>Does a vol needs to be created?</p> <p>Documentation does not give much information about it: <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#claims-as-volumes" rel="nofollow noreferrer">https://kubernetes.io/do...
<p>A <code>PersistentVolumeClaim</code> allows to bind to an existing <code>PersistentVolume</code>. A <code>PersistentVolume</code> is a representation of a &quot;real&quot; storage device.</p> <p>You have the detailed lookup algorithm in the following page, section <code>Matching and binding</code>: <a href="https://...
<p><code>kubectl logs -f &lt;pod-name&gt;</code></p> <p>This command shows the logs from the container log file.</p> <p>Basically, I want to check the difference between &quot;what is generated by the container&quot; and &quot;what is written to the log file&quot;. I see some unusual binary logs, so I just want to find...
<p>Usually, containerized applications, do not write to the log files but send messages to <code>stdout</code>/<code>stderr</code>, there is no point in storing log files inside containers, as they will be deleted when the pod is deleted.<br /> What you see when running</p> <pre><code>kubectl logs -f &lt;pod-name&gt; <...
<p>It seems that we cannot make the Snowplow container (snowplow/scala-stream-collector-kinesis) use the service account we provide. It always uses the <code>shared-eks-node-role</code> but not the provided service account. The config is set to <code>default</code> for both the <code>accessKey</code> as the <code>secre...
<p>The collector itself doesn't do any role swapping. It only cares to receive credentials via one of three methods:</p> <ul> <li>the default creds provider chain</li> <li>a specific IAM role</li> <li>environment variables.</li> </ul> <p>The most popular deployment is on an EC2 instance, in which case the default EC2 r...
<p>I'm new to Kubernetes and to supporting a particular website hosted in Kubernetes. I'm trying to figure out why cert-manager did not renew the certificate in the QA environment a few weeks back.</p> <p>Looking at the details of various certificate-related resources, the problem seems to be that the challenge failed...
<p>In the end I was unable to determine the cause of the certificate renewal failure. However, events on one of the certificate-related resources suggested previous renewals had worked. So I thought it was possible whatever the problem was might have been transient or a one-off, and that trying again to renew the cer...
<p>Previously my kubernetes pod was running as root and I was running <code>ulimit -l &lt;MLOCK_AMOUNT&gt;</code> in its startup script before starting its main program in foreground. However, I can no more run my pod as root, would you please know how can I set this limit now?</p>
<p>To be able to set it per specific <code>Pod</code>, the way you did it before, unfortunatelly you need privilege escalation i.e. run your container as root.</p> <p>As far as I understand you're interested in setting it only per specific <code>Pod</code>, not globally, right ? Because it can be done by changing docke...
<p>I have multiple openshift routes of type:</p> <pre><code>apiVersion: route.openshift.io/v1 kind: Route metadata: name: &lt;name&gt; labels: app.kubernetes.io/name: &lt;app-name&gt; spec: host: &lt;host&gt; port: targetPort: &lt;targetPort&gt; tls: termination: reencrypt destinationCACertifi...
<p>The option <code>reencrypt</code> is not available in NGINX ingress controller. TLS cert in bare metal ingress is just stored in a secret. In the case of NGINX ingress controller, TLS termination takes place at the controller. In the case of openshift's route, it is similar to edge termination. So it is impossible...
<p>Following a tutorial on Kubernetes and got stuck after the logs look fine, but the port exposed doesn't work : &quot;Connection Refused&quot; using Chrome / curl.</p> <p>Used a yaml file to power up the service via NodePort / ClusterIP.</p> <p>posts-srv.yaml - Updated</p> <pre class="lang-js prettyprint-override"><c...
<p>For structural reasons, it's better to specify the nodePort in your service yaml configuration file or kubernetes will allocate it randomly from the k8s port range (30000-32767). In the ports section it's a list of ports no need, in your case, to specify a name check the <a href="https://kubernetes.io/docs/concepts...
<p>Hope you are all well,</p> <p>I am currently trying to rollout the <a href="https://github.com/ansible/awx-operator" rel="noreferrer">awx-operator</a> on to a Kubernetes Cluster and I am running into a few issues with going to the service from outside of the cluster.</p> <p>Currently I have the following services se...
<p>You are right and the blank address is the issue here. In traditional <em>cloud</em> environments, where network load balancers are available on-demand, a single Kubernetes manifest suffices to provide a single point of contact to the NGINX Ingress controller to external clients and, indirectly, to any application r...
<p>I use k8s nginx ingress controller before my backend, having two instances. When web-cleint sends quite big request to ingress - nginx for POST/PUT/GET request always returns 400 Bad request. Btw, no another explanation or details for this error, or at least it is logged in some place where I cannot find it or ident...
<p>So answer is: nginx is not guilty in described behaviour. After thoroughly investigation of log of java-app which stands behind nginx this exception was noticed</p> <pre><code>[INFO ] 2021-05-10 16:20:56.354 --- [io-10104-exec-4] org.apache.juli.logging.DirectJDKLog : Error parsing HTTP request header Note: furt...
<p>I would like to extend the default &quot;service port range&quot; in <a href="https://docs.k0sproject.io/v1.21.0+k0s.0/" rel="nofollow noreferrer">K0s Kubernetes distro</a>.</p> <p>I know that in kubernetes, setting <code>--service-node-port-range</code> option in <code>/etc/kubernetes/manifests/kube-apiserver.yaml<...
<p>It looks like you could use <code>spec.api.extraArgs</code> to pass the <code>service-node-port-range</code> parameter to api-server.</p> <p><a href="https://docs.k0sproject.io/v1.21.0+k0s.0/configuration/#specapi" rel="nofollow noreferrer">Spec api</a>:</p> <blockquote> <p><strong>extraArgs</strong>: Map of key-val...
<p>Say I have some special nodes in my cluster, and I want to be able to identify with a pod label all pods running on these nodes.</p> <p>Taints &amp; tolerations are close to this, but afaik tolerations aren’t labels, they’re their own thing, and can’t be referenced in places where you expect a label selector, right?...
<p>There are two parts of problem to solve:<br /> <strong>1. Ensure that pods with specific labels are scheduled to specific set of nodes.</strong><br /> This can be done by using custom scheduler or a plugin for default scheduler (more <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-sche...
<p>I installed the Kubernetes and performed kubeadm init and join from the worker too. But when i run kubectl get nodes it gives the following response</p> <p>the server doesn't have a resource type "nodes"</p> <p>What might be the problem here? COuld not see anything in the /var/log/messages </p> <p>Any hints here?...
<p>In my case, I wanted to see the description of my pods.</p> <p>When I used <code>kubectl describe postgres-deployment-866647ff76-72kwf</code>, the error said <strong>error: the server doesn't have a resource type &quot;postgres-deployment-866647ff76-72kwf&quot;</strong>.</p> <p>I corrected it by adding <code>pod</co...
<p>I am learning about highly available distributed systems and some of the concepts that keep coming up are load balancing (Nginx) and container orchestration (Kubernetes). Right now my simplified understanding of them is as so:</p> <h3>Nginx</h3> <ul> <li>Web server that handles Http requests</li> <li>Performs load b...
<blockquote> <p>So my question is, do we use both of these tools in conjunction? It seems like there is some overlap?</p> </blockquote> <p>You seem to have mixed a few concepts. Don't look to much on the number of IP addresses, but more on the <strong>role</strong> of the different components.</p> <h2>Load Balancer / G...
<p>I have an application deployed to Kubernetes that depends on an outside application. Sometimes the connection between these 2 goes to an invalid state, and that can only be fixed by restarting my application.</p> <p>To do automatic restarts, I have configured a liveness probe that will verify the connection.</p> <p>...
<p>I would say, accordingly to the documentation:</p> <blockquote> <h3>Voluntary and involuntary disruptions</h3> <p>Pods do not disappear until someone (a person or a controller) destroys them, or there is an unavoidable hardware or system software error.</p> <p>We call these unavoidable cases <em>involuntary disrupt...
<p>We have a use case to monitor kubernetes clusters and I am trying to find the list of exceptions thrown by kubernetes to reflect the status of the k8s server (in a namespace) while trying to submit a job on the UI.</p> <p>Example: if k8s server throws <code>ClusterNotFound</code> exception that means we cannot submi...
<p>The file you are referencing is a part of Kubernetes library used by many Kubernetes components for API requests fields validations. As all Kubernetes components are written in Go and I couldn't find any plans to port Kubernetes to Java, it's unlikely to have a Java version of that file.</p> <p>However, there is an ...
<p>I have a kubernetes deployment managed by a helm chart that I am planning an upgrade of. The app has 2 persistent volumes attached which are are EBS volumes in AWS. If the deployment goes wrong and needs rolling back I might also need to roll back the EBS volumes. How would one manage that in K8s? I can easily creat...
<p>First you need to define a storage class with reclaimPolicy: Delete</p> <p><a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/storage-classes/</a></p> <pre><code>apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: nam...
<p>I use Kubernetes which v1.19.7, when I run the CronJob sample</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1 kind: CronJob metadata: name: express-learn-cronjob spec: schedule: &quot;*/1 * * * *&quot; jobTemplate: spec: template: spec: containers: ...
<p>For Kubernetes version 1.19.x you need to use <code>batch/v1beta1</code> as apiVersion for your CronJob.</p> <p>That is documented in the doc version 1-19:</p> <p><a href="https://v1-19.docs.kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">https://v1-19.docs.kubernetes.io/docs/concepts/...
<p>I am learning about highly available distributed systems and some of the concepts that keep coming up are load balancing (Nginx) and container orchestration (Kubernetes). Right now my simplified understanding of them is as so:</p> <h3>Nginx</h3> <ul> <li>Web server that handles Http requests</li> <li>Performs load b...
<p>Kubernetes gives you a self-contained/sandboxed environment where your services are safe from the outside world running on private non-routable subnets. Because pods are ephemeral, their IPs can change anytime. Hence, Kubernetes has a &quot;Service&quot; concept. Different micro-services interact with each other us...
<p>I've created a simple K8s deployment with the <code>kubectl create</code> command</p> <pre><code>kubectl create -f k8-deployment.yaml </code></pre> <p>My <code>k8-deployment.yaml</code> file looks like this</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: mag...
<p>You can do this in two ways. Either <em>imperative</em> - a quick command Or <em>declarative</em> - good for a production environment where you store your Deployment-manifest in Git.</p> <p><strong>Imperative way</strong>: (this will then diverge from what you have in your yaml-file)</p> <pre><code>kubectl scale dep...
<p>I have a microservice that is working on my laptop. However, I am using docker compose. I am working to deploy to a kubernetes cluster which I have already set up. I am stuck on making data persistent. E.g here is my mongodb in docker-compose</p> <pre><code>systemdb: container_name: system-db image: mongo:4....
<p>Ok, I have a solution. It works simply by selecting the volume by using the matchLabels selector.</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: mongodb-data-volume labels: app: moderetic type: mongodb role: data spec: storageClassName: hcloud-volumes capacity: storage: ...
<p>I am looking for a simple method to get the storage used and storage allocated for a persistent volume dynamically claimed by PVC for any pod. Is there any rest API or <code>oc</code> command for the same?</p> <p>I am new to OpenShift/Kubernetes. As per my investigation, I could not find any such command. <code>oc ...
<p>You can do: <code>oc rsh podname</code> to access pod command line and then: <code>du -c /path/to/pv</code> or <code>du -shc /path/to/pv</code>.</p>
<p>Is it possible to trigger Pub/Sub event or Google Cloud Function in the GCloud, when my Node pool is auto-scaling under high performance conditions?</p> <p>Or is there any other analytics event which can be used to trigger Cloud Function?</p>
<p>You can be notified (in Pub/Sub) when a node pool is scaled up by setting a <a href="https://cloud.google.com/logging/docs/export" rel="nofollow noreferrer">sink on Stackdriver logs</a>, with a Pub/Sub topic as destination.</p> <p>You have to listen to specific logs corresponding to the scale up of your node pool. T...
<p>I am new to Kubernetes and this is my first time deploying a react-django web app to Kubernetes cluster.</p> <p>I have created:</p> <ol> <li>frontend.yaml # to run npm server</li> <li>backend.yaml # to run django server</li> <li>backend-service.yaml # to make django server accessible for react.</li> </ol> <p>In my f...
<p>Welcome to the community!</p> <p>I reproduced your example and made it work fine. I forked your repository, made some changes to js files and package.json and added Dockerfiles (you can see this commit <a href="https://github.com/fivecatscats/ToDoList/commit/74790836659232284832688beb2e1779660d7615" rel="nofollow no...
<p>I'm trying to provision emepheral environments via automation leveraging Kubernetes namespaces. My automation workers deployed in Kubernetes must be able to create Namespaces. So far my experimentation with this led me nowhere. Which binding do I need to attach to the Service Account to allow it to control Namespace...
<p>To give a pod control over something in Kubernetes you need at least four things:</p> <ol> <li>Create or select existing <code>Role</code>/<code>ClusterRole</code> (you picked <code>administer-cluster</code>, which rules are unknown to me).</li> <li>Create or select existing <code>ServiceAccount</code> (you created ...
<p>After restarting the VM, microk8s stopped running.</p> <pre><code>Executing this command outputs the following: microk8s status: microk8s is not running. use microk8s inspect for a deeper inspection. microk8s kubectl get pod: The connection to the server 127.0.0.1 16443 was refused did you specify the right host or ...
<p>Run <em>ps -ef | grep kubelet</em></p> <p>Output will be somewhat like this:</p> <p><em>root 934 1 5 08:17 ? 00:20:40 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=<strong>/etc/kubernetes/kubelet.conf</strong> --config=/var/lib/kubelet/config.yaml --net...
<p>In kubernetes POD I have an option to mount a secret or a configmap as a volume mounted to the POD. It would be difficult to access these files as environment variables. So why should I be doing it instead of using them as environment variables?</p>
<p>This depends on how the application expect to load the secret.</p> <p>E.g. if the application expect to load an <a href="https://www.tutorialsteacher.com/https/ssl-certificate-format" rel="nofollow noreferrer">SSL certificate file</a>, it is possible to have the certificated as a file in a Secret and mount the Secre...
<p>I have been trying to setup Jenkins to utilize Kubernetes as in the tutorials. I have everything working really well, but I have been trying to add some custom images using the Kubernetes Jenkins plugin. It seems that any public images work just fine, but when I create an image and put it in my private Container R...
<p>When a container build agent (old term was <code>slave</code>) shows as <em>Offline</em> within Jenkins, this usually means there was an error in the Jenkinsfile if using Pipeline, or there was a problem pulling the agent image container.</p> <p>If you're using the Kubernetes Plugin, you'll see the error on the Kube...
<p>Having:</p> <pre><code>kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: namespace: default name: example-role rules: - apiGroups: [&quot;&quot;] resources: [&quot;pods&quot;] verbs: [&quot;get&quot;, &quot;watch&quot;, &quot;list&quot;] </code></pre> <p>And rolebinding:</p> <pre><code>kind: Role...
<p>All Kubernetes clusters have two categories of users: service accounts managed by Kubernetes, and normal users, and a third subject: Groups. Kubernetes does not have objects (kinds) which represent normal user accounts. Normal users cannot be added to a cluster through an API call. Normal users are typically managed...
<p>I have a deployment.yaml which has a readiness probe on the container. (The readiness probe is intended to fail here)</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: nginx name: my-nginx-deployment spec: replicas: 2 selector: matchLabels: app...
<p>The <code>port-forward</code> <a href="https://v1-17.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#create-connect-portforward-pod-v1-core" rel="nofollow noreferrer">api</a> is for a Pod. The <code>kubectl port-forward</code> command just use <em>service</em> to make it easy to use, but your port ...
<p>I have a resource yaml file in a folder structure given below</p> <blockquote> <p>base</p> <p>---- first.yaml</p> <p>main</p> <p>---- kustomization.yaml</p> </blockquote> <p>In kustomization.yaml I am referring the first.yaml as</p> <blockquote> <p>resources:</p> <ul> <li>../base/first.yaml</li> </ul> </blockquote> ...
<p>Kustomize cannot refer to individual resources in parent directories, it can only refer to resources in current or child directories, but it can refer to other Kustomize directories.</p> <p>The following would be a valid configuration for what you have:</p> <pre><code>. ├── base │   ├── main │   │   ├── kustomizatio...
<p>I have a problem with switching context in a terminal and Docker desktop bar panel on Mac:</p> <pre><code>kubectl config use-context master-cluster error: open /Users/sacherus/.kube/config.lock: file exists ls -lh /Users/sacherus/.kube/config.lock ---------- 1 sacherus staff 0B Jun 9 00:01 </code></pre> <...
<p>Community wiki answer based on discussion from the comments</p> <p>Most probably the root cause is duplicate entries in KUBECONFIG env.</p> <p>To fix the problem export proper KUBECONFIG. This was also discussed <a href="https://stackoverflow.com/questions/58985141/getting-kubectl-config-use-context-error-when-tryin...
<p>I'm trying to use the <a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">Kubernetes client-go</a> to access pod details in a cluster.</p> <p>I want to use it to get the details of pods running in one particular namespace, similar to <code>kubectl get pods -n &lt;my namespace&gt;</code>.</p> ...
<p>So, I wrote a function that takes in a Kubernetes client (refer the client-go for details on making one) and a namespace and returns all the pods available-</p> <pre class="lang-golang prettyprint-override"><code>func GetPods(client *meshkitkube.Client, namespace string) (*v1core.PodList, error) { // Create a po...
<p>I can install bitnami/redis with this helm command:</p> <pre><code>helm upgrade --install &quot;my-release&quot; bitnami/redis \ --set auth.existingSecret=redis-key \ --set metrics.enabled=true \ --set metrics.podAnnotations.release=prom \ --set master.podAnnotations.&quot;linkerd\.io/inject&quot...
<p>Look at <a href="https://argoproj.github.io/argo-cd/operator-manual/application.yaml" rel="nofollow noreferrer">this example</a>, parameters containing dots need to be escaped.</p>
<p>i've found two similar posts here but one hasn't been answered and the other was about android. I have a spring boot project and I want to access GCP Storage files within my application.</p> <p>Locally everything works fine I can access my bucket and read as well as store files in my storage. But when i upload it to...
<p>It looks like the conventional Spring boot packaging here isn't packaging the dependency in the needed way. Usually you'll see something like:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt; &lt;version&gt...
<p>I am working to configure Istio in my on prem Kubernetes cluster. As part of this I have to coordinate with my System Admins to setup DNS and load balancer resources.</p> <p>I have found with my work learing and setting up Istio, that I need to fully uninstall it and re-install it. <em>When I do that Istio will pi...
<p>In your Istio operator yaml you can define/override ingressgateway settings (k8s section of an ingressgateway definition)</p> <p><a href="https://istio.io/latest/docs/reference/config/istio.operator.v1alpha1/#KubernetesResourcesSpec" rel="nofollow noreferrer">https://istio.io/latest/docs/reference/config/istio.opera...
<p>I'm trying to add kubectl provider for terraform module and I follow the docs from <a href="https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs" rel="nofollow noreferrer">Terraform kubectl</a>. I run <code>terraform init</code> and provider is installed with success but when I try to add a sample...
<p>In my case it was due to referencing kubectl resources in a module, but the module needed the provider adding to <code>required_providers</code> within the module:</p> <pre><code>terraform { required_providers { kubectl = { source = &quot;gavinbunney/kubectl&quot; version = &quot;x.x.x&quot; }...
<p>I'm new to Kubernetes (K8s). It's my understanding that in order to &quot;do things&quot; in a kubernetes cluster, we interact with a kuberentes REST API endpoint and create/update/delete objects. When these objects are created/updated/deleted K8s will see those changes and take steps to bring the system in-line w...
<blockquote> <p>Is there a canonical description of all the possible configuration fields for these objects?</p> </blockquote> <p>Yes, there is the <a href="https://kubernetes.io/docs/reference/kubernetes-api/" rel="nofollow noreferrer">Kubernetes API reference</a> e.g. for <a href="https://kubernetes.io/docs/reference...
<p>As per these two issues on <code>ingress-nginx</code> Github, it seems that the only way to get grpc/http2 working on port 80 without TLS is by using a custom config template:</p> <ol> <li><a href="https://github.com/kubernetes/ingress-nginx/issues/6313" rel="nofollow noreferrer">ingress does not supporting http2 at...
<p>This is a community wiki answer posted for better visibility. Feel free to expand it.</p> <p>As already mentioned in the comments, the steps to make it work are as follows:</p> <ol> <li><p>Launch a separate nginx controller in an empty namespace to avoid issues with the main controller.</p> </li> <li><p>Create custo...
<p>I have a simple container that consists of OpenLDAP installed on Alpine. It's installed to run as a non-root user. I am able to run the container without any issues using my local Docker engine. However, when I deploy it to our Kubernetes system it is killed almost immediately as OOMKilled. I've tried increasing...
<p>Check your deployment or pod spec for resource limits.</p> <p>If your application requires more memory than it is allowed, it will be OOMKilled by the kubernetes.</p> <pre><code>... resources: limits: memory: 200Mi requests: memory: 100Mi ... </code></pre> <p><strong>Equivalent JAVA JVM flags to better u...
<p>I have an NFS based PVC in a kubernetes cluster that I need to freeze to take a snapshot of. I tried fsfreeze, but I get &quot;operation not supported&quot;. I assume because it is trying to freeze the entire nfs instead of just the mount. I have checked and I can freeze the filesystem on the side of the NFS serve...
<p>From <a href="https://github.com/vmware-tanzu/velero/issues/2042" rel="nofollow noreferrer">https://github.com/vmware-tanzu/velero/issues/2042</a> and some other quick poking around, fsfreeze doesn't support NFS mounts. In general it seems to mostly on work with real local volumes which you'll almost never use with ...
<p>In GKE, the <code>Reclaim Policy</code> of my <code>PersistentVolume</code> is set to <code>Retain</code>, in order to prevent unintentional data removal. However, sometimes, after the deletion of some <code>PersistentVolumes</code>, I'd like to remove the associated <code>Google Persistent Disks</code> manually. De...
<p>This one should work:</p> <pre><code>gcloud compute disks delete $(gcloud compute disks list --filter=&quot;-users:*&quot; --format &quot;value(uri())&quot;) </code></pre>
<p>Dear StackOverflow community!</p> <p>I am trying to run the <a href="https://github.com/GoogleCloudPlatform/microservices-demo" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/microservices-demo</a> locally on minikube, so I am following their development guide: <a href="https://github.com/GoogleClo...
<p>Tried it with docker driver, i.e. <code>minikube start --driver=docker</code>, and it works. Thanks Brian!</p>
<p>Assume there is a system that accepts millions of simultaneous WebSocket connections from client applications. I was wondering if there is a way to route WebSocket connections to a specific instance behind a load balancer (or IP/Domain/etc) if clients provide some form of metadata, such as hash key, instance name, e...
<p>Routing in HTTP is generally based on the hostname and/or URL path. Sometimes to a lesser degree on other headers like cookies. But in this case it would mean that each group should have it's own unique URL.</p> <p>But that part is easy, what I think you're really asking is &quot;given arbitrary URLs, how can I get ...
<p>I have the following ConfigMap in my Kubernetes cluster that contains the <code>web.config</code> for my application there is a different one per environment so I would like to volume mount the ConfigMap to <code>web.config</code> in the pod.</p> <p><strong>ConfigMap</strong>:</p> <pre class="lang-yaml prettyprint-o...
<p>When configMap is mounted as volume then it will delete all the files which were previously present in the mount path, this is expected behaviour. Please refer caution section in this <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#populate-a-volume-with-data-stored-in-a-co...
<p>I followed <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes" rel="nofollow noreferrer">this tutorial</a> to serve a basic application using the NGINX Ingrss Controller, and cert-manager with letsencrypt.</p> <p>I am able to visit th...
<p>LetsEncrypt staging is for testing, and does not issue certificates that are trusted by browsers. Use the production LE URL instead <code>https://acme-v02.api.letsencrypt.org/directory</code></p>
<p>I'm trying to use kubernetes-alpha provider in Terraform, but I have &quot;Failed to construct REST client&quot; error message. I'm using tfk8s to convert my yaml file to terraform code.</p> <p>I make the seme declaration for the provider than kubernetes, and my kubernetes provider work correctely</p> <pre><code>pr...
<p>After some digging, I found that this resource requires a running kubernetes instance and config before the terraform plan will work properly. Best stated in github here: <a href="https://github.com/hashicorp/terraform-provider-kubernetes-alpha/issues/199#issuecomment-832614387" rel="nofollow noreferrer">https://gi...
<p>in my k8s system I have a nginx ingress controller as LoadBalancer and accessing it to ddns adress like hedehodo.ddns.net and this triggering to forward web traffic to another nginx port. Now I deployed another nginx which works on node.js app but I cannot forward nginx ingress controller for any request to port 300...
<p>Each host cannot share multiple duplicate paths, so in your example, the request to host: <code>hedehodo.ddns.net</code> will always map to the first service listed: <code>my-nginx:80</code>.</p> <p>To use another service, you have to specify a different path. That path can use any service that you want. Your ingres...
<p>I want to deploy helm charts, which are stored in a repository in AWS ECR, in the kubernetes cluster using ArgoCD. But I am getting a 401 unauthorized issue. I have pasted the entire issue below</p> <pre><code>Unable to create application: application spec is invalid: InvalidSpecError: Unable to get app details: rpc...
<p>Yes, you can use ECR for storing helm charts (<a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/push-oci-artifact.html" rel="noreferrer">https://docs.aws.amazon.com/AmazonECR/latest/userguide/push-oci-artifact.html</a>)</p> <p>I have managed to add the repo to ArgoCD, but the token expires so it is not...
<p>I'm trying to set up an Ingress rule for a service (Kibana) running in my microk8s cluster but I'm having some problems.</p> <p>The first rule set up is</p> <pre><code>Name: web-ingress Namespace: default Address: 127.0.0.1 Default backend: default-http-backend:80 (&lt;error: endpoints &...
<p>Add the following annotation to the <code>kibana</code> ingress so that nginx-ingress interprets the <code>/kibana(/|$)(.*)</code> path using regex:</p> <pre><code> nginx.ingress.kubernetes.io/use-regex: &quot;true&quot; </code></pre> <p>Additional detail: To let kibana know that it runs on <code>/kibana</code> path...
<p>I am using kubernetes and its resources like secrets. During deployment one secret has been created (say test-secret) with some values inside it. Now I need to renamed this secretes (dev-secret) within the same namespace. How can I rename the secret or how can I copy test-secret value to dev-secret.</p> <p>Please le...
<p>There is no specific way to do this. The Kubernetes API does not have &quot;rename&quot; as an operation. In this particular case you would <code>kubectl get server test-secret -o yaml</code>, clean up the <code>metadata:</code> sections that don't apply anymore, edit the name, and <code>kubectl apply</code> it agai...
<p>I am trying to create a shell script that will validate that certain pods are ready by checking the READY heading showing 1/1. I have tried two ways.</p> <p>1.</p> <pre><code>ready=$(oc get pods | awk '{print $2}' | tail -n +2) # prints 1/1 or 0/1 for each pod until [[ ${ready} == "1/1" ]] do echo "Waiting for p...
<p>I'm surprised no one so far has mentioned the experimental, yet official <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait" rel="noreferrer">kubectl wait</a>:<br /> <code>$ kubectl wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=del...
<p>In my spring boot microservice project, one of the microservice is upgraded to java 11 and it is causing some issue in my existing functionality. I want to change the version of java from 11 to 8 in that microservice. but I am unable to do it as its created as docker image automatically through jenkins.</p> <p>In th...
<p>@RakshithM yes, Jenkins must refer the <code>Dockerfile</code> to build docker container, if you find out then you can do it as suggested by @David. for you reference <a href="https://docs.docker.com/language/java/build-images/" rel="nofollow noreferrer">https://docs.docker.com/language/java/build-images/</a> , any ...
<p>I've got familiar with kubernetes very recently. I want to deploy a project into my minikube cluster. Here is the yaml file:</p> <p><em>deployment.yml</em></p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: labels: run: project name: project namespace: default spec: replicas: 1 selector: ...
<p>I think you can use a Service of type <code>ExternalName</code> with the special hostname provided by Minikube: <a href="https://minikube.sigs.k8s.io/docs/handbook/host-access/#hostminikubeinternal" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/host-access/#hostminikubeinternal</a> This expose...
<p>I have used some bitnami charts in my kubernetes app. In my pod, there is a file whose path is /etc/settings/test.html. I want to override the file. When I search it, I figured out that I should mount my file by creating a configmap. But how can I use the created configmap with the <strong>existed pod</strong> . Man...
<p>If not all then almost all pod specs are immutable, meaning that you can't change them without destroying the old pod and creating a new one with desired parameters. There is <em>no way</em> to edit pod volume list without recreating it.</p> <p>The reason behind this is that pods aren't meant to be immortal. Pods me...
<p>I enabled AGIC in the Azure portal and then created <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout" rel="nofollow noreferrer">Fanout Ingress</a>. But it's not working. I checked Rules (ingress-appgateway &gt; Rules &gt; Path-based routing) and paths are targeting correct back...
<p><code>appgw.ingress.kubernetes.io/backend-path-prefix: /</code> solved the problem as pointed out by @Matt in the comment section.</p> <p>I can now target multiple backend pools using different paths i.e. <code>/api</code> for API service &amp; <code>/app</code> for UI app.</p> <p>I wrote <a href="https://hovermind....
<p>I have recently upgrade my AKS cluster from 1.16.x to 1.18.17 (it was a jump of two versions). I did the upgrade using the Azure Portal, not the CLI.</p> <p>The upgrade itself has worked, I can see my cluster is now on version 1.18.17 and on first glance everything seems to be working as expected, but at the top of ...
<p>Answering my own question in the hope it can help others, or myself in the future.</p> <p>I managed to get more information of the error by running an update with the azure cli <a href="https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster" rel="nofollow noreferrer">Upgrade an Azure Kubernetes Service (AKS) cl...