prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>When I am installing CoreDNS using this command ,by the way,the OS version is: CentOS 7.6 and Kubernetes version is: v1.15.2:</p>
<pre><code>kubectl create -f coredns.yaml
</code></pre>
<p>The output is:</p>
<pre><code>[root@ops001 coredns]# kubectl create -f coredns.yaml
serviceaccount/coredns created
clusterrol... | <p>From this error message</p>
<pre><code>Error from server (BadRequest):
error when creating "coredns.yaml":
Deployment in version "v1" cannot be handled as a Deployment:
v1.Deployment.Spec:
v1.DeploymentSpec.Template: v
1.PodTemplateSpec.Spec:
v1.PodSpec.Containers: []v1.Container:
v1.Contai... |
<p>I ran:</p>
<pre><code>kubectl api-resources | grep "External"
externalmetrics metrics.aws true ExternalMetric
</code></pre>
<p>I want to delete this <code>metrics.aws</code> API resource, but I am not even sure how it was deployed. How can I de... | <ul>
<li>If it is a not a standard resource, then It might be implemented as a "Customer Resource Definition (crds)"</li>
</ul>
<pre class="lang-bash prettyprint-override"><code>kubectl get crds | grep externalmetrics
</code></pre>
<ul>
<li>Check if there are any Custom Resources created under this crd and d... |
<p>I have the following .yaml file:</p>
<pre><code>apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: quickstart
spec:
version: 8.0.0
count: 1
elasticsearchRef:
name: quickstart
</code></pre>
<p>when I try to create the instance using kubectl create -f , I get the error</p>
<pre><code>error:... | <p>How you have installed it? looks like you are missing the <strong>CRD</strong></p>
<p>Try applying this once:</p>
<p><code>kubectl apply -f https://download.elastic.co/downloads/eck/1.0.0/all-in-one.yaml</code></p>
<p>You can check the list of API resources available :</p>
<p><code>kubectl api-resources</code></p>
|
<p>I have an AKS cluster (Azure CNI) which I'm trying to implement NetworkPolicies on. I've created the network policy which is</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: myserver
spec:
podSelector:
matchLabels:
service: my-server
policyTypes:
- Ingress
- Egr... | <p>Solution which does not require a <code>name</code> label to the target namespace. It's necessary to define a <code>namespaceSelector</code> as well as a <code>podSelector</code>. The default <code>namespaceSelector</code> will target the pod's own namespace.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Net... |
<p>I need to set up a kubernetes pod to create demo environments for clients of my web application, with a 20 day trial duration. After these 20 days, the pod should be automatically deleted, how can I make the pod self-destruct after 20 days?
I use Rancher to deploy my pods.</p>
| <p>You can achieve this using <strong>two</strong> ways, write your own code and run on K8s to check status which will delete the deployment (POD) after 20 days</p>
<p>Reference github : <a href="https://github.com/dignajar/clean-pods" rel="nofollow noreferrer">https://github.com/dignajar/clean-pods</a></p>
<p>There is... |
<p>So right now we are trying to get a <a href="https://artifacthub.io/packages/helm/bitnami/redis" rel="nofollow noreferrer">Bitnami Redis Sentinel</a> cluster working, together with our Rails app + Sidekiq.</p>
<p>We tried different things, but it's not really clear to us, how we should specify the sentinels for Side... | <h2>Difference between a Kubernetes Service and a Headless Service</h2>
<p>Let's get started by clarifying the difference between a Headless Service and a Service.</p>
<p>A Service allows one to connect to one Pod, while a headless Service returns the list of available IP addresses from all the available pods, allowing... |
<p>I want to have a cron job inside specific ns which will be able to delete all the namespace pod, I tried like following</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
name: restart
namespace: foo
spec:
concurrencyPolicy: Forbid
schedule: "*/1 * * * *"
jobTemplate:
spec:
bac... | <p>Your pod is using credentials of service account you are running it as. If you haven't specified service account name - it will use <code>default</code> one, or <code>system:serviceaccount:foo:default</code> in your case</p>
<p>It's generally a bad idea to give any additional rights to default sa, and by default it ... |
<p>How can I disconnect from a kubernetes cluster from gitbash, I connected once and I can't "disconnect" or make the cluster name go away.</p>
<p><a href="https://i.stack.imgur.com/yVI20.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yVI20.png" alt="enter image description here" /></a></p>
| <p>Thanks a lot. really what I needed was to run the command:</p>
<pre><code>kubectl config unset current-context
</code></pre>
|
<p>I need to persist the heap dump when the java process gets OOM and the pod is restarted.</p>
<p>I have following added in the jvm args</p>
<pre><code>-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/dumps
</code></pre>
<p>...and emptydir is mounted on the same path.</p>
<p>But the is... | <p>You will have to persists the heap dumps on a shared network location between the pods. In order to achieve this, you will need to provide persistent volume claims and in EKS, this could be achieved using an Elastic File System mounted on different availability zones. You can start learning about it by reading this ... |
<p>I'm following this tutorial on Microservices
<a href="https://www.youtube.com/watch?v=DgVjEo3OGBI" rel="nofollow noreferrer">https://www.youtube.com/watch?v=DgVjEo3OGBI</a></p>
<p>At some point, I deploy a SQL Server image in Kubernetes, using this Yaml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metad... | <p><a href="https://i.stack.imgur.com/jt0c4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jt0c4.png" alt="enter image description here" /></a>
if you turn off that service then it will work</p>
|
<p>Is there a way to prevent a Pod from deploying onto Kubernetes if it does not have memory resource requests & limits set?</p>
| <p>Yes, you can apply <a href="https://kubernetes.io/docs/concepts/policy/limit-range/" rel="nofollow noreferrer">Limit Ranges</a>. See e.g. <a href="https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/" rel="nofollow noreferrer">Configure Minimum and Maximum CPU Constraints fo... |
<p>I want to allow a ServiceAccount in namespace A to access a resource in namespace B.
To achieve this I connect the ServiceAccount to a ClusterRole via a ClusterRoleBinding.
<a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole" rel="nofollow noreferrer">The documentation</a> say... | <p><code>...how to create a ClusterRole with namespaced resources...</code></p>
<p>Read further <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#clusterrole-example" rel="nofollow noreferrer">down</a> a bit:</p>
<blockquote>
<p>A ClusterRole can be used to grant the same permissions as a Role.
Bec... |
<p>I have created a simple Springboot application which runs on my localhost port number 9091 which returns "Hello world!!!" when http://localhost:9091/helloWorld url is invoked.</p>
<p>Below are the code snippets of my Springboot main class and controller class</p>
<pre><code>@SpringBootApplication
public cl... | <p>I found the solution for this. I just added the following dependency in the pom.xml</p>
<pre><code> <dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>1.6.3</version>
</dependency>... |
<p>I am following the <code>Installation Instructions</code> from <a href="https://argoproj.github.io/argo-cd/getting_started/#3-access-the-argo-cd-api-server" rel="nofollow noreferrer">https://argoproj.github.io/argo-cd/getting_started/#3-access-the-argo-cd-api-server</a>
and even though the service type has been chan... | <p>If you wish to expose an ArgoCD server via ingress, you can disable the TLS by patching the argocd-server deployment:</p>
<p>no-tls.yaml</p>
<hr />
<pre><code>spec:
template:
spec:
containers:
- name: argocd-server
command:
- argocd-server
- --insecure
</code></pre>
<p... |
<p>Developing CRDs for Kubernetes, using VScode as an IDE. Want to provide autocompletion and Intellisense in IDE.</p>
<p>It needs a JSON schema to do so. I have a huge number of CRDs to support. I want to do it in an easy way to convert CRDs to JSON schema.</p>
| <p>You can export the swagger definition (including your CRDs) of your Kubernetes server and then generate the json schema from the swagger export.</p>
<p>Create a proxy to your API server and export the swagger</p>
<pre><code>kubectl proxy --port=8080
curl localhost:8080/openapi/v2 > k8s-swagger.json
</code></pre>
... |
<p>In kubernetes we can use environment variable to pass hostIP using</p>
<pre><code> env:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
</code></pre>
<p>So similarly how get hostName instead of HostIP?</p>
| <pre><code>env:
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
</code></pre>
<p>See: <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-app... |
<p>I would like to block <code>/public/configs</code> in my k8s ingress.</p>
<p>My current settings doesnt work.</p>
<pre><code> - host: example.com
http:
paths:
- path: /*
pathType: ImplementationSpecific
backend:
service:
name: service-m... | <p>1- Create a dummy service and send it to that:</p>
<pre><code> - path: /public/configs
pathType: ImplementationSpecific
backend:
service:
name: dummy-service
port:
number: 80
</code></pre>
<p>2- use <code>server-snippets</code> as bellow to return 403 or any error you want:</... |
<p>In my kubernetes deployment file I have a annotation as below</p>
<pre><code>spec:
template:
metadata:
annotations:
prometheus.io/port: "24231"
prometheus.io/scrape: "true"
</code></pre>
<p>But when i apply the deployment file it will be replaced with</p>
<pre><code>sp... | <p>you are showing us different parts of the deployment manifest here, so I think you are confusing the different metadata sections in the same file.</p>
<p>the first section, <code>.metadata</code>, is applied to the deployment itself.</p>
<p>the <code>.spec.template.metadata</code> section is applied to the pods that... |
<p>Test1
I created an ingress with a cert-manager annotation.
This one fails with the following error "nginx ingress-controller error : admission webhook "validate.nginx.ingress.kubernetes.io" denied the request host and path already defined "</p>
<p>Test2
I created the same ingress but without the... | <p>The same domain name probably exist within the ingress. You can delete the ingress by executing following command:</p>
<p><code>kubectl get ingress --all-namespaces</code></p>
<p>to list installed ingresses</p>
<p><code>kubectl delete ingress ingress-name -n ingress-namespace</code>,</p>
<p>to delete the troublesome... |
<p>container "abc-job" in pod "abc-job-manual-h9k-vbbzw" is waiting to start: CreateContainerConfigError</p>
<p>Error: container has runAsNonRoot and image will run as root (pod: "abc-job-manual-h9k-xyz-ns-nonprod(e38ece94-b411-4d70-bc29-3711f36cfe45)", container: abc-cron-job)</p>
<p>Belo... | <p>in yaml file, securityContext was missing, i added that and now it is working fine. Below one is the updated yaml file</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: abc-cron-job
spec:
schedule: "10 * * * *"
jobTemplate:
spec:
template:
spec:
securi... |
<p>I want to run a loop on the pods in specific namespace, however the trick is to do it in a cronJob,<em>is it possible inline</em>?</p>
<p><code>kubectl get pods -n foo</code></p>
<p>The trick here is after you get the list of the pods, I need to loop on then and delete each one by one with timeout of 15 seconde, is... | <p>In your case you can use something like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1
kind: CronJob
metadata:
name: restart
namespace: foo
spec:
concurrencyPolicy: Forbid
schedule: "*/1 * * * *"
jobTemplate:
spec:
backoffLimit: 2
activeDeadlineSe... |
<p>Is there any <code>kubectl</code> command to see how much RAM (e.g. GB) has the entire cluster?</p>
<p>Basically I would like to get the sum of all the RAM of all the nodes in the cluster.</p>
<p>The command would be useful to understand the "size" of the Kubernetes cluster.</p>
| <p>You can install <code>view-utilization</code> kubectl plugin with:</p>
<pre><code>kubectl krew install view-utilization
</code></pre>
<p>Then you can run:</p>
<pre><code>kubectl view-utilization -h
</code></pre>
<p>...and you should look for values under "Alloc" columns:</p>
<pre><code>Resource Req %R ... |
<p>I am new to K8s and trying to create a Helm chart to setup my application.</p>
<p>I want a frictionless experience for users setting up the application without much manual intervention.</p>
<p>Creating the helm chart i was pleased with the provided templating functionallity but missing one essential thing: Creating ... | <p>You could try <a href="https://github.com/bitnami-labs/sealed-secrets" rel="nofollow noreferrer">Sealed Secrets</a>. It stores secrets encrypted using assimetric keys, so they secrets can be only restored having the proper keys.</p>
|
<p>I am using elastic search version 7.9 and trying to set up kibana on my Kubernetes cluster. I have deployed kibana and added nodePort service to access kibana from my browser. I getting a timeout error on the browser. the following is my service and deployment YAML:</p>
<pre><code>apiVersion: v1
kind: Service
metada... | <p>You need to extend the kibana docker image with the required plugins.</p>
<p>copy the plugin file and using kibana-plugin install the plugin from the given file as given below</p>
<pre><code>RUN /usr/share/kibana/bin/kibana-plugin install file:///kibana-xxxx-plugin.zip
</code></pre>
|
<p>We've an application and API, running on kubernetes on Azure, using an nginx-ingress and cert-manager which automatically creates letsencrypt certificates. The connection to the application/API is encrypted with TLS1.3.</p>
<p>From an older application, running on a Win 2012 server, we want to retrieve data from the... | <p>As your win server connects to the application on <strong>K8s</strong> you have to set the version of <strong>TLS</strong> on the Nginx ingress level.</p>
<p>Nginx ingress & cert-manager is point where you server connects and access API so you just have to update the TLS version of Nginx.</p>
<p>You can do it by... |
<p>When deleting a pod manually <code>kubectl delete</code> wait for the pod to be deleted and one can include a <code>kubectl wait --for....</code> condition in a script to wait for the pod to be deleted.</p>
<p>I would like to perform the same wait condition but when scaling down (replicas: 0) a deployment.</p>
<p>Fr... | <p>The easiest way would be to use labels and issue <code>kubectl wait</code> based on that.</p>
<pre class="lang-text prettyprint-override"><code>kubectl wait --for delete pod --selector=<label>=<value>
</code></pre>
<p><em>but</em>, since you don't want that, you can use the script below</p>
<pre class="l... |
<p>I have setup GKS in free trail access.</p>
<p>here is screenshot of cluster
<a href="https://i.stack.imgur.com/885zK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/885zK.png" alt="enter image description here" /></a></p>
<p>I have already setup vm instance in gce. So my kubernets cluster is havin... | <blockquote>
<p>So i delete one node will it create a new node with deploy my running
pods into another 2 nodes it will become heavy</p>
</blockquote>
<p>GKE will manage the Nodes using Node pool config.</p>
<p>if inside your GKE you have set 3 nodes and manually remove 1 instance it will auto create new Node in cluste... |
<p>Usually when I deploy a Simple HTTPS server in VM I do</p>
<p><strong>Create Certificate with ip</strong></p>
<pre><code>$ openssl req -new -x509 -keyout private_key.pem -out public_cert.pem -days 365 -nodes
Generating a RSA private key
..+++++
.................................+++++
writing new private key to 'priva... | <p>To do the same in Kubernetes you need to create a Secret with the certificate in it, like this one:</p>
<pre class="lang-yaml prettyprint-override"><code>kind: Secret
apiVersion: v1
metadata:
name: my-tls-secret
data:
tls.crt: BASE64-ENCODED CERTIFICATE
tls.key: BASE64-ENCODED KEY
</code></pre>
<p>Then you nee... |
<p>We have cluster with Istio and also Jenkins job to get "stable" pods, which uses this <code>kubectl</code> query:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get po -o=jsonpath="{range .items[?(@.status.containerStatuses[-1].ready==true)]}{.spec.containers[0].image}{'\\n'}{end}"
<... | <p>What about something like this?</p>
<pre><code>kubectl get po -o go-template='{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}{{range .items}}{{$pod := .}}{{range .status.containerStatuses}}{{if eq .ready false}}{{$pod.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}' | sort | uniq -u
</code></pre>
... |
<p>I am looking for a (more or less scientific) document/presentation that explains why the developers of the "Kubernbetes language" made the choice to fragment an application definition (for instance) in multiple yaml files instead of writing a single yaml file with all the details of the application deploym... | <p>First things first, Kubernetes does not have its own language, most used language is YAML, but you could work with JSON, or even XML if this were supported. YAML is more human readable and portable across several programming languages.
Kubernetes is complex because we want to do complex things. It simply makes thing... |
<p>I have created a k8s cluster in GKE. But I want to configure API server for k8s audit purposes so I have to set <code>--audit-policy-file</code> flag and <code>--audit-webhook-config-file</code> flags as arguments in the API server. How do I do that?</p>
| <p>I am afraid it's not possible.</p>
<p>Please keep in mind that there are some differences between On-Premise Kubernetes cluster and GKE cluster. Most important is that GKE master is managed completely by Google and you cannot reach it or change anything there. For example in <a href="https://cloud.google.com/kuberne... |
<p>We have many applications for which we have created helm charts.</p>
<p>Now we need to upgrade our k8s clusters to v1.22. Is there any efficient way to update the charts to support the latest APIs in v1.22? Are there any tools or tips to script the above functionality...?</p>
| <p>You have tools available like <a href="https://github.com/rikatz/kubepug" rel="nofollow noreferrer">https://github.com/rikatz/kubepug</a>. Still, in correction phase I encourage you to perform a manual assessment of the deployment and modify it accordingly. Some changes will be a simple keyword change, others will i... |
<p>We have a kubernetes cluster deployed on AWS EKS, and are experiencing intermittent timeouts on CoreDNS pods, usually clustered in groups of 5-15 failed queries in span of around 5 minutes. In a cluster, all queries regard the same hostname.</p>
<p>CoreDNS spits such logs:</p>
<pre><code>[ERROR] plugin/errors: 2 exa... | <p>You may be hitting a limit after which all requests are throttled.</p>
<p>There are 2 things that come to mind</p>
<ul>
<li><a href="https://coredns.io/plugins/cache/" rel="nofollow noreferrer">Enable DNS caching on CoreDNS</a></li>
<li><a href="https://aws.amazon.com/premiumsupport/knowledge-center/dns-resolution-f... |
<p>For example, guestbook-ui service and bbs-ui service are installed in k8s.</p>
<p>And I want to map guestbook-ui only to the 8080 listener port and bbs-ui service to the 8081 listener port to the pre-generated k8s ALB ingress.</p>
<p>However, if you write and store the following in spec, all guestbook-ui and bbs-ui ... | <p>There is a feature to automatically merge multiple ingress rules for all ingresses in the same <strong>ingress group</strong>. The AWS ALB ingress controller supports them with a single ALB.</p>
<pre class="lang-yaml prettyprint-override"><code>metadata:
annotations:
alb.ingress.kubernetes.io/group.name: my-gr... |
<p>I am looking for a (more or less scientific) document/presentation that explains why the developers of the "Kubernbetes language" made the choice to fragment an application definition (for instance) in multiple yaml files instead of writing a single yaml file with all the details of the application deploym... | <blockquote>
<p>why the developers of the "Kubernbetes language" made the choice to fragment an application definition (for instance) in multiple yaml files instead of writing a single yaml file with all the details of the application deployment (all deployments, volumes, ...)?</p>
</blockquote>
<p>This allow... |
<p>I am using Kubernetes client: <a href="https://pypi.org/project/kubernetes/" rel="nofollow noreferrer">Kubernetes</a></p>
<p>My function:</p>
<pre><code> def __get_gateway_token_secret(self):
try:
self.__get_kubernetes_config()
api = client.CoreV1Api()
secret = api.read_namespaced_secr... | <p>Everything (or almost everything) is possible to mock :)</p>
<p>In this example you're mocking method on actual instance of <code>CoreV1Api</code>, but inside your method <code>__get_gateway_token_secret</code> you're creating a distinct new instance of <code>CoreV1APi</code>.</p>
<p>You should apply patch to class,... |
<p>While deploying a Kubernetes application, I want to check if a resource is already present. If so it shall not be rendered. To archive this behaviour the <a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/" rel="nofollow noreferrer">lookup function</a> of helm is used. As it seems is always e... | <p>i think you cannot use this if-statement to validate what you want.</p>
<p>the lookup function returns a list of objects that were found by your lookup. so, if you want to validate that there are no serviceaccounts with the properties you specified, you should check if the returned list is empty.</p>
<p>test somethi... |
<p>I need some help regarding this OOM status of pods 137. I am kinda stuck here for 3 days now. I built a docker image of a flask application. I run the docker image, it was running fine with a memory usage of 2.7 GB.
I uploaded it to GKE with the following specification.
<a href="https://i.stack.imgur.com/o5dGZ.png" ... | <p>A Pod always runs on a Node and is the basic unit in a kubernetes engine.
A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine, depending on the cluster.
A cluster is a set of nodes that run containerized applications.</p>
<p>Now coming back to your question on OOM issue. Mostly... |
<p>My project is deployed in k8s environment and we are using fluent bit to send logs to ES. I need to send java stacktrace as one document. Therefore I have used fluent bit multi-line parser but I cannot get it work.</p>
<p><strong>Approach 1:</strong></p>
<p>As per lot of tutorials and documentations I configured flu... | <p>You actually need 2 multiline detections to make this work. You need one filtering out the docker output (on the tail input) and another filter to parse everything in the log key.</p>
<p>The solution I think would be:</p>
<pre><code>inputs: |
[INPUT]
Name tail
Tag kube.... |
<p>I have deployed my running application in AKS. I want to add new disk (Harddisk of 30GB) but I don't know how to do it.</p>
<p>I want to attach 3 disks.</p>
<p>Here is details of AKS:</p>
<ul>
<li>Node size: <code>Standard_DS2_v2</code></li>
<li>Node pools: <code>1 node pool</code></li>
<li>Storage is:</li>
</ul>
<h... | <p>Based on <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#:%7E:text=A%20PersistentVolume%20(PV)%20is%20a,node%20is%20a%20cluster%20resource.&text=Pods%20can%20request%20specific%20levels%20of%20resources%20(CPU%20and%20Memory)." rel="nofollow noreferrer">Kubernetes documentation</a>:</p>
... |
<p>I've built a Quarkus 2.7.1 console application using <a href="https://quarkus.io/guides/picocli" rel="nofollow noreferrer">picocli</a> that includes several subcommands. I'd like to be able to run this application within a Kubernetes cluster and decide its arguments at run-time. This is so that I can use the same co... | <p>You can set <code>quarkus.jib.jvm-entrypoint</code> to any container entrypoint command you want, including scripts. An example in the <a href="https://quarkus.io/guides/container-image#jvm-debugging" rel="nofollow noreferrer">doc</a> is <code>quarkus.jib.jvm-entrypoint=/deployments/run-java.sh</code>. You could mak... |
<p>When I run <code>kubectl delete raycluster <raycluster-name></code>, sometimes this command hangs. It looks like this is because Kubernetes finalizers for the raycluster are preventing deletion of the resource until some condition is met. Indeed, I see the raycluster gets marked with a deletion timestamp like ... | <p>Assuming the operator is running when you try to delete the resource, the hanging behavior is a bug.
Would you mind filing a <a href="https://github.com/ray-project/ray/issues/new?assignees=&labels=bug%2Ctriage&template=bug-report.yml&title=%5BBug%5D%20" rel="nofollow noreferrer">bug report</a> on the Ra... |
<p>Here is my ingress.yml file</p>
<pre><code>spec:
rules:
- host: {{- if .Values.ingress.host }} {{ tpl .Values.ingress.host . }} {{- end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ssl-redirect
port:
name: use-a... | <p><code>ingress.yaml</code> should be something like</p>
<pre><code>kind: Ingress
metadata:
name: {{ $name }}
labels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with $_annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
... |
<p>I need some help regarding this OOM status of pods 137. I am kinda stuck here for 3 days now. I built a docker image of a flask application. I run the docker image, it was running fine with a memory usage of 2.7 GB.
I uploaded it to GKE with the following specification.
<a href="https://i.stack.imgur.com/o5dGZ.png" ... | <p>The message <code>back-off restarting failed container</code> appears when you are facing a temporary resource overload, as a result of an activity spike. And the <code>OOMKilled code 137</code> means that a container or pod was terminated because they used more memory than the one allowed. OOM stands for <code>“Out... |
<p>In particular, %CPU/R, %CPU/L, %MEM/R, and %MEM/L. While I'm at it, what are the units of the memory and CPU (non-percentage) columns?</p>
| <p>They are explained in the K9s release notes <a href="https://github.com/derailed/k9s/blob/master/change_logs/release_v0.13.4.md#cpumem-metrics" rel="noreferrer">here</a></p>
<ul>
<li>%CPU/R Percentage of requested cpu</li>
<li>%MEM/R Percentage of requested memory</li>
<li>%CPU/L Percentage of limited cpu</... |
<p>I see <code>patchesStrategicMerge</code>in my kustomization.yaml file, but not getting it clearly, like whats its need or why we require that?</p>
<p>kustomization.yaml</p>
<pre class="lang-yaml prettyprint-override"><code>resources:
- a.yaml
patchesStrategicMerge:
- b.yaml
- c.yaml
</code></pre>
<p>I went through ... | <p>This comes in handy you <em>inherit</em> from some base and want to apply partial changes to said base. That way, you can have one source YAML file and perform different customizations based on it, without having to recreate the entire resource. That is one key selling point of <a href="https://kubernetes.io/docs/ta... |
<p>I have an ingress controller working for UI container service and backend container service. my ingress configuration is as follows:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: testapp
annotations:
rules:
- host: test1.example.com
http:
paths:
- path: /static
... | <p>First of all look at the YAML below to understand how works <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite" rel="nofollow noreferrer">rewrite rule</a>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ngin... |
<p>I have Kubernetes cluster running on a VM. A truncated overview of the mounts is:</p>
<pre class="lang-sh prettyprint-override"><code>$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 4.5G 15G 24% /
/dev/mapper/vg001-lv--docker 140G 33G 108G 23% /var/l... | <p><strong>Some theory</strong></p>
<p>By default <code>Capacity</code> and <code>Allocatable</code> for ephemeral-storage in standard kubernetes environment is sourced from filesystem (mounted to /var/lib/kubelet).
This is the default location for kubelet directory.</p>
<p><a href="https://kubernetes.io/docs/concepts/... |
<p>I have an emberjs application which has been deployed and in google chrome browser im getting the following errors for 2 of the .js files.</p>
<blockquote>
<p>Failed to find a valid digest in the 'integrity' attribute for
resource
'http://staging.org.com/assets/vendor-0ada2c9fb4d3e07ad2f0c6a990945270.js'
with comput... | <p>I got this error when deploying a Blazor WebAssembly app.</p>
<blockquote>
<p>Failed to find a valid digest in the 'integrity' attribute for
resource</p>
</blockquote>
<p>And then it showed several NuGets. Manually deleted all <code>bin</code> and <code>obj</code> folders in the solution and then redeployed. After t... |
<p>I want to set wildcard subdomain for my project, using k8s, nginx ingress controller, helm chart:</p>
<p>In <code>ingress.yaml</code> file:</p>
<pre><code>...
rules:
- host: {{ .Values.ingress.host }}
...
</code></pre>
<p>In <code>values.yaml</code> file, I change host <code>example.local</code> to <code>*.example... | <p>YAML treats strings starting with asterisk in a special way - that's why the hostname with wildcards like <code>*.example.local</code> breaks the ingress on <code>helm install</code>.
In order to be recognized as strings, the values in <code>ingress.yaml</code> file should be quoted with <code>" "</code>... |
<p>I am trying to deploy a service using helm. The cluster is Azure AKS & I have one DNS zone associated with a cluster that can be used for ingress.</p>
<p>But the issue is that the DNS zone is in k8s secret & I want to use it in ingress as host. like below</p>
<pre class="lang-yaml prettyprint-override"><code... | <p><em>This is a community wiki answer posted for better visibility. Feel free to expand it.</em></p>
<p>For the current version of Helm (3.8.0), it seems not possible to use values right from Secret <strong>with standard approach</strong>.
Based on the information from <a href="https://helm.sh/" rel="nofollow noreferr... |
<p>I want to return a complex value (dict) from a Helm function, so that I can do further processing in the template or other functions.</p>
<p>I have defined this function:</p>
<pre><code>{{- define "return-dict-function" -}}
key1: value1
key2: value2
{{- end -}}
</code></pre>
<p>And I can output the functio... | <p>There are several solutions to return complex values and do further processing:</p>
<p><strong>1) function returns plain yaml</strong></p>
<p>Take the example function <code>return-dict-function</code> from the question.
If you use <code>fromYaml</code> you'll get a <code>dict</code>:</p>
<pre><code>{{ $dict := incl... |
<p>I have a use-case for concurrent restart of all pods in a statefulset.</p>
<p>Does kubernetes statefulset support concurrent restart of all pods?</p>
<p>According to the statefulset documentation, this can be accomplished by setting the pod update policy to parallel as in this example:</p>
<pre><code>apiVersion: ap... | <p>As the document pointed, Parallel pod management will effective only in the scaling operations. <code>This option only affects the behavior for scaling operations. Updates are not affected.</code></p>
<p>Maybe you can try something like
<code>kubectl scale statefulset producer --replicas=0 -n ragnarok</code>
and
<co... |
<p>In the new <strong>Kubespray</strong> release <strong>containerd</strong> is set as default, but the old one isn't.</p>
<p>I want to change docker to containerd in old version and install it with that version.</p>
<p>When I looked the <code>offline.yml</code> I don't see any option for <strong>containerd</strong> in... | <p>Always try to dig in history in documentation. Since you're looking for outdated version see <a href="https://github.com/kubernetes-sigs/kubespray/commit/8f2b0772f9ca2d146438638e1fb9f7484cbdbd55#:%7E:text=calicoctl%2Dlinux%2D%7B%7B%20image_arch%20%7D%7D%22-,%23%20CentOS/Redhat,extras_rh_repo_gpgkey%3A%20%22%7B%7B%20... |
<p>I have kubernetes job and I would like to get his pod logs in the jenkins pipeline.</p>
<p>So I try to grep pod name to the jenkins variable and then get logs.</p>
<pre><code>POD_NAME = sh script: "kubectl describe jobs.batch ${JOB_NAME} | grep 'Created pod' | cut -d':' -f2"
echo "${POD_NAME}"
... | <p>I assume that your jenkins controller or agent is able to query the kubernetes api with kubectl because it has a serviceaccount or some other form of credential to access kubernetes.</p>
<p>If that is true, I propose that you use a label to identify the pods created by the job and to query anything related to them.<... |
<p>I have a custom Container Image for postgresql and try to run this as a Stateful kubernetes application</p>
<p>The image knows 2 Volumes which are mounted into</p>
<ol>
<li><code>/opt/db/data/postgres/data</code> (the <code>$PGDATA</code> directory of my postgres intallation)</li>
<li><code>/opt/db/backup</code></li... | <p>The directory which you had created in Dockerfile will be overlaid when you mount persistent volume to the same path. You can re-construct the directory structure in your "take-volume-mounts-ownership" container:</p>
<pre><code>...
initContainers:
- name: take-volume-mounts-ownership
...
env:
- name:... |
<p>Based on <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes" rel="nofollow noreferrer">the documentation</a> <code>initialDelaySeconds</code> gives some delay before the first readiness probe is checking the pod. But the only effect of read... | <p>Things to consider:</p>
<ol>
<li>No reason to set it earlier than the earliest possible startup time.</li>
<li>If you set it late, you are wasting resources (pods not receiving traffic): 1 minute delay for 60 pods is 1 hour.</li>
<li>How much resource does the readiness Probe consume? Does it make external calls (Da... |
<p>I need to persist the heap dump when the java process gets OOM and the pod is restarted.</p>
<p>I have following added in the jvm args</p>
<pre><code>-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/dumps
</code></pre>
<p>...and emptydir is mounted on the same path.</p>
<p>But the is... | <p>As writing to EFS is too slow in your case, there is another option for AWS EKS - <code>awsElasticBlockStore</code>.</p>
<blockquote>
<p>The contents of an EBS volume are persisted and the volume is unmounted when a pod is removed. This means that an EBS volume can be pre-populated with data, and that data can be sh... |
<p>I've been having a daily issue with my Kubernetes cluster (running on 1.18) where one of the nodes will go over 100% CPU utilisation, and Kubernetes will fail to connect external visitors to my pods. (A website outage, basically)</p>
<p>The strange thing is the pods are always sitting at a comfortable 30% (or lower!... | <p>You could try to open an <code>ssh</code> connection to the node and then check which process(es) consume CPU using <code>top</code>. If this process runs in a pod and your have <code>crictl</code> installed on the node, you can use <a href="https://github.com/k8s-school/pid2pod" rel="nofollow noreferrer">https://gi... |
<p>I have an application running on my home cluster.<br>
My cluster is running K3S.<br>
The cluster exists of 5 Raspberry Pi's 3B and 1 Ubuntu VM.<br>
One of my deployments is Domoticz.<br>
This uses a SQLite database to store data.<br>
I'm using this as a StorageClass. <a href="https://github.com/kubernetes-sigs/nfs-s... | <p>I fixed this by using longhorn instead of NFS.
Thanks Andrew Skorkin for the tip</p>
|
<p>I'm hitting to 3rd party API, and the endpoint can handle 1 req in ~2s.</p>
<p>A naive way is to spin up a couple of servers on DigitalOcean or similar to make it possible to send more requests. Basically, one responsibility for each server, so the ~2s wait time is not a problem.</p>
<p>However, are there some techn... | <p>Spinning up more containers does mean you could send more requests per second, in theory.</p>
<p><em>BUT</em>, every container will still have the same exit point - be it your PC, laptop or router (all requests originate from the same source). This means, depending on how 3rd party enforces QPS restrictions, all but... |
<p>I am <a href="https://minikube.sigs.k8s.io/docs/handbook/mount/" rel="nofollow noreferrer">mounting a filesystem</a> on minikube:</p>
<pre><code>minikube mount /var/files/:/usr/share/ -p multinode-demo
</code></pre>
<p>But I found two complications:</p>
<ul>
<li>My cluster has two nodes. The pods in the first node a... | <p>As mentioned in the comments section, I believe your problem is related to the following GitHub issues: <a href="https://github.com/kubernetes/minikube/issues/12165#issuecomment-895104495" rel="nofollow noreferrer">Storage provisioner broken for multinode mode</a> and <a href="https://github.com/kubernetes/minikube/... |
<p>I have set the Kubernetes cronJob to prevent concurrent runs <a href="https://stackoverflow.com/a/62892617/2096986">like here</a> using <code>parallelism: 1</code>, <code>concurrencyPolicy: Forbid</code>, and <code>parallelism: 1</code>. However, when I try to create a cronJob manually I am allowed to do that.</p>
<... | <p>The <code>concurrencyPolicy: Forbidden</code> spec only prevents concurrent pod creations and executions of <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy" rel="nofollow noreferrer">the same <code>CronJob</code></a>. It does not apply across separate CronJobs even th... |
<p>I need to add Java command in container. For it I use Helm Chart.</p>
<pre><code>helm install mychart chart/mychart --set "command.cmd={java,-Disurz_dir=/mnt/isurz,-Dnifi_url=http://srv-ft-ads-01:9090/nifi-api/processors/20e6a079-3721-a43a-0fed7a8f1236,-Des_host_and_port=xxx:9200,-jar,*.jar}"
</code></pre>... | <p>Posting this as a community wiki, feel free to edit and expand.</p>
<hr />
<p>As @larsks correctly mentioned in the comment:</p>
<blockquote>
<p>The quotes are necessary because an unquoted * can't start a YAML
value. They are not part of the value itself.</p>
</blockquote>
<p>For example, this is from <a href="http... |
<p>I am new in Kubernetes, and I want to run the simple flask program on docker in Kubernetes. The image in docker could work successfully, but when I start the K8s.yaml with <code>kubectl apply -f k8s.yaml</code> and execute <code>minikube service flask-app-service</code> the web result reply fail with ERR_CONNECTION_... | <p>Based on the error in the question:</p>
<blockquote>
<p>pods status Error: ErrImageNeverPull.</p>
</blockquote>
<p>pod doesn't start because you have <code>imagePullPolicy: Never</code> in your deployment manifest. Which means that if the image is missing, it won't be pulled anyway.</p>
<p>This is from official docu... |
<p>I'd love to rename or drop a label from a <code>/metrics</code> endpoint within my metric. The metric itself is from the <code>kube-state-metrics</code> application, so nothing extraordinary. The metric looks like this:</p>
<pre><code>kube_pod_container_resource_requests{container="alertmanager", instance=... | <p>The problem is that you are doing those operations at the wrong time. <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config" rel="nofollow noreferrer">relabel_configs</a> happens before metrics are actually gathered, so, at this time, you can only manipulate the labels tha... |
<p>I experienced slow response of any kubectl command at my test environment.
I don't have this issue in the production and at minikube in my dev.
For example I run:</p>
<pre><code>kubectl get deployments
</code></pre>
<p>And I have to wait even one minute. If I break with <em>Ctrl + C</em>, and start again sometime... | <p>If someone is looking at the same issue, you can try out <code>-v=6</code> option to check API response timings.</p>
<pre><code>kubectl get deployments -v=6
</code></pre>
|
<p>I need to start by saying that I have no experience using Cassandra and I am not the one who who created this deployment.</p>
<p>I have Cassandra running in a cluster in AKS. The PVC as configured in the statefulset is 1000Gi. Currently the pods are out of storage and are in a constant unhealthy state.</p>
<p>I am l... | <p>Answer for: <strong>How can I expand a PVC for StatefulSet on AKS without loosing data?</strong></p>
<p>While the answer of @Erick Raminez is a very good advice for Cassandra specific, I would like to answers the more general question "How can I expand a PVC for my StatefulSet on AKS without loosing data?"... |
<p>I am new to Kubernetes Operators. I have a general question about how to conceive of cleanup at the point of deletion.</p>
<p>Let's say the Controller is managing a resource which consists of a Deployment among other things. This Deployment writes to some external database. I'd like the items from the Database to be... | <p>Have you heard about Finalizers and <a href="https://kubernetes.io/blog/2021/05/14/using-finalizers-to-control-deletion/#owner-references" rel="nofollow noreferrer">Owner References</a> in Kubernetes? It's the Owner references describe how groups of objects are related. They are properties on resources that specify ... |
<p>I am trying to run a spark-submit to the Kubernetes cluster with spark 3.2.1 image and it is working. Now my question is, can I execute an init container along with the spark-submit? What am trying to achieve is that the init container check another service is up or not, is it up then spark-submit will run or it fai... | <p>I found that the best way to submit a spark job is the sparkoperator, more details can be found in the <a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/docs/user-guide.md#using-init-containers" rel="nofollow noreferrer">GitHub link</a></p>
<p>There is one option to include an init co... |
<p>I need to watch (and wait) until a POD is deleted. I need to this is because I need to start a second pod (with the same name) immediately after the first one has been deleted.</p>
<p>This is what I'm trying:</p>
<pre><code>func (k *k8sClient) waitPodDeleted(ctx context.Context, resName string) error {
watcher, ... | <p>As I said in the comments, the real problem was the watcher I was creating to watch the pod I want to get deleted. In the watcher I was creating a LabelSelector that was selecting two pods instead of one. This is the complete solution, including the watcher.</p>
<pre><code>func (k *k8sClient) createPodWatcher(ctx co... |
<p>Friends</p>
<p>Im writing a configMap containing an array of postgres db names. Approach 1 throws an error like
scalar value is expected at postgres.db.name</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-init
data:
postgres.host: "postgreshost"
postgres.db.name: {"postgre... | <p>Edit: As @ShawnFumo and @HuBeZa pointed out, my old answer was incorrect. Configmap data key/value pairs expect the value to be in string format, therefore it isn't possible to provide a dict/list as value.</p>
<p>note: you have 4 "-" at the start of your second example, which would make the YAML document ... |
<p>I'm attempting to use the <a href="https://plugins.jenkins.io/statistics-gatherer/%3E" rel="nofollow noreferrer">Statistics Gathering</a> Jenkins plugin to forward metrics to Logstash. The plugin is configured with the following url: <code>http://logstash.monitoring-observability:9000</code>. Both Jenkins and Logsta... | <p>I resolved this error by updating the configmap to this:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-configmap
namespace: monitoring-observability
data:
logstash.yml: |
path.config: /usr/share/logstash/pipeline
logstash.conf: |
input {
tcp {
port => "9... |
<p>I've started experimenting with Argocd as part of my cluster setup and set it up to watch a test repo containing some yaml files for a small application I wanted to use for the experiment. While getting to know the system a bit, I broke the repo connection and instead of fixing it I decided that I had what I wanted,... | <p>If your problem is that the namespace cannot be deleted, the following two solutions may help you:</p>
<ol>
<li>Check what resources are stuck in the deletion process, delete these resources, and then delete ns</li>
<li>Edit the namespace of argocd, check if there is a finalizer field in the spec, delete that field ... |
<p>How do you update postgresql.conf or pg_hba.conf for the main postgresql chart on <a href="https://artifacthub.io" rel="nofollow noreferrer">https://artifacthub.io</a>? (In particular I have been trying to update the wal_level within the postgresql.conf)</p>
<p>Related Links:</p>
<ul>
<li><a href="https://github.com... | <p>Documentation is hard to follow without any real good examples, but basically in the fine print they mention you have to completely override postgresql.conf and pg_hba.conf if you want to update anything here. I'm sure there is a better way to perform an update of just one key such as wal_level, but I found this app... |
<p>I have a k8s deployment which is using <strong>Cloud DNS</strong> And <strong>Managed Certificate ( for SSL )</strong> along with the k8s service.</p>
<p>I have configured HTTP to HTTPS according to <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#https_redirect" rel="nofollow norefer... | <p>GCP provides protection from these types of attacks via <a href="https://cloud.google.com/armor#section-2" rel="nofollow noreferrer">Cloud Armor</a>. Cloud Armor has built-in <a href="https://cloud.google.com/armor/docs/rule-tuning#protocol_attack" rel="nofollow noreferrer">WAF policies</a> which support protection... |
<p>I have my application running in EKS cluster.I have exposed the application using Ingress- ALB load balancer controller. ALB load balancer controller has deleted recently, how to find when it got deleted.</p>
| <p>If you have configured the ALB-ingress controller driver to dump logs on S3. Its a place to start. This <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v1.1/guide/ingress/annotation/#:%7E:text=enable%20access%20log%20to%20s3" rel="nofollow noreferrer">enter link description here</a> guide wil... |
<p>Is there a way to create a K8s cluster role with full access (all resources, verbs and apigroups on any namespaces) but no commands execution on all namespaces for example: <code>kubectl delete pods --all-namespaces</code> or <code>kubectl delete pv --all-namespaces</code>?</p>
<p>(Running the same commands on a sin... | <p>What if bind clusterrole to only needed namespaces and not give permissions to restricted ones? Thats not full solution, at least user wont be able to delete not needed ones. And strictly answering your question - not sure this is possible.</p>
<pre><code>---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tes... |
<p>I am having running elastic-search on my Kubernetes cluster with host <code>http://192.168.18.35:31200/</code>. Now I have to connect my elastic search to the kibana. For that an enrollment token needs to be generated but how?
When I login to the root directory of elastic-search from kibana dashboard and type the fo... | <p>Assuming that you are on debian/ ubuntu, this should help</p>
<pre><code>cd /usr/share/elasticsearch/bin/
then
./elasticsearch-create-enrollment-token --scope kibana
</code></pre>
|
<p>I am new to K8s. I am trying to deploy a Datadog agent to my cluster to collect logs and this happens through a ConfigMap.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-cm
data:
fluent-bit.conf: |
[SERVICE]
Parsers_File parsers.conf
[INPUT]
name ... | <p>In theory you could <a href="https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables" rel="nofollow noreferrer">Secret as a environment variable</a>, and pass it to a Pod using ConfigMap.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Secret
metada... |
<p>Background: I have two deployments in my k8s cluster called (as an example) the following:</p>
<pre><code>foo-bar
foo-bar-asd
</code></pre>
<p>In my pipeline, I want to implement logic which checks if there's any deployments named "foo-bar" already deployed.</p>
<p>How do I construct my command to only fet... | <p><code>grep</code> command can also exclude certain string. You can run something like</p>
<p><code>kubectl -n my-namespace get deployments | grep foo-bar | grep -v foo-bar-asd</code></p>
<p>This should show you what you are looking for.</p>
|
<p>I deployed K8S cluster on AWS EKS (nodegroup) with 3 nodes. I'd like to see the pod CIDR for each node but this command returns empty: <code>$ kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'</code>. Why doesn't it have CIDR in the configuration?</p>
<pre><code>$ kubectl get nodes
NAME ... | <p>From kubelet let documentation I can see that it is only being used for standalone configuration
<a href="https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/</a></p>
<p><a href="https://i.stack.imgu... |
<p>I have two below docker commands, can someone let me know the equivalent <code>kubernetes</code> (<code>kubectl</code>) command for single node cluster :</p>
<pre><code>docker image prune -a --force --filter until=5m
docker container prune --force --filter until=5m
</code></pre>
<p>Also are these two commands doing ... | <blockquote>
<p>can someone let me know the equivalent kubernetes (kubectl) command for single node cluster</p>
<pre><code>docker image prune -a --force --filter until=5m
docker container prune --force --filter until=5m
</code></pre>
</blockquote>
<p>You don't directly interact with the docker containers or images on t... |
<p>I am in the process of deploying ActiveMQ 5.15 in HA on Kubernetes. Previously I was using a deployment and a <code>clusterIP</code> Service. And it was working fine. The master will boot up and the slave will wait for the lock to be acquired. If I delete the pod which is the master one, the slave picks up and becom... | <blockquote>
<p>I noticed also that two PVC were created id0 and id1 in the case of statefulset compared to deployment which had only 1 PVC. Could that be the issue since it is no more a shared storage?</p>
</blockquote>
<p>You are right. When using k8s StatefulSets each Pod gets its own persistent storage (dedicated P... |
<p>What is the difference between <code>minikube start</code> and <code>minikube create cluster</code>?</p>
<p>Do they both create a cluster?</p>
| <p><code>Minikube start</code>, start the cluster with the name <code>minikube</code> by default</p>
<p><code>minikube create cluster</code> which version are you using ? No commands exist actually in official documentation: <a href="https://minikube.sigs.k8s.io/docs/commands/" rel="nofollow noreferrer">https://minikub... |
<p>I have a Kubernetes Cluster and I've been trying to forward logs to Splunk with this <a href="https://github.com/splunk/splunk-connect-for-kubernetes#prerequisites" rel="nofollow noreferrer">splunk-connect-for-kubernetes</a> repo which is essentially Splunk's own kubernetes-oriented configuration of fluentd.</p>
<p>... | <p>I had a very similar problem once and changing the path in the values.yaml file helped to solve the problem. It is perfectly described in <a href="https://community.splunk.com/t5/All-Apps-and-Add-ons/splunk-connect-for-kubernetes-var-log-containers-log-unreadable/m-p/473943" rel="nofollow noreferrer">this thread</a>... |
<p>I am new to kubernetes helm chart. There is a yaml file named configmap. This file containing all the configuration which are related to the application. Since this file containing a lot of data, I was trying to put some data to the new file and access using FILE object. So created two different file with the name:
... | <pre><code>{{ (tpl (.Files.Glob "data2.yaml").AsConfig . ) | indent 2 }}
</code></pre>
<p>Using above syntax it's picking the actual value of variables. But it also printing the file name like below:</p>
<pre><code>data2.yaml: |-
</code></pre>
<p>So I resolve the issue by using below syntax:</p>
<pre><code>{{... |
<p>I'm running a <code>flask</code> application with <code>gunicorn</code> and <code>gevent</code> worker class. In my own test environment, I follow the official guide <code>multiprocessing.cpu_count() * 2 + 1</code> to set worker number.</p>
<p>If I want to put the application on Kubernetes' pod and assume that resou... | <blockquote>
<p>how to calculate the worker number? should I use limits CPU or requests CPU?</p>
</blockquote>
<p>It depends on your situation. First, look at the documentation about <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits" rel="nofollow noreferrer">re... |
<p>Recently, the same container of several pods in a deployment restarted with <code>OOMKilled</code> event.
Here is the description of one of the containers:</p>
<pre><code>State: Running
Started: Tue, 15 Feb 2022 23:33:06 +0000
Last State: Terminated
Reason: OOMKilled
Exi... | <p>Two possible reasons:</p>
<h4>Reason #1</h4>
<p>Subprocess was killed by OOM killer (it received SIGKILL(9) from OOM killer), resulting in application crashing with <em>exit code 1</em>, and <em>OOMKilled</em> reason for termination.</p>
<h4>Reason #2</h4>
<p>If you have <code>initContainers</code> specified, init c... |
<p>I am using kubernetes (by windows 10 - docker desktop).</p>
<p>I am using mysql, that is running by helm 3 (loaded from bitnami repository).</p>
<p>I am creating another application.
For now, I am testing on docker (not in kubernetes yet).</p>
<p>Everything is fine, but when trying to connect the database from my pr... | <p>Docker containers are isolated from other containers and the external network by default. There are several options to establish connection between Docker containers:</p>
<ul>
<li><p>Docker sets up a default <code>bridge</code> network automatically, through which the communication is possible between containers and... |
<p>I am setting up nginx autoscaling based on CPU.</p>
<p>Setup on the nginx deployment is:</p>
<pre><code> resources:
limits:
cpu: "2"
memory: 1000Mi
requests:
cpu: 100m
memory: 100Mi
</code></pre>
<p>When I check <code>kubectl top po... | <p>So it turns out I was using an additional metric that wasn't working (it was a custom metric that didn't have a source from metric server) - and I think that broke the metrics from updating.</p>
<p>I had another</p>
<pre><code> metrics:
- type: Object
</code></pre>
<p>that was showing up as on the HPA targets ou... |
<p>I have to changed the <code>terminationGracePeriodSeconds</code> from 30 to 120 in Kubernetes deployment manifest file but when I am deploying using helm:</p>
<pre><code>helm upgrade --install <chartname> --values <valuesfilename>
</code></pre>
<p>The old pods getting terminated immediately and new pods ... | <p>The Kubernetes parameter <code>terminationGracePeriodSeconds</code> decides on how much time Kubernetes waits until it forcefully kills your container. In other words, when Kubernetes wants to terminate your Pod, it does the following:</p>
<ol>
<li>Kubernetes sends <code>SIGTERM</code> to your container</li>
<li>Kub... |
<p>I want to remove pod that I deployed to my cluster with <code>helm install</code>.</p>
<p>I used 3 ways to do so:</p>
<ol>
<li><code>helm uninstall <release name></code> -> remove the pod from the cluster and from the helm list</li>
<li><code>helm delete <release name></code> -> remove the pod from... | <p><code>helm delete</code> is an alias for <code>helm uninstall</code> and you can see this when you check the <code>--help</code> syntax:</p>
<pre><code>$ helm delete --help
...
Usage:
helm uninstall RELEASE_NAME [...] [flags]
</code></pre>
<p><code>kubectl delete ...</code> just removes the resource in the cluster... |
<p>We are using the Job <code>ttlSecondsAfterFinished</code> attribute to automatically clean up finished jobs. When we had a very small number of jobs (10-50), the jobs (and their pods) would get cleaned up approximately 60 seconds after completion. However, now that we have ~5000 jobs running on our cluster, it takes... | <p><strong>Solution 1</strong></p>
<p>How do you use the Job <code>ttlSecondsAfterFinished</code>? You can specify <code>.spec.ttlSecondsAfterFinished</code> to the value what you need. Below is the example from <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/#ttl-mechanism-for-finished-jobs" rel... |
<p>I've been having loads of issues with <code>kubectl</code> not having enough space. How can I increase the default storage size allocated to <code>docker</code>?</p>
<p>None of minikube recommendations worked.</p>
<pre><code>1. Run "docker system prune" to remove unused Docker data (optionally with "-... | <p>Taking your comment into consideration</p>
<blockquote>
<p>I get ImagePullBackOff when I try to deploy nginx on the cluster –
Caterina</p>
</blockquote>
<p>You can specify minikube's disk allocations separately:</p>
<p><code>minikube start --memory=8192 --cpus=4 --disk-size=50g</code></p>
<p>Which can help you to wo... |
<p>I have to changed the <code>terminationGracePeriodSeconds</code> from 30 to 120 in Kubernetes deployment manifest file but when I am deploying using helm:</p>
<pre><code>helm upgrade --install <chartname> --values <valuesfilename>
</code></pre>
<p>The old pods getting terminated immediately and new pods ... | <p>Basically, it is expected behavior for <code>terminationGracePeriodSeconds</code>, as it is <em>optional</em> duration in seconds the pod needs to terminate gracefully.</p>
<p>On pod termination - the lifecycle is described <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" r... |
<p>I got to know that the "krew" is the famous and fancy kubernetes plugin.</p>
<p>So I want to install the "krew" in my clusters.</p>
<p>But because of some reasons, my clusters must be disconnected to public internet.</p>
<p>I installed the k8s in my clusters with offline. (kubespray)</p>
<p>I pus... | <p>Not sure what you would achieve by having <code>krew</code> installed in an offline environment. <code>krew</code> need the internet to download the various plugins from their source over the internet.</p>
<p>Although, You "may" not need to install <code>krew</code> at all. You can manually check the plugi... |
<p>I have created my own k8s cluster using Kubeadm with two Ubuntu virtual servers - one master and one worker node. I also deployed a Springboot app with MongoDB persistence and it works absolutely fine. Below are the nodes in my k8s cluster</p>
<p><a href="https://i.stack.imgur.com/Ng1KH.png" rel="nofollow noreferrer... | <p>May you have updated the <strong>PVC</strong> mount path and due to that mongo not aware of where to store or save the data</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: mongo
name: mongo
spec:
replicas: 1
selector:
matchLabels:
app: mongo
... |
<p>Sorry in advance as this is probably a very easy question to answer, I am pretty new to prometheus and grafana and I am trying to figure out where this metric in prometheus is coming from "container_cpu_usage_seconds_total".</p>
<p>I have found online that all metrics starting with "node_" come f... | <p>The metric</p>
<p><strong>container_cpu_usage_seconds_total</strong></p>
<p>comes from <code>cAdvisor</code> service embedded in <code>kubelet</code>, exposed through port <code>10250</code> and endpoint <code>/metrics/cadvisor</code>.</p>
<p>The metric's source code definition is in:</p>
<p><a href="https://github.... |
<p>I'm using GKE to manage my app and the app is trying to consume 3rd party API, and the 3rd party API is whitelisting ip addresses that trying to access their APIs, how can i find what ip address that my app used when consume 3rd party APIs?</p>
| <p>The IP address used by the Pod depends on type of service and a few more factors, which are very well documented in <a href="https://kubernetes.io/docs/tutorials/services/source-ip/" rel="nofollow noreferrer">this documentation page</a></p>
<p>There is also IP Masquerade agent which allows you to use Node's IP addre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.