prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I have the following <code>MutatingWebhookConfiguration</code></p>
<pre><code>apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: example-webhook
webhooks:
- name: example-webhook.default.svc.cluster.local
admissionReviewVersions:
- "v1beta1"
sid... | <p>Not sure if you can use webhook on port 80...</p>
<p>Perhaps some of this will be useful to you, I used the following script to generate certificates, you can change it to suit your needs:</p>
<pre><code>#!/bin/bash
set -e
service=webhook-svc
namespace=default
secret=webhook-certs
csrName=${service}.${namespace}
... |
<p>I am trying depoly a replicaset of mongodb in my kind kubernetes.</p>
<p>Well, my first step is run thsi command:</p>
<pre><code>helm upgrade --install mongodb bitnami/mongodb
--set mongodb.global.storageClass=standard
--set mongodbRootPassword=root
--set mongodbUsername=mongoUser
--set mongodbPassword=mongoUser ... | <blockquote>
<p>How I can connect to this replicaSet?</p>
</blockquote>
<p>You can use the K8s service to connect with these replicas <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">service type like LoadBalancer</a>, <a href="https://kubernetes.io/docs/tasks/access-... |
<p>I have deployed pihole on my k3s cluster using this helm chart <a href="https://github.com/MoJo2600/pihole-kubernetes" rel="nofollow noreferrer">https://github.com/MoJo2600/pihole-kubernetes</a>.<br />
(I used this <a href="https://www.jeffgeerling.com/blog/2020/raspberry-pi-cluster-episode-4-minecraft-pi-hole-grafa... | <ul>
<li><p>Looks Like "pihole-dns-tcp" is in a different namespace to the namespace where patch command is being ran.</p>
</li>
<li><p>As per the article you have shared , it seems like service <code>pihole-dns-tcp</code> is in <code>pihole </code>. So the command should be</p>
</li>
</ul>
<p><code>kubectl p... |
<p>I am running Spark Submit through a pod within cluster on Kubernetes with the following script:</p>
<pre><code>/opt/spark/bin/spark-submit
--master k8s://someCluster
--deploy-mode cluster
--name someName
--class some.class
--conf spark.driver.userClassPathFirst=true
--conf spark.kubernetes.namespace=someNam... | <p>Found out the endpoint wasn't added to the service because the driver pod has multiple containers, one of them terminates early causing readiness of the pod to be "not ready"; hence the service does not register the driver pod endpoint. Since there are no endpoints for the service, the executor pods trying... |
<p>I encountered as below when executing sudo kubeadm init
Help me~~</p>
<pre><code>$ sudo kubeadm init
[init] Using Kubernetes version: v1.24.1
[preflight] Running pre-flight checks
[WARNING SystemVerification]: missing optional cgroups: blkio
error execution phase preflight: [preflight] Some fatal errors occu... | <p>work around found here :
<a href="https://github.com/containerd/containerd/issues/4581" rel="noreferrer">https://github.com/containerd/containerd/issues/4581</a></p>
<pre><code>rm /etc/containerd/config.toml
systemctl restart containerd
kubeadm init
</code></pre>
|
<p>I'm planning to deploy a small Kubernetes cluster (3x 32GB Nodes). I'm not experienced with K8S and I need to come up with some kind of resilient SQL database setup and CockroachDB seems like a great choice.</p>
<p>I wonder if it's possible to <em>relatively easy</em> deploy a configuration, where some CockroachDB i... | <p>Yes, it's straight forward to do a multi-cloud deployment of CRDB. This is one of the great advantages of cockroachdb. Simply run the <code>cockroach start</code> command on each of the VMs/pods running cockroachdb and they will form a cluster.</p>
<p>See this blog post/tutorial for more info: <a href="https://www.c... |
<p>We have a service running behind istio virtual service. Occasionally the request timeouts at the client side while everything is normal inside the service.</p>
<p>To solve this problem, we want to record time cost for all queries, and use these data to check time cost for specific query (by specifying filter fields ... | <p>You can check the istio standard metrics and istio with prometheus integration.</p>
<p><a href="https://istio.io/latest/docs/reference/config/metrics/#:%7E:text=For%20HTTP%2C%20HTTP%2F2%2C,measures%20the%20duration%20of%20requests" rel="nofollow noreferrer">https://istio.io/latest/docs/reference/config/metrics/#:~:t... |
<p>I am trying to cache response of my API but I am getting <code>X-Cache-Status: MISS</code> every time. My Api return a text/plain response('hello' & 'bye').
I don't know what I am missing, also the setup is on minikube.</p>
<p>My Ingress.yaml</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata... | <p>show kubectl -n <em>ingresscontrollernamespace</em> describe pod <em>ingresscontrollerpodname</em></p>
<p><a href="https://kubernetes.slack.com/archives/CANQGM8BA/p1654524670938769" rel="nofollow noreferrer">https://kubernetes.slack.com/archives/CANQGM8BA/p1654524670938769</a></p>
|
<p>I created a job,and rerun it several times。
When I delete this job. Only the latest pod be deleted.</p>
<p>How Can I delete these pods all.</p>
| <p><strong>For Cronjob</strong></p>
<p>You can use the <strong>successfulJobsHistoryLimit</strong> to manage the pod count, if you will set it to <strong>0</strong>, POD will get removed as soon as it complete it's execution successfully.</p>
<pre><code>successfulJobsHistoryLimit: 0
failedJobsHistoryLimit: 0
</code></p... |
<p>I'm quite new in GitLab cicd.
I have created simple nginx deployment including namespace,configmap,svc,deployment
configmap contains simple custom index.html with cicd variable:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: index-html-configmap
namespace: lazzio
data:
index.html: |
<html... | <p>you have actually few ways to do it.</p>
<ol>
<li><p>Personally like <a href="https://www.baeldung.com/linux/envsubst-command" rel="nofollow noreferrer">envsubst</a>, it's easy to implement and has a little weight. But you have to install it (in e.g. gitlab runner) to avoid downloading it each time pipeline runs.</p... |
<p>In docker, we can use</p>
<pre><code>docker manifest inspect
</code></pre>
<p>to check the image manifest.</p>
<p>For nerdctl and ctr\crictl, there is no manifest related commands.</p>
<p>nerdctl image inspect only shows some basic information about the image.</p>
| <ol>
<li>check sha of the image by <code>nerdctl inspect</code></li>
</ol>
<pre><code> "Id": "sha256:221177c6082a88ea4f6240ab2450d540955ac6f4d5454f0e15751b653ebda165",
"RepoTags": [
"k8s.gcr.io/pause:3.7"
],
"RepoDigests": [
... |
<p>I am using this yaml file for deployment - <a href="https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-dbless.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/Kong/kubernetes-ingress-controller/master/deploy/single/all-in-one-dbless.yaml</a></p>
<p>I... | <p>Yes, you can do it, just change the service type to <strong>NodePort</strong>.</p>
<p>There is also thread discussion in Kong community : <a href="https://discuss.konghq.com/t/expose-kong-on-nodeport/8497" rel="nofollow noreferrer">https://discuss.konghq.com/t/expose-kong-on-nodeport/8497</a></p>
<pre><code>---
apiV... |
<p>When deleting a pod or deploying a new version of a pod kubernetes should theoretically send a <code>SIGTERM</code> to the process running and then wait <code>gracePeriodSeconds</code> (30 by default) seconds before it sends a <code>SIGKILL</code>.</p>
<p>I have encountered the problem that this first <code>SIGTERM<... | <p>For termination to work correctly, you need to ensure your application is the main container process. With the <a href="https://docs.docker.com/engine/reference/builder/#shell-form-entrypoint-example" rel="noreferrer">shell form</a> <code>CMD</code>, the command your container runs is <code>/bin/sh -c '${CMD}'</cod... |
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: pv-pod
namespace: auth
spec:
containers:
- name: busybox
image: busybox
#************** HERE is the command!
command: ['sh', '-c', 'while true; do echo date > /output/output.log; sleep 5; done']
volumeMounts:
- name: pv-storage
mou... | <p>You could use <a href="https://unix.stackexchange.com/questions/440088/what-is-command-substitution-in-a-shell">command substitution</a> for this. That would be in shell or bash, the same.</p>
<p>Additionally, you may need to escape the dollar sign, since <code>$()</code> has a <a href="https://kubernetes.io/docs/ta... |
<p>I have the following <code>MutatingWebhookConfiguration</code></p>
<pre><code>apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: example-webhook
webhooks:
- name: example-webhook.default.svc.cluster.local
admissionReviewVersions:
- "v1beta1"
sid... | <p>Did you try adding the <strong>port</strong> attribute in your MutatingWebhookConfiguration</p>
<pre class="lang-yaml prettyprint-override"><code>clientConfig:
service:
name: example-webhook
namespace: default
path: "/mutate"
port: 80
</code></pre>
|
<p>I'm trying to install Traefik on a K8s cluster using ArgoCD to deploy the official Helm chart. But I also need it to us an additional "values.yml" file. When I try to specify in the Application yaml file what additional values file to use, it fails to file not found for it.</p>
<p>Here is what I'm using:... | <p>I assume this is because Argo will look for <code>traefik-values.yml</code> file in the <code>repoURL</code> (so, not in the location where <code>Application</code> file is), and it obviously doesn't exist there.</p>
<p>You can check more about this issue <a href="https://github.com/argoproj/argo-cd/issues/2789" rel... |
<p>Giving the port forward object</p>
<pre><code>from kubernetes.stream import stream, portforward
pf = portforward(
k8s_client_v1.connect_get_namespaced_pod_portforward,
pod_name,
name_space,
ports=port
)
pf.socket(port)
</code></pre>
<p><code>pf</code> is a socke... | <p>Thanks to your code snipped, I could get this to work for me - which means that your code basically works: I have successfully used it to send TCP data on a custom port to a kubernetes services (haven't tried UDP, though). It seems to work quite similar but not exactly the same as <code>kubectl port-forward</code>.<... |
<p>I have a Discord channel. I want <code>Google Cloud Monitoring</code> to send notifications to this channel via <code>webhook</code>.</p>
<p>Help me please T.T</p>
| <p>You can use the notification channel of webhook to send the notification to your discord.</p>
<p><a href="https://cloud.google.com/monitoring/support/notification-options#webhooks" rel="nofollow noreferrer">https://cloud.google.com/monitoring/support/notification-options#webhooks</a></p>
<p><a href="https://i.stack.... |
<p>When we run kubectl get pod => it is listing the count of containers running inside a pod and restart count. So I am not sure which container gets restarted. Either I need to login to UI or using kubectl describe pods.</p>
<pre><code>NAME READY STATUS RESTARTS AGE
test-pod 2/2 Running 5 ... | <p>You can try something like this:</p>
<pre><code>kubectl get pods <pod-name> -o jsonpath='{.spec.containers[*].name} {.status.containerStatuses[*].restartCount} {.status.containerStatuses[*].state}'
</code></pre>
<p>You will get in result container-name, restartCount and state.
Then you will be able to format i... |
<p>Often there is more than one search result returned from <code>/</code> filter command which is confirm by pressing <code>Enter</code>. Then I can navigate the results, but have no way to filter based on data displayed e.g. <strong>Status</strong> or <strong>CPU</strong>.</p>
<p>QUESTION: Is this possible? If so, wh... | <p>I don't think it's possible to filter search result, but you can sort them, which can be helpful in most cases. For example:</p>
<ul>
<li>SHIFT+C sorts by CPU</li>
<li>SHIFT+M sorts by MEMORY</li>
<li>SHIFT+S sorts by STATUS</li>
<li>...</li>
</ul>
|
<p>I wonder the difference between kube-proxy and cni.</p>
<ol>
<li><p>Does calico also use iptables to set policies? In this case, the role overlaps with the kube-proxy, what's the difference between the two?</p>
</li>
<li><p>Why kube-proxy disable for Calico eBPF mode?
Since kube-proxy uses iptables, do you disable k... | <ol>
<li><p>Calico defaults to using iptables to set network policies. Calico iptables chains/rules sit along side and integrate with the kube-proxy rules (when kube-proxy is in iptables mode).</p>
</li>
<li><p>The BPF code Calico implements intercepts the packets before the kube-proxy iptables rules are able to. You d... |
<p>I was using Docker Desktop on my Mac for a long time. Currently Docker desktop causing a huge issues related to starting up. Everytime <a href="https://stackoverflow.com/questions/69552636/cannot-launch-docker-desktop-for-mac/71861493#71861493">it needs some tweak</a> to run or uninstall and install it again, that t... | <p>After posting the question on StackOverflow I was non stop searching for a solution. Finally it took a day to fixed it (for me). While searching on google <a href="https://github.com/nektos/act/issues/1051#issuecomment-1070599087" rel="noreferrer">I have found a solution in this link</a>.</p>
<p>Basically <code>Coli... |
<p>I have an EKS deployment with a service account with policy and role that enable access to S3.</p>
<p>This works well for root account in the container. The container can execute <code>aws s3 cp ...</code> with no issue.</p>
<p>The problem is that another user cannot. It gets <code>AccessDenied</code> from the S3 se... | <p>You can check out the reference for how IAM roles for service accounts work in k8s <a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html#pod-configuration" rel="nofollow noreferrer">here</a>.<br />
In short, in order to allow another user to use the IAM role... |
<p>There are two kubelet nodes and each kubelet node contains several containers including server with wildfly. Even though I do not define containerPort <> hostPort, the management console can be reached with port 9990 from outside. I do not have any clue, why?</p>
<pre><code>- name: server
image: registry/ser... | <p>You can expose the port in two places, when you run the container, and when you build the image. Typically you only do the latter since exposing the port is documentation of what ports are likely listening for connections inside the container (it doesn't have any affect on networking).</p>
<p>To see if the port was ... |
<p>I am following this AWS guide: <a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-alb-ingress-controller-fargate/" rel="nofollow noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/eks-alb-ingress-controller-fargate/</a> to setup my kubernetes cluster under ALB.</p>
<p>After installin... | <p>the security group solved me:</p>
<pre><code>node_security_group_additional_rules = {
ingress_allow_access_from_control_plane = {
type = "ingress"
protocol = "tcp"
from_port = 9443
to_port ... |
<p>When defining the Taints & Tolerations, we defined the Taint as below:</p>
<pre><code>kubectl taint nodes node1 key1=value1:NoSchedule
</code></pre>
<p>Now any pod that does not have toleration defined as below will not be scheduled on node1. And the one that has toleration defined, gets scheduled on this node. ... | <blockquote>
<p>What impact does it have if:</p>
<ol>
<li>The node effect is NoSchedule</li>
</ol>
<p>kubectl taint nodes node1 key1=value1:NoSchedule</p>
<ol start="2">
<li>But the POD toleration is NoExecute</li>
</ol>
</blockquote>
<p>Pod will not be schedule on the node where it failed to tolerate, eg. your sample ... |
<p>I am trying to figure out how to enable the proxy protocol header in GKE.</p>
<p>Usually, you can do it with gcloud:</p>
<pre><code>gcloud compute target-ssl-proxies update my-ssl-lb-target-proxy \
--proxy-header=PROXY_V1
</code></pre>
<p><a href="https://cloud.google.com/load-balancing/docs/tcp/setting-up-tcp#u... | <p>When you create a Service of type "LoadBalancer" in GKE, it uses a <a href="https://cloud.google.com/load-balancing/docs/network" rel="nofollow noreferrer">Network Load Balancer</a> for external services and an <a href="https://cloud.google.com/load-balancing/docs/internal" rel="nofollow noreferrer">Intern... |
<p>In a namespace <code>foo</code> there is an existing pod running</p>
<pre><code>$ kubectl get pods -n foo
NAME READY STATUS RESTARTS AGE
hello-1816639685-xejyk 1/1 Running 0 6d3h
</code></pre>
<p>How can we duplicate the <code>hello</code> pod so that we can try out... | <p>You can get the pod manifest using YAML output from kubectl and create a new pod based on that specification.</p>
<p>For example</p>
<p><code>kubectl get pod hello-1816639685-xejyk -n foo -o yaml</code></p>
<p>You need to use a different name or namespace, since the name must be unique.</p>
|
<p>i'm working on a continuous deployment routine for a kubernetes application: everytime i push a git tag, a github action is activated which calls <code>kubectl apply -f kubernetes</code> to apply a bunch of yaml kubernetes definitions</p>
<p>let's say i add yaml for a new service, and deploy it -- kubectl will add ... | <p>Before deleting the yaml file, you can run <code>kubectl delete -f file.yaml</code>, this way all the resources created by this file will be deleted.</p>
<hr />
<p>However, what you are looking for, is achieving the desired state using k8s. You can do this by using tools like <a href="https://github.com/roboll/helmf... |
<p>I'm trying to run a tomcat container in K8S with a non-root user, to do so I set User 'tomcat' with the appropriate permission in Docker Image. I have a startup script that creates a directory in /opt/var/logs (during container startup) and also starts tomcat service.</p>
<pre><code>#steps in Dockerfile
#adding tomc... | <p>you need to run an initcontainer that will execute chmod 777 on the mounted volume to to be able to use the volume in a container with a non root user</p>
<p>this can be easily done by creating an init container from an alpine image</p>
<p>you can face this problem when trying to use longhorn as your storage class</... |
<p>I have installed microk8s on my centos 8 operating system.</p>
<pre><code>kube-system coredns-7f9c69c78c-lxm7c 0/1 Running 1 18m
kube-system calico-node-thhp8 1/1 Running 1 68m
kube-system calico-kube-controllers-f7868dd95-dpsnl ... | <p>Have you tried updating the microk8s version?</p>
|
<p>So we are using Loki/Grafana to collect logs from our Kubernetes cluster, and the tool is great for that. But now that I have cleaned up the logs, I would also like to visualize them!</p>
<ol>
<li><p>My logs
<a href="https://i.stack.imgur.com/muDOL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m... | <p>As suggested by @Witt, it is possible to transform the JSON by applying a transformation.</p>
<p>If I choose the <strong>Transform</strong> pane and extract fields, I now get the JSON keys as columns in the Table view.</p>
<p><a href="https://i.stack.imgur.com/dcNXq.png" rel="nofollow noreferrer"><img src="https://i... |
<p>When deploying my operator bundle using OLM I get the following error:</p>
<pre><code>level=error msg="File with size ... exceeded 1048576 limit, aborting" file=/bundle/manifests/crd.yaml
Error: error loading manifests from directory: file crd.yaml bigger than total allowed limit
Usage:
opm alpha bundle ... | <p>Bundles have a size limitation because their manifests are used to create a configMap, and the Kubernetes API does not allow configMaps larger than <code>~1MB</code>. Beginning with OLM version <code>v0.19.0</code> and OPM <code>1.17.5</code>, these values are now compressed using <code>Gzip</code> and then encoded ... |
<p>I've been studying Kubernetes' main features for days, I understood many things, really I did. But I found nowhere the answer to this question: how does Kubernetes balance requests among cluster's nodes?</p>
<p>Well, I mean, suppose an on premise private Kubernetes cluster: LoadBalancer type actually makes a service... | <p>If you don't have something in place that does load balancing externally (f.e. istio) all your mentioned options boil down to getting tcp connections into the cluster.</p>
<p>Inside the cluster a ClusterIP is the real concept for load balancing: All Pods that are assigned to a Service with a ClusterIP will be used (... |
<p>I have written custom golang kong plugin called <code>go-wait</code> following the example from the github repo <a href="https://github.com/redhwannacef/youtube-tutorials/tree/main/kong-gateway-custom-plugin" rel="nofollow noreferrer">https://github.com/redhwannacef/youtube-tutorials/tree/main/kong-gateway-custom-pl... | <p>Update: Found the answer I was looking for, along with setting the environment variables generated by the image, there's modifications in the <code>_helpers.tpl</code> file of the kong helm chart itself.
The reason is that in the deployment charts, the configuration expects plugins to be configured in values-custom.... |
<p>Our EKS cluster is terraform managed and was specified with EC2 Launch Template as terraform resource. Our aws_eks_node_group includes Launch template section as shown below.</p>
<pre><code>resource "aws_eks_node_group" eks_node_group" {
.........................
..........................
launch_te... | <ol>
<li></li>
</ol>
<blockquote>
<p>The Amazon EKS API creates this launch template either by <strong>copying</strong> one you provide or by creating one automatically with default values in your account.</p>
</blockquote>
<ol start="2">
<li></li>
</ol>
<blockquote>
<p>We don't recommend that you modify auto-generated... |
<p>I'm new to kubernetes and nginx, and am having trouble understanding how to implement Ingress (nginx-ingress) for my particular use case.</p>
<p>I want to expose the pgadmin PostgreSQL admin tool from my cluster.</p>
<p>I have other applications exposed via nginx-ingress from my cluster and I like each to hang off i... | <p>Had same kind of requirement for me, solved it by adding <code>X-Script-Name</code> in annotations</p>
<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header X-Script-Name /pgadmin;
</code></pre>
<p>The full Ingress file looks like mentioned below.</p>
<p>Note: This is my test enviro... |
<p>I am trying to do an upgrade to a CRD in Kubernetes for Apache Flink.</p>
<p>Below are the Events in the HelmRelease. I am trying to upgrade the flink-operator from v0.1.0 to v1.0.0. I am also using FluxCD which has been configured to create and/or replace CRDs. Flux is attempting to do this correctly but the Kubern... | <p>You are correct, unfortunately we simply do not support this graceful upgrade path between 0.1.0 and 1.0.0.</p>
<p>The process is documented here: <a href="https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/operations/upgrade/#upgrading-from-v1alpha1---v1beta1" rel="nofollow noreferrer">http... |
<p>Has anyone been able to get Apache ignite to work with Istio on Kubernetes.
I have Apache Ignite client and server pod communication working successfully on Kubernetes but once envoy sidecar is injected we get the following error:</p>
<pre class="lang-text prettyprint-override"><code>Caused by: org.apache.ignite.spi... | <p>A workaround is to add annotation to the deployment</p>
<pre><code> traffic.sidecar.istio.io/excludeInboundPorts: "47100,47500"
traffic.sidecar.istio.io/excludeOutboundPorts: "47100,47500"
</code></pre>
|
<p>I'm trying to improve my knowledge in GCP-GKE as a newbie and in the way to do that, I found out a little concept that I don't quite understand yet. In GKE, there is a <strong>Service Account</strong> called <code>service-PROJECT_NUM@container-engine-robot.iam.gserviceaccount.com</code> (where the <code>PROJECT_NUM<... | <p><a href="https://cloud.google.com/iam/docs/service-accounts" rel="nofollow noreferrer">Service Accounts</a> aka "robots" contrast with user ("human") accounts and represent two forms of Google identity.</p>
<blockquote>
<p><strong>NOTE</strong> Robots was the original name for Service Accounts an... |
<p>I have the following in <code>main.tf</code></p>
<pre><code>data "kubectl_path_documents" "yaml-files" {
pattern = "${path.module}/manifests/*.yaml"
}
resource "kubectl_manifest" "yaml-manifests" {
for_each = toset(data.kubectl_path_documents.yaml-files.documen... | <p>I was able to resolve this using a null_resource that executes a sh script with values to be sed'ed.</p>
|
<p>I am using kubernetes to deploy a postgresql pod.</p>
<p>My k8s manifest for that works nicely. I only paste the relevant code below:</p>
<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql
spec:
...
template:
...
spec:
containers:
- name: postgresql
image: pos... | <ul>
<li>I created simple Dockerfile to examine "VOLUME" instruction in Dockerfile as below :</li>
</ul>
<pre><code>[root@machine stack]# cat Dockerfile
FROM busybox
VOLUME /insidecontiner
RUN echo "writing From Container" >> /insidecontiner/file
CMD sleep 1000
[root@machine stack]# docker bu... |
<p>the configmap.yaml</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "test.fullname" . }}-config-map
data:
brokerConf: |
{{ .Values.configmap }}
</code></pre>
<p>the below values.yaml is right.</p>
<pre><code>configmap: |
key=values
</code></pre>
<p>but the values.yaml is... | <p>You may update the <code>configmap</code> as below:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: config-map
data:
brokerConf:
{{ .Values.configmap| indent 4|trim }}
</code></pre>
<p>The error is caused because the 2nd line in <code>data.brokerConf</code> is not indented properly. Something l... |
<p>I am trying to delete a namespace but it is in terminating state, I tried removing the finalizer and applying replace but not able to succeed. Below are the steps and error</p>
<pre><code>[root@~]# kubectl replace "/api/v1/namespaces/service-catalog/finalize" -f n.json
namespace/service-catalog replaced
[root@~]#
[... | <p>I was looking for all the finalizers that were used in our cluster and this worked for me. It checks for all types of objects in all namespaces and returns their finalizers -- you can probably use awk and grep to filter it out for what you're looking for</p>
<p><code>kubectl get all -o custom-columns=Kind:.kind,Nam... |
<p>I am attempting to install my first kubernetes cluster on Ubuntu 22.04 server. I'm following the instructions given at this link (<a href="https://www.cloudsigma.com/how-to-install-and-use-kubernetes-on-ubuntu-20-04/" rel="nofollow noreferrer">https://www.cloudsigma.com/how-to-install-and-use-kubernetes-on-ubuntu-2... | <p>It appears that the "default" install of "containerd" (current version 1.6.6 as of today) from the Ubuntu "Jammy" repository does not create a config file (/etc/containerd/config.toml) that functions properly. Even removing the "disabled_plugins = ..." entry (i.e. everything ... |
<p>Hi All I'm working on designing a Kubernetes sidecar / Adapter pattern for the Spring Boot Application to export Prometheus metrics, I am aware that we can use maven dependency
<code>io.micrometer:micrometer-registry-prometheus</code> to expose Prometheus metrics directly. However, with my limited knowledge, I got t... | <p>One way of accomplishing this is using a solution such as Open-Telemetry. You can choose to auto-instrument your application using OTEL agents and corresponding collectors (that run as a side-car application)</p>
<p>An example of this for the Java Petstore is here : <a href="https://signoz.io/blog/opentelemetry-spri... |
<p>I downloaded Kubernetes for integration with Jenkins and created a Serviceaccount, but the secret is not automatically created.</p>
<p>In the past, I remember that a Secret was automatically created and the Token was mounted when Serviceaccount was created.</p>
<p>How can I automatically create a Secret as before?</... | <p>As mentioned by @P.... In kubernetes version 1.24 this behaviour has been changed, the <strong>LegacyServiceAccountTokenNoAutoGeneration</strong> feature gate is enabled by default in 1.24.</p>
<p>New secrets containing service account tokens are no longer auto-generated and are not automatically ambient in secrets ... |
<p>Im trying to get <code>RAW</code> data from operator CR and im getting an <strong>empty object</strong> . (all others value are working as expected )
I’ve created a <strong>minimal example</strong> for the issue, in the example im trying to read the <code>infrastructureConfig</code> object</p>
<p><strong>The tricky ... | <p>Currently, you can only put the <code>// +kubebuilder:pruning:PreserveUnknownFields</code> on the <code>Provider v1beta1.Provider</code>, which means all sub fields in it will be allowed with additional unknown fields.</p>
<p>The good news is, your problem will be solved after <a href="https://github.com/kubernetes-... |
<p>I’m doing some <code>chaos testing</code> in <code>K8s</code>. My platform use <code>Istio envoy sidecar</code>, and as some use case of my chaos scenarios, I would like to stop/kill a envoy proxy without kill the service container, and see what is the standard behavior.</p>
<p>So far I don’t manage to figure how to... | <p>Use the /quitquitquit endpoint:</p>
<p><a href="https://www.envoyproxy.io/docs/envoy/latest/operations/admin#post--quitquitquit" rel="nofollow noreferrer">https://www.envoyproxy.io/docs/envoy/latest/operations/admin#post--quitquitquit</a></p>
<p>curl -sf -XPOST <a href="http://127.0.0.1:15020/quitquitquit" rel="nofo... |
<p><strong>Requirement</strong> : With private GKE ( version : <strong>1.21.11-gke.1100</strong> ), each pod is required to have a dedicated public IP as source IP when reaching to internet. It is not required for ingress but only for egress.</p>
<p><strong>Solution tried</strong> : Cloud NAT. Works partially. Meaning,... | <p>You can create the <strong>NAT gateway instance</strong> and forward the traffic from there.</p>
<p>Here terraform script to create : <a href="https://github.com/GoogleCloudPlatform/terraform-google-nat-gateway/tree/master/examples" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/terraform-google-na... |
<p>I know how to list of pods for certain namespace as follows:</p>
<pre><code>kubectl get pods -n mynamespace
</code></pre>
<p>There is one <code>POD</code> on the list which i am interested. I would like to be able to see what <code>yaml</code> deployment file was used for creation of that pod and the content of it. ... | <p>To get the deployment used to generate a pod, have to look at the pod yaml or describe the pod:</p>
<pre><code>kubectl get pod -n {namespace} {pod-name} -o yaml
</code></pre>
<p>Look for the "<code>ownerReferences</code>" section. This will tell you what "owns" the pod. This will likely be a Repl... |
<p>I'm creating multiple ingress controller in different namespaces. Initially, it's creating a load balancer in AWS and attached pod IP addresses to target groups. After some days it is not updating the new pod IP to the target group. I've attached the ingress controller logs here.</p>
<pre><code>E0712 15:02:30.516295... | <p>I have had an issue like that on <strong>AKS</strong>. I have two Nginx Ingress Controllers:</p>
<ol>
<li>external-nginx-ingress</li>
<li>internal-nginx-ingress</li>
</ol>
<p>Only one worked at a time, Internal or external.</p>
<p>After specifying a unique <strong><code>election-id</code></strong> for each one the p... |
<p>When learning the Kubernetes CNI, I heard some plugins are using the BGP or VXLAN under the hood.</p>
<p>On the internet, border gateway protocol (BGP) manages how packets are routed between edge routers.</p>
<p><strong>Autonomous systems (AS)</strong> are network routers managed by a single enterprise or service pr... | <p>The CNI plugin is responsible for allocating IP addresses (IPAM) and ensuring that packets get where they need to get.</p>
<p>For Calico specifically, you can get a lot of information from the <a href="https://projectcalico.docs.tigera.io/reference/architecture/overview#ipam-plugin" rel="nofollow noreferrer">archite... |
<p>I am trying to access an external postgres from my pod. The problem is that in order to do this, I need to allow in the external database <code>pg_hba.conf</code> the "host address"/ "IP" of the pod. It is clear that I can temporarily use the address of the node, e.g. someNode.online-server.cloud... | <p>It's <a href="https://www.postgresql.org/docs/current/auth-pg-hba-conf.html" rel="nofollow noreferrer">documented</a> that the address field can be a CIDR.</p>
<blockquote>
<p>Specifies the client machine address(es) that this record matches. This field can contain either a host name, an IP address range, or one of ... |
<p>Assuming I have this values.yaml under my helm chart -</p>
<pre class="lang-yaml prettyprint-override"><code>tasks:
- name: test-production-dev
env:
- production
- dev
- name: test-dev
env:
- dev
- name: test-all
environment_variables:
STAGE: dev
</code></pre>
<p>I would like to ru... | <p>values.yaml</p>
<pre class="lang-yaml prettyprint-override"><code>tasks:
- name: test-production-dev
env:
- production
- dev
- name: test-dev
env:
- dev
- name: test-all
- name: test-production
env:
- production
environment_variables:
STAGE: dev
</code></pre>
<p>templat... |
<p>I am getting an unfamiliar error that is keeping my k8s cluster from starting when I run <code>skaffold dev</code>.</p>
<blockquote>
<p>➜ ticketing git:(master) ✗ kubectl logs client-depl-d86b58456-tv8l2</p>
<blockquote>
<p>client@1.0.0 dev
next</p>
</blockquote>
<p>Browserslist: caniuse-lite is outdated. Please ru... | <p>I had to go inside the <code>package.json</code> file of my frontend client application and change the start script to <code>NODE_OPTIONS=--openssl-legacy-provider next dev</code></p>
<p>Error was documented here:</p>
<p><a href="https://github.com/nodejs/node/issues/40455" rel="nofollow noreferrer">https://github.c... |
<p>I have 2 Springboot microservices, one is the Eureka server and the other one is the Gateway.</p>
<p>I can't find the right configuration to make the Gateway register to the Eureka server.</p>
<p>This is the <code>eureka.yml</code> with the K8s configuration:</p>
<p><strong>Eureka.yml</strong></p>
<pre><code>apiVers... | <p>I resolved by modifying the Gateway.application.yml in this way:</p>
<pre><code>eureka:
instance:
preferIpAddress: true
hostname: eureka-0
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://eureka-0.eureka:8761/eureka/
</code></pre>
<p>EDIT:</p>
<p>I'm ... |
<p>How can I rewrite an URI in a VirtualService but just internally? In other words:</p>
<ol>
<li>A client requests api.example.com/users/get/87</li>
<li>IngressGateway receives the request and translates it to api.example.com/get/87 to the "users" pod. The pod's web server doesn't "know" the URL &q... | <p>URL rewrite - Browser URL will not be changed to redirect URL. For ex: "http://xx.xx.xx.xx:8080/api/v1/products" is the url which has been requested in browser. And in virtual service if you use rewrite: uri: /productpage. In this case the browser url will still remain "http://xx.xx.xx.xx:8080/api/v... |
<p>Im using bitnami helm chart for keycloak. and trying to achieve High availability with 3 keycloak replics, using DNS ping.</p>
<pre><code>Chart version: 5.2.8
Image version: 15.1.1-debian-10-r10
Helm repo: https://charts.bitnami.com/bitnami -> bitnami/keycloak
</code></pre>
<p>The modified parameters of values.y... | <p>One common scenario that may lead to such a situation is when the node that issued the access code is not the one who has received the <em>code to token</em> request. So the client gets the access code from node 1 but the second request reaches node 2 and the value is not yet in this node's cache. The safest approac... |
<p>We are running a pod in Kubernetes that needs to load a file during runtime. This file has the following properties:</p>
<ul>
<li>It is known at build time</li>
<li>It should be mounted read-only by multiple pods (the same kind)</li>
<li>It might change (externally to the cluster) and needs to be updated</li>
<li>Fo... | <p>You need to use a shared filesystem that supports Read/Write Multiple Pods.
Here is a link to the CSI Drivers which can be used with Kubernetes and provide those access:
<a href="https://kubernetes-csi.github.io/docs/drivers.html" rel="nofollow noreferrer">https://kubernetes-csi.github.io/docs/drivers.html</a></p>
<... |
<p>I have Standard GKE cluster and want to migrate all my running services to new Autopilot cluster. I research official documentation and don't find anything how I can perform this migration</p>
| <p>At the moment this operation is not possible to convert Standard GKE cluster to Autopilot GKE .</p>
<p>In GKE Documentation <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview" rel="nofollow noreferrer">Autopilot overview</a> under Other limitations you can find section <a href="http... |
<p>In Azure Kubernetes Service, I am trying to setup Locust load test, as of now locust test contains 1 master and 2 slave pods. With default dnspolicy provided by kubernetes, Slave pods able to establish connection with master pod, which I had confirmed in locust webpage. But to run locust test successfully slave pods... | <p>It was not the issue with kubernetes, I was able to establish connection between master and slave with the help of this link <a href="http://www.github.com/locustio/locust/issues/294" rel="nofollow noreferrer">www.github.com/locustio/locust/issues/294</a>. What was missing was a env variable so I added these env var... |
<p>After an unexpected power failure, the mongodb service I deployed on k8s could not be restarted normally. The log of mongodb showed that there was a problem with its data and could not be started.</p>
<p>I did not record the specific error log.</p>
| <p>Here is my fix:</p>
<h2>First</h2>
<p>change k8s deployment.yaml config.</p>
<p>Because we want to repair the data file of mongodb, the first step is to make the mongo pod run, we run the command in the pod.</p>
<p>Now change the startup command of the container:</p>
<pre class="lang-yaml prettyprint-override"><code... |
<p>I added this in my values.yaml expecting the serviceAccount to be created when I do the helm install but that did not work, am I missing something ?</p>
<ul>
<li>helm version v3.9.0</li>
<li>kubernetes version v1.24.0</li>
</ul>
<pre><code>serviceAccount:
# Specifies whether a service account should be created
c... | <p>Thanks for the help, I ended up putting this file in the templates directory so it gets processed as you mentioned, I used helm lookup to check if the ServiceAccount is there or not so the first helm install does the installation (<a href="https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#using-the-... |
<p>We are developing a simulation software which is deployed and scaled between multiple pods using kubernetes.
When a user makes a simulation request, a pod is selected which starts doing the job and is considered as busy.
When another user makes a simulation request, it should be routed to the next free pod.
Currentl... | <p>Another solution to the one suggested in above answer is to make use of Headless Service and some reverse-proxy/load balancer like HAProxy(I used it).</p>
<p>So you can have a headless service or change the existing service which is exposing your pods like below. It is the configuration <strong>clusterIP:None</stro... |
<p>So I wanted to fetch logs from a specific namespace and send them to opensearch, so I didn't get a clue so I decided to try to make it like this:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
labels:
k8s-app: fluentd-logging
name: simple-fluentd-configmap
namespace: fluent-log
data:
fluent.conf... | <p>The second match clause in your configuration (the one starting with <code>kubernetes.var.log...</code>) should contain the namespace, and therefore you can filter based on specific namespaces and decide how to handle those specific logs.</p>
<p>If, for any reason, the log path in your cluster does not contain the n... |
<p>I've built an application through Docker with a docker-compose.yml file and I'm now trying to convert it into deployment file for K8S.</p>
<p>I tried to use <code>kompose convert</code> command but it seems to work weirdly.</p>
<p>Here is my docker-compose.yml:</p>
<pre><code>version: "3"
services:
work... | <p>I'd recommend using Kompose as a starting point or inspiration more than an end-to-end solution. It does have some real limitations and it's hard to correct those without understanding Kubernetes's deployment model.</p>
<p>I would clean up your <code>docker-compose.yml</code> file before you start. You have <code>... |
<p>I am trying to deploy WSO2 API Manager Operator on AWS EKS cluster following the doc [https://github.com/wso2/k8s-wso2am-operator][1]</p>
<p>But When I execute the command: <strong>kubectl apply -f scenarios/scenario-1/</strong></p>
<p>I get the error: <strong>unable to recognize "scenarios\scenario-1\2-custom-... | <p>This indicates that the CRDs are not deployed. Did you install the CRDs as explained <a href="https://apim.docs.wso2.com/en/latest/install-and-setup/setup/kubernetes-operators/k8s-api-operator/install/" rel="nofollow noreferrer">here</a>? The repo you are referring seems to be for APIM operator to deploy APIM. Rther... |
<p>I have an init container that do some stuff that needs for the main container to run correctly, like creating some directories and a liveness probe that may fail if one of these directories were deleted. When the pod is restarted due to fail of liveness probe I expect that init container is also being restarted, but... | <p>The restart number refers to <strong>container</strong> restarts, not <strong>pod</strong> restarts.</p>
<p>init container need to run only once in a pos lifetime, and you need to design your containers like that, you can read this <a href="https://github.com/kubernetes/community/pull/2342" rel="nofollow noreferrer"... |
<p>What is the best way to authenticate to a GKE cluster without actually setting env variables for GOOGLE_APPLICATION_CREDENTIALS or KUBECONFIG. I have an application running on a container which has to communicate with multiple GKE clusters at once. Hence I am trying to generate the kubeconfig yaml file on the fly li... | <p>I ended up using oauth2 to generate a token and inpute that value in the kubeconfig token.</p>
<p>Sample code to extract the token</p>
<pre><code>
func getGKEToken(creds []byte, ctx context.Context) (string, error){
var token *oauth2.Token
scopes := []string{"https://www.googleapis.com/auth/cloud-platfo... |
<p>I've deployed Prometheus, Alertmanager, Grafana et cetera in the <code>cattle-monitoring-system</code> namespace using the rancher-monitoring Helm chart. Look <a href="https://github.com/rancher/charts/tree/release-v2.5/charts/rancher-monitoring" rel="nofollow noreferrer">here</a> and <a href="https://rancher.com/do... | <p><a href="https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md#:%7E:text=The%20Prometheus%20resource%20declaratively%20describes,of%20ServiceMonitors%20to%20be%20used." rel="nofollow noreferrer">Thanks to this documentation</a> I managed to fix this issue. ... |
<p>I am trying to deploy WSO2 API Manager Operator on AWS EKS cluster following the doc [https://github.com/wso2/k8s-wso2am-operator][1]</p>
<p>But When I execute the command: <strong>kubectl apply -f scenarios/scenario-1/</strong></p>
<p>I get the error: <strong>unable to recognize "scenarios\scenario-1\2-custom-... | <p>wso2am-operator is not tested in newer kubernetes versions (1.20+). Some of the kubernetes APIs used were deprecated even in previous versions and removed in v1.22[1]. Those include <code>rbac.authorization.k8s.io/v1beta1</code> and <code>apiextensions.k8s.io/v1beta1</code>. The error you are seeing is because the c... |
<p>Error starting tunneling of service.</p>
<p>OS: mac os<br />
minikube version: v1.25.2<br />
kubectl version: 1.24.1.</p>
<p>and using docker desktop</p>
<p>The following script is the configuration of the <code>/zipkin</code> directory.</p>
<pre><code># service.yaml
apiVersion: v1
kind: Service
metadata:
name: zi... | <p>I too had the same issue but then figured out from minikube documentation: <a href="https://minikube.sigs.k8s.io/docs/handbook/accessing/#example-of-nodeport" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/accessing/#example-of-nodeport</a></p>
<p>In one terminal do this:</p>
<pre><code>minikub... |
<p>I haven't used kubectl in about two months. It was working well in June but now I get the following error:</p>
<pre><code>$ kubectl
fatal error: runtime: bsdthread_register error
runtime stack:
runtime.throw(0x2cb65a5, 0x21)
/usr/local/go/src/runtime/panic.go:596 +0x95 fp=0x7fff5fbff810 sp=0x7fff5fbff7f0
runt... | <p>The problem is caused by a library change for system calls in MacOS 12. Older binaries use an old library which isn't supported anymore.</p>
<p>Update your kubectl to a new version. This should fix it.</p>
<p>If you can't update because you need an older version (e.g. because of api changes) you can build the needed... |
<p>Traefik allows to specify a middleware to authenticate each request using <code>forwardAuth</code>, in the documentation it specifies to use an external provider.</p>
<pre class="lang-yaml prettyprint-override"><code># Forward authentication to example.com
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
me... | <p>I used K8 Fully Qualified Domain Name as the address for this to work:</p>
<p><code>service-name.namespace.svc.cluster.local</code>.</p>
|
<p>I'm testing <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-gateways" rel="nofollow noreferrer">Gateway API</a> with GKE (version 1.21.11-gke.1100). I'm using <code>gatewayClassName: gke-l7-rilb</code> for a Gateway with TLS between the client and the gateway. HTTPS is working perfectly be... | <p>I found a solution which I think of as a workaround.</p>
<ol>
<li><p>Use <code>networking.gke.io/app-protocols: '{"web":"HTTPS"}'</code> annotation rather than <code>cloud.google.com/app-protocols: '{"web":"HTTPS"}'</code>. This annotation is to use at service level, where <c... |
<p>I am trying to access my microservice "externalforum-api-svc" inside my kubernetes cluster using ocelot gateway. I`ve followed the docs but it does not seem to be working.</p>
<p>Can someone please tell me whats wrong with it?</p>
<p>I want to deploy the ocelot api gateway as clusterIP and use Ingress to a... | <p>In my case error was different and it could not map proper pod. So you can map manually</p>
<pre><code>{
"Routes": [
{
"DownstreamPathTemplate": "/api/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndP... |
<p>I have many FastApi apps that are running in kubernetes. All of them are using some common kubernetes functionalities like liveness and readiness probe, discovering neighbour pods using ordinals(This is my next challenge). There are some logic in code that I need to implement but in general many parts of the code st... | <p>What specific feature of K8S do you want to implement in your FastAPI apps? Liveness- and readiness endpoints are easy (as in, they are endpoints you can define in FastAPI and then declare them in your YAML definition of your pod).</p>
<p>My understanding is, you want pods in a StatefulSet to communicate with each o... |
<p>The timezone did not meet my expectations When i use <code>kubectl logs <mypod> --timestamps</code> to get the pod log.</p>
<p>current output:</p>
<pre class="lang-bash prettyprint-override"><code>2022-06-15T07:31:41.826543867Z 2022/06/15 15:31:41 [info] Start grpc server listen 58212 port.
2022-06-15T07:31:41... | <p><code>kubectl</code> does not support this directly at the time of writing this and it tricky to do this in a portable way. On Linux something like this would work:</p>
<pre><code>kubectl logs --timestamps mypod | while read timestamp line; do \
echo "$(env TZ="EST" date -d "$timestamp" '+... |
<p>We are in the process of migrating our Service Fabric services to Kubernetes. Most of them were "stateless" services and were easy to migrate. However, we have one "stateful" service that uses SF's Reliable Collections pretty heavily.</p>
<p>K8s has Statefulsets, but that's not really comparable ... | <p>AFAIK this cannot be done by using a .Net library.
K8 is all about orchestration. SF on the other hand is both an orchestrator + rich programming /application model + state management.
If you want to do something like reliable collection in K8 then you have to either</p>
<p>A) built your own replication solution wit... |
<p>Im new to helm. While installing a helm chart I had to update its dependency, post which Im unable to install the helm chart.</p>
<p>These are the steps that I have followed:</p>
<ol>
<li>Downloaded the helm chart using</li>
</ol>
<pre><code>helm pull codecentric/keycloak --version 18.1.1 --untar
</code></pre>
<ol s... | <p>it seems that the statefulset template in the keycloak chart includes a function from the postgresql chart when its deployment is enabled. since you replaced the postgresql chart with the postgresql-ha chart, the function cannot be included (probably because the function doesn't exist in the postgresql-ha chart) and... |
<p>We have the below directory structure on the Linux system.</p>
<pre><code> /root
├─dirA
│ ├─main.tf
│ ├─terraform.tfvars
│ └─variables.tf
└─dirB
└─main.tf
</code></pre>
<p><strong>==FIRST==</strong></p>
<p>We used the below snippet in <code>main.tf</code> file of <code>dirA</code> to create a... | <p>We have solved both the issues with the setup below.</p>
<p>File <strong>dirA/main.tf</strong> contains something similar to</p>
<pre><code>resource "local_file" "kubeconfig" {
content = module.gke_auth.kubeconfig_raw
filename = "${path.module}/kubeconfig"
}
output "kubeconfi... |
<p>I am learning kubernetes and minikube, and I am following this tutorial:</p>
<p><a href="https://minikube.sigs.k8s.io/docs/handbook/accessing/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/accessing/</a></p>
<p>But I am running into a problem, I am not able to load the exposed service. Here a... | <p>Please use <code>minikube ip</code> command to get the IP of minikube and then use port number with it.</p>
<p>Also, refer below link:</p>
<p><a href="https://minikube.sigs.k8s.io/docs/handbook/accessing/#:%7E:text=minikube%20tunnel%20runs%20as%20a,on%20the%20host%20operating%20system" rel="nofollow noreferrer">http... |
<p>When I type <code>kubectl log pod/yourpod</code> to get my pod's logs, behind the scene, k8s must read the log from somewhere in my pod.</p>
<p>What's the default path to the log generated by my container?
How to change the path?</p>
<p>Inside my container, my process uses <code>sigs.k8s.io/controller-runtime/pkg/lo... | <p>It is the console output (stdout / stderr) that is captured by the container runtime and made available by the kubelet running on the node to the API server.</p>
<p>So there is not real log file, though the container runtime usually has a means of buffering the logs to the file system.</p>
|
<p>I am deploying authelia with their helm chart <a href="https://artifacthub.io/packages/helm/truecharts/authelia" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/truecharts/authelia</a>.</p>
<p>I need to mount a ConfigMap to a specific file in the authelia container, however this is not available as a ... | <p>I would say you could try to use <code>kubectl patch</code> to mount the ConfigMap to the authelia container afterwards. <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/" rel="nofollow noreferrer">Look here</a> for more information.</p>
<p>So create a <code>.yml</c... |
<p>I am using DSBulk to unload data into CSV from a DSE cluster installed under Kubernetes, My cluster consists of 9 Kubernetes Pods each with 120 GB Ram.</p>
<p>I have monitored the resources while unloading the data and observed that the more the data is fetched in CSV the more the ram is getting utilised and pods ar... | <p>After a lot of Trial and Error, we found out the problem was with Kubernetes Cassandra pods using the main server's memory size as <strong>Max Direct Memory Size</strong>, rather than using the pods max assigned Ram.</p>
<p>The pods were assigned 120 GB of Ram, but Cassandra on each pod was assigning 185 GB Ram to <... |
<p>I have two helm charts, I need to generate a random password in one of the charts, and I am required to use the same password in the second.</p>
<p>What would be the best practice to achieve this?</p>
<p>Thanks in advance!!</p>
| <p>Generate the password in a known secret name then refer to that secret in the other chart?</p>
|
<pre><code> kubectl cp namespace/podname:/path/target .
</code></pre>
<p>If I use the instructed command from kubernetes guide, it only copies the contents inside the <code>target</code> directory and omits <code>target</code> itself.<br />
I don't want to use <code>mkdir</code> every time I need to copy.<br />
What's ... | <p>I have a pod under <code>default</code> namespace called <code>ubuntu-pod</code> with a file located at root: <code>/decomission.log</code> and I got the same error:</p>
<pre class="lang-yaml prettyprint-override"><code>$ kubectl cp default/ubuntu-pod:/decommission.log decommission.log
tar: Removing leading `/' from... |
<p>I have an architectural question:
We have a Django project made of multiple apps. There is a core app that holds the main models used for the other sets of apps.
Then, we have a couple apps for user facing APIs. Lastly, we have some internal apps and tools used by developers only that are accessible in Admin UI as e... | <p>Django and microservices? Yeah, maybe somewhere in the parallel universe.</p>
<p>Only one thing that I may recommend is to build two identical services like <code>django_container_internal</code> and <code>django_container_production</code>. In this case you will be able to release <code>internal tools</code> withou... |
<p>I have a below pipeline</p>
<pre><code>apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: git-clone-pipeline
spec:
params:
- name: repo-url
type: string
workspaces:
- name: shared-workspace
tasks:
- name: clone-repository
taskRef:
name: git-clone
workspaces:
... | <p>You're using an emptyDir as a workspace. You should use a PVC. You could fix your PipelineRun with something like this:</p>
<pre><code>workspaces:
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
</code></pre>... |
<p>I have a domain at Cloudflare and some wildcards for subdomains</p>
<p><a href="https://i.stack.imgur.com/R46FF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R46FF.png" alt="enter image description here" /></a></p>
<p>which both point to the load balancer of an nginx ingress of a Kubernetes clus... | <p>I can advise you to make some check.</p>
<p>Just set the Proxy status for "echo1.eu3.example.com" as DNS only. Then check the access. If ok - install certificates in kubernetes via cert manager. We faced some times with this issue and resolved by using 3 deep domains. For instance "echo1-eu3.example.c... |
<p>I have a k8s cronjob run my docker image <code>transaction-service</code>.</p>
<p>It starts and gets its job done successfully. When it's over, I expect the pod to terminate but... <code>istio-proxy</code> still lingers there:</p>
<p><a href="https://i.stack.imgur.com/NdnGQ.png" rel="nofollow noreferrer"><img src="h... | <p>You have a few options here:</p>
<ol>
<li>On your job/cronjob spec, add the following lines and your job immediately after:</li>
</ol>
<pre><code>command: ["/bin/bash", "-c"]
args:
- |
trap "curl --max-time 2 -s -f -XPOST http://127.0.0.1:15020/quitquitquit" EXIT
while ! curl -s ... |
<p>I want to show the percentage of the server (or service) uptime in Grafana for the last month.
The monitoring service collects data with Prometheus node exporter.</p>
<pre><code>uptime % = ( up / down ) * 100
</code></pre>
| <p>As <a href="https://stackoverflow.com/users/4653675/marcelo-%C3%81vila-de-oliveira">MarceloÁviladeOliveira</a> said I used Black-Box Exporter with this PromQL :</p>
<pre><code>avg_over_time(probe_success{job="$job",instance=~"$instance"}[30d]) * 100
</code></pre>
|
<p>I have a microservice running in kubernetes with deployment. It is serving a Node JS application with PM2.
I recently found whenever I deploy a new version of application with helm, i can see PM2 is being exited with code [0]</p>
<pre><code>PM2 log: App [api.bundle:0] exited with code [0] via signal [SIGINT]
</code>... | <p><code>...whenever I deploy a new version of application with helm, i can see PM2 is being exited with code [0]</code></p>
<p>When you do <code>helm upgrade</code> the command triggers rolling update to the deployment which replace existing pod(s) with new pod. During this process, <code>signal [SIGINT]</code> was se... |
<p>I'm taking a Kubernetes course and part of the course is trying out minikube. I have minikube and kubectl installed on an Ubuntu 20.04 WSL on Windows 11. When I run <code>minikube dashboard</code> in the Ubuntu terminal the process hangs on <code>Verifying proxy health...</code>. I tried running <code>kubectl proxy<... | <p>For me the same issue was resolved after a restart of the minikube.</p>
<pre><code>minikube stop
<close previously opened dashboard process> - for me ctrl+c in separate terminal, but maybe you'd have to kill it
minikube start
minikube dashboard
</code></pre>
|
<p>I have a k8s service that is behind a load balancer and exposes a <code>/metrics</code> endpoint. However, these metrics are identical for each pod, so there is no need to collect them from each pod - rather, any pod can provide the data. Currently, this results in the same metrics being emitted with only the pod di... | <p>Firstly, let me say that is not neccesarily the case that every pod will return the same metrics; pods might return stats on their CPU utilisation, individual jobqueues, a whole load of pod-specific stuff. If this is your own product and they currently don't; they might in the future. It's certainly useful to be abl... |
<p>I have cronjob where the pod it starts ends up in <code>ImagePullBackOff</code> and the cronjob never scheduled another pod , though it has to per schedule. Is there a way to force the cron controller to schedule another pod even though the previous one ended in ImagePullBackOff.</p>
<p>I don't want multiple pods r... | <p>You don't really want the scheduler to schedule another pod. Doing that would lead to a resource leak as mentioned explained in <a href="https://github.com/kubernetes/kubernetes/issues/76570" rel="nofollow noreferrer">Infinite ImagePullBackOff CronJob results in resource leak</a>, which @VonC mentioned in his answer... |
<p>I have deployed kube-state-metrics into kube-system namespace and in the same cluster we are having prometheus-operator running I've written the below service monitor file for sending metrics to prometheus but it is not working. Please find the files below.</p>
<p>Servicemonitor.yaml</p>
<pre><code>apiVersion: monit... | <p>ServiceMonitor's selector>matchLabels should match with "Service"'s labels. Check if your service has correct label.</p>
|
<p>I am using google container registry (GCR) to push and pull docker images. I have created a deployment in kubernetes with 3 replicas. The deployment will use a docker image pulled from the GCR.</p>
<p>Out of 3 replicas, 2 are pulling the images and running fine.But the third replica is showing the below error and th... | <p><strong>ImagePullBackOff</strong> and <strong>ErrImagePull</strong> indicate that the image used by a container cannot be loaded from the image registry.</p>
<p><a href="https://cloud.google.com/kubernetes-engine/docs/troubleshooting#401_unauthorized_cannot_pull_images_from_private_container_registry_repository" rel... |
<p>How do you change the <code>name</code> of a user in a kube config file with kubectl (no text editor)?</p>
<p>Example kube config file <code>stage_config.yaml</code>:</p>
<pre><code>apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://127.0.0.1:6443
name: cluster.local
c... | <p>Use JQ to do the magic (just make sure your KubeConfig is in JSON).
I'm sure is possible to do it with YQ for YAML but I let someone else fill that one in. Set <code>CLUSTER_NAME</code> to your desired value.</p>
<pre class="lang-bash prettyprint-override"><code>jq '.clusters[0].name="'$CLUSTER_NAME'" | .c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.