prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>In the below yaml:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: my-nginx labels: app: my-nginx # Line 6 spec: # Line 7 replicas: 2 selector: matchLabels: app: my-nginx # line 11 template: metadata: labels: app: my-nginx # Line 15 ...
<p>Tried to add comments to explain the role of labels:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: my-nginx labels: app: my-nginx # LABEL-A: &lt;--this label is to manage the deployment itself. this may be used to filter the deployment based on this label. spec: replica...
<p>I built a kubernetes cluster on CentOS 8 first. I followed the how-to found here: <a href="https://www.tecmint.com/install-a-kubernetes-cluster-on-centos-8/" rel="nofollow noreferrer">https://www.tecmint.com/install-a-kubernetes-cluster-on-centos-8/</a></p> <p>And then I built an Ubuntu 18.04 VM and installed Ranch...
<p>OP confirmed that the issue is found to be due to firewall rules. This was debugged by disabling the firewall, that lead to desired operation(cluster addition) to be successful.</p> <p>In order to nodePort service to work properly, port range <code>30000 - 32767</code> should be reachable on all the nodes of the clu...
<p>We have an AKS cluster set up with a multiple availability zone node pool. Using the <code>default</code> storage class, if a Pod needs to move to another node and the only available node is in a different region, the Pod can't start up because the storage is stuck in the original region. Do any of the other built-i...
<p>Yes you can use below configurations depending on your need.</p> <p><strong>Example StorageClass.yaml</strong></p> <pre><code>apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: azurefile provisioner: kubernetes.io/azure-file parameters: skuName: Standard_ZRS location: eastus storageAccount: azu...
<p>I am using Spring Cloud Kubernetes and I am trying to make feign able to send requests based on the name of the services present in kubernetes, but I can't, when I try to make a request the following error occurs:</p> <pre><code> "timestamp": "2019-12-06T15:37:50.285+0000", "status": 500, "error": "Interna...
<p>Long story short, <strong>Spring Cloud Feign works perfectly fine with Spring Cloud Kubernetes</strong> as of July 2021. I've moved a <em>Spring Cloud Feign</em> project from using <em>Spring Cloud Netflix</em> to <em>Spring Cloud Kubernetes</em> and no change in the Feign interfaces was required. I just removed the...
<p>I'm running Docker Desktop for MacOS and I don't know how to stop the Docker service. It runs all the time using up the MacBook battery.</p> <img src="https://i.stack.imgur.com/buRf4.png" width="200" /> <p>On a simple search, there are docs showing how to stop the containers but not the docker service itself.</p> <p...
<p>The docker desktop app starts a qemu vm, so the desktop app has no control over the PIDs. To overcome the &quot;situation&quot; do the following:</p> <ul> <li><p>open the Terminal app</p> </li> <li><p>edit the file <code>~/.bash_profile</code></p> </li> <li><p>add the following lines</p> </li> </ul> <pre> #macro...
<p>I have an image that requires root privilege to start.</p> <p>Now I'm trying to deploy it on OpenShift.</p> <p>this is the deployment yaml I used to deploy it</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: xyz annotations: k8s.v1.cni.cncf.io/networks: macvlan-conf spec: selector: ma...
<p>The SCC you created currently applies to the User <code>developer</code>, and the group <code>developer</code>.</p> <p>Your deployment uses a ServiceAccount <code>runasanyuid</code>.</p> <p>You need to edit your SecurityContextConstraint, allowing that ServiceAccount:</p> <pre><code>[...] users: - developer - system...
<p>I have deployed an app and exposed it as a loadbalancer service. I added the resource field in the yaml of the deployment to request for 100m cpu. Defined a HPA to scale the app when the CPU goes above 50%. The app fails to autoscale and the cpu utilization always shows as unknown.<code>kubectl describe hpa</code> ...
<p>If you are using a multi container based Pod, you must set resources (i.e. requests and limits for CPU and Memory) for all the containers.</p> <pre><code>+ resources: + requests: + cpu: 100m + memory: &quot;256Mi&quot; + limits: + cpu: 200m + memory: &quot;512Mi&quot; </code></pre>
<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>If your Kubernetes cluster runs on a VPC with more than one subnet (which is probably the case), you must provide a private ip address for each subnet.</p> <p>I installed the <a href="https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html" rel="nofollow noreferrer">AWS Load balancer contr...
<p>I am trying to install Argo CLI by following this (<a href="https://github.com/argoproj/argo-workflows/releases" rel="nofollow noreferrer">https://github.com/argoproj/argo-workflows/releases</a>) documentation.</p> <pre><code># Download the binary curl -sLO https://github.com/argoproj/argo/releases/download/v3.1.3/a...
<p>The download links on the Releases page are incorrect. Try this one:</p> <pre><code>curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.1.3/argo-linux-amd64.gz </code></pre> <p>I've submitted an <a href="https://github.com/argoproj/argo-workflows/issues/6440" rel="nofollow noreferrer">issue</a>...
<p>After some struggling I got fluentd to forward Openshift audit log files to Splunk. However this resulted in a huge number of events, so I applied a filter to exclude &quot;get&quot; and &quot;watch&quot;. I would like to include the get secrets.</p> <p>My question, how to change the filter to exclude &quot;get&quo...
<p>Instead of excluding all get, list and watch actions except for secrets I opted to exclude the objects that cause the most events, like namespaces, pods and configmaps. This resulted in the extra filters below. This gives a reduction in Splunk events of about 65%. An Openshift cluster in rest generates without filte...
<p>Recently I was searching for ways to reduce cloud bill and came up to a company named <code>CAST.AI</code>.</p> <p>So to run a savings report you need to install their agent to your cluster and they claim it is <code>read-only</code>.</p> <p>How do I check if this is true?</p> <p>This comes from the <a href="https:/...
<h2 id="short-answer">Short answer</h2> <p>Based on <code>cast.io</code> manifest <strong>it's indeed <code>read-only</code> and safe to say it won't mess up anything in the cluster</strong></p> <h2 id="detailed-answer">Detailed answer</h2> <p>In short words manifest will create: namespace, serviceaccount, clusterole w...
<p>I understand that an NGINX Ingress controller allows <a href="https://kubernetes.github.io/ingress-nginx/examples/customization/custom-headers/" rel="nofollow noreferrer">custom header creation</a> using a <code>ConfigMap</code>. Is there either:</p> <ol> <li>a way to use NGINX for GKE or</li> <li>to directly specif...
<p>Taken from one of my Nginx ingress config values:</p> <p>HSTS - under controller.config:</p> <pre><code> hsts: &quot;True&quot; # default is &quot;False&quot;. Enables HTTP Strict Transport Security (HSTS): the HSTS header is added to the responses from backends. See https://www.nginx.com/blog/http-strict-transport...
<p>I have a set of kubernetes config files that work in one environment. I'm looking to deploy into another environment where I need to add an imagePullSecrets entry to all of the <code>Deployment</code> configs.</p> <p>I can do:</p> <p>regcred-1.yaml:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment ...
<p>Using <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/inlinePatch.md" rel="noreferrer">Inline Patch</a>:</p> <pre class="lang-yaml prettyprint-override"><code>kind: Kustomization apiVersion: kustomize.config.k8s.io/v1beta1 resources: - ../../base patches: - target: kind: Deployme...
<p>I am very new to Kubernetes and am working with an eks cluster. I am trying to pull images and I have added a cert to /etc/docker/certs.d// and I am able to pull fine after logging in. However when I create a deployment to deploy apps to my pods, it seems like I have to manually ssh into my EKS nodes and copy over t...
<p>You can use the <strong>secret</strong> to pull the <strong>docker</strong> and storing the cert in <strong>Kubernetes</strong> level but yes you are right it will work with <strong>POD</strong>. There is no way you can manage or inject at the <strong>node</strong> level.</p> <p>The only option you are left with to ...
<p>I'm new to kubernetes. I would like to know how to pass default.yaml in secrets to env in deployment? i tried it separately but it saves the default empty and i want to override it Thank you.</p>
<p>You can store the file in Secret or Configmap</p> <p>Example :</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: nginx-data data: default.yaml: |- server { server_name _; listen 443 ssl http2; listen [::]:443 ssl http2; ssl_protocols TLSv1.2 TLSv1.3; ...
<p>I have 3 Kubernetes deployments and services for each of the deployments (namespace = firstspace). each deployment is labelled as app1, app2, app3 in order.</p> <p>As an example, if I run the following command. I will get the first pod as the result.</p> <pre><code>kubectl get pods -l app=app1 --namespace firstspace...
<p>After some trial and error, I observed the following. According to the Kubernetes Network Policies <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="nofollow noreferrer">documentation</a>, Deployed Network Policies will be only effective if a <a href="https://kubernetes.io/docs...
<p>I have a k8s environment, where I am running 3 masters and 7 worker nodes. Daily my pods are in evicted states due to disk pressure.</p> <p>I am getting the below error on my worker node.</p> <pre><code>Message: The node was low on resource: ephemeral-storage. </code></pre> <pre><code>Status: Failed R...
<p>Having analysed the comments it looks like pods go in the Evicted state when they're using more resources then available depending on a particular pod limit. A solution in that case might be manually deleting the evicting pods since they're not using resources at that given time. To read more about Node-pressure Evi...
<p>I'm trying to find some way to log audit events for each user, i.e whatever the kubectl commands the user executed and the commands which users ran by logging into any of the pods in the cluster. This logs can pushed to elasticsearch or any other similar logging applications for auditing of the cluster.</p> <p>Can s...
<p>Audit records begin their lifecycle inside the kube-apiserver component. Each request on each stage of its execution generates an audit event, which is then pre-processed according to a certain policy and written to a backend. The policy determines what's recorded and the backends persist the records. Now, this back...
<p>I'm running a bare metal Kubernetes cluster with 1 master node and 3 worker Nodes. I have a bunch of services deployed inside with Istio as an Ingress-gateway.</p> <p>Everything works fine since I can access my services from outside using the ingress-gateway NodePort.</p> <pre><code>NAME TYPE ...
<p>Based on <a href="https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/#determining-the-ingress-ip-and-ports" rel="nofollow noreferrer">official documentation</a>:</p> <blockquote> <p>If the <code>EXTERNAL-IP</code> value is set, your environment has an external load balancer that you can us...
<p>I have a cron job that continues to run though I have no deployments or jobs. I am running minikube:</p> <pre><code>$ kubectl get deployments No resources found in default namespace. $ kubectl delete pods --all &amp;&amp; kubectl delete jobs --all &amp;&amp; get deployments pod &quot;hello-27125612-lmcb5&quot; dele...
<p>These pods are managed by <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">cronjob controller</a>.</p> <p>Use <code>kubectl get cronjobs</code> to list them.</p>
<p>I am completely new in Kubernetes.I was trying to play with minikube in my local machine. I have installed kubectl and minikube locally. When I run</p> <pre><code>minikube start --vm-driver=virtualbox # and then minikube status </code></pre> <p>my output is </p> <pre><code>E0512 23:33:45.964815 23423 status.go...
<p>try these commands in this order:</p> <ol> <li>minikube stop</li> <li>minikube delete</li> <li>minikube start</li> </ol> <p>This worked from me</p>
<p>As part of rolling updates version 1 pod is rolled up with version 2 pod.</p> <p>We need to review the logs of shutdown process of service in the pod (version one).</p> <hr /> <ol> <li><p>Does rolling update delete the version one pod?</p> </li> <li><p>If yes, can we review the logs of deleted pod (version one)? To ...
<blockquote> <ol> <li>Does rolling update delete the version one pod?</li> </ol> </blockquote> <p>The short answer is: Yes.</p> <p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment" rel="nofollow noreferrer">Rolling Update Deployment</a>:</p> <blockquote> <p>The De...
<ul> <li><p>I have an app that works by deployment service and communicates with the world with Nginx-Ingress-controller.</p> </li> <li><p>This app is connected to the MongoDB database.</p> </li> <li><p>I asked to create a cronjob that purges all MongoDB logs once daily at midnight.</p> </li> </ul> <p>&quot;Add a CronJ...
<p>If you want to manage the <strong>logs</strong> due to <strong>Kubernetes</strong> also store the <strong>stdin</strong> &amp; <strong>out</strong> logs. Kubernetes auto manages the logs rotation however if your <strong>application</strong> or <strong>mongoD</strong> internally storing the Logs in <strong>PVC</stron...
<p>I am running a k8 cluster with 8 workers and 3 master nodes. And my pods are evicting repetively with the ephemeral storage issues. Below is the error I am getting on Evicted pods:</p> <pre><code>Message: The node was low on resource: ephemeral-storage. Container xpaas-logger was using 30108Ki, which exceeds ...
<p>&quot;Ephemeral storage&quot; here refers to space being used in the container filesystem that's not in a volume. Something inside your process is using a lot of local disk space. In the abstract this is relatively easy to debug: use <code>kubectl exec</code> to get a shell in the pod, and then use normal Unix com...
<p>I've deployed a small K3S cluster with a master and two workers:</p> <p>The VMs were made with <code>Multipass</code>:</p> <pre><code>$ multipass ls Name State IPv4 Image master-node Running 10.200.68.230 Ubuntu 20.04 LTS ...
<p>Since your service is Cluster Ip you can not access the service out of Kubernetes cluster.</p> <p>You have to expose your service as <strong>Node port</strong> or <strong>Loadbalancer</strong>.</p> <p><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">https://kuberne...
<p>I am trying to set a postgres parameter (shared_buffers) into my postgres database pod. I am trying to set an init container to set the db variable, but it is not working because the init container runs as the root user.</p> <p>What is the best way to edit the db variable on the pods? I do not have the ability to m...
<p>In my case, the <a href="https://stackoverflow.com/a/60783722/7856777">@Rico answer</a> didn't help me out of the box because I don't use postgres with a persistent storage mount, which means there is no /var/lib/postgresql/data folder and pre-existed database (so both proposed options have failed in my case).</p> <...
<p>I have configured Prometheus on one of the kubernetes cluster nodes using [this][1]. After that I added following <code>prometheus.yml</code> file. I can list nodes and apiservers but for pods, all the pods shows down and error:</p> <pre><code>Get &quot;https:// xx.xx.xx:443 /metrics&quot;: dial tcp xx.xx.xx:443: c...
<p>It's impossible to get metrics to external prometheus server without having any prometheus components inside the kubernetes cluster. This happens because cluster network is isolated with host's network and it's not possible to scrape metrics from pods directly from outside the cluster.</p> <p>Please refer to <a href...
<p>I'm creating my Kubernetes single node cluster using kubeadm. After applying the ingress ngnix controller, I'm getting the following error when I try to apply the ingress file.</p> <p>I'm getting the following error while applying the ingress:</p> <p><code>Error from server (InternalError): error when creating &quot...
<p>This usually happens because there is a problem in the configuration of the ValidatingWebhookConfiguration. When you deploy the nginx controller it deploys multiple resources, one of those is this validation, which function is to validate all the ingress that you create later on. Sometimes it might happen that there...
<p>I have a testing scenario to check if the API requests are being handled by another pod if one goes down. I know this is the default behaviour, but I want to stimulate the following scenario.</p> <p>Pod replicas - 2 (pod A and B)</p> <p>During my API requests, I want to kill/stop only pod A. During downtime of A, re...
<p>If you want to simulate what happens if one of the pods just gets lost, you can scale down the deployment</p> <pre class="lang-sh prettyprint-override"><code>kubectl scale deployment the-deployment-name --replicas=1 </code></pre> <p>and Kubernetes will terminate all but one of the pods; you should almost immediately...
<p>Memory and cpu resources of a container can be tracked using prometheus. But can we track I/O of a container? Are there any metrices available?</p>
<p>If you are using Docker containers you can check the data with the <code>docker stats</code> command (as <a href="https://stackoverflow.com/users/6309601/p">P...</a> mentioned in the comment). <a href="https://docs.docker.com/engine/reference/commandline/stats/#extended-description" rel="nofollow noreferrer">Here</a...
<p>I have an Airflow application running in kubernetes along with Vault. I am already using Vault to manage certain Airflow Connections and it's working fine (which proves the connectivity with Vault is working fine).</p> <p>I am now trying to configure Airflow's configs <code>core.sql_alchemy_conn</code>, <code>celery...
<p>Configs are set like Variables in the secret backend, while I was setting them like a Connection with <code>conn_uri</code> as key.</p> <p>It is not clear in the official Documentation and had to go through the code to find the fix.</p> <p>So after putting my configs in correct way (where mount point is <code>secret...
<p>Currently GCEPersistentDisk does not support ReadWriteMany natively, there are other options like filestore which creates a NFS volume, but there are 2 problem here:</p> <ol> <li><p>minimum 1 TB size is needed to be created</p> </li> <li><p>secondly its a manually effort of creating PVs and then PVCs</p> </li> </ol>...
<p>If you have requirement of dynamic provising with you can alos try using the <a href="https://www.gluster.org/" rel="nofollow noreferrer">Gluster</a> FS or <a href="https://min.io/" rel="nofollow noreferrer">Minio</a>.</p> <p>here is one nice example using the GlusterFS dynamic provisioning : <a href="https://docs.o...
<p>We want to load <strong>example.xyz.com</strong> in <strong>site.abc.com</strong>. The best way is to redirect/rewrite all the requests from <strong>site.abc.com</strong> to <strong>example.xyz.com</strong>. However, we don't want the browser URL to be changed. <a href="https://serverfault.com/questions/927820/nginx...
<p>With <a href="https://stackoverflow.com/a/60354450/6663095">this solution</a> as a reference, pointed out by <a href="https://stackoverflow.com/users/11560878/wytrzyma%C5%82y-wiktor">@WytrzymałyWiktor</a> I was able to make changes and it worked. Here is the updated ingress file.</p> <pre><code>apiVersion: networkin...
<p>I have a AzureKeyVaultSecret object yaml. I don't want to use output tag to sync my secret from Azure Key Vault to Kubernetes. How can I automatically get my pod/Deployment/StatefulSet to restart when the secret in AKV(Azure key vault) is changed/updated.</p>
<p>This is going to be a multi-step scenario. Key Vault can be configured to send a message to an Event Hub when a secret changes:</p> <p><a href="https://learn.microsoft.com/en-us/azure/key-vault/general/event-grid-overview" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/key-vault/general/event-gri...
<p>I have two pods, after the first pod has rebooted, the other should automatically reboot after it. Pods are created using different deployments</p>
<p>You can write down the script in python or any language which will look for the event for <strong>POD</strong> or <strong>deployment</strong> as soon as one gets restarted your script will <strong>roll out</strong> the deployment this way for the second deployment PODs will be <strong>restarted</strong>.</p> <p>You ...
<p>I have a weird issue with envFrom:</p> <pre><code> - name: template-api envFrom:    - secretRef: name: common-secrets    - secretRef: name: template-api </code></pre> <p>in common-secrets I have variables like this:</p> <pre><code>MAILHOST=smtp.gmail.com MAILPORT=587 </code></pre> <p>And template-api is l...
<p>Kubernetes won't update it that way, if you are running that approach with any code or script it will work inside the code. like <code>process.env($MAILHOST)</code></p> <p>Whatever you have mentioned in secret it will get injected into the <strong>OS</strong> <strong>environment</strong> now if the same values are t...
<p>I am testing istio 1.10.3 to add headers with minikube but I am not able to do so.</p> <p><strong>Istio</strong> is installed in the <code>istio-system</code> namespaces. The namespace where the deployment is deployed is labeled with <code>istio-injection=enabled</code>.</p> <p>In the <code>config_dump</code> I can ...
<blockquote> <p>it is only working when I configure the context in <strong>GATEWAY</strong>, the envoyFilter is running in the <strong>istio-system</strong> namespace</p> </blockquote> <p>That's correct! You should apply your <code>EnvoyFilter</code> in the config root namespace <code>istio-system</code>- in your case...
<p>I'm trying to set up an ingress controller in Kubernetes that will give me strict alternation between two (or more) pods running in the same service.</p> <p>My testing setup is a single Kubernetes node, with a deployment of two nginx pods. The deployment is then exposed with a NodePort service.</p> <p>I've then depl...
<p>Nginx default behavior is like <strong>round-robin</strong> only. You can use it to perform most tests on Nginx ingress with different config <strong>tweaks</strong> if required.</p> <p>There is also other options like you can use the <strong>Istio</strong> <strong>service mesh</strong>.</p> <p>You can Load balance ...
<p>I've upgrade from Flux V1 to V2. It all went fairly smooth but I can't seem to get the <code>ImageUpdateAutomation</code> to work. Flux knows I have images to update but it doesn't change the container image in the <code>deployment.yaml</code> manifest and commit the changes to Github. I have no errors in my logs so...
<p>My issue was that I didn't add the comment after my image declaration in my deployment yaml. <a href="https://fluxcd.io/docs/guides/image-update/#configure-image-updates" rel="nofollow noreferrer">More details</a>. Honestly, I'm surprised this is not <a href="https://kubernetes.io/docs/concepts/overview/working-with...
<p><em>*Cross-posted from k3d GitHub Discussion: <a href="https://github.com/rancher/k3d/discussions/690" rel="nofollow noreferrer">https://github.com/rancher/k3d/discussions/690</a></em></p> <p>I am attempting to expose two services over two ports. As an alternative, I'd also love to know how to expose them over the s...
<p>You either have to use an ingress, or have to open ports on each individual node (k3d runs on docker, so you have to expose the docker ports)</p> <p><em>Without opening a port <em>during the creation of the k3d cluster</em>, a nodeport service will not expose your app</em></p> <p><code>k3d cluster create mycluster -...
<p>I Have 1 master and 2 work kubernetes cluster, i am running application on that cluster but pods running on the worker node is not able to connect to the internet and i am also enable egress network policy for all pods. this is my network policy</p> <pre><code>kind: NetworkPolicy metadata: name: allow-all-egress ...
<p>Try this example</p> <pre><code>kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: allow-all-traffic namespace: default spec: podSelector: {} ingress: - {} </code></pre> <p><a href="https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/02a-allow-all-traffic-to-an-applica...
<p>Need help on setting up the ingress in K8S. Thank you in advance.</p> <p>I have configured, NGINX Controller and Cert-Manager on the AKS cluster using Helm.</p> <p>Here is the svc, pods list. <a href="https://i.stack.imgur.com/wb6AN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wb6AN.png" alt="e...
<p>Looks like you are missing the block of <code>rpe-delivers-orders-proxy-api</code> in your ingress config</p> <pre><code>- path: /(.*) pathType: Prefix backend: service: name: rpe-delivers-orders-proxy-api port: number: 80 </code></pre> <p>If you have a...
<p>I can understand basic management and operation of container on bare-metal running Docker engine and Kubernetes Orchestration. I'm wondering how is the management and orchestration of container on virtual machine (VM)? Anyone familiar working of container on VM, does it difficult to manage and orchestrate compare to...
<p>There is no difference if you are looking forward to using <strong>VM</strong> as <strong>worker node</strong> of the <strong>Kubernetes</strong> cluster and manage the POD (container) over it. Kubernetes consider and manage the VM as Node.</p> <p>If you are looking forward to running standalone containers on top of...
<p>I need to create additional cluster in minikube. I searched for a while I haven't got any resource on this.How to create a cluster in minikube?</p>
<p>Create first cluster named <code>cluster-1</code>:</p> <pre><code>minikube start -p cluster-1 </code></pre> <p>Create second cluster named <code>cluster-2</code>:</p> <pre><code>minikube start -p cluster-2 </code></pre> <p>Switch between the clusters:</p> <pre><code># switch to cluster-1 minikube profile cluster-1 ...
<p>First of all, what I want to build is right below. <a href="https://i.stack.imgur.com/b5yKz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b5yKz.png" alt="enter image description here" /></a></p> <p>as above diagram, I want Ingress to make distribute traffics to service which is at other namespac...
<p><em>I'm posting it as an answer for better visibility. As I already mentioned in my comments:</em></p> <p>As far as I know you cannot use <strong>GKE ingress</strong> with <code>ExternalName</code> Service type. The two supported types are <code>LoadBalancer</code> and <code>NodePort</code>. If nothing changed recen...
<p>We have an existing ALB Ingress controller deployment in EKS cluster having image as v1.1.9:</p> <p>docker.io/amazon/aws-alb-ingress-controller:v1.1.9</p> <p>Now we are in process of migrating from AWS ALB Ingress Controller (v1) to the new AWS Load Balancer Controller (v2).</p> <p>Following this document : <a href=...
<p>First, I would remove all the ingress objects that use ALB Ingress controller (will cause downtime). To do so, <code>kubectl get ingress -A</code>, go through each one of them and see if it has annotation -</p> <pre><code>annotations: kubernetes.io/ingress.class: alb </code></pre> <p>Then use <code>kubectl delet...
<p>We are evaluating Dapr for our microservice framework. We will be using Kubernetes. One of the advertised selling points for Dapr is service invocation and service discovery. Doesn't K8s already offer service discovery out of the box?</p>
<p>Short answer: <strong>Yes</strong> (<em>Kubernetes</em> offers Service Discovery)</p> <p>While there may be several patterns (and tools being the implementation of these patterns) for Service Discovery, <em>Kubernetes</em> offers service discovery <em>at its core</em> through the <strong>Service</strong> objects avo...
<p>I am trying to provision a <strong>private AKS cluster</strong> using terraform. I want to connect my private AKS cluster to <strong>an existing VNET</strong> that I have created using the Azure portal.</p> <p>The Virtual network option is available in the Azure portal. Please find the below image.</p> <p><a href="h...
<p>I used an existing code from Github with some changes as we already have vnet so instead of resource block I have used data block to get the details of the existing Vnet and instead of using the default subnet I created a subnet for aks and other one for firewall.</p> <pre><code>terraform { required_version = &quo...
<p>I have a k8 setup that looks like this</p> <p><code>ingress -&gt; headless service (k8 service with clusterIp: none) -&gt; statefulsets ( 2pods)</code></p> <p>Fqdn looks like this:</p> <pre><code>nslookup my-service Server: 100.4.0.10 Address: 100.4.0.10#53 Name: my-service.my-namespace.svc.cluster...
<p>example statefulset called <code>foo</code> with image <code>nginx</code>:</p> <pre><code>k get statefulsets.apps NAME READY AGE foo 3/3 8m55s </code></pre> <p>This stateful set created following pods(<code>foo-0,foo-1,foo-2</code>):</p> <pre><code>k get pod -o wide NAME READY STATUS RESTARTS ...
<p>I have questions about my basic understanding about the setup of my k8s cluster.</p> <p>I have a K8s running on Hetzner-cloud and allocated a &quot;physical&quot; <code>Loadbalancer</code> (which can be controlled via <code>annotations</code> on a Service.) I use a nginx (or traefik) as my <code>ingress-controller</...
<p>1.- No. Ingress Controller and your workload doesn't have to be in the same namespace. In fact, you will have the Ingress Controller running in a separate namespace than your workload.</p> <p>2.-Yes. Generally speaking your <code>Ingress</code> rules, meaning your <code>Ingress</code> object, meaning your <code>Ingr...
<p>I currently have a GitHub repository that contains my application code and a Kubernetes deployment configuration file (called <code>deployment.yml</code>). I.e., my repository has the following structure:</p> <pre><code>repository +- ...application code... +- Dockerfile \- deployment.yml </code></pre> <p>When ...
<p><strong>Helm</strong> templating is also a good option however if your project is basic and won't be much requirement there use this basic method keeping the <strong>deployment.yaml</strong> in repo simple way.</p> <p>Ideally, you can keep your <strong>deployment</strong> file dynamic as much as possible rather than...
<p>I need some help from the community, I'm still new to K8 and Spring Boot. Thanks all in advance.<br /> what I need is to have 4 K8 pods running in K8 environment and each pod have slightly different configuration from each other, for example, I have a property in one of my java class called regions, it extract it'...
<p>If you want to run <strong>4</strong> different pods with different configurations, you have to deploy the <strong>4</strong> different deployments in <strong>kubernetes</strong>.</p> <p>You can create the different <code>configmap</code> as per need storing the whole <code>Application.yaml</code> file or environmen...
<p>I followed this tutorial for deploying vault into a minikube cluster: <a href="https://learn.hashicorp.com/tutorials/vault/kubernetes-minikube?in=vault/kubernetes" rel="nofollow noreferrer">https://learn.hashicorp.com/tutorials/vault/kubernetes-minikube?in=vault/kubernetes</a>.</p> <p>I don't understand, however, ho...
<p>I found this blog post on hashicorp's site which seems to address configuration once you are up and running: <a href="https://www.hashicorp.com/blog/codifying-vault-policies-and-configuration" rel="nofollow noreferrer">https://www.hashicorp.com/blog/codifying-vault-policies-and-configuration</a>.</p> <p>There's also...
<p>I need to start by saying that I have no experience using Cassandra and I am not the one who who created this deployment.</p> <p>I have Cassandra running in a cluster in AKS. The PVC as configured in the statefulset is 1000Gi. Currently the pods are out of storage and are in a constant unhealthy state.</p> <p>I am l...
<p>Ordinarily in a Cassandra cluster, the best practice is to scale horizontally (not vertically). You want more Cassandra nodes to spread the load out to achieve maximum throughput.</p> <p>The equivalent in Kubernetes is to scale up your deployment. As you increase the node count, the amount of data on each individual...
<p>I am using Prometheus version 2.28, I enabled basic Authentication on Prometheus server and seems that after enabling that, <code>/-/healthy</code> and <code>/-/ready</code> endpoints are also secured. I am using these endpoints in Kubernates for liveness and rediness probe. I have option to pass in Authorization he...
<p>Unfortunately <strong>no</strong>. What you have is probably the only solution that works, as of today.</p> <p>Back in 2015 there was a GitHub issue (<a href="https://github.com/kubernetes/kubernetes/issues/16910" rel="nofollow noreferrer">#16910</a>) to implement authentication support for HTTP liveness probes, but...
<p>I have an Azure Kubernetes cluster with Velero installed. A Service Principal was created for Velero, per <a href="https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure/tree/master#option-1-create-service-principal" rel="nofollow noreferrer">option 1 of the instructions</a>.</p> <p>Velero was working fin...
<h1>1. Update credentials file</h1> <p>First, update your credentials file (for most providers, this is <code>credentials-velero</code> and the contents are described in the plugin installation instructions: <a href="https://github.com/vmware-tanzu/velero-plugin-for-aws#set-permissions-for-velero" rel="nofollow norefer...
<p>Is there a way to combine <code>kubectl top pod</code> and <code>kubectl top nodes</code>?</p> <p>Basically I want to know pods sorted by cpu/memory usage <strong>BY</strong> node.</p> <p>I can only get pods sorted by memory/cpu for whole cluster with <code>kubectl top pod</code> or directly memory/cpu usage per who...
<p>There is no built-in solution to achieve your expectations. <code>kubectl top pod</code> and <code>kubectl top node</code> are different commands and cannot be mixed each other. It is possible to <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#interacting-with-running-pods" rel="nofollow noreferrer...
<p>I am trying to create a Service: NodePort for one of the pods I have deployed,</p> <p><strong>Below is my service definition</strong></p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Service metadata: name: voting-service labels: name: voting-service app: demo-voting-app spec: ...
<p>As @HarshManvar mentioned you can change the port in the service file for one that isn't allocated.</p> <p>Later you find that port <code>30004</code> was already allocated as there was a pod using that port:</p> <blockquote> <p>kubectl get svc | grep 30004</p> </blockquote>
<p>I have two services one for serving static files and other for serving apis. I have created a single ingress controller for these.</p> <p>I want to serve <code>/</code> from service1 and <code>/api</code> from service2. My services are running fine. but I am getting 404 for <code>/api</code> path.</p> <p>Below is my...
<p>remove this annotation and try</p> <pre><code>annotations: nginx.ingress.kubernetes.io/rewrite-target: / </code></pre> <p>if your cluster is supporting old <strong>API</strong> : extensions/v1beta1</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: service-ingress spec: rules: - ho...
<p>I am using kubernetes cluster provided from infra team(not minikube), I have created traefik ingress controller with all the configuration, ingress container, our applications are running in the cluster. now i want to access the application using domain name or ip address, for this, i have created a Ingress resourc...
<p>If you using any Load balancer behind the ingress or any ingress controller with a load Balancer you have to use the Load balancer IP everywhere.</p> <p>So you have to map the <code>Loadbalancer IP</code> into the <code>DNS</code> for <code>dummy.domain.com</code>, or else if you are not using the load balancer you ...
<p>Very new to K3s and I'm attempting to just practice by creating a deployment with 3 replicas of an ngnix pod. It creates on 2 of my worker nodes but one of the pods tried creating on my master node but I got a CreateContainerError. After digging further I found the following error: Error: failed to get sandbox conta...
<p>So all it needed was a fresh install and that seems to have solved everything. Probably should have tried that first.</p>
<p>I want to run pods with <code>runsc</code> as default on my k8s nodes but <code>kube-proxy</code> or other nodes can't be run via <code>runsc</code>. So, I want to automate the process in a way that after the Kubernetes start, every new pod will be run via <code>runsc</code>.</p>
<p>According to the <a href="https://kubernetes.io/docs/concepts/containers/runtime-class/" rel="nofollow noreferrer">official documentation</a>, this can be done with the below steps:</p> <ul> <li><p><a href="https://kubernetes.io/docs/concepts/containers/runtime-class/#1-configure-the-cri-implementation-on-nodes" rel...
<p>I have a simple Node.js chat example which uses socket.io. I have tested this deployment with a docker container locally, and a web client succesfully connects to the websocket (socket.io). The problem arise when I try to deploy this on a Kubernetes cluster with an ingress Controller.</p> <p>My question is, is there...
<p>This one is working with one</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: certmanager.k8s.io/cluster-issuer: core-prod kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/proxy-read-timeout: &quot;1800&quot; nginx.ingress.kubernetes.io/proxy-send-tim...
<p>I am trying to use Nginx ingress to access kubernetes dashboard on my local pc. The step I followed are:</p> <p>Getting nginx ingress</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.48.1/deploy/static/provider/cloud/deploy.yaml </code></pre> <p>Getting kuberne...
<p>I resolved adding annotations section in ingress yaml.</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: dashboard-ingress namespace: kubernetes-dashboard annotations: kubernetes.io/ingress.class: &quot;nginx&quot; nginx.ingress.kubernetes.io/ssl-passthrough: &quot;true&quot...
<p>I'm creating a custom resource definition (CRD) with an associated controller using <a href="https://github.com/kubernetes-sigs/kubebuilder" rel="nofollow noreferrer">kubebuilder</a>. My controller reconcile loop creates a deployment sub-resource and parents it to the custom resource using <code> controllerutil.SetC...
<p>Using @coderanger's hint, I could see that the <code>metadata.ownerReferences</code> weren't being set correctly when running the following command:</p> <pre class="lang-sh prettyprint-override"><code>kubectl get deployments sample-deployment -o yaml </code></pre> <p>The problem was my controller's reconcile code. I...
<p>I've created a cluster on Google Kubernetes Engine :</p> <pre><code>gcloud container clusters create training-cluster --num-nodes=1 --zone=us-central1-a --machine-type=&quot;n1-highmem-2&quot; --scopes=&quot;gke-default,storage-rw&quot; </code></pre> <p>I get the credentials:</p> <pre><code>gcloud c...
<p>If you are running the <strong>POD</strong> you set the <code>restartPolicy: Never</code> also</p> <p>The spec of a Pod has a <code>restartPolicy</code> field with possible values <strong>Always</strong>, <strong>OnFailure</strong>, and <strong>Never</strong>. The default value is Always.</p> <blockquote> <p>The res...
<p>In Nginx, we can set up basic auth by adding annotation in the ingress.</p> <pre><code>nginx.ingress.kubernetes.io/auth-realm: Authentication Required nginx.ingress.kubernetes.io/auth-secret: basic-auth nginx.ingress.kubernetes.io/auth-type: basic </code></pre> <p>But if we are using azure application gateway instea...
<p>Unfortunately <strong>Azure Application Gateway</strong> doesn't support <strong>basic auth</strong> and I would say using an <strong>ingress controller</strong> like <strong>nginx-ingress</strong> is the proper choice in a scenario where you need this feature. The lack of support for authentication in <strong>Azure...
<p>I've created a cluster on Google Kubernetes Engine :</p> <pre><code>gcloud container clusters create training-cluster --num-nodes=1 --zone=us-central1-a --machine-type=&quot;n1-highmem-2&quot; --scopes=&quot;gke-default,storage-rw&quot; </code></pre> <p>I get the credentials:</p> <pre><code>gcloud c...
<p>If you want to run the pod only once (stop the lifecycle as soon as the code/training is done), then you have to change the restartPolicy to Never or OnFailure in your pod yaml definition file.</p> <pre><code>containers: - name: my-custom-container image: gcr.io/xyz/object-classification:gpu args: {I...
<p>I am creating a GitHub workflow action, to deploy the build into an integration cluster and for that first, I wanted to create a namespace using kubectl, but I am getting an error: <code> error: You must be logged in to the server (Unauthorized)</code></p> <p>Here is my action.yaml snippet</p> <pre><code> use...
<p>you can try out the</p> <pre><code>- name: verify deployment uses: kodermax/kubectl-aws-eks@master env: KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} with: args: create ns &lt;namespace-name&gt; </code></pre> <p>however your config looks good but <strong>makesure</strong> you ha...
<p><strong>Background</strong></p> <p>On the Google Kubernetes Engine we've been using Cloud Endpoints, and the Extensible Service Proxy (v2) for service-to-service authentication.</p> <p>The services authenticate themselves by including the bearer JWT token in the <code>Authorization</code> header of the HTTP requests...
<p>To get an IdToken for the attached service account, you can use <code>GoogleCredential.GetApplicationDefault().GetOidcTokenAsync(...)</code>.</p>
<p>I know each pod gets a (unique) UUID, but is it possible to also give it, automatically, a low id number, that can be reusable as long as no two pods use them at the same time? So if pod 4 dies, the next time a pod is started gets 4. There can be gaps from time to time.</p> <p>My goal is to use this number as the wo...
<p>There is no built-in way to do this.</p> <p>The most straightforward workaround would be a <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="noreferrer">initcontainer</a>. On the pod start, the initcontainer runs before the start of the original containers, determines this id, and se...
<p>We are using AKS version 1.19.11.</p> <p>It is noticed that whenever a new rollout is in placed for our deployments or a new pod got created as part of the hpa settings or pod got restarted, We are getting high cpu usage alerts.</p> <p>For example, -if a new pod got created as part of any of the above activities, w...
<p>i am not sure what metrics you are looking at in AKS monitoring specifically as you have not mentioned it but it could be possible,</p> <p>when you are deploying the POD or HPA scaling the replicas your AKS showing the total resource of all replicas.</p> <p>During the <strong>deployment</strong>, it's possible at a ...
<p>I've installed Jenkins on GKE using <a href="https://artifacthub.io/packages/helm/bitnami/jenkins" rel="nofollow noreferrer">Bitnami Chart</a> and it is online.</p> <p>When I want to adjust it using <code>helm upgrade</code>, Kubernetes brings up a new instance while leaving the other running (as expected), but the ...
<p>You can delete the <strong>deployment</strong> of <strong>Jenkin</strong> first if you will delete the deployment other components will be there along with the storage disk which can reattached to the new deployment</p> <pre><code>kubectl delete deployments.apps jenkins </code></pre> <p><a href="https://artifacthub....
<p>I have set up a k8s cluster (1 node cluster) using DOKS. The service is running fine with nodeport config. However, I am unable to access it using <code>http://${NodeIP}:${NodePort}</code> from browsers. I have even tried to add the firewall rule, but i am getting <code>error response from backend</code> while tryin...
<p>Looks like a security group or a firewall issue. Run a traceroute to the destination IP from the machine with your browser.</p> <p>If it stops at the last hop, it is most likely the security group not allowing connections to your port from the source subnet.</p> <p>If the traceroute stops in the middle it is more li...
<p>I'm running prometheus and grafana under k3s, accessible (respectively) at <a href="http://monitoring.internal/prometheus" rel="nofollow noreferrer">http://monitoring.internal/prometheus</a> and <a href="http://monitoring.internal/grafana" rel="nofollow noreferrer">http://monitoring.internal/grafana</a>. The grafana...
<p>Since I haven't been able to figure out traefik yet, I thought I'd post my solution here in case anyone else runs into the same situation. I am hoping someone comes along who knows The Right Way to to do this, and if I figure out I'll update this answer.</p> <p>I added a new deployment that runs <a href="https://git...
<p>I have a couple of helm charts in a <code>myapp/templates/</code> directory, and they deploy as expected with <code>helm install myapp</code>.</p> <p>These two templates are for example:</p> <ul> <li>database.yaml</li> <li>cronjob.yaml</li> </ul> <p>I'd like for the <code>cronjob.yaml</code> to only run after the <c...
<p>Use init containers in the Pod Spec of Cron Job to check DB is up and running. <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podspec-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podspec-v1-core</a></p> <p>Example:</p> <pre><co...
<p>I have tried to read all the questions and answers in Stack Overflow, and doing a lot of googling, ask some of my Kubernetes Guru around me, but to not available... I am becoming crazy with that problem...</p> <p>Here is my problem, we have several environment, with different tenant, and each of them has an NFS serv...
<p>I know how frustrated it is, I have used this on centos 8, Ubuntu 18, 20 on baremetal and digital ocean, and we have to install nfs tools on host server, than it worked like a charm. We even not have to touch user security uuid etc.</p>
<p>i have lots of deployments yaml files and lots of services yaml files, i want to know if it is possible to execute all the yaml files at once ? i tried this command:</p> <pre><code>kubectl create -f *.yaml </code></pre> <p>But it's not working </p> <p>Thanks</p>
<p>If you are inside any directory and you want to apply all the YAML</p> <pre><code>kubectl apply -f ./ </code></pre> <p>or else you merge many <code>YAML</code> files in single <code>YAML</code> file</p> <pre><code>YAML1 content --- YAML 2 content --- YAML 3 contnet </code></pre>
<p>I have the following <code>configmap</code> where I want to retrieve the IPs using jsonpath how can that be done?</p> <pre><code>apiVersion: v1 data: domain.yaml: | dns: - 127.0.0.1 - 127.0.0.2 </code></pre> <p>I have tried the following which does not work: <code>kubectl get cm domain -o jsonpath=...
<p>this is not quite simple, as the</p> <pre><code>dns: - 127.0.0.1 - 127.0.0.2 </code></pre> <p>is interpreted as a single json value.</p> <p>for example <code>kubectl get cm testcm -o jsonpath='{.data}'</code> returns the following output <code>{&quot;domain.yaml&quot;:&quot;dns:\n - 127.0.0.1\n - 127.0.0.2\n&quot;...
<p>my.cnf in kubernetes configmap is not recognized by mysql pod.</p> <p>This is <strong>mysql.yaml</strong></p> <pre><code>apiVersion: apps/v1 kind: StatefulSet metadata: namespace: ***** name: ***** spec: serviceName: mysql-service replicas: 1 selector: matchLabels: app: ***** template: meta...
<p>From the official documentation of the docker image found <a href="https://hub.docker.com/_/mysql" rel="nofollow noreferrer">here</a> this could have several reasons.</p> <p>Check the default mysql configuration under <code>/etc/mysql/my.cnf</code> if there is an <code>includedir</code> statement which includes your...
<p>I have a .NET 5 API app running a Kestrel server inside a Docker container. I can run the app locally inside of the Docker container without any trouble. The issue occurs when I deploy to Kubernetes which has a LoadBalancer that appears to be causing issues.</p> <p>I receive the following error(s) repeatedly:</p> <p...
<p>You need to decide if you want to terminate https on your application or before that. I would suggest that you use Ingress instead of LB type service to expose your service to external world. That way you can configure https termination on the ingress it self and the app would remain http based with no need to confi...
<p>[ Disclaimer: this question was originally posted <a href="https://serverfault.com/questions/939527/kubernetes-calico-on-oracle-cloud-oci">on ServerFault</a>. However, since the official K8s <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/" rel="nofollow noreferrer">documentation<...
<p>After a long time and a lot of testing, my belief is that this was caused by IP-in-IP (ipip, or IP protocol 4) traffic being blocked by the Oracle cloud networking layer.</p> <p>Even though I was unable to find this documented anywhere, it is something that is common for cloud providers (Azure, for example, does the...
<p>I have a mosquitto broker running on a pod, this server is exposed as a service as both DNS and IP address.</p> <p>But this service is accessible by any pod in the cluster.</p> <p>I want to restrict access to this service such that pods trying to connect to this DNS or IP address should only be able to if the pods h...
<p>The UseCase you are describing is exactly what <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="noreferrer">NetworkPolicies</a> are here for.</p> <p>Basically you define selector for pods which the network traffic should be restricted (i.e. your mosquito broker) and what speci...
<p>we have an aks cluster and having one system nodepool and 2 user nodepools (usnp1&amp;usnp2) currently. We have multiple applications pods currently running across the usernodepools.</p> <p>So now we have a requirement to run one of our existing application pods to dedicately have a seperate nodepool and namespace s...
<ol> <li> <blockquote> <p>... so nodeselector will be a better option?</p> </blockquote> </li> </ol> <p>You could use nodeSelector but also nodeAffinity. It is just a matter of configuration. The nodeSelector strictly define that the Pod with e.g</p> <pre><code>nodeSelector: usnp1: &quot;true&quot; </code></pre> <p>...
<p>This is a really basic question, that I just can't seem to find it ANYWHERE. I need to create a <strong>CronJob on OpenShift Container Platform</strong>. </p> <p>I wasn't able to find a page on the Container Platform on how to directly create a CronJob.</p> <p>But I did manage to find instruction on creating it by...
<p>You can find cron jobs in the <code>Cluster Console/Workloads/Cron Jobs</code>.</p>
<p>I am trying to set up external dns from Eks manifest file.</p> <p>I created EKS cluster and created 3 fargate profiles, default, kube-system and dev. Coredns pods are up and running.</p> <p>I then installed AWS Load Balancer Controller by following this doc. <a href="https://docs.aws.amazon.com/eks/latest/userguide/...
<p>First, check the ingress itself works. Check the AWS load balancers and load balancer target groups. The target group targets should be active. If you do a <code>kubectl get ingress</code> this should be also output the DNS name of the load balancer created. Use <code>curl</code> to check this url works! The annotat...
<p>I am currently trying to modify my image:tag in my build config from shell command using oc patch.<br /> My command is as such :</p> <pre><code>oc patch bc/my-bc-name --patch '{&quot;spec&quot;:{&quot;strategy&quot;:{&quot;sourceStrategy&quot;:{&quot;from&quot;:{&quot;name&quot;: &quot;image:tag&quot; }}}}}' </code>...
<p>Surround your environment variable with single quotes as shown below. This will allow the shell to replace/expand it with its value.</p> <pre><code>oc patch bc/my-bc-name --patch '{&quot;spec&quot;:{&quot;strategy&quot;:{&quot;sourceStrategy&quot;:{&quot;from&quot;:{&quot;name&quot;: &quot;'$myImage'&quot;}}}}}' </c...
<p>Is it possible to control the percentage of traffic going to a particular pod with Kubernetes Service, without controlling the number of underlying pod? By default, kube- chooses a backend via a round-robin algorithm.</p>
<p>Yes, possible with the <strong>extra</strong> configuration of <strong>Service mesh</strong>.</p> <p>If you looking forward to do it using the simple service it's hard to do it based on <strong>%</strong> as the default behavior is <strong>round-robin</strong>.</p> <p>For example, if you are using the <strong>Istio ...
<p>i have lots of deployments yaml files and lots of services yaml files, i want to know if it is possible to execute all the yaml files at once ? i tried this command:</p> <pre><code>kubectl create -f *.yaml </code></pre> <p>But it's not working </p> <p>Thanks</p>
<p>Addition to @Harsh answer.</p> <p>Apply resources from a directory:</p> <pre><code>kubectl apply -k dir/ </code></pre> <p>Include the sub directories to include all manifest files from sub-directories.</p> <pre><code> kubectl apply -R -f dir/ </code></pre> <blockquote> <p>-R, --recursive=false: Process the director...
<p>Ok.. so, we have Google Secret Manager on GCP, AWS Secret Manager in AWS, Key Vault in Azure... and so on.</p> <p>Those services give you libs so you can code the way your software will access the secrets there. They all look straightforward and sort of easy to implement. Right?</p> <p>For instance, using Google SM ...
<p>There are many possible motivations why you may want to use an abstraction (such as the CSI driver or sidecar injector) over a native integration:</p> <ul> <li><p><strong>Portability</strong> - If you're multi-cloud or multi-target, you may have multiple secret management solutions. Or you might have a different sec...
<p>ConfigMap exists in the right namespace, but getting this error that it couldn't construct reference to configmap, and did not get a confirmation that leaderelection has been successfully required. Any advice would be appreciated</p> <p><strong>error log snippet</strong></p> <pre><code>... 2021-08-04T18:14:35.659Z ...
<p>Looks like the error is telling you:</p> <pre><code>... SelfLink: &quot;&quot;, ... </code></pre> <p><code>... due to: 'selfLink was empty, can't make reference' ...</code></p> <p>Thread here suggests some solutions <a href="https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/issues/25#issuecomment-74...
<p>So, we can see from this fun issue: <a href="https://github.com/aws/aws-cli/issues/4947" rel="noreferrer">https://github.com/aws/aws-cli/issues/4947</a></p> <p>that AWS CLI 2 is never going to be pushed to pip.</p> <p>In AWS MWAA (Managed AIrflow), we <em>are not given</em> the ability to specify apt-get level insta...
<p>MWAA doesn't currently support installing a specific AWS CLI version. This is a limitation that the MWAA team is aware of.</p>
<p>I need to monitoring a lot of legacy containers in my eks cluster that having a nfs mountpath. To map nfs directory in container i using nfs-client helm chart.</p> <p>I need to monitor when my mountpath for some reason is lost, and the only way that i find to do that is exec a command in container.</p> <pre><code>#!...
<p>As Matt has pointed out in the comments: first order of business should be to see if you can simply facilitate your monitoring requirement from node_exporter.</p> <p>Below is a more generic answer on collecting metrics from arbitrary shell commands.</p> <hr /> <p>Prometheus is a pull-based monitoring system. You con...
<p>i have encountered a strange problem with my cluster</p> <p>in my cluster i have a deployment and a Loadbalancer service exposing this deployment it worked like a charm but suddenly the Loadbalancer started to return an error:</p> <pre><code>curl: (56) Recv failure: Connection reset by peer </code></pre> <p>the erro...
<p>The issue in my case turned to be a network component (like a FW) blocking the outbound connection after dimming the cluster 'unsafe' for no apparent reason</p> <p>so in essence it was not a K8s issue but an IT one</p>
<p>I am trying to configure Kubernetes on docker-for-desktops and I want to change the default network assigned to containers. </p> <blockquote> <p>Example: the default network is <code>10.1.0.0/16</code> but I want <code>172.16.0.0/16</code>. </p> </blockquote> <p>I changed the docker network section to <code>Subn...
<p>Kubernetes also has a subnet that it uses and a corresponding network setting, which defaults to <code>10.1.0.0/16</code>, but this setting is not exposed in the Docker for-win UI. In <a href="https://github.com/docker/for-win/issues/1667#issuecomment-367357067" rel="nofollow noreferrer">docker/for-win issue #1667: ...
<p>I'm curious on how the <code>@Value</code> works internally on Spring so that it can actually read value from <code>ConfigMap</code> of Kubernetes Cluster.</p> <p>I know that:</p> <ul> <li><code>@Value(&quot;${my.nested.variable}&quot;)</code> were used to access variables declared on <code>application.properties</c...
<p>This is a community wiki answer. Feel free to expand it.</p> <p>As already mentioned by David Maze in the comments, <a href="https://spring.io/projects/spring-cloud-kubernetes" rel="nofollow noreferrer">Spring Cloud Kubernetes</a> is reading <a href="https://docs.spring.io/spring-cloud-kubernetes/docs/current/refere...
<p>I'm using <code>hyperkube</code> to start <code>kube-controller-manager</code> docker container. In order to rotate the kubernetes CA I followed <a href="https://kubernetes.io/docs/tasks/tls/manual-rotation-of-ca-certificates/" rel="nofollow noreferrer">this doc</a>. I have to point the KCM <code>client-ca</code> an...
<p>There are two possible ways of starting kube-controller-manager with customized settings, by providing YAML files.</p> <h4>Method #1</h4> <p>The <code>kube-controller-manager</code> runs as a pod in your control plane. It's config file is located in <code>/etc/kubernetes/manifests</code>, a <code>kube-controller-man...
<p>In Kubernetes, more specifically GKE, I created a Filestore volume, with the minimum of 1TB.</p> <p>I created then a Persistent Volume Claim of 20gb.</p> <p>What happens, if for another service I create another 20gb PVC ?</p> <p>Specifically, how does this kind of storage work if you want to share the disk space bet...
<p>There is a one-to-one mapping between a PVC and a PV, so you cannot create multiple PVCs pointing to the same PV.</p> <p>But there are two possible ways you can share the underlying Filestore file share across multiple pods.</p> <ol> <li><p>You can share a single PVC across multiple pods. So you could create a sing...
<p>I have a wehook running in my cluster.</p> <p>I created a certificate and signed it successfully.</p> <p>certificate configuration:</p> <pre><code>cat &gt; csr.conf &lt;&lt;EOF [req] req_extensions = v3_req distinguished_name = req_distinguished_name [req_distinguished_name] [ v3_req ] basicConstraints = CA:FALSE ke...
<p>In your old CertificateSigningRequest yaml you were using <em>server auth</em> as one of the key usages but, in latest one you changed it to <em>client auth</em> . the cert needed by webhook need to be signed with server auth key and signerName should be kubernetes.io/kubelet-serving . So update your files as follow...
<p>I am working with kubernetes and I need to pass parquet files containing datasets between pods , but I don't know which option will work best.</p> <p>As I know, persistent disk allows me to mount a shared volume on my pods, but with cloud storage I can share these files too.</p> <p>All the process is hosted on googl...
<p>If you want to persist the data you have to use the file store of Google. Which will support the read write many.</p> <blockquote> <p>Persistent Volumes in GKE are supported using the Persistent Disks. The problem with these disks is that they only support ReadWriteOnce(RWO) (the volume can be mounted as read-write ...