prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I have two mac mini computers and I'm trying to create a K8s cluster using k3d. I can create a cluster on a single host very easily. However, I'm having trouble finding any guidance on creating a cluster that has multiple hosts (machines). Any ideas?</p>
| <p>According to your question, you want to create k8s cluster with k3d on multiple hosts.</p>
<p>But, based on the information, described on <a href="https://github.com/rancher/k3d/issues/408#issuecomment-733883237" rel="nofollow noreferrer">k3d Issues page on GitHub</a> (issue still open), this solution:</p>
<blockquo... |
<p>Following the documentation I try to setup the Seldon-Core quick-start <a href="https://docs.seldon.io/projects/seldon-core/en/v1.11.1/workflow/github-readme.html" rel="nofollow noreferrer">https://docs.seldon.io/projects/seldon-core/en/v1.11.1/workflow/github-readme.html</a></p>
<p>I don't have LoadBalancer so I wo... | <p>If you install with istio enabled you also need to install the istio gateway.</p>
<p>I've tested your flow and it didn't work, and then did work after installing the following istio gateway.</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: seldon-gateway
namespace: istio-syst... |
<p>Is there a way to disable service links globally. There's a field in <code>podSpec</code>:</p>
<pre><code>enableServiceLinks: false
</code></pre>
<p>but it's <code>true</code> by default. I couldn't find anything in kubelet to kill it. Or is there some cool admission webhook toolchain I could use</p>
| <p>You can use the Kubernetes-native policy engine called <a href="https://kyverno.io/" rel="nofollow noreferrer">Kyverno</a>. Kyverno policies can validate, <strong>mutate</strong> (see: <a href="https://kyverno.io/docs/writing-policies/mutate/" rel="nofollow noreferrer">Mutate Resources</a>), and generate Kubernetes ... |
<p>I'm creating multiple pods at the same time in Openshift, and I also want to check the containers inside the pods are working correctly.
Some of these containers can take a while to start-up, and I don't want to wait for one pod to be fully running before starting up the other one.</p>
<p>Are there any Openshift / K... | <p>Please configure the <a href="https://cloud.redhat.com/blog/liveness-and-readiness-probes" rel="nofollow noreferrer">Liveness and Readiness Probes</a></p>
<blockquote>
<ul>
<li>Liveness : Under what circumstances is it appropriate to restart the pod?</li>
<li>Readiness : under what circumstances should we take the p... |
<p>There is a field in the CRD called 'storage'</p>
<pre><code>apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
spec:
...
versions:
- name: v1
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the ... | <p>A k8s resource (including custom resource) can have support for multiple API versions (say <code>v1beta1</code>, <code>v1</code>, etc.) at once. It's there for various reasons such as API stability and backward compatibility.</p>
<p>As you know, on the creation of a resource's object, the k8s store it on persistent ... |
<p>I'm creating multiple pods at the same time in Openshift, and I also want to check the containers inside the pods are working correctly.
Some of these containers can take a while to start-up, and I don't want to wait for one pod to be fully running before starting up the other one.</p>
<p>Are there any Openshift / K... | <p><code>...Some of these containers can take a while to start-up</code></p>
<p>Liveness probe is not a good option for containers that requires extended startup time, mainly because you have to set a long time to cater for startup; which is irrelevant after that - result to unable to detect problem on time during exec... |
<p>I am trying to create a deployment with Kubectl run. I want to specify replicas as part of the command.
I get</p>
<pre><code>Error: unknown flag: --replicas
</code></pre>
<p>Is this deprecated in the current version. If yes how do we achieve replicas.</p>
| <p>Using <code>kubectl run</code> for deployments has been deprecated for quite some time and removed in a recent kubernetes version.</p>
<p>If you want to create a deployment using the kubectl commandline, use</p>
<pre><code>kubectl create deployment $deploymentname --image $image --replicas $replicacount
</code></pre... |
<p>I have this in a <code>selenium-hub-service.yml</code> file:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: selenium-srv
spec:
selector:
app: selenium-hub
ports:
- port: 4444
nodePort: 30001
type: NodePort
sessionAffinity: None
</code></pre>
<p>When I do <code>kubectl describe servic... | <p>Posted community wiki based on <a href="https://github.com/kubernetes/minikube/issues/11193" rel="nofollow noreferrer">this Github topic</a>. Feel free to expand it.</p>
<p>The information below assumes that you are using <a href="https://minikube.sigs.k8s.io/docs/drivers/docker/" rel="nofollow noreferrer">the defau... |
<p>We are leveraging Kubernetes ingress with external service <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#external-authentication" rel="nofollow noreferrer">JWT authentication</a> using <code>auth-url</code> as a part of the ingress.</p>
<p>Now we want to use the <cod... | <p>Posting general answer as no further details and explanation provided.</p>
<p>It's true that there is not so much documentation around, so I decided to dig into <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">NGINX Ingress source code</a>.</p>
<p>The value set in annotation <code>ngin... |
<p>I have a pod running RabbitMQ. Below is the deployment manifest:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
name: service-rabbitmq
spec:
selector:
app: service-rabbitmq
ports:
- port: 5672
targetPort: 5672
---
apiVersion: apps/v1
kind: Deployment
... | <p>The pod gets oomkilled (last state, reason) and you need to assign more resources (memory) to the pod.</p>
|
<p>For <code>ReplicaSets</code> I see there is a way to use a Horizontal Pod Autoscaler (HPA) and set a max/min value for the number of replicas allowed. Is there a similar feature for <code>StatefulSets</code>? Since it also allows you to specify the number of replicas to deploy initially? For example, how would I tel... | <p>I have posted community wiki answer for better visibility.
<a href="https://stackoverflow.com/users/213269/jonas" title="102,968 reputation">Jonas</a> well mentioned in the comment:</p>
<blockquote>
<p>First sentence in the <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nof... |
<p>I want to read file paths from a persistent volume and store these file paths into a persistent queue of sorts. This would probably be done with an application contained within a pod. This persistent volume will be updated constantly with new files. This means that I will need to constantly update the queue with new... | <p>Have you ever heard about <a href="https://kubemq.io/" rel="nofollow noreferrer">KubeMQ</a>? There is <a href="https://github.com/kubemq-io/kubemq-community" rel="nofollow noreferrer">a KubeMQ community</a> where you can refer to with the guides and help.</p>
<p>As an alternative solution you can find useful <a href... |
<p>Something wrong happend with my RPi 4 cluster based on k3sup.</p>
<p>Everything works as expected until yesterday when I had to reinstall master node operating system. For example, I have a redis installed on master node and then some pods on worker nodes. My pods can not connect to redis via DNS: <code>redis-master... | <p>There was one more thing that was not mentioned. I'm using OpenVPN with NordVPN server list on master node, and use a privoxy for worker nodes.</p>
<p>When you install and run OpenVPN before running kubernetes master, OpenVPN add rules that block kubernetes networking. So, coredns does not work and you can't reach a... |
<p>I noticed that during the <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">ingress-nginx</a> pod creation/termination, there is a huge number of events created. Further "investigation" showed that each nginx pod creates</p>
<pre><code>42s Normal Sync ingress/na... | <p>This is expected behavior.</p>
<p>As we can see <a href="https://github.com/kubernetes/ingress-nginx/blob/6499393772ee786179b006b423e11950912e8295/internal/ingress/controller/store/store.go#L378" rel="nofollow noreferrer">here</a>, this is an informer, which creates the sync event for each valid ingress. In turn, th... |
<p>We want to use <a href="https://paketo.io" rel="nofollow noreferrer">Paketo.io</a> / <a href="https://buildpacks.io" rel="nofollow noreferrer">CloudNativeBuildpacks (CNB)</a> <a href="https://docs.gitlab.com/ee/ci/" rel="nofollow noreferrer">GitLab CI</a> in the most simple way. Our GitLab setup uses an AWS EKS clus... | <h2>TLDR;</h2>
<p>Use the Buildpack's lifecycle directly inside your <code>.gitlab-ci.yml</code> <a href="https://gitlab.com/jonashackt/microservice-api-spring-boot/-/blob/main/.gitlab-ci.yml" rel="noreferrer">here's a fully working example</a>):</p>
<pre><code>image: paketobuildpacks/builder
stages:
- build
# We s... |
<p>I want to read file paths from a persistent volume and store these file paths into a persistent queue of sorts. This would probably be done with an application contained within a pod. This persistent volume will be updated constantly with new files. This means that I will need to constantly update the queue with new... | <blockquote>
<p>What if this application that is adding items to the queue crashes?
Kubernetes would be able to reboot the application, but I do not want
to add in file paths that are already in the queue. The app would need
to know what exists in the queue before adding in files</p>
</blockquote>
<p>if you are looking... |
<p>We need to scale up pods in our AKS Cluster. </p>
<p>Somethimes we need to spin up so much, that multiple extra nodes are needed. </p>
<p>Our docker image is 20GB big to pull. <br>
(Yes I know its way to big, but it's impossible to reduce the size due being an older application.) </p>
<p>But I'm wondering if we spin... | <p>Images are cached on the node to speedup new created pods on the same node.</p>
<p>A very simple way to prevent that would be starting one pod per node at first and then scaling it up so the container runtime can reuse the previously pulled image.</p>
|
<p>I heard ElasticSearch is already changing its license to SSPL. Because of that, it will not be considered as an OSS (OpenSource Software) anymore.</p>
<p>Do you know of a better OSS as replacement for ElasticSearch?</p>
<p>Hope suggested OSS has an official image in dockerhub since I will be using it also in Kuberne... | <p>The <a href="https://opensearch.org/" rel="nofollow noreferrer">OpenSearch</a> alternative provided by AWS could be a correct possibility.
It's forked from Elasticsearch and provide the same <a href="https://aws.amazon.com/fr/blogs/aws/amazon-elasticsearch-service-is-now-amazon-opensearch-service-and-supports-opense... |
<p>I'm looking to create a small web application that lists some data about the ingresses in my cluster. The application will be hosted in the cluster itself, so I assume i'm going to need a service account attached to a backend application that calls the kubernetes api to get the data, then serves that up to the fron... | <p>You can use the JavaScript Kubernetes Client package for node directly in you node application to access kubeapi server over REST APIs</p>
<pre><code>npm install @kubernetes/client-node
</code></pre>
<p>You can use either way to provide authentication information to your kubernetes client</p>
<p>This is a code which... |
<p>I want to list a node's pods and pod statues, eg.</p>
<pre><code>Node A
Pod1 Status
Pod2 Status
Node B
Pod1 Status
Pod2 Status
</code></pre>
<p>Is there a <code>kubectl</code> command I can use for this?</p>
| <p>Try this:<br />
<code>kubectl get pods -A --field-selector spec.nodeName=<node name> | awk '{print $2" "$4}'</code></p>
|
<p>I have a Docker container with MariaDB running in Microk8s (running on a single Unix machine).</p>
<pre><code># Hello World Deployment YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb
spec:
selector:
matchLabels:
app: mariadb
template:
metadata:
labels:
app: mariadb... | <p>The answer has been written in comments section, but to clarify I am posting here solution as Community Wiki.</p>
<p>In this case problem with connection has been resolved by setting <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#selector" rel="nofollow noreferrer"><code>spec.selector... |
<p>Prometheus-operator seems to generate <code>promethues-operated</code> service which just points to Prometheus instance at port 9090.</p>
<p>What does this service do? We define other services to point at our Prometheus cluster.</p>
<p>What would be repercussions on removing <code>prometheus-operated</code> service?... | <p>Based on the documentation, <code>prometheus-operated</code> is a governing service for statefulsets, in other words it's Prometheus's service endpoint which is used for its functioning.</p>
<p>Below are some references:</p>
<blockquote>
<p>What you are referring to is the governing service that point to the
synthes... |
<p>I am having a k3s cluster with my application pods running. In all the pods when I login ( with <code>kubectl exec <pod_name> -n <ns> -it /bin/bash</code> command ) there is <strong><code>kubernetes.io</code></strong> directory which contain secret token that anyone can get if they do <code>cat token</c... | <p>To clarify a couple of things:</p>
<blockquote>
<p>This seems a security threat (or vulnerability).</p>
</blockquote>
<p>It actually isn't a vulnerability unless you configured it to be one.
The ServiceAccount you are talking about is the <code>deafult</code> one which exists in every namespace.
By default that Serv... |
<p>I am new to Terraform and learning.
I have to provide two roles in a resource block(builtin and custom), is this supported in terraform?</p>
<pre><code>variable "role_definition_id" {
type = list(string)
description = "Role definition id"
default = ["READER", "Custom_role&quo... | <p><code>role_definition_name</code> should be <strong>string</strong>,not a list. You can try the following:</p>
<pre><code>resource "azurerm_role_assignment" "example" {
for_each = {for idx, value in toset(local.principal_ids): idx=>value}
scope = data.azurerm_subscription.primary.id
role... |
<p>I have Docker Desktop (Windows) installed, and have turned on Kubernetes.</p>
<p>I've installed the Nginx ingress controller by running the following command:</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/cloud/deploy.yaml
</code><... | <p>I worked it out, after a hint from @clarj about checking the Nginx Controller pod logs.</p>
<p>Turned out I was missing the following annotation from my ingress...</p>
<pre><code> annotations:
kubernetes.io/ingress.class: "nginx"
</code></pre>
<p>(see my 'Update' in my initial post)</p>
<p>After that ... |
<p>Below is the current configuration for livenessProbe:</p>
<pre><code> livenessProbe:
httpGet:
path: /heartbeat
port: 8000
initialDelaySeconds: 2
timeoutSeconds: 2
periodSeconds: 8
failureThreshold: 2
</code></pre>
<hr />
<p>But response body for URL <code... | <p>You can interpret the body in your probe using shell command, example:</p>
<pre><code>livenessProbe:
exec:
command:
- sh
- -c
- curl -s localhost | grep 'status: "UP"'
</code></pre>
<p><code>grep</code> return non-zero if <code>status: "DOWN"</code> which will direct readinessPr... |
<p>I have implemented a gRPC service, build it into a container, and deployed it using k8s, in particular AWS EKS, as a DaemonSet.</p>
<p>The Pod starts and turns to be in Running status very soon, but it takes very long, typically 300s, for the actual service to be accessible.</p>
<p>In fact, when I run <code>kubectl ... | <p>When you use HTTP_PROXY for your solution, watchout how it may route differently from your underlying cluster network - which often result to unexpected timeout.</p>
|
<p>I have implemented a gRPC service, build it into a container, and deployed it using k8s, in particular AWS EKS, as a DaemonSet.</p>
<p>The Pod starts and turns to be in Running status very soon, but it takes very long, typically 300s, for the actual service to be accessible.</p>
<p>In fact, when I run <code>kubectl ... | <p>I have posted community wiki answer to summarize the topic:</p>
<p>As <a href="https://stackoverflow.com/users/14704799/gohmc">gohm'c</a> has mentioned in the comment:</p>
<blockquote>
<p>Do connections made by container "source" always have to go thru HTTP_PROXY, even if it is connecting services in the c... |
<p>I'm trying to pass my client IP address through my NGINX Ingress using Kubernetes on Azure</p>
<p>I've created this configmap for the NGINX config to add the headers:</p>
<pre><code>apiVersion: v1
data:
X-Real-IP: $remote_addr;
X-Forwarded-For: $proxy_add_x_forwarded_for;
X-Forwarded-Proto: $proxy_x_forwarded_... | <p>You are missing the namespace prefix for proxy-set-headers value. Because you have deployed <code>custom-headers</code> configmap to the default namespace, it should be</p>
<pre><code>data:
proxy-set-headers: default/custom-headers
</code></pre>
|
<p>I heard ElasticSearch is already changing its license to SSPL. Because of that, it will not be considered as an OSS (OpenSource Software) anymore.</p>
<p>Do you know of a better OSS as replacement for ElasticSearch?</p>
<p>Hope suggested OSS has an official image in dockerhub since I will be using it also in Kuberne... | <p>Elasticsearch was on SSPL, but we moved to a simpler license. check out <a href="https://www.elastic.co/blog/elastic-license-v2" rel="nofollow noreferrer">https://www.elastic.co/blog/elastic-license-v2</a> for details on that aspect</p>
|
<p>I'm using AWS EKS 1.21 with service account discovery enabled.<br />
Created an OIDC provider, the <code>.well-known/openid-configuration</code> endpoint returns a correct configuration:</p>
<pre><code>{
"issuer": "https://oidc.eks.eu-west-1.amazonaws.com/id/***",
"jwks_uri": "... | <p>Finally got an answer <a href="https://github.com/kubernetes/kubernetes/issues/105654#issuecomment-942777567" rel="noreferrer">elsewhere</a>.</p>
<blockquote>
<p>cluster operators can specify flag --service-account-extend-token-expiration=true to kube apiserver to allow tokens have longer expiration temporarily duri... |
<p>After creating a deployment with Kubernetes Python Client , and exposing the service with type ClusterIP, how can i get the Cluster-IP using the python client instead of using Kubectl command ?</p>
<p>Service was created based on the example code</p>
<pre><code>def create_service():
core_v1_api = client.CoreV1Api()
... | <p>Simply get the service and read its <code>spec.cluster_ip</code> property:</p>
<pre class="lang-py prettyprint-override"><code>from kubernetes import client, config
config.load_kube_config()
api = client.CoreV1Api()
service = api.read_namespaced_service(name="kubernetes", namespace="default")
pri... |
<p>I was under the impression in Kubernetes the way you expose a port for your application was by first exposing it in the Dockerfile using <code>EXPOSE</code>, then setting the <code>containerPort</code> setting in the deployment yaml file, and finally setting the <code>targetPort</code> in the service yaml file. I th... | <p>The port on which a process is listening is only known to the developer of the process as the port binding happens in code. <code>EXPOSE</code> and <code>containerPort</code> are ways to communicate this to outside world.</p>
<p><code>EXPOSE</code> directive in the Dockerfile doesn't do anything other than acting as... |
<p>I was following the <a href="https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/" rel="nofollow noreferrer">Run a Single-Instance Stateful Application</a> tutorial of Kubernetes (I changed the MySQL docker image's tag to 8), and it seems the server is running correctly:
<a href... | <p>Default behavior of <code>root</code> account can only be connected to from inside the container. Here's an updated version of the example that allows you to connect from remote:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
spec:
selector:
matchLabels:
app: mysql
strategy... |
<p>This is my DaemonSet</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx
spec:
selector:
matchLabels:
run: nginx
template:
metadata:
labels:
run: nginx
annotations:
"cluster-autoscaler.kubernetes.io/enabl... | <p>The <code>cluster-autoscaler.kubernetes.io/enable-ds-eviction</code> annotation does not apply once a node is actually empty. During the scale down process, while the autoscaler is evicting/rescheduling pods elsewhere, it will ignore daemonsets when <code>cluster-autoscaler.kubernetes.io/enable-ds-eviction</code> i... |
<p>I have a container image that is loading multiple large files on startup. When restarting the container, all files have to be loaded again.</p>
<p>What I want to do now is to start six instances which only load one file each, given an environment variable. Now my question is how to configure this. What I could do is... | <p>Ideally, you should have to keep it like <strong>deployment+service</strong> and make 5-6 different secret or configmap as per need storing the environment variables files your application require.</p>
<p>Inject this <code>secret</code> or <code>configmap</code> one by one to each different deployment.</p>
<blockquo... |
<p>I recently learned about <code>helm</code> and how easy it is to deploy the whole <code>prometheus</code> stack for monitoring a Kubernetes cluster, so I decided to try it out on a staging cluster at my work.</p>
<p>I started by creating a dedicates namespace on the cluster for monitoring with:</p>
<pre class="lang-... | <p>The Prometheus Operator includes several Custom Resource Definitions (CRDs) including <code>ServiceMonitor</code> (and <code>PodMonitor</code>). <code>ServiceMonitor</code>'s are used to define services to the Operator to be monitored.</p>
<p>I'm familiar with the Operator although not the Helm deployment but I susp... |
<p>Kubectl provides a nice way to convert environment variable files into secrets using:</p>
<pre><code>$ kubectl create secret generic my-env-list --from-env-file=envfile
</code></pre>
<p>Is there any way to achieve this in Helm? I tried the below snippet but the result was quite different:</p>
<pre><code>kind: Secret... | <p>It appears kubectl just does the simple thing and only <a href="https://github.com/kubernetes/kubernetes/blob/v1.22.0/staging/src/k8s.io/kubectl/pkg/cmd/util/env_file.go#L56" rel="nofollow noreferrer">splits on a single <code>=</code> character</a> so the Helm way would be to replicate that behavior (helm has <code>... |
<p>I have a pod that exposes an HTTP service.<br />
This pod has some HTTP endpoints which are available under <code>/accounts</code>.<br />
My goal is to access this sub-path via <code>accounts.example.com</code>.</p>
<p>For example if the url <code>accounts.example.com/test</code> is requested, the nginx ingress shou... | <p>You should use rewrite to accomplish your request.</p>
<p><a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/examples/rewrite/</a></p>
<ul>
<li>Here is an example:
<ul>
<li>Focus on this line: <code>path: /something(/|$)(.*)</co... |
<p>I am trying to mount dags folder to be able to run a python script inside of the KubernetesPodOperator on Aiflow, but can't figure out how to do it. In production I would like to do it in Google Composer. Here is my task:</p>
<pre><code>kubernetes_min_pod = KubernetesPodOperator(
task_id='pod-ex-minimum',
cm... | <p>As per this <a href="https://cloud.google.com/composer/docs/composer-2/cloud-storage" rel="nofollow noreferrer">doc</a>, when you create an environment, Cloud Composer creates a Cloud Storage bucket and associates the bucket with your environment. The name of the bucket is based on the environment region, name, and ... |
<p>Looking for the best way to integrate ACR with AKS for Producation environment, Seems there are multiple ways like, during installation, and after installation, using service principala,a nd using image pull secret etc..</p>
<p>So for our production environment looking for most recommended option, where the requirem... | <p>IMHO the best way is Azure RBAC. You dont need to attach the ACR while creating the AKS. You can leverage Azure RBAC and assign the Role "AcrPull" to the Kubelet identity of your nodepool. This can be done for every ACR you have:</p>
<pre><code>export KUBE_ID=$(az aks show -g <resource group> -n <... |
<p>I'm trying to forward port 8080 for my nginx ingress controller for Kubernetes. I'm running the command:</p>
<pre><code>kubectl -n nginx-ingress port-forward nginx-ingress-768dfsssd5bf-v23ja 8080:8080 --request-timeout 0
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
</code></pre>
<p... | <p>Well, it's expected behaviour - <code>kubectl port-forward</code> is not getting <a href="https://stackoverflow.com/questions/48863164/kubernetes-prompt-freezes-at-port-forward-command/48866118#48866118">daemonized by default</a>. From the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-fo... |
<p>I'm trying to add a self-signed certificate in my AKS cluster using Cert-Manager.</p>
<p>I created a <code>ClusterIssuer</code> for the CA certificate (to sign the certificate) and a second <code>ClusterIssuer</code> for the Certificate (self-signed) I want to use.</p>
<p>I am not sure if the <code>certificate2</cod... | <h2>ApiVersions</h2>
<p>First I noticed you're using <code>v1alpha2</code> apiVersion which is depricated and will be removed in <code>1.6</code> cert-manager:</p>
<pre><code>$ kubectl apply -f cluster-alpha.yaml
Warning: cert-manager.io/v1alpha2 ClusterIssuer is deprecated in v1.4+, unavailable in v1.6+; use cert-mana... |
<p>I tried to deploy prometheus with using <code>https://prometheus-community.github.io/helm-charts</code>
But I wanted to have a custom <code>prometheus.yml</code> Therefore the approach I used is the build the prometheus docker image by copying the customised prometheus.yml file. (via a simple pipeline)</p>
<p>Docker... | <p>The challenege was to manage the prometheus.yml as a seperate file. I have found <code>extraConfigmapMounts</code> option in the community Prometheus stack.</p>
<p>Therefore creating a configMap using the <code>prometheus.yml</code> and mount it to the application seems like a good way of achieving it.
Simply use of... |
<p>I have created a Kubernetes cluster in the <a href="https://upcloud.com/community/tutorials/deploy-kubernetes-using-kubespray/" rel="nofollow noreferrer">cloud- using this tutorial</a> and deployed [to the cluster] a backend application called <code>chatapp</code> from the Docker private registry. Since there is no ... | <p>Your request has reached the k8s api-server at 6443 instead of your chatapp. To access your chatapp; first retrieve the nodePort number: <code>kubectl describe service chatapp | grep -i nodeport</code>, then use this # to access your app at <code>http://a.b.c.d:<nodePort></code></p>
|
<p>I have used this document for creating kafka <a href="https://kow3ns.github.io/kubernetes-kafka/manifests/" rel="nofollow noreferrer">https://kow3ns.github.io/kubernetes-kafka/manifests/</a></p>
<p>able to create zookeeper, facing issue with the creation of kafka.getting error to connect with the zookeeper.</p>
<p>t... | <p>Your Kafka and Zookeeper deployments are running in the <code>kaf</code> namespace according to your screenshots, presumably you have set this up manually and applied the configurations while in that namespace? Neither the Kafka or Zookeeper YAML files explicitly state a namespace in metadata, so will be deployed to... |
<p>I have an application running in multithreading and requires many cores on a SINGLE instance.
Just wondering how to merge multiple pod (ie containers) into a single big node, so the application can run on this big node.
For example: 64 pods into a single one (ie 64 cores).</p>
<p>This is not for production or HA ser... | <p>First of all, running multiple pods on a single node couldn't be called "merging", assigning or scheduling are better verbs I guess.</p>
<p>you just need to label your node, then schedule your pods to be spawned on nodes with that label:</p>
<ol>
<li><p>Run: <code>kubectl get nodes</code> , note the node n... |
<p>Note: I am not running locally on Minikube or something, but GKE - but could be any provider.</p>
<p>I want to be able to create users/contexts in K8s with openssl:</p>
<pre><code>openssl x509 -req -in juan.csr -CA CA_LOCATION/ca.crt -CAKey CA_LOCATION/ca.key -CAcreateserial -out juan.crt -days 500
</code></pre>
... | <p>You don't. Google do not expose the keys as per the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-trust#root_of_trust" rel="nofollow noreferrer">documentation</a>.</p>
<p>Specifically and I quote:</p>
<blockquote>
<p>An internal Google service manages root keys for this CA, which are non... |
<p>I use Autopilot on GKE. I've created some log based metrics that I'd like to use to scale up pods.</p>
<p>To begin with - I'm not sure if it's great idea - the metric is just number of records in DB to process... I have a feeling using logs to scale app might bring in some weird infinite loop or something....</p>
<p... | <p>GKE Autopilot clusters have <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity" rel="nofollow noreferrer">Workload Identity</a> enabled for consuming other GCP services, including Cloud Monitoring.</p>
<p>You'll want to follow the steps <a href="https://cloud.google.com/kubernetes-engi... |
<p>We've been using <code>/stats/summary</code> to get <code>fs</code> metrics, which is like:</p>
<pre><code>"fs": {
"time": "2021-10-14T03:46:05Z",
"availableBytes": 17989276262,
"capacityBytes": 29845807308,
"usedBytes": 5856531046,
"inodesFree&qu... | <p>Posted community wiki based on Github topic. Feel free to expand it.</p>
<hr />
<p>Personally, I have not found any equivalent of this call (<code>/api/v1/nodes/<node name>/proxy/stats/summary</code>), and as it is still working and not deprecated in the Kubernetes newest versions ( <code>1.21</code> and <code... |
<p>I wish to create Persistent Volumes across multiple zones.</p>
<p>There are two lists inside the data object, one for az's and the other for vol id's.</p>
<p>The structure is:</p>
<pre><code>persistentVolume:
az:
- eu-west-2a
- eu-west-2b
- eu-west-2c
storageClassName: postgres
storage: 10Gi
accessMode... | <p>It is not possible to do what you want with the current structure you have, but if you are willing to change your <code>values.yaml</code> a bit:</p>
<pre><code>persistentVolume:
az:
- region: eu-west-2a
volumeID: vol-123
- region: eu-west-2b
volumeID: vol-456
- region: eu-west-2c
vol... |
<p>The .spec.selector field defines how the Deployment finds which Pods to manage. But we also defines labels inside template then what is the extra things we are getting with .spec.selectors field because Deployment can find the Pods to be managed with the label defined in template also ?</p>
<p>In the below code how... | <p><code>spec.seletor</code> field is used by Deployment/Replicaset controllers. It must be a <strong>subset</strong> of the labels specified in the <code>podTemplate</code>. That is why you may have additional labels in your pods. But they will still be managed by the deployment.</p>
<p><code>spec.selector</code> is a... |
<p>My remotely working setup is as follows:</p>
<p><code>PersistentVolume</code> is mounted to a <code>gcePersistentDisk</code>. Pod "Lagg" makes a claim on the entirety of the persistent disk. "Lagg" is a google containers <a href="http://gcr.io/google-containers/volume-nfs" rel="nofollow noreferre... | <p>DNS resolution problems with <code>google_containers/volume-nfs</code>, on non-GKE clusters, is a known issue:</p>
<ul>
<li><a href="https://github.com/kubernetes/examples/issues/390" rel="nofollow noreferrer">NFS example with a cluster local service name only works on GKE but not for minikube/kubeadm #390</a></li>
... |
<p>I am testing a log previous command and for that I need a pod to restart.</p>
<p>I can get my pods using a command like</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get pods -n $ns -l $label
</code></pre>
<p>Which shows that my pods did not restart so far. I want to test the command:</p>
<pre class="l... | <p>There are different ways to achieve your goal. I'll describe below most useful options.</p>
<h2>Crictl</h2>
<p>Most correct and efficient way - restart the pod on container runtime level.</p>
<p>I tested this on Google Cloud Platform - GKE and minikube with <code>docker</code> driver.</p>
<p>You need to <code>ssh</c... |
<p>I created a mutating admission webhook in my Kubernetes cluster.
The api mutation webhook adds tolerations to a Deployment YAML.
However, it says an error <code>Internal error occurred: jsonpatch add operation does not apply: doc is missing path: "/spec/template/spec/tolerations/"</code></p>
<p>My Yaml Sample file:... | <p>I don't see the whole file, therefore I cannot correct it.
But the problem is with your path, you are probably linking an array -- you have to specify an index. When you want to add an element to the end of an array, use <code>-1</code> like this: <code>spec/template/spec/containers/0/env/-1</code></p>
<hr />
<p>Hav... |
<p>We have been using Terraform for almost a year now to manage all kinds of resources on AWS from bastion hosts to VPCs, RDS and also EKS.</p>
<p>We are sometimes really baffled by the EKS module. It could however be due to lack of understanding (and documentation), so here it goes:</p>
<p><strong>Problem:</strong> Up... | <p>To my knowledge, there is currently no way to resize an EKS node volume without recreating the node using Terraform.</p>
<p>Fortunately, there is a workaround: As you also found out, you can directly change the node size via the AWS UI or API. To update your state file afterward, you can run <code>terraform apply -r... |
<p>I am new in Kubernetes and stuck on the issue. I was trying to renew letsencrypt SSL certificate. But when I try to get certificate by running following command</p>
<pre><code>kubectl get certificate
</code></pre>
<p>System throwing this exception</p>
<pre><code>Error from server: conversion webhook for cert-manager... | <p>The problem was with "<strong>cert-manager-cainjector</strong>" pod status which was "<strong>CrashLoopBackOff</strong>" due to FailedMount as <strong>secret</strong> was not found for mounting. I have created that secret and after that it start working fine.</p>
|
<p>A node have a plenty of info for metrics collection, under cgroups kubepods.slice for example. but to complete the metric you have to relate a pod metric to a pod name. a name and namespace itself are kind of static metric of a pod, so they are first things alongside with pod uuid that it should have to describe a p... | <p>You may use <code>docker</code> inspect:</p>
<pre><code>docker inspect <container-id> --format='{{index .Config.Labels "io.kubernetes.pod.name"}
docker inspect <container-id> --format='{{index .Config.Labels "io.kubernetes.pod.namespace"}}'
</code></pre>
<p>Following command will lis... |
<p>I have a Deployment with x amount of gameservers (pods) running. I'm using Agones to make sure gameservers with players connected to them won't get stopped by downscaling. In addition, I use a Service ("connected" to all of the gameserves) which acts as a LoadBalancer for the pods and as I understand it, i... | <p>Instead of using a LoadBalancer to spread players across your game instances, I'd recommend using the Agones <a href="https://agones.dev/site/docs/reference/gameserverallocation/" rel="nofollow noreferrer">GameServerAllocation</a> API to let Agones find an available game server for you.</p>
<p>If you allow multiple ... |
<p>I have two cluster in GCP.</p>
<ol>
<li>GKE cluster which has only postgres installed using Kubernetes.</li>
<li>A dataproc cluster.</li>
</ol>
<p>Now if i make the service of postgres as Internally load balanced to provide security i can access it using my VPN configurations .</p>
<p>But the problem got while acces... | <p>If you are using the <strong>LoadBancer</strong> to expose the service directly and not using the Ingress you can use the <strong>IP whitelisting</strong> option to Whitelist your <strong>Data Cluster</strong> IPs.</p>
<p>Example</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: postgres
spec:
ports:
... |
<p>I have a set of Kubernetes pods (Kafka). They have been created by Terraform but somehow, they "fell" out of the state (Terraform does not recognize them) and are wrong configured (I don't need them anyways anymore).</p>
<p><a href="https://i.stack.imgur.com/zyuNP.png" rel="nofollow noreferrer"><img src="h... | <p>Ok, I was able to find the root cause.</p>
<p>With:</p>
<pre><code>kubectl get all --all-namespaces
</code></pre>
<p>I looked up everything that is related to the name of the pods. In this cause, I found services that were related. After I deleted those services, the pods did not get recreated again.</p>
<p>I still ... |
<ul>
<li><p>Can Kubernetes pods share significant amount of memory?</p>
</li>
<li><p>Does copy-on-write style forking exist for pods?</p>
</li>
</ul>
<p>The purpose is to make pods spawn faster and use less memory.</p>
<p>Our scenario is that we have a dedicated game server to host in kubernetes. The problem is that on... | <p>One of Kubernetes' assumptions is that <em>pods</em> are scheduled on different Nodes, which contradicts the idea of sharing common resources (does not apply for storage where <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="nofollow noreferrer">there are many options and documentation available</... |
<p>I would like to deploy an application and the pod should not go to running status(it should be non-operational). User might trigger this when it really requires using Infrastructure as Code (Terraform). I am aware of using <code>kubectl scale -- replicas=0 </code>. Any other leads or info will be well appreciated.</... | <p>You can keep the replica count to <strong>zero</strong> for the <strong>Deployment</strong> or <strong>POD</strong> into your <strong>YAML</strong> file if you are using it.</p>
<p>Or if you are using the <strong>Terraform</strong></p>
<pre><code>resource "kubernetes_deployment" "example" {
met... |
<p>I have a set of Kubernetes pods (Kafka). They have been created by Terraform but somehow, they "fell" out of the state (Terraform does not recognize them) and are wrong configured (I don't need them anyways anymore).</p>
<p><a href="https://i.stack.imgur.com/zyuNP.png" rel="nofollow noreferrer"><img src="h... | <p>It's really like a <code>statefulset</code>, who control the <code>pods</code></p>
<blockquote>
<p>the Pods in a StatefulSet have a sticky, unique identity. This identity is based on a unique ordinal index that is assigned to each Pod by the StatefulSet controller.
The Pods' names take the form "<statefulset... |
<p>I'm trying to figure out how to use nginx proxy cache with some specific rules. For exemple, when i'm hosting Ghost or Wordpress, I don't want to cache admin section. Using server snippet, I've tried a lot of different combinaison but still have issues with cache in admin section.</p>
<pre><code>nginx.ingress.kuber... | <p>I had exact same desire: cache Ghost responses with respect to their <code>Cache-Control</code> headers directly on Nginx Ingress in the Kubernetes cluster.</p>
<p>After some hours spent on it here is my solution:</p>
<h1>First step</h1>
<p>First of all, you need to define <code>proxy_cache_path</code> on Nginx Ingr... |
<p>Although in an ideal world of Kubernetes you don't need to care about dependencies, the reality is different; we do have applications (consumer services) that rely on backing services (e.g. databases) to be available at startup.</p>
<p>To achieve this deployment order for services we have a few options available wit... | <p>You are right,</p>
<p>i think the reality is that without automation, it is impossible to manage the large scalable system of Consumers and Producers.</p>
<p>Operators are widely used for handling database backups & and other automation tasks.</p>
<p>If you see with some scenarios like vault : <a href="https://w... |
<p>I am new to K8s, and I am facing issues trying to connect to K8s NodePort service from outside the cluster.</p>
<p>I am unable to load the nginx default page when I try accessing it from my local machine using the URL: http://localhost:31008</p>
<p>I understand this is a common problem and I referred the below solut... | <p>There is an issue in the target port config as <strong>Nginx</strong> run on default port <strong>80</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: NodePort
selector:
app: front-end
name: nginx
ports:
- port: 8080
targetPort: 80
nodePort: 3100... |
<p>For some application,start or restart need more resources than running。for exapmle:es/flink。if a node have network jitter,all pods would restart at the same time in this node。When this happens,cpu usage becomes very high in this node。it would increase resource competition in this node。</p>
<p>now i want to start pod... | <p>Kubernetes have auto-healing</p>
<p>You can let the POD crash and Kubernetes will auto re-start them soon as get the sufficient memory or resource requirement</p>
<p>Or else if you want to put the wait somehow so that deployment wait and gradually start one by one</p>
<p>you can use the sidecar and use the POD lifec... |
<p>I have created a server named <a href="https://github.com/CyBear-Jinni/cbj_remote-pipes" rel="nofollow noreferrer">Remote Pipes</a> that get clients connections with streams and transfer data between them.</p>
<p>On one side there is a computer Hub and on the other side there are a number of App clients.</p>
<p>The ... | <p><strong>Kafka</strong> might help if we put it in between however not sure what you are streaming if it's payload data that would be good</p>
<p><a href="https://i.stack.imgur.com/wqmBY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wqmBY.png" alt="enter image description here" /></a></p>
<p>as y... |
<p>I'm working on a simple python 3 application that would be using print statements.
It is crutial for me to see the logs when i execute kubectl log command.
However, the logs are never present.
It looks like the application may not be running in the pod.
When i'm executing kubectl --it exexc and go in to pod I land u... | <p>It might be that the <code>args</code> commands in the pod definition are overriding the Dockerfile <code>CMD</code> command, I'd give it a try without the definition args or by matching them (so the args calls the <code>python ./main.py</code></p>
|
<p>I want to know what nodes correspond to pods in a K8s cluster. I am working with a 3 node K8s cluster which has 2 specific pods among other pods.</p>
<p><strong>How can I see which pod exists in which node using <code>kubectl</code>?</strong></p>
<p>When I use <code>kubectl get pods</code>, I get the following:</p>
... | <p>Try <code>kubectl get pods -o wide</code>.</p>
<p>You can get more details in this very detailed <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">Kubernetes cheatsheet</a>.</p>
|
<p>I am trying to make this basic example work on docker desktop on windows, I am not using <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">minikube</a>.</p>
<p>I managed to reach the service using NodePort with:</p>
<pre><code>http://localhost:31429
</code></pre>
<p>But when I tr... | <p><em>Reproduced this case on Docker Desktop 4.1.1, Windows 10 Pro</em></p>
<ol>
<li><p>Install <a href="https://kubernetes.github.io/ingress-nginx/deploy/#docker-desktop" rel="nofollow noreferrer">Ingress Controller for Docker Desktop</a>:</p>
<p><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ing... |
<p>Hi I would like to update a yaml like string into a yaml</p>
<p>i do have the following yaml file <code>argocd.yaml</code></p>
<pre><code>---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
namespace: mynamespace
name:my-app
spec:
project: xxx
destination:
server: xxx
namespace: xxx
so... | <p>Your second approach can work, but in a roundabout way, as <a href="https://github.com/mikefarah/yq" rel="nofollow noreferrer">mikefarah/yq</a> does not support updating <a href="http://yaml-multiline.info/" rel="nofollow noreferrer">multi-line block literals</a> yet</p>
<p>One way to solve this, with the existing c... |
<p>I have a k8s cluster that runs just fine. It has several standalone mongodb statefulsets connected via NFC. The problem is, whenever their is a power outage, the mongodb databases get corrupt:</p>
<pre><code>{"t":{"$date":"2021-10-15T13:10:06.446+00:00"},"s":"W", &q... | <p>well after several attempts I think I have finally made some breakthrough so I wanted to leave this here for someone else.</p>
<p>Since the mongodb is not running, add the command</p>
<pre><code>command: ["sleep"]
args: ["infinity"]
</code></pre>
<p>in the resource file (hoping it is a statefulse... |
<p>How to fix pop up error <a href="http:///Users/162408.suryadi/Library/Application%20Support/Lens/node_module/lenscloud-lens-extension" rel="nofollow noreferrer">permission denied</a>?</p>
<p>The log:</p>
<pre><code> 50 silly saveTree +-- lens-survey@5.2.5-latest.20211001.2
50 silly saveTree +-- lens-telemetry... | <p>In your logs you can find the description of your problem:</p>
<blockquote>
<p>It is likely you do not have the permissions to access this file as the current user.</p>
</blockquote>
<p>And one more thing to check:</p>
<blockquote>
<p>If you believe this might be a permissions issue, please double-check the permissi... |
<p>Below is the manifest for Pod within a deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus-deployment
namespace: monitoring
labels:
app: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
a... | <p>The ConfigMap needs to exist at the time of the creation of the POD unless the ConfigMap reference of the deployment is marked as "optional".</p>
<pre><code> volumes:
- name: config-volume
configMap:
name: prometheus-config
optional: true
</code></pre>
<p>In the case where the opti... |
<p>I've recently started using NFS volumes for my clusters on-prem. This is the simplest and best solution for me, however it seems pretty limited in regards to the actual mounts options.</p>
<p>Is there anyway to set mount options on the node/cluster in the volume.yml files?</p>
<ul>
<li>NFSv3</li>
<li>NFSv4/4.1</li... | <p>If someone is looking for answers in 2021, here is what is working for me.</p>
<pre><code> mountOptions:
- hard
- timeo=600
- retrans=3
- proto=tcp
- nfsvers=4.2
- port=2050
- rsize=4096
- wsize=4096
- noacl
- nocto
- noatime
- nodiratime
</code></pre>
|
<p>I have <a href="https://docs.aws.amazon.com/eks/latest/userguide/horizontal-pod-autoscaler.html" rel="nofollow noreferrer">HPA</a> for my Kubernetes-deployed app with <a href="https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html" rel="nofollow noreferrer">cluster autoscaler</a>.
Scaling works pro... | <p>Here's a list of some extra things that I've added to my configuration alongside those mentioned above</p>
<ul>
<li>container <code>preStop</code> <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" rel="nofollow noreferrer">hook</a></li>
</ul>
<pre><code>lifecycle:
... |
<p>Can ingress rewrite 405 to the origin url and change the http-errors <code>405</code> to <code>200</code>?</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: frontend-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
r... | <p>You can use <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#server-snippet" rel="nofollow noreferrer">server snippet</a> annotation to achieve it.</p>
<p>Also I rewrote your ingress from <code>extensions/v1beta1</code> apiVersion to <code>networking.k8s.io/v1</code>, b... |
<p>I am using Dockerfile to run shell script of jupyter notebook. When this jupyter terminal starts up, it's starting at /root path, but I want terminal to start with default path /nfs.
What change can be made in the Dockerfile such that this terminal starts at /nfs path ?</p>
| <p>you can add below entry in your dockerfile so everything after mentioned the WORKDIR step would be in the directory you have mentioned.</p>
<pre><code>WORKDIR /nfs
</code></pre>
|
<p>I recently upgraded <code>ingress-nginx</code> to version 1.0.3.</p>
<p>As a result, I removed the <code>kubernetes.io/ingress.class</code> annotation from my ingress, and put <code>.spec.ingressClassName</code> instead.</p>
<p>I am running <code>cert-manager-v1.4.0</code>.</p>
<p>This morning I had an email saying ... | <h2>Issue</h2>
<p>The issue was fixed by certificate renewal, it works fine without manually set <code>spec.ingressClassName</code> in challenge ingress (I saw it with older version), issue was somewhere else.</p>
<p>Also with last available (at the writing moment) <code>cert-manager v1.5.4</code> challenge ingress has... |
<p>In my case, I have to deploy a deployment first and then patch a preStop hook to the deployment in jenkins.</p>
<p>I try to use</p>
<pre><code>kubectl -n mobile patch deployment hero-orders-app --type "json" -p '[
{"op":"add","path":"/spec/template/spec/containers/0/lifec... | <p>I will use a simpler deployment to demonstrate patching a lifecycle hook, where you can use the same technique for your own deployment.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: busybox
spec:
replicas: 1
selector:
matchLabels:
app: busybox
template:
metadata:
lab... |
<p>I am running Airflow on Kubernetes from the <a href="https://github.com/helm/charts/tree/master/stable/airflow" rel="nofollow noreferrer">stable helm chart</a>. I'm running this in an AWS environment. This error exists with and without mounting any external volumes for log storage. I tried to set the configuration o... | <p>I have had this issue with the Google Cloud Plateform and the helm airflow 1.2.0 chart (which uses airflow 2).
What ended up working was:</p>
<pre class="lang-yaml prettyprint-override"><code>extraInitContainers:
- name: fix-volume-logs-permissions
image: busybox
command: [ "sh", "-c", ... |
<p>We have a simple release test for a <code>Redis</code> chart. After running <code>helm test myReleaseName --tls --cleanup</code>, we got </p>
<pre><code>RUNNING: myReleaseName-redis
ERROR: timed out waiting for the condition
</code></pre>
<p>There are several issues in Github repository at <a href="https://github.... | <p>For me, helm couldn't pull the image as it was in private repo</p>
<p><code>kubectl get events</code> helped me get the logs.</p>
<pre><code>9m38s Warning Failed pod/airflow-scheduler-bbd8696bf-5mfg7 Failed to pull image
</code></pre>
<p>After authenticating, helm install command worked.</... |
<p>I am working on a microservice app and I use nginx ingress. I setup rules with 3 services, when I mention host in the rules like this bellow it always gives me 404 for all the services</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-srv
annotations:
kubernetes.io/ingress... | <p>The problem is in dash <code>-</code> in the following line:</p>
<pre><code>rules:
- host: "tradephlo.local"
- http:
</code></pre>
<p>Otherwise, it is 2 different hosts - <code>tradephlo.local</code> abd <code>*</code>.</p>
<p>We can check this with the following command:</p>
<p><code>kubectl descr... |
<p>I have an application running in multithreading and requires many cores on a SINGLE instance.
Just wondering how to merge multiple pod (ie containers) into a single big node, so the application can run on this big node.
For example: 64 pods into a single one (ie 64 cores).</p>
<p>This is not for production or HA ser... | <p>You can't do this with Kubernetes alone. K8s can't merge nodes into a single computational unit.</p>
<p>If you have 1 node, with 60 CPU cores, you can assign 60 cores to your application.<br />
If you have 2 nodes, with 30 CPU cores each, you can only assign 30 CPU cores for your application, on each node.</p>
<p>So... |
<p>For pod with java application there is security context:</p>
<pre><code>spec:
securityContext:
runAsUser: 888
runAsGroup: 888
fsGroup: 888
</code></pre>
<p>Deployment manifest:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: springboot-demo
spec:
replicas: 1
selector:
matc... | <p>I think this can have something to do with linux capabilies: <a href="https://linux-audit.com/linux-capabilities-101/" rel="nofollow noreferrer">https://linux-audit.com/linux-capabilities-101/</a></p>
<p>I would check which capabilies are available to sh/bash process started by 888 user, and compare those bash/sh st... |
<p>I have a bunch of services deployed to a Kubernetes cluster (various pods and services all load-balanced behind a gateway). I am making a REST call to one of them and getting unexpected errors, but the problem is I'm not actually sure <em>which</em> pod/service is actually throwing the error. I would like to check a... | <p>You can fetch the logs of a particular pod or container(use -c flag for container) and grep the error logs by pipelining the log command with the grep command.</p>
<p>For example if I want to get logs of a pod with name my-pod and want to grep "error exists" word then command goes like:</p>
<pre><code>kube... |
<p>thanks for checking out my topic.</p>
<p>I'm currently working to have kustomize to download the resource and base files from our git repository.
We have tried a few options some of them following the documentation and some of them not, see below. But anyhow still not able to download from our remote repo and while ... | <p>Use <code>bases</code> instead of <code>resources</code>:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/ecr/?ref=release-1.0
resources:
- rbac.yaml
- manifest.yaml
</code></pre>
<p>add th... |
<p>I see issues in the Spring cloud config server (Springboot) logs when connecting to the repo where configs are stored. I'm not sure if it's unable to clone because of credentials or something else (git-upload-pack not permitted). Any pointers to this would be great.</p>
<pre><code>2021-10-06 22:52:51.763 INFO 1 ---... | <p>Github token needs to be passed as username which I was configuring against the password property for the spring boot app. The password property needs to be left empty and the Github-token needs to be assigned to the username like below-</p>
<pre><code>spring.cloud.config.server.git.username=asdfasdxxxxxxxyssssysysy... |
<p><strong>Getting error</strong>
postgres deployment for service is getting fail. Checked yaml with yamllint and it is valid, but still getting the error. Deployment file contains ServiceAccount , Service and Statefulset.</p>
<pre><code>install.go:158: [debug] Original chart version: ""
install.go:175: [debu... | <p>The templating mustaches in helm (and its golang text/template peer) must be one token, otherwise yaml believes that <code>{</code> opens a dict, and then <code>{</code> tries to open a <em>child</em> dict and just like in JSON that's not a valid structure</p>
<p>So you'll want:</p>
<pre class="lang-yaml prettyprint... |
<p>How can egress from a Kubernetes pod be limited to only specific FQDN/DNS with Azure CNI Network Policies?</p>
<p>This is something that can be achieved with:</p>
<p>Istio</p>
<pre><code>apiVersion: config.istio.io/v1alpha2
kind: EgressRule
metadata:
name: googleapis
namespace: default
spec:
destination:
... | <p>ATM network policies with FQDN/DNS rules are not supported on AKS.</p>
<p>If you use Azure CNI & Azure Policy Plugin you get the default Kubernetes Network Policies.</p>
<p>If you use Azure CNI & Calico Policy Plugin you get advanced possibilities like Global Network Polices but not the FQDN/DNS one. This is... |
<p>I have a cronjob which run once every midnight, however one day I deployed wrong version of it and consequently the pod it made went failed soon.</p>
<p>So.. the problem is when I delete the failed pod the cronjob immediately recreates it. How can I stop it? Well anyhow its image is already broken so however it recr... | <p><code>my question is "How can I delete failed pod created by cronjob?"</code></p>
<p>You can use <code>ttlSecondsAfterFinished</code> to control how long you want to keep <strong>either Complete or Failed job</strong> in your cluster.</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
...
spec:
... |
<h3>What I'm Trying To Do</h3>
<p>I'm trying to make a deployment and watch for k8s events until the deployment is ready using <strong>k8s node api</strong> (Watch): <a href="https://github.com/kubernetes-client/javascript/blob/master/examples/typescript/watch/watch-example.ts" rel="noreferrer">https://github.com/kuber... | <p>I'll attempt to answer your questions from the client's perspective:</p>
<h2>What is this feature trying to solve? </h2>
<p>Its intended to reduce the load on kube-apiserver from clients that issue Watch requests for a resource type. Bookmarks are intended to let the client know that the server has sent the client a... |
<p>I'm working with Docker and Kubernetes on AWS (cloudformation yaml)</p>
<p>Yaml</p>
<pre><code>...
resources:
requests:
memory: "4Gi"
cpu: "0.5"
limits:
memory: "4Gi"
cpu: "0.5"
</code></pre>
<p>Dockerfile</p>
<pre><code>FROM amazonlinux:latest
RUN yum -y i... | <p>Please change your env variable from <code>JAVA_OPTS</code> to <code>JAVA_TOOL_OPTIONS</code>.
This worked for me with Java8.</p>
|
<p>I have installed a 3 nodes cluster with <strong>K3S</strong>. Nodes are correctly detected by <code>kubectl</code> and I'm able to deploy images.</p>
<pre><code>$ k3s kubectl get nodes
NAME STATUS ROLES AGE VERSION
master Ready control-plane,etcd,maste... | <p>I believe this is an incompatibility with Kubernetes v1.22.</p>
<p>Having encountered the same issue with Rancher v2.6.0 when importing a new v1.22.2 cluster (running on IBM Cloud VPC infrastructure), I tailed the logs of the Docker container running Rancher and observed:</p>
<pre><code>2021/10/20 14:40:31 [INFO] St... |
<p>Whats the best way to get the helm subchart service names to reference into my ingress controller that will sit in the parent chart</p>
<pre><code>values.yaml
---
ingress:
paths:
- serviceName: app-1
path: /app-1/*
port: 8080
- serviceName: app-2
path: /app-2/*
port: 8080
ingress... | <p>helm 3.7 version has solved the problem
<a href="https://github.com/helm/helm/pull/9957" rel="noreferrer">https://github.com/helm/helm/pull/9957</a>.<br />
You can use like this</p>
<pre><code>{{ template "bar.fullname" .Subcharts.bar }}
</code></pre>
|
<p>Two of my microk8s clusters running version 1.21 just stopped working.</p>
<p>kubectl locally returns <code>The connection to the server 127.0.0.1:16443 was refused - did you specify the right host or port?</code></p>
<p>microk8s.status says not running, and microk8s.inspect just checks four services:</p>
<pre><code... | <p>Turns out there were two different problems in the cluster, and that I hadn't changed anything was not entirely true.</p>
<h3>Single-node cluster:</h3>
<p>cluster.yaml was not correct, it was empty. Copying the contents of localnode.yaml to cluster.yaml fixed the problem.</p>
<h3>Multi-node cluster:</h3>
<p>One node... |
<p>I want to put my docker image running react into kubernetes and be able to hit the main page. I am able to get the main page just running <code>docker run --rm -p 3000:3000 reactdemo</code> locally. When I try to deploy to my kubernetes (running locally via docker-desktop) I get no response until eventually a timeou... | <p>Thanks for all the feedback peeps! In trying out the solutions presented I found my error and it was pretty silly. I tried removing the service and trying the different port configs mentioned above. What solved it was using 127.0.0.1:31000 instead of localhost. Not sure why that fixed it but it did!</p>
<p>That bein... |
<p>The command 'kubectl addons list' throws an error:
Error: unknown command "addons" for "kubectl"
Run 'kubectl --help' for usage.</p>
<p>The command 'kubectl plugin list' seems to return something different.
error: unable to find any kubectl plugins in your PATH</p>
<p>Thanks</p>
| <p>as you have stated that you want to enable ingress in your kubernetes cluster:</p>
<p>it works differently on full-blown k8s than in minikube.</p>
<p>in kubernetes, you will need to deploy and configure and ingress controller. having done that the ingress controller will then watch resources of type "ingress&qu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.