prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I enabled <code>ingress</code> on <code>minikube</code></p> <pre><code>C:\WINDOWS\system32&gt;minikube addons enable ingress - Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0 - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1 - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1 * Verify...
<p>I have recreated this situation and got the same situation. After execution the command:</p> <pre><code>minikube addons enable ingress </code></pre> <p>I have same output as yours:</p> <pre><code> - Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0 - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1...
<p>I want to forward the ports</p> <pre><code>kubectl port-forward ... </code></pre> <p>But for this I need to find out the name of pods, I run the command</p> <pre><code>kubectl -n main_sp get pods </code></pre> <p>Getting a list:</p> <pre><code>NAME READY STATUS RESTARTS AGE main-m...
<p>You need to mention the namespace too while using port-forward:</p> <pre class="lang-sh prettyprint-override"><code>$ kubectl port-forward -n main_sp main-ms-hc-78469b74c-7lfdh 8080:80 </code></pre> <p>To port-forward a pod:</p> <pre><code>$ kubectl port-forward -n &lt;namespace&gt; &lt;pod-name&gt; &lt;local-port&g...
<p>I have a Kubernetes <code>Job</code>, <code>job.yaml</code> :</p> <pre><code>--- apiVersion: v1 kind: Namespace metadata: name: my-namespace --- apiVersion: batch/v1 kind: Job metadata: name: my-job namespace: my-namespace spec: template: spec: containers: - name: my-container image: ...
<p>Some of the ways that you could do it outside of the solutions proposed in other answers are following:</p> <ul> <li>With a templating tool like <code>Helm</code> where you would template the exact specification of your workload and then iterate over it with different values (see the example)</li> <li>Use the Kubern...
<p>Whenever I set up a Rancher Kubernetes cluster with RKE, the cluster sets up perfectly. However, I'm getting the following warning message:</p> <pre><code>WARN[0011] [reconcile] host [host.example.com] is a control plane node without reachable Kubernetes API endpoint in the cluster WARN[0011] [reconcile] no control ...
<p>I don't believe you can suppress this warning since as you indicate in your comments, the warning is valid on the first <code>rke up</code> command. It is only a warning, and a valid one at that, even though your configuration appears to have a handle on that. If you are worried about the logs, you could perhaps h...
<p>According to Kubernetes documentation</p> <blockquote> <p>The metadata in an annotation can be small or large, structured or unstructured, and can include characters not permitted by labels.</p> <p>Annotations, like labels, are key/value maps</p> </blockquote> <p>Then there is <a href="https://kubernetes.io/docs/con...
<p><a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go#L47" rel="nofollow noreferrer">Here</a> you can find the code that validates annotations in current master:</p> <pre class="lang-golang prettyprint-override"><code>func ValidateAnnotations(a...
<p>I try to deploy 2 replicas on <strong>k3s</strong> - each one to a different node. According to documentation, it should be pretty easy. However, I must be doing some silly mistake I am not able to find. When I apply the deploy file, both of my pods are running the same node (<em>node1</em>). In case I switch that n...
<ul> <li><p>It is due to incorrect topologyKey , It should be 'kubernetes.io/hostname' not 'topology.kubernetes.io/hostname' .</p> </li> <li><p>So it would be as following :</p> </li> </ul> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: tbd-node-js-runner namespace: default spec: replicas: 2 se...
<p>I am implementing kubernetes network policy for my app on K3s. I want to allow <code>egress</code> (external call to internet from pod) for port <code>443</code> i.e. <code>https</code> calls <em><strong>only</strong></em> and deny/block all egress calls on <code>80</code> port i.e. <code>http</code>. In short, allo...
<ul> <li><p>networkPolicy you have mentioned in the post just allows https/traffic on 443 but you have not mentioned anything in it to deny http(port 80) traffic.</p> </li> <li><p>There are two ways to achieve it :</p> <ul> <li>Setup a default deny policy for egress</li> </ul> <p>either</p> <ul> <li>create another egre...
<p>Using Kubernetes, we could control how many pods (app instances) are created with a new deployment rollout simultaneously. It's achievable by using properties <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#max-surge" rel="nofollow noreferrer">max surge</a> and <a href="https://kuberne...
<p><code>maxUnavailable</code> and <code>maxSurge</code> is definitely the way to go. The steps you listed are on point, and it is how it's supposed to work.</p> <p>What you are experiencing is most probably a bug. There is one similiar issue on GitHub (<a href="https://github.com/kubernetes/kubernetes/issues/99513" re...
<p>I am trying to set up an envoy for k8s. But the envoy service does not start and I see the following error in the log:</p> <pre><code>&quot;The v2 xDS major version is deprecated and disabled by default. Support for v2 will be removed from Envoy at the start of Q1 2021. You may make use of v2 in Q4 2020 by following...
<p>This topic is covered by the <a href="https://www.envoyproxy.io/docs/envoy/latest/faq/api/envoy_v3#how-do-i-configure-envoy-to-use-the-v3-api" rel="nofollow noreferrer">official Envoy FAQ section</a>:</p> <blockquote> <p>All bootstrap files are expected to be v3.</p> <p>For dynamic configuration, we have introduced ...
<p>I've scanned through all resources, still cannot find a way to change <code>extraPortMappings</code> in Kind cluster without deleting and creating again.</p> <p>Is it possible and how?</p>
<p>It's not said explicitly in the official docs, but I found some references that confirm: your thoughts are correct and changing <code>extraPortMappings</code> (as well as other cluster settings) is only possible with recreation of the kind cluster.</p> <blockquote> <p>if you use extraPortMappings in your config, the...
<p>i have trouble in gitlab ci, when am executing <code>terraform apply</code> locally all is ok(kubectl is working correctly in gitlab ci container and locally), but in executing the same script in gitlab ci throws error that showed below</p> <p>terraform version locally <code>v0.12.24</code></p> <p>terraform versio...
<p>make sure that in the kubernetes provider configuration <code>load_config_file</code> is <code>false</code> if you dont use a local config file. this fix the error in my case.</p> <pre class="lang-yaml prettyprint-override"><code>load_config_file = false # when you wish not to load the local config file </code></pre...
<p>Goal is to terminate the pod after completion of Job. This is my yaml file. Currently, my pod status is <strong>completed</strong> after running the job.</p> <pre><code>apiVersion: batch/v1 kind: Job metadata: # Unique key of the Job instance name: example-job spec: template: metadata: name: example-...
<p>You can configure and remove the jobs once complete</p> <p>inside the YAML you can configure limit of keeping the PODs</p> <pre><code>successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 0 </code></pre> <p>you can set the <strong>history limits</strong> using above config in YAML.</p> <blockquote> <p>The .spec.succ...
<p>I am searching for a tutorial or a good reference to perform docker container live migration in Kubernetes between two hosts (embedded devices - arm64 architecture).</p> <p>As far as I searched on the internet resources, I could not find a complete documentation about it. I am a newbe and it will be really helpful i...
<p>Posting this as a community wiki, feel free to edit and expand.</p> <hr /> <p>As @David Maze said in terms of containers and pods, it's not really a live migration. Usually pods are managed by <code>deployments</code> which have <code>replicasets</code> which control pods state: they are created and in requested amo...
<p>I have a simple web app that uses <code>volume</code>/<code>persistent volume claim</code> to serve static data from there. Pods got scheduled only on the first worker node where volume resides. How to deal with the <code>shared</code> volume between nodes in case I want to scale pods and have them allocated across ...
<p>What you are looking for is a volume provider that supports the <code>ReadOnlyMany</code> or <code>ReadWriteMany</code> <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">Access Mode</a>.</p> <p>Follow the documentation link to get a list of the officiall...
<p>I have an EBS volume that I am using that is not encrypted and has a bunch on data on it. I want to take a snapshot of the data on that volume, create a new EBS volume from that snapshot but encrypt it, and then and use it in my EKS cluster. I know how to create a persistent volume, persistent volume claim and then ...
<p>I figured it out - (from <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html</a>)</p> <p>1 - Create a snapshot of the original unencrypted volume.</p> <p>2 - Create a copy of the snapshot you...
<p>I accidentally deleted the config file from ~/.kube/config. Every kubectl command fails due to config missing.</p> <p>Example:</p> <pre><code>kubectl get nodes </code></pre> <blockquote> <p>The connection to the server localhost:8080 was refused - did you specify the right host or port?</p> </blockquote> <p>I have a...
<p>The master copy is available at /etc/rancher/k3s/k3s.yaml. So, copy it back to ~/.kube/config</p> <pre><code>cp /etc/rancher/k3s/k3s.yaml ~/.kube/config </code></pre> <p>Reference: <a href="https://rancher.com/docs/k3s/latest/en/cluster-access/" rel="nofollow noreferrer">https://rancher.com/docs/k3s/latest/en/clust...
<p>im having the following code which works on yq 3 and when I try to upgrade to yq4 it fails</p> <p>this works on yq3 <code>yq w -i dep.yaml 'spec.spec.image' $(MY_VAL)</code></p> <p>on yq4 I got error that it doenst know <code>w</code>how can I make it works I didn't find any match example which can help to my case</...
<p>Take a look at the section 'Updating / writing documents' of the <a href="https://mikefarah.gitbook.io/yq/upgrading-from-v3" rel="nofollow noreferrer">migration guide</a>.</p> <p>The following command should work for your task with version 4 of <a href="https://mikefarah.gitbook.io/yq/" rel="nofollow noreferrer">yq<...
<p>I have a very simple docker-compose app with nginx and php-fpm services.</p> <p>I would like to create a Helm chart that would deploy this exact same thing as a unit (a POD I guess?) but I would like to be able to scale the php-fpm service.</p> <p>How can I achieve that?</p> <p>My idea is to have these containers in...
<blockquote> <p>The &quot;one-container-per-Pod&quot; model is the most common Kubernetes use case; in this case, you can think of a Pod as a wrapper around a single container; Kubernetes manages Pods rather than managing the containers directly.</p> </blockquote> <p>Nginx, Redis should run as separate services, so tha...
<p>I have a very simple docker-compose app with nginx and php-fpm services.</p> <p>I would like to create a Helm chart that would deploy this exact same thing as a unit (a POD I guess?) but I would like to be able to scale the php-fpm service.</p> <p>How can I achieve that?</p> <p>My idea is to have these containers in...
<p>It's best practice to keep the single container inside the pod however we can run the multiple containers also.</p> <p>Keep the <strong>Redis</strong> &amp; <strong>Nginx</strong> containers as separate deployment and you can add the HPA on that they can scale up and down based on load.</p> <p>By keeping the deploym...
<p>I have different sets of <code>environment</code> variables per deployment/microservice and <code>vaule</code> for each environment (dev/test/qa) are different.</p> <p>Do I need <code>overlay</code> file for each deployment/microservice against each environment (dev/test/qa) or I can managed with single overlay per ...
<p>You can keep everything inside the single YAML file and divide the YAML as per need.</p> <p>you can use the <code>---</code> to merge the YAML configuration files in one file like the below in the example.</p> <p>In a single YAML file, you can add everything Secret, deployment, service and etc as per requirement.</p...
<p>how to set image name/tag for container images specified in CRDs through the <code>kustomization.yaml</code> using the images field?</p> <p>The <a href="https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/images/" rel="nofollow noreferrer">images</a> field works well when the container images are s...
<p>Your task can be solved easily using <code>yq</code>. The command depends on the <code>yq</code> implementation you are using:</p> <h3><a href="https://mikefarah.gitbook.io/yq/" rel="nofollow noreferrer">mikefarah/yq - version 4</a></h3> <p><code>IMAGE=&quot;new-image:tag&quot; yq e '.spec.image = strenv(IMAGE)'</co...
<p>I have different sets of <code>environment</code> variables per deployment/microservice and <code>vaule</code> for each environment (dev/test/qa) are different.</p> <p>Do I need <code>overlay</code> file for each deployment/microservice against each environment (dev/test/qa) or I can managed with single overlay per ...
<p>You can use variable in the env value field as below.</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment metadata: name: example-1 spec: template: spec: containers: - name: example-1 image: example:1.0 env: - Name: &quot;A1&quot; ...
<p>Given below is my command to install bitnami keycloak on my kubernetes cluster</p> <pre><code>helm install kc --set auth.adminPassword=admin,auth.adminUser=admin,service.httpPort=8180 bitnami/keycloak -n my-namespace </code></pre> <p>I want to import realms(contains users,groups,clients and roles) into my keycloak b...
<p>In your Keycloak yaml file you need to add the field <code>extraEnvVars</code> and set the <code>KEYCLOAK_EXTRA_ARGS</code> environment variable as shown in the example below:</p> <pre><code>keycloak: enabled: true auth: adminUser: admin adminPassword: secret extraEnvVars: - name: KEYCLOAK_EXTRA_AR...
<p>I am trying to implement blue/green deployment for my application. I am using istio <code>VirtuaService</code> for navigating to blue environment or green environment based on clientId in request header. Backends are working fine.</p> <p>My concern is the frontend. How can I implement blue green for Angular ui at fr...
<p>It's hard for you to get an unambiguous answer about</p> <blockquote> <p>What should be the strategy for angular blue / green deployment?</p> </blockquote> <p>It may all depend on how you set up the cluster, what your application configuration looks like, what your network settings are, and much more. However, you c...
<p>I’m getting an error when using terraform to provision node group on AWS EKS. Error: error waiting for EKS Node Group (xxx) creation: <code>NodeCreationFailure: Unhealthy nodes in the kubernetes cluster.</code></p> <p>And I went to console and inspected the node. There is a message <code>“runtime network not ready: ...
<p>Add pod network add-on</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml </code></pre>
<p>I am using a baremetal cluster of 1 master and 2 nodes on premise in my home lab with istio, metallb and calico.</p> <p>I want to create a DNS server in kubernetes that translates IPs for the hosts on the LAN.</p> <p>Is it possible to use the coreDNS already installed in k8s?</p>
<p>Yes, it's possible but there are some points to consider when doing that. Most of them are described in the Stackoverflow answer below:</p> <ul> <li><em><a href="https://stackoverflow.com/questions/55834721/how-to-expose-kubernetes-dns-externally">Stackoverflow.com: Questions: How to expose Kubernetes DNS externally...
<p>I am trying to list the cpu and memory usage of all the nodes in kubernetes and echo &quot;load exceed&quot; if the memory or cpu limit exceed some digit. I am listing the cpu and memory this command but how to apply the logic to echo that <code>load exceeded</code></p> <p><code>kubectl describe nodes | grep -A 3 &q...
<p>Try this to extract the attributes you want by matching a regex pattern</p> <pre class="lang-sh prettyprint-override"><code>kubectl describe nodes | grep -E -A 3 &quot;Resource|Requests|Limits&quot; </code></pre> <p>You can extend it like this to extract <code>CPU</code> or <code>MEMORY</code> values</p> <pre><code>...
<p>I have the airflow deployed in Kubernetes and it is using the persistent volume method for dag deployment. I am trying to write a script (using GitHub action for CI/CD) for the deployment of my airflow dags which is somewhat like -</p> <blockquote> <pre><code>DAGS=(./*.py) for dag in ${DAGS[@]}; do kubectl cp &q...
<p>I don't think this was an option when you originally posted, but for others:</p> <p>Github Actions lets you create workflows that are manually triggered, and accept input values. <a href="https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/" rel="nofollow noreferrer">https:...
<p>My aim is to gracefully terminate my REST application Pods. I have 2 pods running and when 1 Pod is deleted, requests should be gracefully migrated to other pods. I am using Minikube (v1.20.0)for testing with Jmeter script running 100 API calls. I have also added a delay of 3 seconds inside my API.<br /> I tried to...
<p>this is working as expected! when you kill/delete a pod a SIGTERM signal is sent to the pod. kubernetes waits up to &quot;terminationgraceperiodseconds&quot; for the pod to shutdown normally after receiving the SIGTERM.</p> <p>after terminationgraceperiodseconds has passed and the pod has shutdown itself then kubern...
<p>I created simple kubernetes cluster with demo app. When creating the cluster I installed prometheus-stack and nginx-ingress-controller with helm (default values files).</p> <p>After the cluster is set up I create Ingress object to expose prometheus, grafana and alertmanager with:</p> <pre class="lang-yaml prettyprin...
<p>In the end I was able to find 2 solutions to this problem.</p> <p><strong>Option 1</strong></p> <p>I had DNS zone in azure (where my cluster lives as well) and there I added subdomains for grafana, prometheus and alertmanager pointing to the ingress-controller external IP.</p> <p>When deploying kube-prometheus-stack...
<p>I have deployed my application into a Kubernetes pod along with a fluent-bit sidecar container that collects logs from the sample application.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: nginx-flb-sidecar namespace: default labels: app.kubernetes.io/name: default helm.sh/chart:...
<p>To be clear, there's no way to get access to stdout/stderr directly in fluentbit running in kubernetes. You'll need your logs to be written to disk somewhere. In fact, even though it seems to be a bit wasteful, I find that writing to both stdout AND a location on disk is actually better because you get tighter contr...
<p>I want to run a pod that listens for updates to endpoint lists (I'm not yet ready to adopt the alpha-level feature of endpoint sets, but I'll expand to that eventually.)</p> <p>I have this code:</p> <pre><code>package main import ( &quot;fmt&quot; &quot;os&quot; &quot;os/signal&quot; &quot;sync&quot...
<p>You have created <code>role</code> and <code>rolebinding</code> for <code>eng</code> namespace. However, as per the error message:</p> <pre><code>kubeendpointwatcher.go:55: Failed to list *v1.Endpoints: endpoints is forbidden: User &quot;system:serviceaccount:eng:default&quot; cannot list resource &quot;endpoints&qu...
<p>What I am trying to do, is to deploy an API on Kubernetes and, using Google-managed SSL certificates, redirect it to point on my domain on HTTPS protocol.</p> <p>I have already spent some time on it and done a lot of debugging, but there is one thing that I can't succeed to fix.</p> <p>What is already done and works...
<p>Found it!!!</p> <p>In the <strong>service.yaml</strong> in the annotations had to add another config and attribute a name to my port. Here is a new config</p> <p><strong>service.yaml</strong></p> <pre><code>apiVersion: v1 kind: Service metadata: name: management-api-test-service annotations: cloud.google.com...
<p>I am preparing for the CKAD exam and I am doing practice with the questions provide <a href="https://github.com/dgkanatsios/CKAD-exercises/blob/master/c.pod_design.md" rel="nofollow noreferrer">here</a></p> <p>I have a doubt over this two different way of executing commands. Here the example provided is with a job b...
<p>Because in first example</p> <pre><code>kubectl create job pi --image=perl -- perl -Mbignum=bpi -wle 'print bpi(2000)' </code></pre> <p>you call a <code>perl</code> interpreter, <code>perl -Mbignum=bpi -wle 'print bpi(2000)'</code></p> <p>and in second example you call a bash shell command, <code>echo hello;sleep 3...
<p>I want to customize the certificate validity duration and renewal throughout the cluster. Iguess doing that with ClusterIssuer is feasible. Is there a way to do so ?</p>
<p>For that same you can configure it using the below two field</p> <pre><code>duration: 2160h # 90d renewBefore: 360h # 15d </code></pre> <p>Things to take care :</p> <p>The <code>renewBefore</code> and <code>duration</code> fields must be specified using Golang’s <code>time.Time</code> string format, which does not a...
<p>I am trying to deploy a rest api application in kubernetes with helm. Some of the configuration files have credentials in them and I would like to replace the variables inside the helm templates during the deployment with Kubernetes secrets.</p> <p>Does anyone have a pointer to a documentation where I can explore th...
<p>If you are looking forward to directly deploy the <code>ENV</code> to the deployment file you can also do it if you can few environment variables however best practices to create the <strong>secret</strong> and inject them all into the <strong>deployment</strong>.</p> <p>here sharing the direct example to inject the...
<p>I want to run a kuberenetes cronjob, but my command for the cronjob relies on environment variables to be defined or it will not work. When I set the env variables in the cronjob yaml it mentions that this is invalid YAML, with this message:</p> <blockquote> <p>error: error parsing mapping_rake.yaml: error convertin...
<p>Your CronJob YAML has some indentation issues. Here, is the correctly indented YAML:</p> <pre><code>apiVersion: batch/v1beta1 kind: CronJob metadata: name: bob-mapping-rake-cron spec: schedule: &quot;57 * * * *&quot; concurrencyPolicy: Replace jobTemplate: spec: template: spec: vo...
<p>I want to customize the certificate validity duration and renewal throughout the cluster. Iguess doing that with ClusterIssuer is feasible. Is there a way to do so ?</p>
<p>You can specify the duration of a self signed certificate by specifying the <code>duration</code> field in the <code>Certificate</code> CR:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: certmanager.k8s.io/v1alpha1 kind: Certificate metadata: name: example spec: duration: 24h ... </code></pr...
<p>I have a funny situation with my fluxcd workload on k8s. I am trying to configure fluxcd workload on my k8s (on eks) to deploy app from my repo. The log shows that it was able to access github and found new released k8s object files. but all subsequent access return this error:</p> <pre><code>ERROR: Repository not f...
<p>For FluxCD to be able to to access the private Github repositories, it needs to be able to authenticate to Github. You could create a dedicated Flux user, or use your own.</p> <p>This is done using a Kubernetes secret as such: <a href="https://fluxcd.io/docs/components/source/gitrepositories/#ssh-authentication" rel...
<p>I have a single page app. It is served by (and talks to) an API server running on a Kubernetes deployment with 2 replicas. I have added a <code>X-API-Version</code> header that my API sends on every request, and my client can compare with, to figure out if it needs to inform the user their client code is outdated.</...
<p>For blue-green deployment in Kubernetes, I will recommend to use some third party solution like <a href="https://argoproj.github.io/argo-rollouts/" rel="nofollow noreferrer">Argo Rollouts</a>, <a href="https://docs.nginx.com/nginx-service-mesh/tutorials/trafficsplit-deployments/" rel="nofollow noreferrer">NGINX</a>,...
<p>I know that with Azure AKS , master components are fully managed by the service. But I'm a little confused here when it comes to pick the node pools. I understand that there are two kind of pools system and user, where the user nodes pool offer hosting my application pods. I read on official documentation that <stro...
<p>System node pools in AKS does not contain Master nodes. Master nodes in AKS are 100% managed by Azure and are outside your VNet. A system node pool contains worker nodes on which AKS automatically assigns the label <code>kubernetes.azure.com/mode: system</code>, that's about it. AKS then use that label to deploy cri...
<p>Through Terraform, I am trying to create a VPC-Native GKE cluster in a single zone (europe-north1-b), with a separate node-pool, with the GKE cluster and node-pool in their own VPC Network.</p> <p>My code looks like the following:</p> <pre><code>resource &quot;google_container_cluster&quot; &quot;gke_cluster&quot; {...
<p>Turns out the issue seemed to be with having the large subnetwork secondary ranges.</p> <p>As shown in the question, I had ranges:</p> <ul> <li><code>10.0.0.0/10</code> for the <code>cluster_secondary_range</code>.</li> <li><code>10.64.0.0/10</code> for the <code>services_secondary_range</code>.</li> </ul> <p>These ...
<p>I'm using the following tech:</p> <ul> <li>helm</li> <li>argocd</li> <li>k8s</li> </ul> <p>I created a secret:</p> <pre><code>╰ kubectl create secret generic my-secret --from-file=my-secret=/Users/superduper/project/src/main/resources/config-file.json --dry-run=client -o yaml apiVersion: v1 data: my-secret: &lt...
<p>This is the way Kubernetes mounts Secrets and ConfigMaps by default in order to propagate changes downward to those volume mounts if an upstream change occurs. If you would rather not use a symlink and want to forfeit that ability, use the <code>subPath</code> directive and your mount will appear as you wish.</p> <p...
<p>I'm a bit confuse on how are handle TCP probe with Kubernetes the documentation says:</p> <blockquote> <p>A third type of liveness probe uses a TCP socket. With this configuration, the kubelet will attempt to open a socket to your container on the specified port. If it can establish a connection, the container is co...
<blockquote> <p>But has far as I known, socket client is connected before the server perform accept on the socket</p> </blockquote> <p>While it is true that the connection might be established in the OS before <code>accept</code> is called, it is only established after <code>listen</code> is called on the socket. If th...
<p>Installed PostgreSQL in AWS Eks through Helm <a href="https://bitnami.com/stack/postgresql-ha/helm" rel="nofollow noreferrer">https://bitnami.com/stack/postgresql-ha/helm</a></p> <p>I need to fulfill some tasks in deployments with root rights, but when</p> <pre><code>su - </code></pre> <p>requires a password that I ...
<blockquote> <p>I need [...] to place the .so libraries I need for postgresql in [...] <code>/opt/bitnami/postgresql/lib</code></p> </blockquote> <p>I'd consider this &quot;extending&quot; rather than &quot;configuring&quot; PostgreSQL; it's not a task you can do with a Helm chart alone. On a standalone server it's no...
<p>Is it possible for a pod/deployment/statefulset to be moved to another node or be recreated on another node automatically if the first node fails? The pod in question is set to 1 replica. So is it possible to configure some sort of failover for kubernetes pods? I've tried out pod affinity settings but nothing is mov...
<p>Answer from coderanger remains valid regarding Pods. Answering to your last edit:</p> <p>Your issue is with CSI.</p> <ul> <li><p>When your Pod uses a PersistentVolume whose accessModes is RWO.</p> </li> <li><p>And when the Node hosting your Pod gets unreachable, prompting Kubernetes scheduler to Terminate the curren...
<p>I have a simple task, but it is not solved even after studying dozens of articles.</p> <p>There is a simple AWS EKS cluster created from a demo template using eksctl, ElasticIP and installed without changes <a href="https://bitnami.com/stack/nginx-ingress-controller/helm" rel="nofollow noreferrer">https://bitnami.co...
<p>Yes that's common in AWS articles also NLD value coming like this way only</p> <p><a href="https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/</a></p> <p>In t...
<p>given a database that is part of a statefulset and behind a headless service, how can I use a local client (outside of the cluster) to access the database? Is it possible to create a separate service that targets a specific pod by its stable id?</p>
<p>There are multiple ways you can conect to this database service</p> <p>You can use</p> <p>Port-forward : <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-ac...
<p>I have a business case where I want to access a clustered Redis cache from one account (let's say account A) to an account B.</p> <p>I have used the solution mentioned in the below link and for the most part, it works <a href="https://medium.com/@programmerohit/accessing-aws-elasticache-redis-from-multiple-aws-accou...
<p>So turns out the issue was due to how <code>redis-py-cluster</code> manages host and port.</p> <p>When a new <code>redis-py-cluster</code> object is created it gets a list of host IPs from the Redis server(i.e. Redis cluster host IPs form account A), after which the client tries to connect to the new host and ports....
<p>In my k8s environment where spring-boot applications runs, I checked log location in <code>/var/log</code> and <code>/var/lib</code> but both empty. Then I found log location in <code>/tmp/spring.log</code> . It seems this the default log location. My problem are</p> <ol> <li>How <code>kubectl log</code> knows it sh...
<p>Docker logs only contain the logs that are dumped on STDOUT by your container's process with PID 1 (your container's <code>entrypoint</code> or <code>cmd</code> process).</p> <p>If you want to see the logs via <code>kubectl logs</code> or <code>docker logs</code>, you should redirect your application logs to STDOUT ...
<p>I've Docker Desktop Kubernetes cluster setup in my local machine and it is working fine. Now i'm trying to deploy .Net Core gRPC server and .Net core Console load generator to my cluster.</p> <p>I'm using VisualStudio(2019)'s default template for gRPC application</p> <p><strong>Server:</strong></p> <p>proto file</p>...
<p>You defined your service with the:</p> <pre><code>clusterIP: None </code></pre> <p>which is used to create an headless service. This may be the cause of the problem, so removing it could resolve your error.</p> <hr /> <p>When you create a <code>ClusterIP</code> type service (which is the default type) Kubernetes aut...
<p>I set up a local Kubernetes cluster using Kind, and then I run Apache-Airflow on it using Helm.</p> <p>To actually create the pods and run Airflow, I use the command:</p> <pre><code>helm upgrade -f k8s/values.yaml airflow bitnami/airflow </code></pre> <p>which uses the chart <code>airflow</code> from the <code>bitna...
<p>There is a <code>File</code> type for <code>hostPath</code> which should behave like you desire, as it states in the <a href="https://v1-17.docs.kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">docs</a>:</p> <blockquote> <p>File: A file must exist at the given path</p> </blockquote> <...
<p>Any idea how to go about this, can't find much clear info on google, to measure the Errors (40x, and 50x) on my service endpoints. My services are up and when I delete pods just for a test, I can see in the blackbox metrics that the prometheus gets and error, but not specified like 40x type or 50x.</p> <p>Edit 1:</p...
<p>Based on <a href="https://groups.google.com/g/prometheus-users/c/QUY9NsLPsZk" rel="nofollow noreferrer">this topic</a>:</p> <blockquote> <p>Services in Kubernetes are kind of like load-balancers - they just route requests to underlying pods. The pods themselves actually contain the application that does the work and...
<p>Is it possible to promote a Kubernetes worker node to master to quickly recover from the loss of a master (1 of 3) and restore safety to the cluster? Preferably without disrupting all the pods already running on it. Bare metal deployment. Tx.</p>
<p>It doesn't look like a worker node can be promoted to master in general. However it is easy to sort out for a specific case:</p> <ul> <li>Control plane node disappears from the network</li> <li>Node is manually deleted: <code>k delete node2.example.com --ignore-daemonsets --delete-local-data</code></li> <li>Some tim...
<p>I have a kubernetes pod running which has two containers, say A and B. They share common volume of type <code>emptyDir</code>. I have a usecase in which application running in container A takes files uploaded by client and places them at mount point. Then it signals to container B to process the file. Container B t...
<p>As you are using <code>emptyDir</code>, files must be deleted from one of the sidecars. Now, lets check what are your options here:</p> <ol> <li>Container A or B can delete the files after processing them.</li> <li>Container A or B delete the files once they reach a certain amount (say 1Gi).</li> <li>Add another con...
<p>I have a dedicated server build of a in-development realtime multiplayer game that I'd like to run on a Kubernetes cluster. The game uses WebRTC <code>RTCDataChannel</code>s for network communication as it targets browsers. When running the game server on a Kubernetes node players can connect directly to it if I con...
<p>Indeed, a TURN server can be deployed in the backend to allow exposing only a single UDP and/or TCP port to WebRTC clients. It's not the classic usage but it's something I've seen in production a couple times. Only the client requires the TURN server to be set up, the game server will communicate directly with the T...
<p>I have a pod <code>egress-operator-controller-manager</code> created from <a href="https://github.com/monzo/egress-operator/blob/master/Makefile" rel="nofollow noreferrer">makefile</a> by command <code>make deploy IMG=my_azure_repo/egress-operator:v0.1</code>. <a href="https://i.stack.imgur.com/eT2Sm.png" rel="nofol...
<p>Delete the deployment once and try applying the YAML agian.</p> <p>it could be due to K8s service won't allow the <strong>rolling update</strong> once deployed the <strong>label selectors</strong> of <strong>K8s service</strong> can not be updated until you decide to delete the existing <strong>deployment</strong></...
<p>I have created a Nginx Ingress and Service with the following code:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: myservice spec: type: ClusterIP selector: name: my-app ports: - port: 8000 targetPort: 8000 --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: myingr...
<p>One solution is to use <code>externalTrafficPolicy</code>: <code>Local</code> (see <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="noreferrer">documentation</a>).</p> <p>In fact, according to the <code>kubernetes documentation<...
<p>I deployed a PVC, which dynamically created a PV. After that I deleted the PVC and now my PV looks like below:</p> <pre><code>PS Kubernetes&gt; kubectl get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE pvc-1b59942c-eb2...
<p>When a PVC is deleted, the PV stays in the &quot;Released&quot; state with the claimRef uid of the deleted PVC.</p> <p>To reuse a PV, you need to delete the claimRef to make it go to the &quot;Available&quot; state</p> <p>You may either edit the PV and manually delete the claimRef section, or run the patch command...
<p>I am new to Kubernetes. I have a Kubernetes secret yaml file:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: my-secret type: Opaque data: API_KEY: 123409uhttt SECRET_KEY: yu676jfjehfuehfu02 </code></pre> <p>that I have encoded using gpg encryption:</p> <pre><code> gpg -a --symmetric --cipher-algo A...
<p>it appears as though the value of your secrets are not base64 encoded. either change the type of data to &quot;stringData&quot; which does not need to be base64 encoded or encode the value of your secrets first.</p> <p>e.g. <code>echo &quot;§SECRET_KEY&quot; | base64 </code> and use this value in your secrets. the p...
<p>I'm a novice k8s engineer. Until now, I have managed the k8s certificate by manually renewing it once a year.</p> <p>However, I became curious about how to set the certificates below for more than 1 year in the first place.</p> <pre><code>[root@master ~]# kubeadm alpha certs check-expiration CERTIFICATE ...
<p>It is not recommended to have the certificates for more than one year. Kubernetes provides hassle-free way to create and renew certs every one year. <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/" rel="nofollow noreferrer">Kubernetes Certificates</a> Since you need it for some sp...
<p>I have a statefulset and I need to know what is the current replica count from inside the pod. To do so, I tried:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: StatefulSet metadata: name: sample-mariadb namespace: demo spec: replicas: 3 template: spec: containers: ...
<p>You can only send the fields that are part of Pod specification. The <code>spec.replicas</code> field is part of StatefulSet specification not the underlying pod's. The <code>template</code> part of a StatefulSet is the pod specification. Hence, you are getting this error.</p>
<p>Is there any way to access Google cloud Kubernetes persistent volume data without using pod. I cannot start pod due to data corruption in persistent volume. Have any command line tool or any other way.</p>
<p>If you have any concerns running a pod with any specific application, in that case, you can run the <strong>Ubuntu</strong> POD and attach that pod to the <strong>PVC</strong> and access the data.</p> <p>There also another option to clone the PV and PVC, perform the testing, and newly created PV and PVC while the ol...
<p>Hiii!!!</p> <p>i have deployed to Kubernetes keyrock, apache and mysql..</p> <p>After i used the hpa and my stateful database scaled up, i can't login to my simple site.. This is my sql code:</p> <pre><code>apiVersion: apps/v1 kind: StatefulSet metadata: name: mysql spec: selector: matchLabels: app: my...
<p>You can't just scale up a Standalone database. Using HPA for stateless application works but not for stateful applications like a database.</p> <p>Increasing replica of your StaetefulSet will just create another pod with a new MySQL instance. This new replica isn't aware of the data in your old replica. Basically, ...
<p>From my understanding, we can use Ingress class annotation to use multiple Nginx ingress controllers within a cluster. But I have a use case where I need to use multiple ingress controllers within the same namespace to expose different services in the same namespace using the respective ingress rules created. I foll...
<p>It's not clear from your post if you intend to deploy multiple nginx-ingress controllers or different ingress controllers. However, both can be deployed in the same namespace.</p> <p>In the case of deploying different ingress controllers, it should be easy enough to deploy in the same namespace and use class annotat...
<p>I have deployed keycloak on kubernetes cluster and I want to access it with ingress path url, but I am getting 503 service unavilable when trying to access. But with cluster-ip I am able to access keycloak. With /auth I am able to access the main page of keycloak, i.e <a href="https://my-server.com/keycloak-developm...
<p>After finding a lot I found the solution, we need to add these env variables to our deployment.yaml file to work</p> <ol> <li>KEYCLOAK_USER</li> <li>KEYCLOAK_PASSWORD</li> <li>PROXY_ADDRESS_FORWARDING (value:&quot;true&quot;)</li> <li>KEYCLOAK_FRONTEND_URL (In my case it was something like this:- <a href="https://my...
<p>Is there a way to find the immutable fields in the workload's spec? I could see there are few fields mentioned as immutable in some of the workload resource documentation, But for example in <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a> is ...
<p>Welcome to the community.</p> <p>Unfortunately there's no such list with all <code>immutable fields</code> combined in one place.</p> <p>There are two options:</p> <ol> <li>As you started through reading documentation and see if this is specified explicitly.</li> <li>Start with <code>kubernetes API</code> descriptio...
<p>I'm aware of the concept &quot;provisioner&quot; but i do not understand what intree ebs driver means. Is ebs.csi.aws.com the csi driver maintained by the aws and the other maintained by k8s itself? Is one better than the other?</p>
<p>As per <a href="https://kubernetes.io/blog/2019/12/09/kubernetes-1-17-feature-csi-migration-beta/#why-are-we-migrating-in-tree-plugins-to-csi" rel="noreferrer">the official documentation</a>:</p> <blockquote> <p>Prior to CSI, Kubernetes provided a powerful volume plugin system. These volume plugins were “in-tree” me...
<p>I have some questions regarding my minikube cluster, specifically why there needs to be a tunnel, what the tunnel means actually, and where the port numbers come from.</p> <h2>Background</h2> <p>I'm obviously a total kubernetes beginner...and don't have a ton of networking experience.</p> <p>Ok. I have the following...
<p>Let me answer on all your questions.</p> <p>0 - There's no need to create pods separately (unless it's something to test), this should be done by creating deployments (or statefulsets, depends on the app and needs) which will create a <code>replicaset</code> which will be responsible for keeping right amount of pods...
<p>I've recently started a proof-of-concept to extend our Airflow to use the KubernetesPodOperator to spin up a pod in our kubernetes environment, that also hosts our airflow. This all works; however I've noticed that the logs that we get have the Info for running the task instance and the task instance success; howeve...
<p>I felt I had the same issue... but maybe not as you didn't mention if you were using a subdag (I'm using dag factories methodology). I was clicking on the dag task -&gt; view logs in the UI. Since I was using a subdag for the first time I didn't realize I needed to zoom into it to view the logs.</p> <p><img src="ht...
<p>I have a simple ASP.NET core Web API. It works locally. I deployed it in Azure AKS using the following yaml:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: name: sa-be spec: selector: matchLabels: name: sa-be template: metadata: labels: name: sa-be spec: nod...
<p>Yes, expected. <a href="https://nigelpoulton.com/explained-kubernetes-service-ports/" rel="nofollow noreferrer">Explained: Kubernetes Service Ports</a> - please read full article to understand what is going on in the background.</p> <p>Loadbalancer part:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: ...
<p>I am trying to use the kubectl run command to create a Pod that uses a custom serviceaccount "svcacct1" instead of default serviceaccout. There seems to be no switch for providing a specific serviceaccount within the run command so leveraging --overrides switch to provide JSON as shown below. </p> <pre><code>kubec...
<p>The <code>--serviceaccount</code> flag isn't present in current versions (1.21) and got deprecated as mentioned in the <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.21.md" rel="noreferrer">changelog</a>.</p> <p>But with a slight modification to the command mentioned in the quest...
<p>All,</p> <p>Is there a way to find the nodes associated with Persistent Volume Claim.</p> <p><strong>&gt; kubectl get pvc -n namespace</strong></p> <p>gives me the list of Persistent Volume Claims. But I need the node also to which each of the Claim is associated with.</p> <p>Even describing the PVC does not give me...
<ul> <li>whenever PVC is used by a POD , kubernetes creates a object called <code>volumeattachment</code> which contains the node information where the pvc is attached.</li> </ul> <pre><code> - kubectl get volumeattachements | grep &lt;pv name&gt; // to get the volumeattachment name - kubectl describe volumeattach...
<p>As the title says, im trying to mount a secret, as a volume, into a deployment.</p> <p>I found out i can do it in this way if <code>kind: Pod</code> but couldnt replicate it on <code> kind: Deployment</code></p> <pre><code>apiVersion: apps/v1 kind: Deployment volumeMounts: - name: certs-vol mountPath: &...
<p>As <a href="https://stackoverflow.com/users/10008173/david-maze">David Maze</a> mentioned in the comment:</p> <blockquote> <p>Does <code>secretName:</code> need to be indented one step further (a child of <code>secret:</code>)?</p> </blockquote> <p>Your yaml file should be as follow:</p> <pre class="lang-yaml pre...
<p>I have a running cluster with single master. A load balancer(kube.company.com) is configured to accept traffic at 443 and forwards it to the k8s master 6443.</p> <p>I tried to change my ~/.kube/config <code>server</code> field definition from $masterIP:6443 to kube.company.com:443.</p> <p>It throws the error x509: c...
<p>When using <code>kubeadm</code> to deploy a cluster, if you want to use a custom name to access the <code>Kubernetes API Server</code>, you need to specify the <code>--apiserver-cert-extra-sans</code> flag of <code>kubeadm init</code>.</p> <blockquote> <p>Optional extra Subject Alternative Names (SANs) to use for th...
<p>I am new to the kubernetes world and I am currently stuck with figuring out how to enable endpoints for <code>kube-controller-manager</code> &amp; <code>kube-scheduler</code>. In some future, I'll be using the helm <code>kube-prometheus-stack</code> to scrape those endpoints for metrics. However, for now what would ...
<ul> <li><p>No need to create endpoints for <code>kube-controller-manage</code> and <code>kube-scheduler</code> because they use <code>hostNetwork</code> and uses ports <code>10257</code> and <code>10259</code> respectively.</p> </li> <li><p>you can verify it checking the manifests &quot;/etc/kubernetes/manifests/&quot...
<p>I've been using <strong>Docker Desktop for Windows</strong> for a while and recently I updated to the latest version (<em>3.5.1</em>) but now I'm having problems with Kubernetes because it updated the <strong>client version</strong> (<em>1.21.2</em>) but the <strong>server version</strong> was not updated and contin...
<p>To try to solve this problem I decided to install Minikube, after that, all those problems were solved. Thanks everyone</p>
<p>I'm trying to deploy a MongoDB replica set by using the MongoDB Community Kubernetes Operator in Minikube.<br /> I followed the instructions on the official GitHub, so:</p> <ul> <li>Install the CRD</li> <li>Install the necessary roles and role-bindings</li> <li>Install the Operator Deploy the Replicaset</li> </ul> <...
<p>I think you could be interested into using local type of volumes. It works, like this:</p> <p><strong>First</strong>, you create a storage class for the local volumes. Something like the following:</p> <pre><code>apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: local-storage provisioner: kubernetes...
<p>I have an application that runs health checks on pods. Given the health check, I am attempting to patch a pod's label selector from being active: true to active: false. The following is the code for the iteration of pods to change each pod's labels.</p> <pre><code>CoreV1Api corev1Api = new CoreV1Api(); for (V1Pod po...
<p>After researching more of the current implementation, the client provides the <a href="https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/util/PatchUtils.java" rel="nofollow noreferrer">PatchUtils</a> api that allows me to build a type of patch.</p> <pre><code>CoreV1Api cor...
<p>There are many questions like this I can find in the internet but none of the solutions provided worked.</p> <p>I am using <code>jboss/keycloak:14.0.0</code> docker image. The following properties are set in my <code>ConfigMap</code>:</p> <pre><code>KEYCLOAK_FRONTEND_URL: /mycontext/access-management PROXY_ADDRESS_F...
<p>Okay I managed to get this working by gathering all the solutions that are mentioned out there.</p> <p>So basically, <code>web-context</code> needs to be set and that's something that is not mentioned anywhere in any documentation except word of mouth.</p> <p>To set that, you can write a <code>cli</code> script:</p>...
<p>I'm seeking the answer regarding how to use the Kubernetes Python API to get cluster information (<code>kubectl get clusters</code>).</p> <pre><code>~$ kubectl -n &lt;namespace&gt; get clusters NAME AGE cluster-1 6d17h cluster-2 6d17h </code></pre>
<p>This one maybe help you, <a href="https://github.com/kubernetes-client/python/blob/d8f283e7483848647804eab345645106b6fb357d/examples/remote_cluster.py#L24" rel="nofollow noreferrer">at</a></p> <pre><code>from pick import pick # install pick using `pip install pick` from kubernetes import client, config from kubern...
<p>I want to use <a href="https://github.com/baarde/cert-manager-webhook-ovh" rel="nofollow noreferrer">cert-manager OVH's webhook</a> in order to deliver a https wildcard certificate, but I still can't figure out why the cert-manager can't access to OVH credentials secret (required to create a DNS entry in OVH)</p> <p...
<p>The error message indicating to ServiceAccount <code>cert-manager-webhook-ovh</code> of <code>default</code> namespace. You have given permission to the the ServiceAccount of <code>cert-manager</code> namespace.</p> <pre><code>secrets &quot;ovh-credentials&quot; is forbidden: User &quot;system:serviceaccount:default...
<p>I am trying to limit the resource usage of each container in a pod dynamically. For docker, I used --cgroup-parent to put containers in a specific cgroup directory. However, in Kubernetes, I haven't found any option that I can do this.</p>
<p>You can use the <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver/#using-the-cgroupfs-driver" rel="nofollow noreferrer">cgroupfs</a> driver supported by Kubernetes.</p> <p>But perhaps you just want to <a href="https://kubernetes.io/docs/concepts/configuration/manage-resourc...
<pre><code> api.name: spark-history-server file.upload.path: x gcp.server.property.file.path: x git.files.update.path: x onprem.server.property.file.path: x preferred.id.deployment.file.path: x preferred.id.file.path: x server.error.whitelabel.enabled: &quot;false&quot; server.port: &quot;18080&quot; ...
<p>The problem was that I was trying to add these parameters in Configmap.yaml file instead of Deployment.yaml file. Just add these paramters in SPARK_HISTORY_OPTS.</p> <h1 id="example-ipk8">Example</h1> <ul> <li><p>name: SPARK_HISTORY_OPTS</p> <p>value: &quot;-Dspark.history.fs.logDirectory=/FS/YOU/CREATED/ABOVE -Dspa...
<p>I'm developing a Kubernetes controller. The desired state for this controller is captured in CRD-A and then it creates a deployment and statefulset to achieve the actual state. Currently I'm using server side apply to create/update these deployment and statefulsets.</p> <p>The controller establishes watch on both CR...
<p>Ideally, if the object you provide in the server side apply is not changed, the generation and the resourceVersion of the object should BOTH NOT be changed.</p> <p>But sometimes that's not the case, see this github issue:<a href="https://github.com/kubernetes/kubernetes/issues/95460" rel="nofollow noreferrer">https:...
<p>I'm currently working on an fully managed by Terraform environment but I reached some limitations and I would like to know if there is a feature or a workaround to do what I want :</p> <p>I have an environment described like that :</p> <ul> <li>A VPC with public and private subnets</li> <li>An EKS cluster with som...
<p>This allows you to create a plan that destroys all resources except the module &quot;module.exclude.me&quot;</p> <pre><code>terraform plan -destroy $(for r in `terraform state list | fgrep -v module.exclude.me` ; do printf &quot; -target ${r} &quot;; done) -out destroy.plan </code></pre> <p>Credits go to cmacrae fro...
<p>How can I trigger the update (redeploy) of the hearth through the k8s golang client.</p> <p>At the moment, I use these libraries to get information about pods and namespaces:</p> <pre><code>v1 &quot;k8s.io/api/core/v1 k8s.io/apimachinery/pkg/apis/meta/v1 k8s.io/client-go/kubernetes k8s.io/client-go/rest </code></pre...
<p>The standard way to trigger a rolling restart is set/update an annotation in the pod spec with the current timestamp. The change itself does nothing but that changes the pod template hash which triggers the Deployment controller to do its thang. You can use <code>client-go</code> to do this, though maybe work in a l...
<p>I have deploy <code>helm upgrade --install gitlab gitlab/gitlab --timeout 600s -f gitlab.yaml</code></p> <p>gitlab.yaml is here, ip is <code>minikube ip</code>.</p> <pre class="lang-yaml prettyprint-override"><code># values-minikube.yaml # This example intended as baseline to use Minikube for the deployment of GitLa...
<p>This issue is poorly documented via gitlab itself and the below 'answer' is for any googlers (hint, it's not really an answer):</p> <p>The gitlab minikube setup spins up it's own ingress controllers that are bypassed, which is where TLS would normally be terminated. The '422' error is legitimate because <code>localh...
<p>Two of my cluster nodes gets <code>Kubelet stopped posting node status</code> in <code>kubectl describe node</code> sometimes. In logs of that nodes i see this:</p> <pre><code>Dec 11 12:01:03 alma-kube1 kubelet[946]: E1211 06:01:03.166998 946 controller.go:115] failed to ensure node lease exists, will retry in ...
<p>TL;DR</p> <pre><code>ssh &lt;failing node&gt; sudo systemctl restart kubelet </code></pre> <p>I should have asked myself the magical words of &quot;Have you tried turning it on and off?&quot; I don't know what was causing my <code>kubelet</code> to fail, but I just <code>ssh</code> into the VM and restarted the <cod...
<p>I have already setup a service in a k3s cluster using:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: myservice namespace: mynamespace labels: app: myapp spec: type: LoadBalancer selector: app: myapp ports: - port: 9012 targetPort: 9011 protocol: TCP </code></pre> <blockq...
<h2 id="k3s-cluster-initial-configuration">K3S cluster initial configuration</h2> <p>To reproduce the environment I created a two node <code>k3s</code> cluster following next steps:</p> <ol> <li><p>Install k3s control-plane on required host:</p> <pre><code>curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='--write-kubeco...
<p>I'm testing kubernetes behavior when pod getting error.</p> <p>I now have a pod in CrashLoopBackOff status caused by liveness probe failed, from what I can see in kubernetes events, pod turns into CrashLoopBackOff after 3 times try and begin to back off restarting, but the related Liveness probe failed events won't ...
<p>I think you might be confusing Status Conditions and Events. Events don't &quot;update&quot;, they just exist. It's a stream of event data from the controllers for debugging or alerting on. The <code>Age</code> column is the relative timestamp to the most recent instance of that event type and you can see if does so...
<p>This is a pretty basic question so I figure I must be missing something obvious, Does openshift service uses round-robin to load balance between pods? Or does it forward requests to the pod with the greatest amount of available resources? Or is it totally random?</p> <p>My service configuration looks like that:</p> ...
<p>In Kubernetes (OpenShift is just a Kubernetes distribution), Services result in iptables rules. That means for a Service with more than one Pods, traffic is distributed / redirected via iptables to the different Pods selected by the Service.</p> <p>So for example if we have three Pods selected by a Service, we can s...
<p>Trying to figure out how to authenticate with the storage API from within a GKE cluster.</p> <p>Code:</p> <pre><code>Storage storage = StorageOptions.newBuilder() .setCredentials(ServiceAccountCredentials.getApplicationDefault()) .setProjectId(gcpProjectId) .build().getService(); </code></pre> <p><code>getAppl...
<p>The answer, in part, aside from the annotation syntax, is that, just like me, you probably didn't look closely enough at this part in the documentation:</p> <pre><code> gcloud iam service-accounts add-iam-policy-binding \ --role roles/iam.workloadIdentityUser \ --member &quot;serviceAccount:PROJECT_ID.svc.id....
<p>I am new to Kubernetes. Setting up nginx-ingress in a test cluster. One of our senior people rolled by and noticed the following.</p> <pre><code># kubectl get services ... ingress-ingress-nginx-controller-admission ClusterIP xx.xxx.xxx.xxx &lt;none&gt; 443/TCP ... </code></pre> <p>What's that, he as...
<p>It's the service for the validating webhook that ingress-nginx includes. If you remove it, you'll be unable to create or update Ingress objects unless you also remove the webhook configuration.</p> <p>tl;dr it's important, no touchy</p>
<p>I have a .NET 5.0 App that connects to a SQL Server database. If I host the App in Azure App service and the database in Azure SQL database, all is fine.</p> <p>Now I put the App in a Docker container and deploy it in AKS. It doesn't work anymore (can't connect to the Azure SQL database).</p> <p>How should I configu...
<p>Did you check about the ingress and firewall rules ?</p> <p><a href="https://learn.microsoft.com/en-us/azure/azure-sql/database/firewall-configure" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/azure-sql/database/firewall-configure</a></p> <p>Open the firewall or edit ingress rules so that AKS PO...
<p>Kustomize directory structure</p> <pre><code>├── base │   ├── deployment.yaml │   └── kustomization.yaml └── overlays └── prod ├── kustomization.yaml ├── namespace-a │   ├── deployment-a1 │   │   ├── kustomization.yaml │   │   └── patch.yaml │   ├── deployment-a2 ...
<p>In your particular case, in the most ideal scenario, all the required namespaces should already be created before running the <code>kustomize</code> command. However, I know that you would like to create namespaces dynamically as needed.</p> <p>Using a Bash script as some kind of wrapper can definitely help with thi...
<p>I am trying to follow this tutorial to learn to use <a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">kind</a>. The version I just installed using brew install is: kind version 0.11.1</p> <p>The config file looks like this:</p> <pre class="lang-yaml prettyprint-override"><code>kind: Cluster apiVersion: k...
<p>The version needs to be set to <code>apiVersion: kind.x-k8s.io/v1alpha4</code></p> <p>Notice the change from <code>kind.sigs.k8s.io</code> to <code>kind.x-k8s.io</code> in addition to changing to <code>v1alpha4</code>.</p>
<p>I'm trying to follow <a href="https://github.com/hetznercloud/hcloud-cloud-controller-manager/issues/74#issuecomment-678073133" rel="nofollow noreferrer">this suggestion</a> to use <a href="https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/master/docs/load_balancers.md" rel="nofollow noreferrer">H...
<p>I am not the Kubernetes master (more a noob) but I got it working with a L4-loadbalancer.</p> <p>An annotation has to be set to your Ingress:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx </code></pre> <p>And to use it without nginx-ingres...
<p>I have created a Kubernetes cluster on 2 Rasberry Pis (Model 3 and 3B+) to use as a Kubernetes playground.</p> <p>I have deployed a postgresql and an spring boot app (called meal-planer) to play around with. The meal-planer should read and write data from and to the postgresql.</p> <p>However, the app can't reach th...
<p>First of all, don't use Deployment workloads for applications that require saving the state. This could get you into some trouble and even data loss. For that purpose, you should use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">statefulset</a></p> <blockq...
<p>I am setting up HPA on custom metrics - basically on no. of threads of a deployment.</p> <p>I have created a PrometheusRule to get average of threads (5 min. based). On the container, I am doing cont. load to increase the threads and average value is also going high.</p> <p>I started with 2 replicas and when current...
<p>Finally after a week, found the root cause.</p> <p>So the issue was with the label. I had 2 deployments with same label. So what internal hpa is doing is it's getting stats for all the pods with that label and then doing scale up/down. As soon as I corrected the labels, hpa worked as expected.</p> <p>But the same on...