prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I've got 2 k8 clusters on <code>1.19</code> and <code>1.16</code> versions.
It's need to be updated to <code>1.22</code>. And from documentation I found that Ingress API changed for <code>1.22</code> (<code>extensions/v1beta1</code> deprecated)</p>
<p>Cluster contains allot of ingress with <code>extensions/v1beta1</... | <p>Before version <em>1.20</em> there was <code>kubectl convert</code> command, which was used to <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/#migrate-to-non-deprecated-apis" rel="nofollow noreferrer">convert to non-depracted APIs</a>. However, it was removed in <em>1.20</em> <sup>[<a href... |
<p>Our specialized provider exposes an API that allows only one consumer IP.</p>
<p>How can we get the requests of a cluster with three nodes go out from the same public IP (without NGinX proxy)?</p>
| <blockquote>
<p>How can we get the requests of a cluster with three nodes go out from the same public IP</p>
</blockquote>
<p>Assign the IP to a node, thus making it public. Use an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress controller</a> (bu... |
<p>I want to create a Kubernetes cluster in AWS using the command:</p>
<pre><code>eksctl create cluster \
--name claireudacitycapstoneproject \
--version 1.17 \
--region us-east-1 \
--nodegroup-name standard-workers \
--node-type t2.micro \
--nodes... | <p><code>What permission do I need to provide to the AWS user to execute it?</code></p>
<p>You can check the minimum IAM requirement to run eksctl <a href="https://eksctl.io/usage/minimum-iam-policies/" rel="nofollow noreferrer">here</a>.</p>
|
<p>I have a Kubernetes cluster with Elasticsearch currently deployed.</p>
<p>The Elasticsearch coordinator node is accessible behind a service via a <code>ClusterIP</code> over HTTPS. It uses a self-signed TLS certificate.</p>
<p>I can retrieve the value of the CA:</p>
<pre class="lang-sh prettyprint-override"><code>ku... | <p>Got this working and learned a few things in the process:</p>
<ul>
<li>Secret resources reside in a namespace. Secrets can only be referenced by Pods in that same namespace. (<a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">ref</a>). Therefore, I switched to using a share... |
<p>I want to put my docker image running react into kubernetes and be able to hit the main page. I am able to get the main page just running <code>docker run --rm -p 3000:3000 reactdemo</code> locally. When I try to deploy to my kubernetes (running locally via docker-desktop) I get no response until eventually a timeou... | <p>if you are using Kubernetes using minikube in your local system then it will not work with localhost:3000, because it runs in minikube cluster which has there owned private IP address, so instead of trying localhost:3000 you should try <code> minikube service <servicename></code> this in your terminal and it s... |
<p>Can i use different versions of cassandra in a single cluster? My goal is to transfer data from one DC(A) to new DC(B) and decommission DC(A), but DC(A) is on version 3.11.3 and DC(B) is going to be *3.11.7+</p>
<p>* I Want to use K8ssandra deployment with metrics and other stuff. The K8ssandra project cannot deploy... | <p>K8ssandra itself is purposefully an "opinionated" stack, which is why you can only use certain more recent and not-known to include major issues versions of Cassandra.</p>
<p>But, if you already have the existing cluster, that doesn't mean you can't migrate between them. Check out this blog for an example... |
<p>Is there a way to create a namespace with one label using <code>kubectl</code>?</p>
<p>e.g.</p>
<pre><code>kubectl create ns <newnamespace> label=appid:foo12
</code></pre>
<p>as opposed to using <code>kubectl apply -f <somefile></code></p>
| <p>This may help you:</p>
<pre><code>kubectl create namespace namespace_name
kubectl label namespaces namespace_name labelname=value --overwrite=true
</code></pre>
|
<ul>
<li><p>Can Kubernetes pods share significant amount of memory?</p>
</li>
<li><p>Does copy-on-write style forking exist for pods?</p>
</li>
</ul>
<p>The purpose is to make pods spawn faster and use less memory.</p>
<p>Our scenario is that we have a dedicated game server to host in kubernetes. The problem is that on... | <p>A different way to resolve the issue would be if some of the initialisation can be baked into the image.</p>
<p>As part of the docker image build, start up the game server and do as much of the 30s - 1min initialisation as possible, then dump that part of the memory into a file in the image. On game server boot-up, ... |
<p>I have a pod and a service, basically the problem is that I want the traffic to port 11010/TCP to arrive with a delay for testing purpose:</p>
<p>NAME READY STATUS RESTARTS AGE<br />
pod/regression 1/1 Running 0 6m58s</p>
<p>N... | <p>there is no straightaway solution to this..
but you can use service mesh to achieve this..
I am familiar with istio (not sure with any other service mesh solution) and this could give some idea on how to achieve your query
<a href="https://istio.io/latest/docs/tasks/traffic-management/fault-injection/" rel="nofollow... |
<p>I'm developing a project with microservices architecture. I have Spring cloud gateway, eureka service discovery and book microservice. When i run these application locally everything works. When i run these with docker compose still no problems. But when i deploy these to kubernetes i get error on api gateway. I get... | <p>It seems you have DNS issues with pod hostnames. In kubernetes DNS name of pods are generally formatted like this: <code>pod-ip-address.deployment-name.my-namespace.svc.cluster-domain.example</code> (see <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pods" rel="nofollow noreferrer"... |
<p>I've a simle React JS application and it's using a environment variable(REACT_APP_BACKEND_SERVER_URL) defined in .env file. Now I'm trying to deploy this application to minikube using Kubernetes.</p>
<p>This is my deployment file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: test-ui
spec:
... | <p>After starting the app with your deployment YAML and checking for the environment variables I see the environment variables for that environment variable.</p>
<pre><code>REACT_APP_BACKEND_SERVER_URL=http://127.0.0.1:59058
</code></pre>
<p>you can check that by doing an <code>kubectl exec -it <pod-name> -- sh</... |
<p>My pod can't be created because of the following problem:</p>
<pre><code>Failed to pull image "europe-west3-docker.pkg.dev/<PROJECT_ID>/<REPO_NAME>/my-app:1.0.0": rpc error: code = Unknown desc = Error response from daemon: Get https://europe-west3-docker.pkg.dev/v2/<PROJECT_ID>/<REPO_... | <p>I encountered the same problem, and was able to get it working by executing:</p>
<pre class="lang-sh prettyprint-override"><code>gcloud projects add-iam-policy-binding ${PROJECT} \
--member=serviceAccount:${EMAIL} \
--role=roles/artifactregistry.reader
</code></pre>
<p>with <code>${PROJECT}</code> = the project name... |
<p>I am a beginner with Kubernetes. I have enabled it from Docker Destop and now I want to install Kubernetes Dashboard.</p>
<p>I followed this link:</p>
<p><a href="https://github.com/kubernetes/dashboard#getting-started" rel="nofollow noreferrer">https://github.com/kubernetes/dashboard#getting-started</a></p>
<p>And ... | <p>The error indicated that your cluster version is not compatible to use <code>seccompProfile.type: RuntimeDefault</code>. In this case you don't apply the dashboard spec (<a href="https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml" rel="nofollow noreferrer">https://raw.githubuse... |
<p>I have a master node, now I want to join the master node from a work node, I generated a never expiry token and execute join command, however I got this error:</p>
<pre><code>[root@worker-node1 ~]# kubeadm join 192.168.18.136:6443 --token cjxj26.ibwrtisae30ypis6 \
</code></pre>
<blockquote>
<p>--discovery-token-ca-c... | <p>Maybe your problem, is from token timed out.</p>
<p>If you want to sure this problem exist you can run below command</p>
<pre><code>kubeadm token list
</code></pre>
<p>If above command does not show anything, your problem is token is timed out.</p>
<p>for resolve your problem, you can do below</p>
<pre><code>kubeadm... |
<p><strong>Hello!</strong></p>
<p>I tired to create some playbook for deploying "AWX Operator" and Kubernetes using manual of installation <a href="https://computingforgeeks.com/how-to-install-ansible-awx-on-ubuntu-linux/#comment-8810" rel="nofollow noreferrer">Install AWX Operator</a></p>
<p>I have the comma... | <p>You have everything written in this error :)</p>
<p><strong>There is a problem with the command</strong></p>
<pre class="lang-yaml prettyprint-override"><code>kubectl create ns NAMESPACE
</code></pre>
<p>You want to create a namespace called <code>NAMESPACE</code> which is wrong. <strong>You cannot use capital lette... |
<p>If I run the command</p>
<pre><code>$ kubectl exec pod-name echo Hello World
</code></pre>
<p>I get a deprecation error message asking me to include the '--' characters.</p>
<pre><code>kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
</... | <p>According the book "Kubernetes in action" by Marko Luksa:</p>
<blockquote>
<p>Why the double dash?</p>
</blockquote>
<blockquote>
<p>The double dash (--) in the command signals the end of command options for
kubectl. Everything after the double dash is the command that should be executed
inside the pod . U... |
<p>A simple question about scalability. I have been studying about scalability and I think I understand the basic concept behind it. You use an orchestrator like Kubernetes to manage the automatic scalability of a system. So in that way, as a particular microservice gets an increase demand of calls, the orchestrator wi... | <blockquote>
<p>In the case of our application, we are using SQLite, so each microservice has its own copy of the database.</p>
</blockquote>
<p>One of the most important aspects of services that scale-out is that they are <a href="https://12factor.net/processes" rel="nofollow noreferrer">stateless</a> - services on Ku... |
<p>I have one question regarding the <a href="https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage" rel="nofollow noreferrer">access log of envoy</a>:</p>
<ul>
<li>I use the field host: <code>%REQ(:AUTHORITY)%</code>, can I remove the port?</li>
</ul>
<p>Or is there another fields wh... | <p>First, the <code>"%REQ(:AUTHORITY)%"</code> field does not contain any information about the port. Look at this <a href="https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#format-strings" rel="nofollow noreferrer">official documentation</a>:</p>
<blockquote>
<p>Format ... |
<p>I have the following pod setup:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: proxy-test
namespace: test
spec:
containers:
- name: container-a
image: <Image>
imagePullPolicy: Always
ports:
- name: http-port
containerPort: 8083
- name: container-proxy
... | <h2>Environment</h2>
<p>I replicated the scenario on <code>kubeadm</code> and <code>GCP GKE</code> kubernetes clusters to see if there is any difference - no, they behave the same, so I assume AWS EKS should behave the same too.</p>
<p>I created a pod with 3 containers within:</p>
<pre><code>apiVersion: v1
kind: Pod
me... |
<p>I am trying to add a side car container to an existing pod (webapp-1) to save the logs. However, I am getting error after creating the pod. The pod is crashing and the status changes to error..</p>
<p>For the below question i have added the yaml file. Please let me know if this is fine.</p>
<p> Add a side car conta... | <p>First of all, You could create a directory and the logfile itself. If the <code>count-log-1</code> container spin up first, it will have nothing to read and exit with an error. To to it, a good practise is to use an <strong>Init Container</strong>. <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-con... |
<p>I would like to know, how to find service name from the Pod Name in Kubernetes.</p>
<p>Can you guys suggest ?</p>
| <p>Services (<code>spec.selector</code>) and Pods (<code>metadata.labels</code>) are bound through shared labels.</p>
<p>So, you want to find all Services that include (some) of the Pod's labels.</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get services \
--selector=${KEY-1}=${VALUE-1},${KEY-2}=${VALUE-2... |
<p>I have two services, say <code>svcA</code> and <code>svcB</code> that may sit in different namespaces or even in different k8s clusters. I want to configure the services so that <code>svcA</code> can refer to <code>svcB</code> using some constant address, then deploy an Istio <strong>Service Entry</strong> object de... | <p>I have posted community wiki answer to summarize the topic and paste explanation of the problem:</p>
<p>After doing some random/crazy test, I found that the <em>alias</em> domain name must ends with well know suffix, like <code>.com</code>, <code>.org</code>, arbitrary suffix, like <code>.svc</code>, <code>.al... |
<p>I have created a pod on Kubernetes and mounted a local volume but when I try to execute the ls command on locally mounted volume, I get a permission denied error. If I disable SELINUX then everything works fine. I am unable to make out how do I make it work with SELinux enabled.</p>
<h3>Following is the output of pe... | <p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p>
<p>SELinux labels can be assigned with <code>seLinuxOptions</code>:</p>
<pre><code>apiVersion: v1
metadata:
name: testpod
labels:
name: testpod
spec:
hostname: testpod
restartPolicy: Never
volumes:
- ... |
<p>I'm quite new in docker and VPNs so I don't know what should be the best way to achieve this.</p>
<p>Contex:
I use airflow in Google Cloud to schedule some task. These tasks are dockerized so each task is the execution of a docker container with a script (Using KubernetesPodOperator)</p>
<p>For this use case I need ... | <p>I think what you saw is good advice.</p>
<p>There are a number of projects that show how it could be done - one example here: <a href="https://gitlab.com/dealako/k8s-sidecar-vpn" rel="nofollow noreferrer">https://gitlab.com/dealako/k8s-sidecar-vpn</a></p>
<p>Using sidecar for VPN connection is usually a good idea. I... |
<p>I am new to Kubernetes and I am deploying an application for the first time on Kubernetes. I want to deploy a postgreSQL statefulset and a simple replicaset of spring boot pods. I created a headless service that will be attached to the following statefulset.</p>
<pre><code> # Headless Service
apiVersion: v1
kind:... | <p>The definition of a headless service is to not provide a DNS record and provide internal load balancing.</p>
<p>A headless service can be used to query the endpoints and handle them separately.</p>
<p>To fix your issue create a regular service.</p>
|
<p>I have a phpmyadmin service running on kubernetes cluster. I want to reserve an External IP (static) on google cloud to use with this service so that it could be reachable from the internet.
I have tried reserving an IP address on GCP and used it in the kubernetes service file as below:</p>
<pre><code>apiVersion: v1... | <p>Instead of setting the <code>exteranlIPs</code>, you should set the <code>spec.loadBalancerIP</code> with the <code>spec.type</code> being of <code>LoadBalancer</code> value:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: /snap/kompose/19/kompose-linux-amd64 convert
kompose... |
<p>I'm trying to create a config map from my mongodb configuration file. I have used the following command:</p>
<pre><code>kubectl create configMap mongodb-config-file --from-file=conf=mongodb.cfg
</code></pre>
<p>and I get this error:</p>
<blockquote>
<p>Error: unknown flag: --from-file<br />
See 'kubectl create --hel... | <p>The proper syntax for a <code>configMap</code> object creation is as follows:</p>
<pre><code>kubectl create configmap NAME [--from-file=[key=]source]
</code></pre>
<p>The resource object is <code>configmap</code> and not <code>configMap</code>:</p>
<pre><code>kubectl create configmap mongodb-config-file --from-file=... |
<p>How do I create an ingress(ping) to expose a single service(hello) given a path (/hello )and a port (6789) in a given namespace (dev)?</p>
<p>the following is right? Also how to verify the same?</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ping
namespace: dev
annotations:
n... | <p>You might need to add the host into the ingress YAML if you are looking forward to use the domain for resolution like</p>
<p><strong>hello-world.info</strong> forward the traffic to <strong>hello</strong> service.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annot... |
<p>I have two pods, each with a LoadBalancer svc. Each service's IP address is working.</p>
<p>My first service is:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: hello-world-1
spec:
type: LoadBalancer
selector:
greeting: hello
version: one
ports:
- protocol: TCP
port: 60000
targe... | <p>By default, when you create an ingress in your cluster, GKE creates an HTTP(S) load balancer and configures it to route traffic to your application, as stated in the following document [1]. So, you should not be configuring your services as LoadBalancer type, instead you need to configure them as NodePort.</p>
<p>He... |
<p>I am new to Kubernetes and I am deploying an application for the first time on Kubernetes. I want to deploy a postgreSQL statefulset and a simple replicaset of spring boot pods. I created a headless service that will be attached to the following statefulset.</p>
<pre><code> # Headless Service
apiVersion: v1
kind:... | <p>Headless service won't give you DNS record you should be any of ClusterIP or NodePort or LoadBalancer</p>
<blockquote>
<p>A headless service is a service with a service IP but instead of
load-balancing it will return the IPs of our associated Pods. This
allows us to interact directly with the Pods instead of a proxy... |
<p>I'm trying to emulate <a href="https://github.com/grpc-ecosystem/grpc-health-probe" rel="nofollow noreferrer">theRUN step</a> you would fine in a docker file shown below in the <a href="https://github.com/bazelbuild/rules_docker/blob/master/docs/container.md#container_image" rel="nofollow noreferrer">Bazel docker co... | <p><a href="https://github.com/bazelbuild/rules_docker/blob/master/docker/util/README.md#container_run_and_commit" rel="nofollow noreferrer">container_run_and_commit</a> is the closest equivalent to <code>RUN</code>. Something like this is the direct equivalent:</p>
<pre class="lang-py prettyprint-override"><code>load(... |
<p>I have a kubernetes cluster inside which there will be some pods running. For each pod I want to assign a unique id as env variable. eg: pod 1 server_id= 1, pod 2 server_id=2 etc.
Anyone have any idea how this can be done. I am building my docker image and deploying to cluster through gitlab ci.</p>
| <p><strong>Adding ENV variables into helm or YAML template</strong></p>
<p>You can add a variable to the YAML file and apply it as per the requirement if your deployment are different.</p>
<p><strong>Get the variables values into POD and use it</strong></p>
<p>Or else you can get the POD name of deployment that will be... |
<p>I need to deploy a spring boot application on google Kubernetes. The application depends on Optaplanner which need to compile some Java classes into bytecode on the fly at runtime, so JDK is needed.</p>
<p>How to deploy on a JDK-provided Kubernetes engine, instead of JRE?</p>
| <p>You can create the Docker file and docker image with the JDK so that your application can use the JDK from the docker.</p>
<p>For spring boot example you can check out: <a href="https://github.com/spring-guides/gs-spring-boot-docker" rel="nofollow noreferrer">https://github.com/spring-guides/gs-spring-boot-docker</a... |
<p>Sometimes we face some nginx vulnerabilities,
so we need to fix the nginx vulnerabilities inside ingress-nginx,
but the docker build -t image is too slow.
The reason is that the dockerfile internal will make compile and make install process.
How to add some parameters can make the docker build process faster?</p>
<p... | <p>There is no one good solution on how to speed up the building of a Docker image. This may depend on a number of things. That is why I am posting the answer of the community wiki to present as many solution proposals as possible, referring to various tutorials.</p>
<hr />
<p>There are a few tricks you can use to spee... |
<p>The whole cluster consists of 3 nodes and everything seems to run correctly:</p>
<pre><code>$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default ingress-nginx-controller-5c8d66c76d-wk26n 1/1 Running... | <p>Ingress is <strong>namespaced</strong> resource , and kubernetes-dashboard pod located in "kubernetes-dashboard" namespace .</p>
<p>so you need to move the ingress to the "kubernetes-dashboard" namespace.</p>
<p>:: To list all namespaced k8s resources ::</p>
<pre><code>kubectl api-resources --nam... |
<p>The <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale" rel="nofollow noreferrer">docs</a> says:</p>
<blockquote>
<p>For per-pod resource metrics (like CPU), the controller fetches the metrics from the resource metrics API for each Pod targeted by the HorizontalPodAutoscaler. Then, if... | <p>Your misunderstanding might be that the value of <code>request</code> is not necessarily the minimum your app need to run.</p>
<p>It is what you (the developer, admin, DevOps) request from the Kubernetes cluster for a pod in your application to run and it helps the scheduler to pick the right node for your workload ... |
<p>i would like to know if is possible to isolate namespace on Azure Kubernetes service. Now if i give rbac role to my colleague they can see all namespace, i would like to segregate namespace for department, e.g. data can see only data namespace, dev can see only den namespace etc..</p>
<p>is it possible?</p>
<p>Thank... | <p>yes, You have to Enable <code>AKS-managed Azure Active Directory</code>, <code>Role-based access control (RBAC)</code> & <a href="https://learn.microsoft.com/en-us/azure/aks/azure-ad-rbac?toc=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fazure%2Faks%2Ftoc.json&bc=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fazu... |
<p>I wish to deploy a RabbitMQ StatefulSet on EKS, and prevent it from deploying onto nodes running a Jenkins controller. The affinity rules are not working.</p>
<p>The pod selector labels are:</p>
<pre><code>NAME READY STATUS RESTARTS AGE IP NODE ... | <p>So the above rule do work, but not only had the existing Helm deployment to be deleted, but also the existing deployment PVC and the PV. Once all was cleared down and recreated, the affinity rules started to play ball.</p>
|
<p>In my folder, I have a <strong>deployment.yaml</strong> file and a <strong>kustomization.yaml</strong>
Inside the <strong>kustomization.yaml</strong>:</p>
<pre><code>bases:
- ../base
- deployment.yaml
</code></pre>
<p>When I run <code>kubectl apply -f deployment.yaml</code>, it runs successfully
but when running <co... | <p>This is most likely because the folder is a symlink to another folder or nfs share
It should be hard local directory to be able to apply yaml files in it from kubectl</p>
|
<p>I'm executing some experiments on a Kubeflow cluster and I was wondering if there is a faster way than using the Kubeflow UI to set up the run input parameters.
I would like to connect from command line to the Kubefow cluster and run executions from there but i cannot find any documentation.
Thanks</p>
| <p>Kubeflow pipelines has a command line tool called <a href="https://www.kubeflow.org/docs/components/pipelines/sdk/sdk-overview/#kubeflow-pipelines-cli-tool" rel="nofollow noreferrer">kfp</a>, so for example you can use <code>kfp run submit</code> to start a run.</p>
|
<p>I have an existing ebs volume in AWS with data on it. I need to create a PVC in order to use it in my pods.
Following this guide: <a href="https://medium.com/pablo-perez/launching-a-pod-with-an-existing-ebs-volume-mounted-in-k8s-7b5506fa7fa3" rel="nofollow noreferrer">https://medium.com/pablo-perez/launching-a-pod-w... | <p>The "waiting for consumer" message suggests that your StorageClass has its <code>volumeBindingMode</code> set to <code>waitForFirstConsumer</code>.</p>
<p>The default value for this setting is <code>Immediate</code>: as soon as you register a PVC, your volume provisioner would provision a new volume.</p>
<... |
<p>I am having difficulty getting a kubernetes livenessProbe exec command to work with environment variables.
My goal is for the liveness probe to monitor memory usage on the pod as well as also perform an httpGet health check.</p>
<p>"If container memory usage exceeds 90% of the resource limits OR the http respon... | <p>Looks like the shell is seeing your whole command as a filename to execute.</p>
<p>I would remove the outer quotes</p>
<pre><code>livenessProbe:
exec:
command:
- sh
- -c
- |-
used=$(awk '{ print int($1/1.049e+6) }' /sys/fs/cgroup/memory/memory.usage_in_bytes);
thresh=$(awk '{ print int(... |
<p>How can we ssh into kubernetes cluster from windows machine. I am running my cluster in gcp compute engine.</p>
| <blockquote>
<p>How can we ssh into kubernetes cluster from windows machine</p>
</blockquote>
<p>Hi,</p>
<p>SSH into Kubernetes cluster can mean:</p>
<ol>
<li><p>SSH into the Kubernetes pods <br>
If this is what you mean, you can use the command:</p>
<p><code>kubectl -n your-namespace exec -it your-pod -- sh</code></p>... |
<p>We are using Lens for developing on Kubernetes and we have started using Lens Metrics Stack. Is there a way to change time period of visualization? It is set to <code>-60m</code> by default and so far we could not find any way to change that.</p>
| <p>Yes, you are right. 60 minutes is the default, according to the information from <a href="https://github.com/lensapp/lens/blob/58a446bd45f9ef21fe633e5cda1c695113d5b5c4/src/common/k8s-api/endpoints/metrics.api.ts#L55" rel="nofollow noreferrer">lensapp/lens GitHub repository</a>:</p>
<blockquote>
<p>time-range in seco... |
<p>I'd like to create a nginx ingress controller with AWS internal NLB, the requirement is fix the IP address of NLB endpoint, for example, currently the NLB dns of Nginx ingress service is abc.elb.eu-central-1.amazonaws.com which is resolved to ip address 192.168.1.10, if I delete and re-create nginx ingress controlle... | <p><strong>The only LBs that will be managed (at least at the current version 2.3 of the AWS LB Controller) are "nlb-ip" and "external" types.</strong> This is specified at:
<a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/guide/service/annotations/#legacy-cloud-provider"... |
<p><a href="https://i.stack.imgur.com/rcm8B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rcm8B.png" alt="enter image description here" /></a></p>
<p>The picture above shows the list of all kubernetes pods I need to save to a text file (or multiple text files).</p>
<p>I need a command which:</p>
<o... | <p>The simplest solution is to create a shell script that does exactly what you are looking for:</p>
<pre><code>#!/bin/sh
FILE="text1.txt"
for p in $(kubectl get pods -o jsonpath="{.items[*].metadata.name}"); do
kubectl logs $p >> $FILE
done
</code></pre>
<p>With this script you will get ... |
<p>I would like to create a yaml once the k8s pod is up, in my previous attempt, I just upload the yaml file and use wget to download it.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- name: p-test
image: p-test:latest
command:... | <p>Instead of playing with <code>heredoc</code> in pod definition, it's much better and convenient to define your <code>yaml</code> file in <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">the ConfigMap</a> and refer to it in your pod definition (mount it as volume and <a... |
<p>I would like to manage configuration for a service using terraform to a GKE cluster defined using external terraform script.</p>
<p>I created the configuration using <a href="https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret" rel="nofollow noreferrer"><code>kubernetes_secret</... | <p>I just had the same/similar issue when trying to initialize the kubernetes provider from a google_container_cluster data source. <code>terraform show</code> just displayed all null values for the data source attributes. The fix for me was to specify the project in the data source, e.g.,</p>
<pre><code>data "goo... |
<p>I would like to run a command to clone a script from a remote repository before running <code>skaffold dev</code> I need to either somehow inject a <code>git clone</code> command or put the git clone command and the corresponding arguments in a shell script and run the shell script with Skaffold. </p>
<p>From the S... | <p>skaffold supports lifecycle hooks which allow running custom scripts before/after a build - <a href="https://skaffold.dev/docs/pipeline-stages/lifecycle-hooks/" rel="nofollow noreferrer">https://skaffold.dev/docs/pipeline-stages/lifecycle-hooks/</a></p>
<p>With this, you should be able to add a stanza in your skaffo... |
<p>I have the <a href="https://github.com/sasadangelo/patroni-k8s/blob/main/kustomize/spilo/iks/spilo.yaml" rel="nofollow noreferrer">following Kubernetes YAML</a> with a StatefulSet I use to deploy a PostgreSQL cluster with Patroni. However, the question is relative to how Kubernetes registers Pod names in CoreDNS.</p... | <p>After almost three days of tests, I found a solution. The solution depends on two things:</p>
<ol>
<li>how Kubernetes works;</li>
<li>how Patroni works.</li>
</ol>
<p><strong>How Kubernetes Works</strong></p>
<p>When you create a StatefulSet deployment (but this is true also for Deployment), let's say with 3 pods, K... |
<p>thanks for checking out my topic.</p>
<p>I'm currently working to have kustomize to download the resource and base files from our git repository.
We have tried a few options some of them following the documentation and some of them not, see below. But anyhow still not able to download from our remote repo and while ... | <p>After reaching some Kubernetes colleagues, we found out the reason for my problem.
Basically, when running kubectl with version lower than 1.20 we have kustomize v2.0.3.
My Jenkins agent was using a outdated kubectl version (1.17) and this was the root cause.</p>
<p>In this case, there were two options:</p>
<ol>
<li... |
<p>According to <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/" rel="nofollow noreferrer">this official kubernetes documentation page</a>, it is possible to provide "a command" and args to a container.</p>
<p>The page has 13 occurrences of the string "... | <p>Because the <a href="https://man7.org/linux/man-pages/man2/execve.2.html" rel="noreferrer"><strong>execve</strong>(2) system call</a> takes an array of words. Everything at a higher level fundamentally reduces to this. As you note, a container only runs a single command, and then exits, so the array syntax is a na... |
<p>Below is my output of <code>kubectl get deploy --all-namespaces</code>:</p>
<pre><code>{
"apiVersion": "v1",
"items": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
... | <p>This is quite short answer, however you can use this option:</p>
<pre><code>kubectl get deploy --all-namespaces -o jsonpath='{range .items[?(.metadata.annotations.downscaler/uptime=="Mon-Fri 07:00-21:00 Australia/Sydney")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}'
</code></pre>... |
<p>How can I find easily which CNI plugin is configured and where is the config file associated with it?</p>
| <p>You can look into the content in <code>/etc/cni/net.d</code> and the binary at <code>/opt/cni/bin</code>. If you don't find any of these, you can check kubelet argument <code>--cni-conf-dir</code> and <code>--cni-bin-dir</code> which will point you to the custom location of your CNI plugin.</p>
|
<p>First of all, I am not an expert in container orchestration tools.</p>
<p>I've just installed <a href="https://microk8s.io/" rel="noreferrer">microk8s</a> according to the guide:
<a href="https://microk8s.io/docs/" rel="noreferrer">https://microk8s.io/docs/</a></p>
<p>And if I run <code>microk8s kubectl get nodes</c... | <p>To run Nvidia GPU enabled containers, I had to switch from containerd to docker in microk8s. Here's how I did that:</p>
<ol>
<li><p>Edit <code>/var/snap/microk8s/current/args/kubelet</code></p>
</li>
<li><p>Change <code>--container-runtime=docker</code> from <code>remote</code>. Then, execute the following commands... |
<p>I'm using client-go (the k8s client for go) to programmatically retrieve and update some secrets from my cluster. While doing this, I'm facing the need of unit-testing my code, and after some investigation I stumbled upon client-go's <code>fake</code> client. However, I haven't been able to mock errors yet. I've fol... | <p>I've finally found the error... it is in the resource name of the reactor function, I had <code>secret</code> and it should be the plural <code>secrets</code> instead... :facepalm:. So this is the correct version of the code:</p>
<pre class="lang-golang prettyprint-override"><code>func TestWhenItsNotPossibleToFetchT... |
<p>I am running Nginx and wordpress-fpm in Kubernetes within one pod. Images are stored in EFS and EFS folder linked to wp-content/uploads folder as a symbolic link. EFS folder is available and I can access it from the container.</p>
<p>This is my deployment file:</p>
<pre><code> apiVersion: apps/v1
kind: Deployment... | <p>So the solution:
efs need to be mounted to both containers at the same path, so both containers are able to access it.</p>
|
<p>I created two replicas of nginx with following yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
... | <p>One way to get load balancing on-premise running is with ip virtual services. (ipvs). It;s a service which hands out ip's of the next pod to schedule/call</p>
<p>it's likely installed already.</p>
<pre><code>lsmod | grep ip_vs
ip_vs_sh 16384 0
ip_vs_wrr 16384 0
ip_vs_rr 163... |
<p>I am trying to make Skaffold work with Helm.</p>
<p>Below is my <em><strong>skaffold.yml</strong></em> file:</p>
<pre><code>apiVersion: skaffold/v2beta23
kind: Config
metadata:
name: test-app
build:
artifacts:
- image: test.common.repositories.cloud.int/manager/k8s
docker:
dockerfile: Dockerfile
depl... | <p>I believe this is happening because you have not specified a chart to use for the helm release. I was able to reproduce your issue by commenting out the <code>chartPath</code> field in the <code>skaffold.yaml</code> file of the <a href="https://github.com/GoogleContainerTools/skaffold/tree/main/examples/helm-deploym... |
<p>I'm running kubernetes using an ec2 machine on aws.
Node is in Ubuntu.</p>
<p>my metrics-server version.</p>
<pre><code>wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml
</code></pre>
<p>components.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name... | <p>Download the components.yaml file manually:</p>
<pre><code>wget https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
</code></pre>
<p>Then edit the <strong>args</strong> section under <strong>Deployment</strong>:</p>
<pre><code>spec:
containers:
- args:
- --cert-dir=/tmp... |
<h2>Stack</h2>
<ul>
<li>Kubernetes (Digital Ocean)</li>
<li>Ingress Nginx Controller</li>
<li>React Frontend (static files)</li>
<li>NodeJS/Express Backend</li>
</ul>
<p>At certain point I need to load multiple images, more than a hundred, some are retrieved but many are not loaded. In the chrome console I get the foll... | <p><strong>In short:</strong></p>
<blockquote>
<p>My questions are</p>
<ul>
<li>Is the problem in the ingress-nginx controller?</li>
</ul>
</blockquote>
<p><strong>Basically no</strong></p>
<blockquote>
<ul>
<li>Can this be solved?</li>
</ul>
</blockquote>
<p><strong>Yes</strong></p>
<blockquote>
<ul>
<li>Should I chan... |
<p>I have a helm chart that I was going to deploy and I would like to use the deployment it creates as a sidecar for another deployment. Is this possible using the Rancher's GUI or is it something that I can directly configure in the YAML?</p>
| <p><strong>TL;DR:</strong> No</p>
<hr />
<p>Not really possible. You have to specify multiple containers in the same pod/deployment manifest to create sidecars. Like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
name: webserver
spec:
volumes:
- name: shared-logs
... |
<p>i hope you're doing okay</p>
<p>im trying to build a cdap image that i havein gitlab in aks using argocd</p>
<p>the build works in my local kubernetes cluster with rook-ceph storage class but with managed premium storage class in aks it seems that something is wrong in permissions</p>
<p>here is my storage class :</... | <p>after a lot of testing i changed the storage class
i installed rook-ceph using : <a href="https://dev.to/cdennig/using-rook-ceph-with-pvcs-on-azure-kubernetes-service-djc" rel="nofollow noreferrer">this procedure</a></p>
<p><strong>note:</strong> you have to change the image version in cluster.yaml from ceph/ceph:v1... |
<p>I run a bare-metal Kubernetes cluster and want to map services onto URLs instead of ports (I used <code>NodePort</code> so far).</p>
<p>To achieve this I tried to install an <code>IngressController</code> to be able to deploy Ingress objects containing routing.</p>
<p>I installed the <code>IngressController</code> v... | <p>To clarify the case I am posting answer (from comments area) as Community Wiki.</p>
<p>The problem here was not in configuration but in environment - there was running another ingress in the pod during Longhorn' deployment. This situation led to force basic authentication to both ones.</p>
<p>To resolve that problem... |
<p>Let's say I have two deployments which are exactly the same apart from deployment name:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-d
spec:
replicas: 3
selector:
matchLabels:
app: mynginx
template:
metadata:
labels:
app: mynginx
spec:
contai... | <p>Consider this: The pods are <em>not</em> directly managed by a deployment, but a deployment manages a ReplicaSet.</p>
<p>This can be validated using</p>
<pre><code>kubectl get rs
NAME DESIRED CURRENT READY AGE
nginx-d-5b686ccd46 3 3 3 74s
nginx-d2-7c76fbbbcb 3 ... |
<p>I'm new to Kubernetes and I have a use case where I want to read data from another deployment.</p>
<p>In the following file, the the <code>RabbitmqCluster</code> creates a default user. I want to extract the credentials of that user into a secret for use in other services that need to publish or subscribe to that br... | <p>Your thinking and approach is correct, this way (splitting into two files) seems to be the best option in this case - there is no way to dynamically set values in Kubernetes YAML from the other running Kubernetes resource. Keep in mind that for a secret definition you don't have to use the <code>stringData</code> an... |
<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>Testing with PodDisruptionBudget.
Pod will still restart at the same time.</p>
<h1>example</h1>
<p><a href="https://github.com/AlphaWong/PodDisruptionBudgetAndPodProbe" rel="nofollow noreferrer">https://github.com/AlphaWong/PodDisruptionBudgetAndPodProbe</a></p>
<p>So yes. like @Dawid Kruk u should create a customiz... |
<p>I have deployed a helm chart as shown below:</p>
<p><a href="https://i.stack.imgur.com/GA0xb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GA0xb.png" alt="enter image description here" /></a></p>
<p>When I try to run the <code>helm upgrade</code> command, I get the following error:</p>
<p><a href="https:... | <p>For helm3, <code>helm uninstall --namespace $NAMESPACE $RELEASE_NAME</code></p>
|
<p>I have a NextJS "^11.1.2" app, which gets build in a Dockerfile and deployed to production via CI/CD. <strong>But my <code>process.env</code> variables are not rendered</strong></p>
<p>I have this in my client side code, which should be rendered at runtime:</p>
<p><code>const PublicApiUrl = process.env.NEX... | <p>I had to define the variables also in my <code>next.config.js</code> like so:</p>
<pre class="lang-js prettyprint-override"><code>module.exports = {
serverRuntimeConfig: {
API_URL: process.env.API_URL,
},
// Will be available on both server and client
publicRuntimeConfig: {
NEXT_PUBLI... |
<p>I question I have trouble finding an answer for is this:
When a K8s pod connects to an external service over the Internet, then that external service, what IP address does it see the pod traffic coming from?</p>
<p>I would like to know the answer in two distinct cases:</p>
<ol>
<li>there is a site-to-site VPN betwe... | <p>When the traffic leaves the pod and goes out, it usually undergoes NATing on the K8S Node, so the traffic in most cases will be coming with the Node's IP address in SRC. You can manipulate this process by (re-) configuring <a href="https://kubernetes.io/docs/tasks/administer-cluster/ip-masq-agent/" rel="nofollow nor... |
<p>For some reason, the <code>_confluent_telemetry_metrics</code> gets automatically enabled. This happens even though Confluent Telemetry Reporter is turned off with <code>telemetry.enabled=false</code>. This is with Confluent Operator with Kubernetes on my laptop (Confluent Platform v6.0).</p>
<pre><code>[INFO] 2020-... | <p>I had exactly the same problem, and fall on this question.
I know the question is old, but I've got a solution from Confluent support :
You have to set <code>confluent.reporters.telemetry.auto.enable</code> to <code>false</code> to disable this topic feed.
See <a href="https://docs.confluent.io/platform/current/inst... |
<p>I have recently installed airflow 2.1.3 using apache-airflow helm repo on Azure AKS cluster. But post the installation, The Dag files are not getting displayed on the UI. The reason could be the scheduler getting terminated consistently. Below is the error. Can anyone please help me with the below issue?</p>
<p><div... | <p>I have previously been able to fix this by setting a higher value in <strong>airflow.cfg</strong> for <code>scheduler_health_check_threshold</code></p>
<p>For Ex:<br />
<code>scheduler_health_check_threshold = 240</code></p>
<p>Also, ensure that <code>orphaned_tasks_check_interval</code> is greater than the value th... |
<p>I've one question regard the helm dependency, when you decleare that one chart B is dependent on chart A , when it starts to install chart B, after the A is up and running? , how does helm know that, liveness prob ? something else?</p>
| <p>There is no such thing as</p>
<blockquote>
<p>install chart B, after the A is up and running</p>
</blockquote>
<p>right now in helm.</p>
<p>It will just template and feed all the resources you have in your chart and in all it's dependencies to k8s API server.</p>
<p>You can take a look at <a href="https://helm.sh/do... |
<p>In Kubernetes cluster I am trying to build a selenium hub and node. I am able to do it in the distributive mode, but trying to do in hub node mode.</p>
<h1>Hub-deployment.yaml</h1>
<pre><code>apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: selenium-hub
spec:
selector:
matchLabels:
app: selenium-hu... | <p>The hub also needs to expose the publisher and subscriber ports, so that the it can be reached by your node/chrome pod. Update to the following:</p>
<p><strong>hub-service.yaml</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: selenium-hub
spec:
ports:
- name: "selenium-hub"
po... |
<p>Usage of the same TCP port for Rabbitmq 5672 and transfer requests to different <code>namespaces/rabbitmq_service</code> based on the host-based routing.</p>
<p>What works:</p>
<pre class="lang-yaml prettyprint-override"><code>chart: nginx-git/ingress-nginx
version: 3.32.0
values:
- tcp:
5672: "cust1nam... | <h2>A bit of theory</h2>
<p>Approach you're trying to implement is not possible due to network protocols implementation and difference between them.</p>
<p><code>TCP</code> protocol works on transport layer, it has source and destination IPs and ports, it does <strong>not</strong> have any hosts information within. In ... |
<p>I wanted to create a MySQL container in Kubernetes with default disabled strict mode. I know the way of how to disable strict mode in docker. I tried to use the same way in Kubernetes, but it shows an errors log.</p>
<p>docker</p>
<pre class="lang-sh prettyprint-override"><code>docker container run -t -d --name hell... | <p>Based on the error you're getting, it is reading the double quotes as value to sql_mode. You should omit the escaped double-quotes.</p>
<pre><code>args: ["--sql-mode="]
</code></pre>
|
<p>I have this ingress and service created on my Kubernetes cluster</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
metadata:
name: google-storage-buckets
spec:
type: ExternalName
externalName: storage.googleapis.com
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: proxy-ass... | <p>We had a very similar case, gatsby static site on a GCP bucket.</p>
<p>we also tested <code>try_files</code> and <code>index</code> directives but didn't work.</p>
<p>In our case these hacky <code>configuration-snippets</code> did the trick:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
name: gcp-storage-b... |
<p>I'm evaluating crossplane to use as our go to tool to deploy our clients different solutions and have struggled with one issue:</p>
<p>We want to install crossplane to one cluster on GCP (which we create manually) and use that crossplane to provision new cluster on which we can install helm charts and deploy as usua... | <p>As you've noticed, <code>ProviderConfig</code> with <code>InjectedIdentity</code> is for the case where <code>provider-helm</code> installs the helm release into the same cluster.</p>
<p>To deploy to other clusters, provider-helm needs a <code>kubeconfig</code> file of the remote cluster which needs to be provided a... |
<p>I am having some issues with a fairly new cluster where a couple of nodes (always seems to happen in pairs but potentially just a coincidence) will become NotReady and a <code>kubectl describe</code> will say that the Kubelet stopped posting node status for memory, disk, PID and ready.</p>
<p>All of the running pods... | <p>I had the same issue, after 20-30 min my nodes became in <code>NotRready</code> status, and all pods linked to these nodes became stuck in <code>Terminating</code> status.<br/>I tried to connect to my nodes via SSH, sometimes I faced a timeout, sometimes I could (hardly) connect, and I executed the <code>top</code> ... |
<p>The main question is if there is a way to finish a pod from the <strong>client-go sdk</strong>, I'm not trying to delete a pod, I just want to finish it with a Phase-Status: <strong>Completed</strong>.</p>
<p>In the code, I'm trying to update the pod phase but It doesn't work, It does not return an error or panic bu... | <p>You cannot set the <code>phase</code> or anything else in the Pod <code>status</code> field, it is <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#pod-v1-core" rel="nofollow noreferrer">read only</a>. According to the <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifec... |
<p>Below is my kubernetes file and I need to do two things</p>
<ol>
<li>need to mount a folder with a file</li>
<li>need to mount a file with startup script</li>
</ol>
<p>I have on my local /tmp/zoo folder both the files and my zoo folder files never appear in /bitnami/zookeeper inside the pod.</p>
<p>The below is the ... | <p>A service cannot be assigned a volume. In line 4 of your YAML, you specify "Service" when it should be "Pod" and every resource used in Kubernetes must have a name, in metadata you could add it. That should fix the simple problem.</p>
<pre><code>apiVersion: v1
items:
- apiVersion: v1
kind: Pod ... |
<p>I followed the next guide <a href="https://computingforgeeks.com/deploy-kubernetes-cluster-on-ubuntu-with-kubeadm/" rel="nofollow noreferrer">https://computingforgeeks.com/deploy-kubernetes-cluster-on-ubuntu-with-kubeadm/</a> in BareMetal Ubuntu 20.04 with 2 nodes.</p>
<p>I chose Docker as my Container Runtime and s... | <p>I use Flannel and had a similar problem. Restarting the coredns deployment solved it for me:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl rollout restart -n kube-system deployment/coredns
</code></pre>
|
<p>I am collecting logs from a kubernetes cluster using fluentbit, having an output that connect to loki to send them there.</p>
<p>This is my loki configuration at fluentbit configmap file</p>
<p>Since loki is deployed at <code>loki</code> namespace, and fluentbit at <code>fluentbit</code> namespace I am using to cont... | <p>You should not use curly braces for the labeling, this would do:</p>
<pre><code>[OUTPUT]
...
Labels job="fluent-bit"
...
</code></pre>
<p>See the example here: <a href="https://docs.fluentbit.io/manual/pipeline/outputs/loki" rel="nofollow noreferrer">https://docs.fluentbit.io/manual/pipeline/ou... |
<p>I'm trying to use micronaut kubernetes informer like what they explained in documentation . this is my code</p>
<pre><code>@Singleton
@Informer(apiType = V1ConfigMap.class, apiListType =
V1ConfigMapList.class)
public class ConfigMapInformer implements
ResourceEventHandler<V1ConfigMap> {
@Override
public vo... | <p>It's hard to guess without having the access to the source code. But there's an example informer app in the micronaut-kubernetes github <a href="https://github.com/micronaut-projects/micronaut-kubernetes/tree/master/examples/micronaut-kubernetes-informer" rel="nofollow noreferrer">https://github.com/micronaut-projec... |
<p>Is there any command to revert back to previous configuration on a resource?</p>
<p>For example, if I have a Service kind resource created declaratively, and then I change the ports manually, how can I discard live changes so the original definition that created the resource is reapplied?</p>
<p>Is there any track... | <p>Since you're asking explicitly about the <code>last-applied-configuration</code> annotation...</p>
<p>Very simple:</p>
<pre><code>kubectl apply view-last-applied deployment/foobar-module | kubectl apply -f -
</code></pre>
<p>Given that <code>apply</code> composes via stdin ever so flexibly — there's no dedicated <co... |
<p>I am trying to get a list of all possible resources of a given cluster using the fabric8 openshift-client (or kubernetes-client), so trying to obtain same as command <code>oc api-resources</code>. So far I am able to get the list of apiGroups with a code like this</p>
<pre class="lang-java prettyprint-override"><cod... | <p>Fabric8 Kubernetes Client has <code>client.getApiGroups()</code> method to get a list of all available api groups. You can then get api resource for each version using <code>client.getApiResources()</code> to get output like <code>kubectl api-resources</code>.</p>
<p>I was able to do it with something like this. I a... |
<p>I am trying to contact from a customized helm chart to a fully managed Postgres service on azure, and then I have to put the url connection string according to the app I want to deploy.</p>
<p>I want to ask which value should be the <code>DATABASE_URL</code> at the helm chart deployment?
My situation is the followin... | <p>I think the problem with your connection string is, its <em>username</em> has a special character <code>@</code>, which might be breaking the connection string format and causing the validation error.</p>
<p>Your value</p>
<pre><code>- name: DATABASE_URL
value: "postgres://nmbrs@postgresql-nmb-psfc-stag:$(POS... |
<p>In a multiple node cluster we want to expose a service handling UDP traffic. There are two requirements:</p>
<ol>
<li>We want the service to be backed up by multiple pods (possibly running on different nodes) in order to scale horizontally.</li>
<li>The service needs the UDP source IP address of the client (i.e., sh... | <p><strong>The Problem</strong></p>
<p>I feel like there is a need for some explanation before facing the actual issue(s) in order to understand <em>why</em> things do not work as expected:</p>
<p>Usually what happens when using <code>NodePort</code> is that you expose a port on every node in your cluster. When making ... |
<p>I have been trying to get my kubernetes to launch my web application on a browser through my local host. When I try to open local host it times out and I have tried using minikube service --url and that also does not work. All of my deployment, and service pods are running. I have also tried port forward and changi... | <p>it's due to your container running on port <strong>8000</strong></p>
<p>But your service is forwarding the traffic to <strong>5000</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: mywebsite
spec:
type: LoadBalancer
selector:
app: mywebsite
ports:
- protocol: TCP
name: http
p... |
<p>I'm trying to understand what is the correct usage of command in Pods. Taking below example of my yaml. This is a working YAML. My doubts are</p>
<p>1> the sleep command is issued for 3600 seconds, but my pod busybox2 is still running after few hours when I see pods via 'k get pods'. My current understanding is, ... | <p><code>...but my pod busybox2 is still running after few hours...</code></p>
<p>This is because the default value for <code>restartPolicy</code> is <code>Always</code>. Means after an hour, your pod actually restarted.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: busybox2
namespace: default
spec:
res... |
<p>Is there a way to test that the templating works fine for all the possible values?<br>
(note: this is different from helm test which is used for testing the deployed chart through arbitrary code ran in a job).</p>
<p>What I would like to achieve is iterating over a set of values and checking the generated K8s resour... | <p>Yes, we do that with <a href="https://www.openpolicyagent.org/docs/latest/policy-language/" rel="nofollow noreferrer">rego policy rules</a>. The set-up is not complicated, this is how it looks as part of one of the pipeline of ours (this is a very simplified example to get you started):</p>
<pre><code># install conf... |
<p>I want to deploy IBM-MQ to Kubernetes (Rancher) using helmfile. I've found this link and did everything as described in the guide: <a href="https://artifacthub.io/packages/helm/ibm-charts/ibm-mqadvanced-server-dev" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/ibm-charts/ibm-mqadvanced-server-dev</a... | <p>I will leave some things as an exercise to you, but here is what that tutorial says:</p>
<pre><code>helm repo add ibm-stable-charts https://raw.githubusercontent.com/IBM/charts/master/repo/stable
</code></pre>
<p>You don't really need to do this, since you are using <code>helmfile</code>.</p>
<p>Then they say to iss... |
<p>As the question shows, I have very low knowledge about kubernetes. Following a tutorial, I made a Kubernetes cluster to run a web app on a local server using Minikube. I have applied the kubernetes components and they are running but the Web-Server does not respond to HTTP requests. My problem is that all the system... | <p>use a tool like <a href="https://github.com/kubernetes/kubernetes-dashboard" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes-dashboard</a></p>
<p>You can install kubectl and kubernetes-dashboard in a k8s cluster (<a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="nofollow noref... |
<p>I'm trying to create a Kubernetes network policy that blocks a pod from connecting to the internet. The pod should only have access to the local network <code>10.0.0.0/8</code>.</p>
<p>Using the Kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#default-deny-all-egress-traf... | <p>Network policies are implemented by the <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/" rel="nofollow noreferrer">network plugin</a>. To use network policies, you must be using a networking solution which supports NetworkPolicy. Creating a NetworkPolicy resource w... |
<p>As the question shows, I have very low knowledge about kubernetes. Following a tutorial, I made a Kubernetes cluster to run a web app on a local server using Minikube. I have applied the kubernetes components and they are running but the Web-Server does not respond to HTTP requests. My problem is that all the system... | <pre><code>kubectl get pods
</code></pre>
<p>will show you all your pods and their status. A quick check to make sure that all is at least running.</p>
<p>If there are pods that are unhealthy, then</p>
<pre><code>kubectl describe pod <pod name>
</code></pre>
<p>will give some more information.. eg image not found... |
<p>We are using Kubernetes v1.19.13 hosted on Google Kubernetes Engine. We want to configure an Ingress controller so that the Google HTTP(S) LoadBalancer is configured to allow only TLS 1.2 and 1.3 and these features/ciphers:</p>
<pre><code>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
T... | <p>You won't be able to do this using annotations. You cannot currently create an SSL Policy via annotations. SSL Policies need to be <a href="https://cloud.google.com/load-balancing/docs/use-ssl-policies#creating_ssl_policies" rel="nofollow noreferrer">created</a> via gcloud CLI or via the GCP API.</p>
<p>You'll the... |
<p>I have the following command:</p>
<pre><code>kubectl delete -n vnamespace secret --field-selector type=my_secret
</code></pre>
<p>this works fine but delete all secrets. I want to delete secrets older than 24 hours. How can I add it?</p>
| <p>You can use <code>jq</code> to parse kubectl output and list all secrets older than 24h, and pass it to delete.</p>
<pre class="lang-sh prettyprint-override"><code>kubectl delete secret -n vnamespace $(kubectl -n vnamespace get secrets --field-selector type=my_secret -o json | jq -r "[.items[] | {name: .metadat... |
<p>I intend to test a non-trivial Kubernetes setup as part of CI and wish to run the full system before CD. I cannot run <code>--privileged</code> containers and am running the docker container as a sibling to the host using <code>docker run -v /var/run/docker.sock:/var/run/docker.sock</code></p>
<p>The basic docker se... | <p>Because <code>minikube</code> does not complete the cluster creation, running Kubernetes in a (sibling) Docker container favours <code>kind</code>.</p>
<p>Given that the (sibling) container does not know enough about its setup, the networking connections are a bit flawed. Specifically, a loopback IP is selected by <... |
<p><strong>TL;DR</strong><br />
How can I setup a light-weight web server to execute external programs to handle REST requests?</p>
<p><strong>The long version</strong>:<br />
We have a set of services and databases deployed in Kubernetes via Helm. There are some executables that perform maintenance, cleanup, backup, r... | <p>Here's k8s native approach:</p>
<p><code>... a set of services and databases deployed in Kubernetes... some executables that perform maintenance, cleanup, backup, restore etc...some on-demand & some periodically</code></p>
<p>If you can bake those "executables" into an image, you can run these programs... |
<p>We have data stored on a persistent volume attached to a k8s pod on google cloud. And we want to copy these data over to another persistent volume attached to a different pod on the same cluster.</p>
<p>Is there any direct way to do this? We don't want to leverage other storage as an intermediate though.</p>
| <p>You can use the <a href="https://velero.io/" rel="nofollow noreferrer">velero</a> to move the <strong>PV</strong> and <strong>PVC</strong> across the <strong>cluster</strong></p>
<p>for that,<a href="https://velero.io/" rel="nofollow noreferrer">enter link description here</a> you can use the tool velero</p>
<p>whic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.