prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I am trying to set up a <code>kind</code> cluster for my kubernetes cluster. Unfortunately, it fails after preparing the nodes when it is writing the nodes. I will attach you the output and some information. Thank you in advance for any help!</p> <p>Cheers</p> <h2>The Error</h2> <pre><code>$ kind create cluster --co...
<p>Answer is not concrete, be prepared from the beginning. There is a huge closed <a href="https://github.com/kubernetes-sigs/kind/issues/1288" rel="nofollow noreferrer">Cannot create cluster due to docker exec cat /kind/version failing</a> github issue without resolution, but..</p> <p>The issue you encountered is pret...
<p>I need to execute a diagnostic program written for my application. The application is running/deployed in a Kubernetes pod. I want to copy a diagnostic executable jar file inside the Kubernetes pod and execute it without stopping the pod. How can this be achieved ? Is there a specific way to run the executable jar u...
<p>You can try the <code>kubectl cp</code> command:</p> <p>From the <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands" rel="noreferrer">docs</a>:</p> <blockquote> <p>Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace</p> </blockquote> <pre><code>kub...
<p>I have a legacy app which keep checking an empty file inside a directory and perform certain action if the file timestamp is changed.</p> <p>I am migrating this app to Kubernetes so I want to create an empty file inside the pod. I tried subpath like below but it doesn't create any file.</p> <pre><code>apiVersion: v1...
<p>If the objective is to create a empty file when the Pod starts, then the most easy way is to either use the entrypoint of the docker image or an init container.</p> <p>With the initContainer, you could go with something like the following (or with a more complex init image which you build and execute a whole bash sc...
<p>I am using Helm w/ Kubernetes and am trying to add data that I have in an existing Configmap to an existing secret. The reason for this, is that there is a property on a CRD that I need to set which only takes in a single secret key ref. The existing secret is created by Vault, and the existing Configmap is configur...
<p>As far as I am aware of there is not way to do this in kubernetes.</p> <p>The only solution that I can see would be to implement some tool yourself. With something like <a href="https://kopf.readthedocs.io/en/latest/" rel="nofollow noreferrer">kopf</a> you could implement a simple operator that listen for the creati...
<p>I am moving from single pod(docker image) to multiple pods for my Spring Application on Kubernetes for load handling. But I am facing an issue because I have a cron scheduler method in my application which runs daily at a particular time. If I deploy multiple pods, they all run simultaneously and as a result multipl...
<p>You can use a quartz scheduler with JDBC store. This will take care of your requirement automatically.</p> <p>In short: &quot;Load-balancing occurs automatically, with each node of the cluster firing jobs as quickly as it can. When a trigger’s firing time occurs, the first node to acquire it (by placing a lock on it...
<p>I deployed 2 front-end applications that are based on angular. I use ingress-nginx (<code>k8s.gcr.io/ingress-nginx/controller:v0.44.0</code>) with the following configurations to route the requests to these applications:</p> <pre><code>apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: portal-ingr...
<p>According to the <a href="https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/#path-priority" rel="noreferrer">ingress-nginx documentation</a>, the first step it follows is to order the paths in descending length, then it transforms these paths into nginx <a href="https://nginx.org/en/docs/ht...
<p>Here is how my <strong>virtual service</strong> currently looks like -</p> <pre><code>apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: example-route spec: hosts: - example.com http: - match: - port: 443 - uri: prefix: &quot;/catalog&quot; route: - destinati...
<p>Istio does provide some support for circuit breaking as described in <a href="https://istio.io/latest/docs/tasks/traffic-management/circuit-breaking/" rel="nofollow noreferrer">https://istio.io/latest/docs/tasks/traffic-management/circuit-breaking/</a></p> <p>However, afaik there is no support for fallbacks. This pr...
<p>If you have a PDB that specifies a higher <code>minAvailable</code> than the <code>minReplicas</code> of a HPA, will the number of pods ever reach the lower <code>minReplicas</code>?</p> <p>Example configs:</p> <p>PDB</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: policy/v1beta1 kind: PodDisruptio...
<p>In your case both objects will be created and value <code>minAvailable: 3</code> defined in PodDisruptionBudget will have higher priority than <code>minReplicas: 2</code> defined in Deployment. Conditions defined in PDB are more important. In such case conditions for PDB are met but if autoscaler will try to decreas...
<p>I have a list of pods like so:</p> <pre><code>❯ kubectl get pods -l app=test-pod (base) NAME READY STATUS RESTARTS AGE test-deployment-674667c867-jhvg4 1...
<p>You have to use a headless service with selectors. It returns the ip addresses of the pods.</p> <p>See here: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#headless-services</a></p...
<p>We have defined our internal Load Balancer.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: ads-aks-test annotations: service.beta.kubernetes.io/azure-load-balancer-internal: &quot;true&quot; spec: type: LoadBalancer ports: - protocol: TCP port: 9000 selector: app: ads-aks-test </...
<p>Set up <a href="https://github.com/kubernetes-sigs/external-dns" rel="nofollow noreferrer">ExternalDNS</a> in your K8s cluster. Here is a guide for <a href="https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/azure-private-dns.md" rel="nofollow noreferrer">Azure Private DNS</a>. This will allo...
<p>My cluster certificates are expired and now I cannot execute any kubectls commands.</p> <pre><code>root@node1:~# kubectl get ns Unable to connect to the server: x509: certificate has expired or is not yet valid root@node1:~# </code></pre> <p>I have created this cluster using Kubespray , kubeadm version is v1.16.3 a...
<p>First you need to renew expired certificates, use <code>kubeadm</code> to do this:</p> <pre><code>kubeadm alpha certs renew apiserver kubeadm alpha certs renew apiserver-kubelet-client kubeadm alpha certs renew front-proxy-client </code></pre> <p>Next generate new <code>kubeconfig</code> files:</p> <pre><code>kubead...
<p>I have a pod running and want to port forward so i can access the pod from the internal network. I don't know what port it is listening on though, there is no service yet.</p> <p>I describe the pod:</p> <pre><code>$ kubectl describe pod queue-l7wck Name: queue-l7wck Namespace: default Priority: 0 N...
<p>Try the combination of both <strong>kubectl</strong> and your Linux command to get the <strong>Port</strong> container is listening on:</p> <pre><code>kubectl exec &lt;pod name here&gt; -- netstat -tulpn </code></pre> <p>Further you can pipe this result with <code>grep</code> to narrow the findings if required eg.</...
<p>on microsoft <a href="https://learn.microsoft.com/en-us/azure/aks/ingress-internal-ip" rel="nofollow noreferrer">docs</a> I found that I should define this Helm YAML file for creating Kubernetes Ingress Controller:</p> <pre><code>controller: service: loadBalancerIP: 10.240.0.42 annotations: service.b...
<p>The <code>-f</code> does not set a &quot;manifest&quot; as stated in the Microsoft docs. As per <code>helm install --help</code>:</p> <blockquote> <p><code>-f</code>, <code>--values</code> strings specify values in a YAML file or a URL (can specify multiple)</p> </blockquote> <p>The default <a href="ht...
<p>I would like to list pods created within 24 hours. I didn't find any kubectl commands or anything to get those. Could anyone please help me with the kubectl command to get only the pods created in last 24 hours.</p>
<p>In order to list all Pods created within the last 24h you can use the below command:</p> <pre><code>kubectl get pods --sort-by=.metadata.creationTimestamp | awk 'match($5,/^[0-9]h|^[0-9][0-9]h|^[0-9]m|^[0-9][0-9]m|^[0-9]s|^[0-9][0-9]s/) {print $0}' </code></pre> <p>If you also want to get Pods with errors only than ...
<p>I have deployed an Azure AKS cluster using Azure CNI behind Application Gateway. Currently, internal pod communication is via http. I am trying to make this communication secure by implementing SSL. I didn't find any optimal solution after skimming through MSDN and Kubernetes documentation. Is there any way this can...
<p>CNI won't automatically encrypt the communication between pods on its own. You could use external tools like Linkerd or Istio which could encrypt traffic between pods</p> <p>Linkerd and Isito will encrypt traffic with mTLS out of the box.</p> <p><a href="https://linkerd.io/2/features/automatic-mtls/" rel="nofollow n...
<p><strong>UPDATE</strong>: Apologies for perhaps causing controversy but it seems like there was another cronjob running that was also calling a function that was grabbing those apiKeys from the DB but I was not sure until I seperated the part where it was grabbing them from the environment variables ;_;. So basically...
<p>UPDATE: Apologies for perhaps causing controversy but it seems like there was another cronjob running that was also calling a function that was grabbing those apiKeys from the DB but I was not sure until I seperated the part where it was grabbing them from the environment variables ;_;. So basically this whole post ...
<p>Is there a way to configure Kubernetes (or <code>kubectl</code>) so that an attempt to delete a namespace that has Kubernetes resources will result in an error?</p> <p>Here is an example:</p> <pre><code>$ kubectl create ns testing namespace/testing created $ kubectl apply -n testing -f pod-nginx.yaml pod/example-po...
<p>Unfortunately, I am not aware of any way to do this the way you expect it to work. The best solution I could come up with is to use RBAC to prevent users from deleting namespaces. It's not what you are asking for but it's probably the closest you are going to get:</p> <pre class="lang-yaml prettyprint-override"><cod...
<p>I've added some scaling policies to my <strong>HorizontalPodAutoscaler</strong> but they are not being applied. The <em>scaleUp</em> and <em>scaleDown</em> behaviours are being ignored. I need a way to stop pods scaling up and down every few minutes in response to small CPU spikes. Ideally the HPA would scale up qui...
<p>It works for me,</p> <p>Client Version: v1.20.2 Server Version: v1.18.9-eks-d1db3c</p> <p>kubectl api-versions and my cluster also supports autoscaling/v2beta2</p> <pre><code>apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template &quot;ks.fullname&quot; . }}-keycloak spec: scal...
<p>I deployed my first container, I got info:</p> <pre><code>deployment.apps/frontarena-ads-deployment created </code></pre> <p>but then I saw my container creation is stuck in Waiting status. Then I saw the logs using <code>kubectl describe pod frontarena-ads-deployment-5b475667dd-gzmlp</code> and saw MountVolume erro...
<p>The Issue was because of the different Azure Regions in which AKS cluster and Azure File Share are deployed. If they are in the same Region you would not have this issue.</p>
<p>I'm trying to install the cert-manager ClusterIssuer on a AKS, and because the cluster is behind Azure Application Gateway I've gone down the route of using a DNS solver rather the HTTP. However, the challenge fails with an error calling the Cloudflare API. I've redacted emails and domains through the code snippets,...
<p>As <a href="https://stackoverflow.com/users/5525824/harsh-manvar">Harsh Manvar</a> guessed, it was an issue with the secret. I wasn't running the <code>kubectl apply</code> command through <a href="https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html" rel="nofollow noreferrer">envsubst</a> ...
<p>Has anyone come across this issue before?</p> <pre><code>/snap/bin/microk8s permanently dropping privs did not work: File exists </code></pre> <p>I get the same error when trying to run any of the other sub commands like microk8s.enable, microk8s.status, microk8s.kubectl - all same error message.</p> <p>I tried to:<...
<p>I had a same error message when I execute docker command after installing docker via snap. After logout-login, the error was solved in my case.</p>
<p>I followed the official instruction and had no problem with running kie server and workbench on Docker. However, when I try with Kubernetes I bump into some problem. There is no Execution server in the list (Business Central -&gt; Deploy -&gt; Execution Servers). Both of them are up and running, I can access Busines...
<p>I was working on a similar set up and used your YAML file as a start (thanks for that)!</p> <p>I had to add the following snippet to the <code>kia-server-showcase</code> container:</p> <pre><code> env: - name: KIE_WB_ENV_KIE_CONTEXT_PATH value: &quot;business-central&quot; </code></pre> <p>It d...
<p>I'm looking the way to define <strong>externalIP</strong> range during Openshift cluster installation ( via declarations in install-config.yaml ).</p> <p>Openshift docs for 4.3 and later version ( <a href="https://docs.openshift.com/container-platform/4.3/installing/installing_bare_metal/installing-bare-metal.html#i...
<p>actually you can:</p> <p>first create the openshift install manifests</p> <pre><code>./openshift-install create manifests --dir=&lt;installation_directory&gt; </code></pre> <p>check the output:</p> <pre><code>ls &lt;installation_directory&gt;/manifests/cluster-network-* cluster-network-01-crd.yml cluster-network-02...
<p>I'm trying to use <a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">KIND</a> to spin up my Kubernetes cluster and trying to use it with Kubectl but I'm stymied at the first hurdle</p> <p>I set up a cluster using the following kind config</p> <pre><code>kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nod...
<p>I solve this issue with <code>sudo chmod 0644 /etc/kubernetes/admin.conf</code> and <code>export KUBECONFIG=/etc/kubernetes/admin.conf</code></p>
<p>I am deploying a 2-node Kubernetes cluster on GCloud using kops with the following commands:</p> <pre><code>kops create cluster part1.k8s.local --zones europe-west3-a --node-count 2 --node-image ubuntu-os-cloud/ubuntu-2004-focal-v20210129 --node-size &quot;e2-standard-2&quot; --ssh-public-key ~/.ssh/id_rsa.pub --sta...
<p>I've encounter the issue when I tested some scenarios with <code>SSH keys</code> (add, remove, overwrite, etc).</p> <p>When you are logging to <code>GKE</code> console, your <code>ssh keys</code> are stored in <code>~/.ssh</code>. If folder it's empty, those keys will be created ocne you will connect to VM (google_c...
<p>i have a netcore webapi deployed on kubernetes. Every night at midnight i need to call an endpoint to do some operations on every pod, so i have deployed a cronjob that calls the api with curl and the method does the required operations.</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: test-c...
<p>That is an expected behavior as when we do <code>curl</code> on a Kubernetes <code>Service</code> object, it is expected to pass the requests to only one of the <code>endpoints</code> (IP of the pods). To achieve, what you need, you need to write a custom script that first gets the endpoints associated with the serv...
<p>I'm deploying a NodeJS project that uses PostgreSQL with Prisma to Kubernetes. I created the <code>Dockerfile</code> and I'm building the docker image to Docker Hub:</p> <pre><code>FROM node:lts-slim WORKDIR /app # Add `/app/node_modules/.bin` to $PATH ENV PATH /app/node_modules/.bin:$PATH ENV NODE_ENV=production ...
<p>In this case, I would suggest running <code>prisma migrate deploy</code> as mentioned <a href="https://www.prisma.io/docs/reference/api-reference/command-reference/#migrate-deploy" rel="noreferrer">here</a> in your CI/CD step before deploying the application so that you do not need to perform it on every start scrip...
<p>I just installed Helm v3.4.2 and the command below prints many packages as DEPRECATED in the description:</p> <p><code>helm search repo stable</code></p> <p>Output:</p> <pre><code>stable/acs-engine-autoscaler 2.2.2 2.1.1 DEPRECATED Scales worker nodes within agent pools stable...
<p>The underlying reason &quot;why&quot; is that the CNCF no longer wanted to pay the costs in hosting a single monolithic repository:</p> <p><a href="https://www.cncf.io/blog/2020/10/07/important-reminder-for-all-helm-users-stable-incubator-repos-are-deprecated-and-all-images-are-changing-location/" rel="noreferrer">h...
<p>After reading some documentation regarding <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="noreferrer">Persistent Volumes</a> in Kubernetes I am wondering which one would be the best setup (storage speaking) for running a highly available ElasticSearch cluster. I am not running the typ...
<p>A good pattern to deploy an ElasticSearch cluster in kubernetes is to define a <code>StatefulSets</code>.</p> <blockquote> <p>Because the StatefulSet replicates more than one Pod you cannot simply reference a persistent volume claim. Instead, you need to add a <code>persistent volume claim template</code> to the Sta...
<p>I'm using Elastic Heartbeat in a Kubernetes Cluster.</p> <p>I'm trying to setup google cloud platform module to Heartbeat, the documentation say:</p> <pre><code> metricbeat.modules: - module: googlecloud metricsets: - compute region: &quot;us-&quot; project_id: &quot;your project id&...
<p>Solved!</p> <p>I created a secret with my credentials.json file and I mounted the secret as volumen in the pod.</p> <p>Configuration:</p> <p>secret.yaml:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: credentials-secret type: Opaque stringData: sa_json: | { &quot;type&quot;: &quot;service_a...
<p>I'm running a pod in kubernetes, with hugepages allocated in host and hugepages defined in the pod. The kubernetes worker is in a VM. The VM (host) has huge pages allocated. The pod fails to allocate hugepages though. Application gets SIGBUS when trying to write to the first hugepage allocation.</p> <p>The pod defin...
<p>This is <a href="https://github.com/kubernetes/kubernetes/issues/71233" rel="nofollow noreferrer">a known problem</a> in K8s.</p> <p>The culprit is that kubelet doesn't update /sys/fs/cgroup/hugetlb/kubepods/hugetlb.2MB.limit_in_bytes upon Node Status Update which happens every 5 minutes by default. Yet it updates t...
<p>I would like to pass array as property in yaml (values file) in Helm. What I tried:</p> <ol> <li><p>Attempt.</p> <pre><code>elasticsearch: uri: "[\"127.0.0.1:9200\",\"127.0.0.2:9200\"]" </code></pre> <p>Error:</p> <blockquote> <p>ReadString: expects " or n, but found [, error found in #10 byte of ...|RCH_U...
<p>Helm Rendering of values from values.yaml to config.yaml :</p> <p><em>values.yaml</em>:</p> <pre><code>sites: - dataprovider: abcd - dataprovider: xyzx </code></pre> <p><em>config.yaml</em>:</p> <pre><code>sites: {{ toYaml .Values.sites | indent 10 }} </code></pre>
<p>I have a very simple <code>Spring Boot</code> Helloworld application that displays <code>Hello World!</code> message using a <code>REST</code> <code>API</code>.</p> <p>I would like to deploy that application on my <code>Ubuntu</code> node which has <code>MicroK8s</code> installed.</p> <p><strong>Steps Followed:</str...
<p><strong>MicroK8s</strong> has his own packaged version of <code>kubectl</code> that by default it's accessed through <strong>MicroK8s</strong> including its <strong>configuration</strong>.</p> <p><code>microk8s kubectl</code></p> <p>In order that <strong>JKube</strong> knows about your <strong>MicroK8s</strong> clus...
<p>I am new to devops world and have a doubt in Kubernetes. My usecase is as follows.<br /> <strong>My organization is currently hosting all its microservices in Docker containers using Kubernetes container orchestration platform.</strong></p> <p>How I want my microservice container to be scaled and automated using Kub...
<p>I would use <a href="https://github.com/kubeflow/kfserving" rel="nofollow noreferrer">KFServing</a> for serverless inference on k8s. You can install it as a <a href="https://github.com/kubeflow/kfserving#standalone-kfserving-installation" rel="nofollow noreferrer">standalone component</a> or you can run it with the ...
<p>I have a very simple query, in a very simple table:</p> <pre class="lang-py prettyprint-override"><code>def get_defaults(domain): defaults = BaseDefaults.query.filter_by(domain=domain).first() return defaults </code></pre> <p>The table has (no kidding) 3 rows, with 34 columns, 1 PK, 1 Unique, 2 FK. of the fo...
<p>For anyone that's going through something similar, I fixed my problem with <code>lazy=True</code> in the <code>backref</code> model declaration.</p> <p>This wasn't a problem until a completely different table in the database started to grow fast - we were using <code>lazy='joined'</code> which would automatically jo...
<p>I am planing on using <strong>AWS SQS</strong> to receive messages from server and then instantly have <strong>Kubernetes Load Balancer</strong> consume them and pass each message to one of the pods.</p> <p>My biggest concern is in which way can Load Balancer be triggered by AWS SQS.</p> <p>Is this possible to do?</...
<p>To expand on @Marcin's comment:</p> <p>There is no integration between the Elastic Load Balancer implementations and SQS in any direction. Part of the reason is, that they both implement a pattern, which requires a trigger from the outside for them to do anything.</p> <p>To consume a message from SQS, the <strong>co...
<p>I need to configure a TCP port on my AKS Cluster to allow RabbitMQ to work</p> <p>I have installed nginx-ingress with helm as follows:</p> <pre><code>kubectl create namespace ingress-basic helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm install nginx-ingress ingress-nginx/ingress-nginx ...
<p>I believe the issue here was that helm was configuring so much of my own stuff that I wasn't able to customise too much.</p> <p>I uninstalled the ingress with helm and changed the ingress creation script to this:</p> <pre class="lang-yaml prettyprint-override"><code>helm install nginx-ingress ingress-nginx/ingress-n...
<p>I need to oveeride some of properties defined in a application.yml of Spring Boot application running in k8s. How can I do this? The only way I found is to mount whole application.yml but I only need to override one property.</p>
<p>Could be doable in another way, that's why i'm answering again. Do it in an easy way.</p> <p>Create your application.yml in a configmap and mount it as a sub directory called config into the same directory where the spring boot jar ins located.</p> <p>The documentation of <a href="https://docs.spring.io/spring-boot/...
<p>Does k3s supports the ServiceTopology feature, and if so, how to enable it?</p>
<p>Yes, but it's a feature-gate: Using CLI:</p> <pre><code>--kube-apiserver-arg feature-gates=ServiceTopology=true,... </code></pre> <p>I have no firsthand experience with running it on k3s.</p>
<p>I am newbie to kubernetes, I see one of my node's role is <code>control-plane,master</code>. What is the difference? is a master node is a node running kube-apiserver? Then what defined control-plane node?</p> <p>I am using kubectl 1.20.2(kubeadm also 1.20.2).</p>
<p>The old <code>node-role.kubernetes.io/master</code> label and taint key has been deprecated and will be replaced with <code>node-role.kubernetes.io/control-plane</code> instead, they are both valid during a transition period. Adding them both ensures backward compatibility while also supporting tools using the newer...
<p>I'm Trying to have a kubernetes cluster on aws and It's keep on failing while validation. using following command to update the cluster <code>kops update cluster cluster.foo.com --yes</code> and post running this <code>kops validate cluster</code></p> <pre><code>Using cluster from kubectl context: cluster.foo.co...
<p>Since EC2 uses elastic IP address for public IP, each time you reboot master node it will receive a new public IP. It happens that KOPS does not pick up the new IP for the Kube API. For example, if your cluster name was <code>kube.mydomain.com</code>, the API DNS would be: <code>api.kube.mydomain.com</code> as you c...
<p>I have this Deployment object:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: deployment-webserver-nginx annotations: description: This is a demo deployment for nginx webserver labels: app: deployment-webserver-nginx spec: replicas: 3 selector: matchLabels: app: depl...
<p>From the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#selector" rel="nofollow noreferrer">official docs</a>:</p> <blockquote> <p>Note: You should not create other Pods whose labels match this selector, either directly, by creating another Deployment, or by creating another controlle...
<p>in Azure Kubernetes Service - where is the ConfigMap definition for Ingress Controller?</p> <p>I got really confused - I installed Ingress with <code>helm install</code> which provided me an nginx Ingress <strong>Pod and Service</strong>.</p> <p><code>helm install nginx-ingress ingress-nginx/ingress-nginx -f interna...
<p>To get the <code>Configmap</code> object, you can use one of the below two:</p> <pre><code>kubectl get cm --namespace &lt;ns&gt; &lt;configmap-name&gt; </code></pre> <p>or</p> <pre><code>kubectl get configmap --namespace &lt;ns&gt; &lt;configmap-name&gt; </code></pre>
<p>I have 2 different microservices deployed as backend in minikube, call it deployment A and deployment B. Both these deployments have a different replica of pods running.</p> <p>Deployment B is exposed as service B. Pods of deployment A call deployment B pods via service B which is of ClusterIP type.</p> <p>The pods ...
<p>So the solution to the above problem that I figured out is as follows :</p> <p>In the current setup, install linkerd using this link. <a href="https://linkerd.io/2/getting-started/" rel="nofollow noreferrer">Linkerd Installation in Kubernetes</a></p> <p>After that inject the linkerd proxy into celery deployment as f...
<p>As a followup question to my post <a href="https://stackoverflow.com/questions/66191604/helm-function-to-set-value-based-on-a-variable">Helm function to set value based on a variable?</a>, and modifying the answer given in <a href="https://stackoverflow.com/questions/52742241/dynamically-accessing-values-depending-o...
<p>If I do this, that is, pipe <code>pluck</code> with the <code>int</code> converter, it works, but it doesn't explain why <code>pluck</code> returns a <code>float64</code> value.</p> <pre><code>templates/deployments.yaml -------------------------- apiVersion: apps/v1 kind: Deployment metadata: ... spec: {{- if not ...
<p>I'm currently developing my ci/cd pipeline via 'gitHub' actions.<br /> My k8s deployments being managed by 'helm' and runs on GKE and my 'images' stored in 'gcp' I've successfully manages to build and deploy a new image via 'gitHub' actions, and now I've would like that one of the pods will fetch the latest version ...
<h1>Use kubectl rollout</h1> <p>If you are using <code>latest</code> tag for image and <code>imagePullPolicy</code> is set as <code>Always</code>, you can try <code>kubectl rollout</code> command to fetch the latest built image.</p> <p>But <code>latest</code> image tag is not recommended for the prod deployment, becaus...
<p>Problem:</p> <p>I want every pod created in my cluster to hold\point the same data e.g. let's say I want all of them to have an env vars like &quot;OWNER=MYNAME&quot;. there are multiple users in my cluster and I don't want them to start changing their YAMLs and manually assign OWNER:MYNAME to env.</p> <p>Is there a...
<p><a href="https://v1-19.docs.kubernetes.io/docs/concepts/workloads/pods/podpreset/" rel="nofollow noreferrer">Pod Preset</a> might help you here to partially achieve what you need. Pod Preset resource allows injecting additional runtime requirements into a Pod at creation time. You use label selectors to specify the ...
<p>I'm trying to list knative (v0.17.0) <code>services</code>, I have a <code>clientset</code> but I don't know where to start. Here is a service I launched for my test :</p> <pre><code>apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: name: &quot;helloworld&quot; spec: runLatest: configuration: ...
<p>Basing this off <a href="https://gist.github.com/mhausenblas/30e8dc5f7682888c10906cb0f8c471cb" rel="nofollow noreferrer">this gist</a> adapted for the post-1.18 client-go, and the <a href="https://pkg.go.dev/knative.dev/serving@v0.20.0/pkg/client/clientset/versioned/typed/serving/v1" rel="nofollow noreferrer">Servin...
<p>I have a simple demo Flask application that is deployed to kubernetes using minikube. I am able to access the app using the Services. But I am not able to connect using ingress.</p> <p><strong>Services.yaml</strong></p> <pre><code>apiVersion: v1 kind: Service metadata: name: services-app-service spec: selector: ...
<p>The issue is that you need to access it with a Host head of <code>mydemo.info</code> for that Ingress spec to work. You also need to confirm you have an Ingress Controller installed, usually ingress-nginx for new users but there are many options. Then you would look for the Ingress Controllers NodePort or LoadBalanc...
<p>I need to specify External IP that will be associated to Nginx service upon the Ingress Controller creation using the HELM install:</p> <pre><code>helm install nginx-ingress ingress-nginx/ingress-nginx -f internal-ingress.yaml --set controller.nodeSelector.&quot;beta\.kubernetes\.io/os&quot;=linux --set defaultBac...
<p>You can add flag to installation command:</p> <pre><code> --set controller.service.loadBalancerIP=XXXX </code></pre> <p>where XXXX is static EXTERNAL IP you want to use. Remember that IP needs to be regional and in the same region as the cluster.</p> <p>See: <a href="https://stackoverflow.com/questions/55421381/how...
<p>I made a demo with kubernetes/go-client where i tried to list pods from my cluster.</p> <pre><code> config, err := rest.InClusterConfig() if err != nil { panic(err.Error()) } clientset, err := kubernetes.NewForConfig(config) if err != nil { panic(err.Error()) } pods, err...
<p>You need to check if the <code>err</code> on the last line is non-nil.</p> <pre><code>pods, err := clientset.CoreV1().Pods(&quot;&quot;).List(context.TODO(), metav1.ListOptions{}) </code></pre> <blockquote> <p>OK, there is the problem. pods is forbidden: User &quot;system:serviceaccount:mis-pruebas:sa-prueba-go&quot...
<p>I have installed kubernetes cluster thus I have a deployment file for jenkins.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: jenkins spec: replicas: 1 selector: matchLabels: app: jenkins template: metadata: labels: app: jenkins spec: containers: ...
<p>Try adding securityContext in your deployment</p> <pre><code>spec: securityContext: runAsUser: 0 </code></pre> <p>If this doesnt work,( your jenkins deployment is failing or some other issue), then when you enter the pod ( pod exec) check what user is it by running <code>id</code> or <code>whoami</code></p>
<p>In Azure Kubernetes (AKS) if pod sending the traffic outside the cluster it get Natted to the Node IP address. For example, if pod nettools ( from node aks-agentpool-35359625-1 ) sending the traffic to Azure destinations that is outside of the cluster it get natted to 10.240.0.35. Is there a way to preserve the orig...
<p>You can edit the azure-ip-masq-agent configmap to add the target private IP CIDR that you don't want it to be Masqueraded.</p> <pre class="lang-sh prettyprint-override"><code>kubectl get pods --namespace kube-system -l &quot;k8s-app=azure-ip-masq-agent&quot; -o wide kubectl describe configmap azure-ip-masq-agent-co...
<p>I have an operator that has 2 controllers in it. The controllerA watches for CRD_A and if it finds a CR (we can have only one CR of this type in the cluster) of this type A the controller creates a podA and sets the CR as the owner of the podA. The controllerB watches for CRD_B, if it finds CR of type B the controll...
<p>I think you were asking in Slack about this last week but the rough answer is &quot;use a watch map&quot;. <a href="https://github.com/coderanger/migrations-operator/blob/088a3b832f0acab4bfe02c03a4404628c5ddfd97/components/migrations.go#L63-L91" rel="nofollow noreferrer">https://github.com/coderanger/migrations-oper...
<p>Hi the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#containerport-v1-core" rel="nofollow noreferrer">documentation </a> says about the name field in containers.ports :</p> <blockquote> <p>name If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in ...
<p>The <code>port</code> field represents the port at which the <code>Service</code> object listens to and the <code>targetPort</code> represents the port at which the container is listening.</p> <p>Try this:</p> <pre><code>kind: Service apiVersion: v1 metadata: name: banana-service spec: selector: app: banana ...
<p>I'm adding an Ingress as follows:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: cheddar spec: rules: - host: cheddar.213.215.191.78.nip.io http: paths: - backend: service: name: cheddar port: number: 80 path...
<p>I have analyzed you issue and came to the following conclusions:</p> <ol> <li>The Ingress will work and these Warnings you see are just to inform you about the available api versioning. You don't have to worry about this. I've seen the same Warnings:</li> </ol> <hr /> <pre><code>@microk8s:~$ kubectl describe ing War...
<p>I'm creating a HorizontalPodAutoscaler in Kubernetes and I need to configure the downscale stabilization window to be smaller than the default. The code used and error are below:</p> <pre><code>apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: busy-autoscaler spec: behavior: ...
<p>Client Version: v1.20.2 Server Version: v1.18.9-eks-d1db3c</p> <p>Make sure <code>kubectl api-versions</code> and your cluster supports autoscaling/v2beta2</p> <pre><code>apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: {{ template &quot;ks.fullname&quot; . }}-keycloak spec: scaleTar...
<p>I have Kubernetes running on Azure, and it uses a load balancer. Azure has assigned a public IP address to this load balancer, and for the purposes of setting up an Application Gateway via the Azure CLI I wish to obtain the IP address of the k8s load balancer using the Azure CLI.</p> <p>I can obtain the load balance...
<p>Try this (assuming, your LB only has one inbound IP address. Otherwise $pipId is an array)</p> <pre><code>$pipId = $(az network lb show --id $loadBalancer.id --query &quot;frontendIpConfigurations | [?loadBalancingRules != null].publicIpAddress.id&quot; -o tsv) $ip = (az network public-ip show --ids $pipId --query ...
<p>I recently upgraded my ingress controller to <a href="https://github.com/nginxinc/kubernetes-ingress/releases/tag/v1.10.0" rel="nofollow noreferrer">kubernetes-ingress v1.10.0</a>. The ingresses seem to route traffic correctly but after checking the pods logs, I noticed a huge amount of notice were generated:</p> <...
<p>I don't know the actual root cause but I deleted all the TLS secrets, certificates and ingresses that were being constantly being updated and recreated them. It solved this issue.</p> <p>Different incidents happened prior to this issue and might have been related to it: 2 of my 3 ingress nodes failed, during the upg...
<p>Following <a href="https://upcloud.com/community/tutorials/install-kubernetes-cluster-centos-8" rel="noreferrer">this tutorial</a>, I set up a worker node for my cluster. However, after running the <code>join</code> command and attempting <code>kubectl get node</code> to verify the node was connected, I am met with ...
<p><strong>TLDR</strong></p> <ol> <li>Run <code>join</code> with sudo</li> <li><code> mv /etc/kubernetes/kubelet.conf /etc/kubernetes/admin.conf</code></li> </ol> <hr /> <p>After some tinkering, I realized it was a combination of a permissions error and the correct file being generated with an incorrect name.</p> <p>In...
<p>I am trying to access the metrics server for a k8s cluster without the use of <code>kubectl proxy</code>. After finding the tutorial at <a href="https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#without-kubectl-proxy" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster...
<p>I figured out it was the <code>apiGroups</code> that needed to be modified. The following ClusterRole and ClusterRoleBinding worked:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: name: test-admin rules: - apiGroups: [&quot;*&quot;] #...
<p>I having my Pod manifest as below:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: pod-nginx-container spec: containers: - name: nginx-alpine-container-1 image: nginx:alpine ports: - containerPort: 80 </code></pre> <p>And I can get a shell to the Container running my Nginx using <code>kub...
<h2>Kubernetes</h2> <p>Kubernetes schedules <a href="https://kubernetes.io/docs/concepts/workloads/pods/" rel="noreferrer">Pods</a> to nodes. A Pod consists of one or more containers - that are instantiated from container images.</p> <h2>Container image</h2> <p>A container image contains a command that will run as the ...
<p>I have installed the latest Minishift release <code>1.34.3</code> on Windows 10 Hyper-V. The OpenShift client version is <code>4.6.16</code> as expected however the Kubernetes version is <code>1.11</code>.</p> <pre><code>PS C:\Tools&gt; minishift version minishift v1.34.3+4b58f89 PS C:\Tools&gt; oc version Client V...
<p><a href="https://github.com/minishift/minishift" rel="nofollow noreferrer">minishift</a> is based on OpenShift 3, not the newer OpenShift 4.</p> <blockquote> <p><strong>Note:</strong> Minishift runs OpenShift 3.x clusters. Due to different installation methods, OpenShift 4.x clusters are not supported.</p> </blockqu...
<p>Below is my Pod manifest:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: pod-debian-container spec: containers: - name: pi image: debian command: [&quot;/bin/echo&quot;] args: [&quot;Hello, World.&quot;] </code></pre> <p>And below is the output of &quot;describe&quot; c...
<p>This looks like a liveness problem related to the CrashLoopBackOff have you cosidered taking a look into this blog it explains very well how to debug the problem <a href="https://managedkube.com/kubernetes/pod/failure/crashloopbackoff/k8sbot/troubleshooting/2019/02/12/pod-failure-crashloopbackoff.html" rel="nofollow...
<p>I am having a cluster on EKS with cluster autoscaler enabled. Lets assume there are 3 nodes node-1,node-2,node3. The nodes can have maximum of 10 pods each. Now when the 31st pod comes into picture the CA will launch a new node and schedule the pod on that. Now maybe lets say the 4 pods from node 2 are not required ...
<p><strong>How to manage pods scheduling?</strong></p> <p>Custom scheduler is, of course one way to go if you have some specific use case but if you just want to have some particular node that you want to schedule the pod into to Kubernetes provides an options to do so.</p> <p>Scheduling algorithm selection can be brok...
<p>I'm trying to access the Argo workflow archive via the REST API. The <a href="https://argoproj.github.io/argo-workflows/access-token/" rel="nofollow noreferrer">documentation</a> states that I need to create a role and a token, so I that's what I did. A role with minimal permissions can be created like so:</p> <pre>...
<p>Looks like the role/serviceaccount/rolebinding created according to the docs only grant permissions to list Workflows in the <code>argo</code> namespace (whether archived or not).</p> <p>The namespace can be specified for the Archive like so:</p> <pre class="lang-sh prettyprint-override"><code>curl http://localhost:...
<p>I assume there are no stupid questions, so here is one that I could not find a direct answer to.</p> <p><strong>The situation</strong></p> <p>I currently have a Kubernetes-cluster running 1.15.x on AKS, deployed and managed through Terraform. AKS recently Azure announced that they would retire the 1.15 version of Ku...
<p>I found this question today and thought I'd add my experience as well. I made the following changes:</p> <ol> <li>Changed the <code>kubernetes_version</code> under <code>azurerm_kubernetes_cluster</code> from &quot;1.16.15&quot; -&gt; &quot;1.17.16&quot;</li> <li>Changed the <code>orchestrator_version</code> under <...
<p>I am working on rails application and it uses Docker and Kubernetes.</p> <p>I do not know Docker and Kubernetes and I need to run the seed file on the production server but it's not working.</p> <p>Following is my Docker file</p> <pre><code>FROM ruby:2.6.5-alpine RUN apk update RUN apk add bash build-base libxml2-d...
<p>Well there are lot of things going on in your Dockerfile, first you are installing postgresql but you are not doing its initial configuration. Normal we use docker-compose file and use pre build postgresql for it with following docker image</p> <pre><code> db: image: postgres:11 ports: - &quot;5432:54...
<p>I was trying to use Kubernetes to set up a service locally. I am using ingress-nginx for routing. I am using Ubuntu 18.04. This is my ingress.yaml file:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress-service annotations: kubernetes.io/ingress.class: nginx nginx.ingre...
<p>I saw you mentioned you are using minikube with nginx ingress addon.</p> <p>This information helps a lot. Try not to skip this kind of information in future. I was assuming that by saying <em>&quot;I was trying to use Kubernetes to set up a service locally&quot;</em> you mean that you run baremetal k8s.</p> <p>Minik...
<p>I was wondering what added value gives the PodDisruptionBudget.</p> <p>As far as I understand, PodDisruptionBudget promises that a certain amount of nodes will always remain in the cluster while there are 2 options to decide how: minAvailable / maxUnavailable.</p> <p>Now, when I define ReplicaSet I define how many r...
<p><code>PodDisruptionBudget</code> helps in ensuring zero downtime for an application which <code>ReplicaSet</code> can't guarantee.</p> <p>The <a href="https://medium.com/@dwdraju/poddisruptionbudget-a-key-for-zero-downtime-c478d056e373" rel="noreferrer">following post</a> explains with an example how <code>PodDisrup...
<p>I'm trying to implement Azure Key Vault such that API keys, credentials and other Kubernetes secrets are read into production and staging environments. Ultimately, I'd like to try to expand that to local development environments so devs don't have to mess with it at all. It is just read in when they start their clus...
<blockquote> <p>Is it possible to change the Network Plugin on the existing cluster or do I need to start a new?</p> </blockquote> <p>It's impossible to change the network plugin on the existing cluster, so you need to create a new cluster and set the network plugin with azure at the creation time. You can find there i...
<p>I'm trying to understand, if it is possible ( and how ) to pin pods of statefulsets to specific availibility zones. In the example above I would like to explicitly configure, that elastic pod 1 runs in availibility zone 1, pod 2 in availibility zone 2 and so forth. I also don't want the pods to run outside of their ...
<p>You can use <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/" rel="nofollow noreferrer">Pod Topology Spread</a> constraints.</p> <blockquote> <p>topology spread constraints control how Pods are spread across your cluster among failure-domains such as regions, zones, nodes,...
<p>Experiencing an odd issue with KubernetesPodOperator on Airflow 1.1.14.</p> <p>Essentially for some jobs Airflow is losing contact with the pod it creates.</p> <p><code>[2021-02-10 07:30:13,657] {taskinstance.py:1150} ERROR - ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))</code></p...
<p>As I have mentioned in comments section I think you can try to set operators <code>get_logs</code> parameter to <code>False</code> - default value is <code>True</code> .</p> <p>Take a look: <a href="https://stackoverflow.com/questions/55176707/airflow-worker-connection-broken-incompleteread0-bytes-read">airflo...
<p>I'm getting the following error when trying to modify the instance types of the worker/master nodes of my k8s cluster.</p> <pre><code>error reading InstanceGroup &quot;nodes&quot;: InstanceGroup.kops.k8s.io &quot;nodes&quot; not found </code></pre> <p>I run the following:</p> <pre><code>kops edit ig nodes --name ${N...
<p>kOps did indeed change recently in that <em>new</em> clusters are provisioned with one instance group per availability zone (AZ) instead of having one node IG that spans all AZs.</p> <p>So in your case, you want to edit both <code>nodes-us-east-2a</code> and <code>nodes-us-east-2b</code>.</p> <p>As a bonus comment, ...
<p>Node.js has introduced the Cluster module to scale up applications for performance optimization. We have Kubernetes doing the same thing.</p> <p>I'm confused if both are serving the same purpose? My assumption is clustering can spawn up to max 8 processes (if there are 4 cpu cores with 2 threads each) and there is n...
<p>Kubernetes and the Node.js <a href="https://nodejs.org/api/cluster.html" rel="nofollow noreferrer">Cluster module</a> operate at different levels.</p> <p>Kubernetes is in charge of orchestrating containers (amongst <em>many</em> other things). From its perspective, there are resources to be allocated, and deployment...
<p>I have installed Istio on my GKE cluster using Istio CLI. I have read that Prometheus comes default with Istio.</p> <p>How do I confirm if Prometheus is correctly installed and how do I access it?</p>
<pre><code># kubectl get po -n istio-system NAME READY STATUS RESTARTS AGE istio-egressgateway-64d976b9b5-pmf8d 1/1 Running 0 18d istio-ingressgateway-68c86b9fc8-94ftm 1/1 Running 0 18d istiod-5c986fb85b-h6v4r 1/1 Running ...
<p>I'm looking at some older <code>deployment.yaml</code> files and I'm curious about the use of <code>environment:</code>.</p> <p>This is the context:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: client-deployment-dev # namespace: development # wouldn't this accomplish the same thing?...
<p><strong>TL; DR;</strong></p> <p>You are referring to two totally different Kubernetes objects which are <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer">Namespace</a> and <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels...
<p>I am trying to create a podAffinity for the replicas of my deployment to be deployed in different nodes within my GCP cluster, I have followed the documentation an this site <a href="https://thenewstack.io/implement-node-and-pod-affinity-anti-affinity-in-kubernetes-a-practical-example/" rel="nofollow noreferrer">htt...
<p>Whatever key-value you specify in <code>matchExpressions</code> also needs to be in <code>labels</code> and <code>matchLabels</code> of the pod <code>spec</code> instead of <code>metadata</code> section.It should be as below</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: mongodb-deployment n...
<p>I just started working with Kubeflow and I ran into a problem. I need my pipeline to be able to automatically get the name of the experiment it belongs to. I tried to use <a href="https://kubeflow-pipelines.readthedocs.io/en/latest/source/kfp.client.html#kfp.Client.get_experiment" rel="nofollow noreferrer">the kfp p...
<p>A run is tied to a experiment, not the other way around. When you run a pipeline you specify the experiement name with <code>kfp.Client.run_pipeline</code> as argument. When you do not specify an experiment then it will automatically be tied to the default experiment on AI platforms.</p> <p>So you won't need to get ...
<p>I'm migrating from Docker to Helm3. My Docker deployment uses .env files to load environment variables see <a href="https://docs.docker.com/compose/env-file/" rel="nofollow noreferrer">reference</a>. During the migration I need to support both the old way and new way so I don't want change the .env format if I can a...
<p>Here's what worked for me but I'm open to a better answer. The only things I don't understand is why I need the empty line {{&quot;&quot;}} - I thought new lines would have been inserted without that.</p> <p>The issue I had with the answer from @Matt was that the indentation came out wrong.</p> <pre><code>{{ $file :...
<p>we recently updated our AKS cluster from 1.17.x to 1.19.x and recognised that the format of our custom application logs in <code>/var/lib/docker/containers</code> changed.</p> <p>Before the update it looked like this: <a href="https://i.stack.imgur.com/0GJio.png" rel="nofollow noreferrer"><img src="https://i.stack.i...
<p>The format of the logs are defined by the container runtime. It seems before you were parsing logs from docker container runtime, and now it is containerd (<a href="https://azure.microsoft.com/en-us/updates/azure-kubernetes-service-aks-support-for-containerd-runtime-is-in-preview/" rel="noreferrer">https://azure.mic...
<p>I've been looking at different references on how to enable k3s (running on my pi) to pull docker images from a private registry on my home network (server laptop on my network). If someone can please point my head in the right direction? This is my approach:</p> <ol> <li>Created the docker registry on my server (and...
<p>... this is so stupid, have no idea why a domain name and port needs to be specified as the &quot;name&quot; of your referred registry, but anyway this solved my issue (for reference):</p> <pre><code>$cat /etc/rancher/k3s/registries.yaml mirrors: &quot;&lt;host IP&gt;:10000&quot;: endpoint: - &quot;http:...
<p>I am trying to setup a user that will have permissions to install using Helm 3 in to a specific namespace. (For my CI/CD system.)</p> <p>For example, if the user tries to run a <code>helm upgrade --install</code> with <code>--namespace=dev</code> then it works just fine. But if they try <code>--namespace=test</cod...
<p>In Kubernetes, best practice is to ensure that your application is operating in the scope that you have specified that is why you have to grant role to user or application-specific service account. Read more about service account permissions <a href="https://kubernetes.io/docs/admin/authorization/rbac/#service-acco...
<p>I'm working on integrating AKV and AKS, although I'm hitting a number of <a href="https://stackoverflow.com/questions/66191176/unable-to-get-azure-key-vault-integrated-with-azure-kubernetes-service">road blocks</a>.</p> <p>At any rate, what I want to ultimately do is automate pulling credentials and API keys from it...
<blockquote> <p>Will the secrets-store.csi.k8s.io in the following be available to use for local dev clusters (as taken from the AKV-AKS integration documentation)?</p> </blockquote> <p>No, it will not be available in local.</p> <p>The <code>secrets-store.csi.k8s.io</code> uses <a href="https://learn.microsoft.com/en-u...
<p>I'm fairly new to kubernetes and docker, so be patient with me.</p> <p>I am trying to mount a Windows share in linux which is contained in docker, which is a kubernetes pod.</p> <p>I managed to get all the correct permissions in kubernetes and docker to mount the share manually. However I need this to be done via th...
<p>I had the same issue. Mount worked on server itself, in running the images as docker container but not in running the images as kubernetes deployment. In my case it helped to add a security context to the deployment with privileges and some linux capabilities:</p> <pre><code>securityContext: capabilities: ...
<p>I have a k8s cluster with machines on two different zones. Originally, I have a StatefulSet with PersistentVolumeClaim, and the Pod &amp; PersistentVolume are on zone #1. Now I want the pod to run one zone #2, so I have to move the PersistentVolume to the zone #2 as well.</p> <p>How can I do so? I know in the differ...
<p>This is example on <code>GKE</code>, however other cloud providers should have similar options but with different zone names.</p> <p>You can do it by <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/regional-pd#dynamic-provisioning" rel="nofollow noreferrer">Regional Persistent Disk...
<p>Say I have this VPA config file:</p> <pre><code>apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: vpa-reco spec: targetRef: apiVersion: &quot;batch/v1beta1&quot; kind: CronJob name: test-autoscaling-1 updatePolicy: updateMode: &quot;Off&quot; </code></pre> <p>How can...
<p>Unfortunately you can't reference multiple objects in a single <code>VPA</code> object.</p> <p>If you tried like below (to have 2 <code>CronJobs</code> in a single <code>VPA</code>):</p> <pre><code>apiVersion: autoscaling.k8s.io/v1 kind: VerticalPodAutoscaler metadata: name: vpa-reco spec: targetRef: - apiVers...
<p>I am building a local testing environment using <code>Kubernetes Minikube</code> cluster. &quot;Some&quot; of the backend APIs and the database were deployed inside the cluster and each of these APIs has its dedicated URL created using <code>ingress</code>. In addition to that, I've deployed &quot;all&quot; the back...
<p>I think more versatile solution would be if you would have <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a> with two hosts solution. This way you wouldn't need any infrastructure changes (only a few adjustments in names).</p> <p>In this solution, you wo...
<p>I am trying to create an encrypted persistent volume claim with an EBS StorageClass with the below k8s yaml:</p> <pre><code> --- ######################################################### # Encrypted storage for Redis AWS EBS ######################################################### apiVersion: storage.k8s.io/v1 k...
<p>I found out the answer thanks to IronMan. I added the proper KMS permissions to the EKS cluster and the volume was created. Answer found here: <a href="https://github.com/kubernetes/kubernetes/issues/62171#issuecomment-380481349" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/62171#issueco...
<p>So there's this page about <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/audit-logging" rel="nofollow noreferrer">auditing-logs</a> and I'm very confused about:</p> <blockquote> <p>The k8s.io service is used for Kubernetes audit logs. These logs are generated by the Kubernetes API Server component ...
<p>If the cluster still exists, you should be able to do the following on GKE</p> <pre><code>kubectl proxy curl http://localhost:8001/logs/kube-apiserver.log </code></pre> <p>AFAIK, there's no way to get server logs for clusters that have been deleted.</p>
<p>I am new to microservices. I have few apps to deploy as microservices.</p> <p>I need a API and Load balancer. For API gateway I come to know about Ingress Nginx. But I am not sure hot setup load balancing. However I could configure it for API gateway as below.</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingr...
<p>Well, this is something like -</p> <p>You got a request from external world and that has been at first level intercepted at load balancer layer and API Gateway should be one of the Microservices where you will keep all of the URL mappings say - <code>/api/orders/{orderId}</code> brings this to your API Gateway and i...
<p>According to the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/" rel="noreferrer">referrence</a>, two of the options <code>kube-apiserver</code> takes are <code>--bind-address</code> and <code>--advertise-address</code> It appears to me that they conflict each other.</p> <...
<p>According to the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/" rel="nofollow noreferrer">reference-kube-apiserver</a> that you are referencing:</p> <blockquote> <p>--advertise-address ip The IP address on which to advertise the apiserver to members of the cluster. This ...
<p>I have two Microservices deployed on K8S cluster (Locally on 3 VMs - 1 Master and 2 Worker Nodes):<br> 1- currency-exchange Microservice<br> 2- currency-conversion Microservice<br></p> <p>I am trying to call <strong>currency-exchange</strong> Microservice from <strong>currency-conversion</strong> by using service na...
<p>It looks to me that you have incorrectly setup your CNI overlay network. I checked your previous question to verify node's ip address and to me it looks that your pod network overlap with your host network:</p> <p>The Kubernetes <code>pod-network-cidr</code> is the <code>IP prefix</code> for all pods in the Kubern...
<p>Unable to remove files older than one day from the mounted volume. My yaml:</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: cfs-cleanup spec: concurrencyPolicy: Forbid schedule: '0 4 * * *' successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 10 jobTemplate: spec: backof...
<p>I'm just guessing, but in your command</p> <pre><code>command: [&quot;find&quot;, &quot;/root/volumes/nginx-cache/cfs* -type f -mtime +1 -exec rm -f {} \;&quot;] </code></pre> <p>path <code>/root/volumes/nginx-cache/cfs*</code> won't get expanded.</p> <p>To verify it, just try <code>command: [&quot;ls&quot;, &quot;/...
<p>I am on Windows and used Docker Desktop to deploy a local Kubernetes cluster using WSL 2. I tried to deploy a pod and expose it through a NodePort service so I could access it outside the cluster, but it is not working.</p> <p>Here are the commands to reproduce the scenario:</p> <pre><code>kubectl create deployment ...
<p>If you want to access it not using localhost you should use your <code>&lt;windows_hosts's_IP:NodePort&gt;</code>.</p> <p>So having your deployment and service deployed:</p> <pre><code>$kubectl get svc,deploy NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/echoserver Node...
<p>i have an application that record live traffic and replay them.</p> <p><a href="https://github.com/buger/goreplay" rel="nofollow noreferrer">https://github.com/buger/goreplay</a></p> <p>it is a simple app to use, but when i tried to use it with kubernetes i get a problem with persisting data in volumes.</p> <p>i wan...
<p>I replicated it and it looks like the volumes are fine.</p> <p>What is not fine, is how you pass file paths to goreplay.</p> <p>Here is what I did:</p> <pre><code>kubectl exec -it goreplay-deployment-899c49f95-7qdh4 -c goreplay sh /home/goreplay # ps auxwf PID USER TIME COMMAND 1 root 0:00 ./gor --in...
<p>I have taken over a code base with a set of yaml files for provisioning kubernetes resources.</p> <p>In the files I keep finding ${VARIABLE}'s but I just cannot seem to figure out what these are a replacement for ? The only thing I can think of is Azure DevOps pipeline variables or as such. But the Microsoft documen...
<p>It's common practice to use these variables in kubernetes manifest yaml and substitute them in the CI pipeline with sed or envsubst or other text manipulator programs, this is probably what you see here. Check the CI config, pipelines and you will find these variable substitutions.</p> <p>Actually these are not even...
<p>As I understand that Kubernetes is a set of binaries that can form a new k8s cluster. There is an open-source <a href="https://github.com/kubernetes/kubernetes" rel="nofollow noreferrer">kubernetes</a> on git hub but there still some confusion:</p> <ol> <li>Who is the core team maintain (have write permission) to <a...
<blockquote> <p>Who is the core team maintain (have write permission) to kubernetes repo? &quot;The Linux Foundation&quot; or CNCF?</p> </blockquote> <p>Cloud Native Computing Foundation (CNCF) is one of the projects hosted by the Linux Foundation. Kubernetes is one of the project graduated from CNCF. Read more over <a...
<p><strong>General Cluster Information:</strong></p> <ul> <li>Kubernetes version: 1.19.13</li> <li>Cloud being used: private</li> <li>Installation method: kubeadm init</li> <li>Host OS: Ubuntu 20.04.1 LTS</li> <li>CNI and version: Weave Net: 2.7.0</li> <li>CRI and version: Docker: 19.3.13</li> </ul> <p>I am trying to g...
<p>This is because <code>Prometheus</code> is monitoring wrong endpoints of those targets and/or targets don't expose metrics endpoint.</p> <p>Take <code>controller-manager</code> for example:</p> <ol> <li>Change bind-address (default: 127.0.0.1):</li> </ol> <pre class="lang-sh prettyprint-override"><code>$ sudo vi /et...
<p>I have a command similar to this</p> <pre class="lang-sh prettyprint-override"><code>kubectl get secrets \ --selector='my-selector' \ -o jsonpath='{range .items[*] }{&quot;\n&quot;}{.metadata.labels.cluster-name}{&quot;.&quot;}{.metadata.namespace {&quot;:&quot;}{&quot;5432&quot;}{&quot;postgres&quot; }{&quot;:&quot...
<p>As per @mdaniel suggestion I used the <code>-o go-template</code></p> <p>My main syntaxal changes were removing the [ ], ie, <code>{range .items[*] }</code> to <code>{{range .items}}'</code></p> <p>And if a key contained a <code>-</code> then <code>{.metadata.labels.cluster-name}</code> became <code>{{index .metadat...