prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I have a shared yaml file for multiple pipelines and I would like to parameterize the tag of one of the images in the yaml file.</p>
<p>What would be the simplest way to do this? At the moment I am maintaining multiple <code>KubernetesPods.yaml</code>, such as <code>KubernetesPods-1.5.0.yaml</code> and interpolating... | <p>You can do it using <code>yaml</code> instead of <code>yamlFile</code></p>
<pre><code>pipeline {
agent {
kubernetes {
yaml """
kind: Pod
spec:
containers:
- name: example-image
image: example/image:${params.AGENT_POD_SPEC}
imagePullPolicy: Always
command:
- cat
"&q... |
<p>I'm currently working on a Kubernetes deployment file and I need to set the environment variables that the container will have.</p>
<p>Is there a way to set Kubernetes secrets as environment variables in the deployment file?</p>
<p>Here is a dummy file to help explain:</p>
<p><a href="https://i.stack.imgur.com/mv4Rr... | <p>Yes, of course, you can mount env variables from config maps or secrets with</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata: ...
spec:
...
template:
...
spec:
containers:
- name: app
image: ...
envFrom:
- configMapRef:
name: env-conf... |
<p>I want to add a wireguard sidecar container to prometheus stack installed via helm chart such that I can fetch client connected via vpn. I'm using the helm chart from <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">prometheus-community/ku... | <ol>
<li><p>there is no psp in the newer kube-prometheus-stack. see <a href="https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/README.md" rel="nofollow noreferrer">https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/README.md</a> - search f... |
<p>I am using <code>kube-prometheus-stack</code> and the yaml snippets you see below are part of a <code>PrometheusRule</code> definition.</p>
<p>This is a completely hypothetical scenario, the simplest one I could think of that illustrates my point.</p>
<p>Given this kind of metric:</p>
<pre><code>cpu_usage{job="... | <p>There is currently no way in Prometheus to have this kind of "templating".</p>
<p>The only way to get something near would be to use recording rules that that define the maximum value for the label:</p>
<pre><code>rules:
- record: max_cpu_usage
expr: vector(50)
labels:
must_be_lower_than:"50&q... |
<h1>Background</h1>
<p>I'm installing Elastic Search into my cluster with a helm chart with the following command:</p>
<pre class="lang-bash prettyprint-override"><code>helm -n elasticsearch upgrade --install -f values_elasticsearch.yaml elasticsearch elastic/elasticsearch
</code></pre>
<p>This allows me to override t... | <p>helm subchart is ideal way</p>
<ul>
<li>You can create a helm chart and add the elasticsearch as subchart</li>
<li>You can add required istio yaml files inside your template folder</li>
<li>First you should run <code>helm dep update</code> then run the install/upgrade command</li>
</ul>
|
<p>I want to utilize data from a persistent volume as <code>readOnly</code> inside a container.
What is the difference of setting the <code>readOnly</code> flag under the <code>volumeMounts</code> vs the deployment <code>volumes.persistentVolumeClaim</code>?</p>
<p>The results seems to be the same. Is one of the two re... | <p>In your case, yes, the outcome is the same. But this functionality is not redundant, because the <code>readOnly</code> on a volume and <code>readOnly</code> on a <code>mountPoint</code> have different implications. For example,</p>
<ol>
<li><code>readOnly: true</code> on a <code>volumeMount</code> means that the <co... |
<p><a href="https://i.stack.imgur.com/dLCUi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dLCUi.png" alt="Running Netstat in terminal" /></a>
<a href="https://i.stack.imgur.com/2JQyb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2JQyb.png" alt="Kubectl Version" /></a></p>
<p>I ... | <p>This isn't a kubernetes process. This is a result of installing docker and how it configures itself to <em>enable</em> you to run kubernetes locally. The string "kubernetes" is coming from your <code>hosts</code> file even though you might not have turned on the feature to use k8s.</p>
<p>If you open <code... |
<p>Is it possible to pull private images in Github Container Registry using GITHUB_TOKEN?</p>
<p>If so, what do I need to configure in k8s?</p>
<p>Thanks!</p>
| <p>Yes you can. You will have to create a <code>secret</code> object in your cluster.</p>
<pre><code>kubectl create secret docker-registry ghcr-login-secret --docker-server=https://ghcr.io --docker-username=$YOUR_GITHUB_USERNAME --docker-password=$YOUR_GITHUB_TOKEN --docker-email=$YOUR_EMAIL
</code></pre>
<blockquote>
... |
<p>I am writing a terraform file in GCP to run a stateless application on a GKE, these are the steps I'm trying to get into terraform.</p>
<ol>
<li>Create a service account</li>
<li>Grant roles to the service account</li>
<li>Creating the cluster</li>
<li>Configuring the deployment</li>
</ol>
<pre><code>apiVersion: app... | <p>You can use this script and extend it further to deploy the YAML files with that : <a href="https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples/simple_autopilot_public" rel="nofollow noreferrer">https://github.com/terraform-google-modules/terraform-google-kubernetes-en... |
<p>I have pods running on different nodes. But when I execute the command
<code>curl -s checkip.dyndns.org</code>, I am getting the same public IP for all. So, is the pod's public IP different from the public IP of the node it is running?</p>
<p>Also, when I execute the command <code>kubectl get nodes -o wide</code>, I... | <p><code>...when I execute the command curl -s checkip.dyndns.org, I am getting the same public IP for all.</code></p>
<p>That's your NAT public IP.</p>
<p><code>I actually need the node's public IP address...</code></p>
<p>The node needs to run in a subnet that allows direct (no NAT) Internet access and have public IP... |
<p>I'm trying to run k3s in rootless-mode. For now, i've done common steps from <a href="https://rootlesscontaine.rs/getting-started" rel="nofollow noreferrer">https://rootlesscontaine.rs/getting-started</a> and used unit-file from <a href="https://github.com/k3s-io/k3s/blob/master/k3s-rootless.service" rel="nofollow n... | <p>The solution was quite obvious.
In unit file k3s-rootless.service I used the wrong snapshotter. For containerd in k3s rootless-mode it has to be '--snapshotter=fuse-overlayfs'.
fuse-overlayf also need to be installed before run k3s in rootless-mode.</p>
|
<p>I have a Kubernetes controller written using client-go <a href="https://pkg.go.dev/k8s.io/client-go/informers" rel="nofollow noreferrer">informers</a> package. It maintains a watch on all Pods in the cluster, there are about 15k of these objects, and their YAML representation takes around 600 MB to print (I assume t... | <p>Here's an idea, you can get a list of all the <code>DaemonSets</code> in your cluster. Read the <code>spec.selector.matchLabels</code> field to retrieve the label that the <code>DaemonSet</code> pods are bound to have. Use those labels as part of your <code>TweakListOptionsFunc</code> with a logic like:</p>
<pre><co... |
<p>Does the # in front of success and failure in a Kubectl describe (refer picture) meant to represent something?</p>
<p>All of the elements in each of those probes represent a config element for the probe but success and failure are prefixed with a #. I initially thought maybe it is a default value (which was not spec... | <p>It appears to be just be embedded into the print statement:</p>
<p><a href="https://github.com/kubernetes/kubernetes/blob/b1e130fe83156783153538b6d79821c2fdaa85bb/staging/src/k8s.io/kubectl/pkg/describe/describe.go#L1956" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/b1e130fe83156783153538b... |
<p>I am a beginner to Kubernetes. I have created a secret file and referred it in deployment yaml file.</p>
<p>app-secret.yaml</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: app-secret
data:
username: YWRtaW4=
password: YWRtaW4=
</code></pre>
<p>deploy.yaml</p>
<pre><code>env:
- name: DEPLOY... | <p>You could use the <code>stringData</code> format:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Secret
metadata:
name: app-secret
stringData:
username: "YWRtaW4="
password: "YWRtaW4="
</code></pre>
<p>From K8s doc:
<a href="https://i.stack.imgur.com/uasIb.png" r... |
<p>When reading blog posts about WAFs and Kubernetes, it seems 90+ % of the posts are written by WAF-providers, while the remaining posts seem to be sceptical. So I would like to hear what your experiences are with WAFs, do they make sense, and if so can you recommend any good open-source WAFs? We are currently not all... | <p>A WAF is not strictly <em>necessary</em> on Kubernetes βΒ or on any other deployment platform. Honestly, even after consulting for dozens of companies, I've seldom encountered any site that used a WAF at all.</p>
<p>You're right that you could duplicate the functions of a WAF using other technology. But you're basica... |
<p>Please correct me if I'm wrong. Up to my understanding, advantage of containers is that those don't need to supply the whole OS and they also don't need to execute it (but instead they utilize underlying OS which is provided e.g. by Docker) which leads to the saving of the resources -especially the memory.</p>
<p>My... | <p>Short answer: you can pick any base image that's compatible with whatever is running inside your container.</p>
<blockquote>
<p>advantage of containers is that those don't need to supply the whole OS and they also don't need to execute it (but instead they utilize underlying OS which is provided e.g. by Docker)</p>
... |
<p>I am attempting to build a simple app with FastAPI and React. I have been advised by our engineering dept, that I should Dockerize it as one app instead of a front and back end...</p>
<p>I have the app functioning as I need without any issues, my current directory structure is.</p>
<pre class="lang-bash prettyprint-... | <p>As a good practice, one docker image should contain one process. Therefore you should dockerize them separatly (have one <code>Dockerfile</code> per app).</p>
<p>Then, you can add a <code>docker-compose.yml</code> file at the root of your project in order to link them together, it could look like that:</p>
<pre clas... |
<p>A few months back, I deployed the Elastic-Search (version - 8.0.1) on Kubernetes (GCP) as a service as External load balancer using this <a href="https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-deploy-elasticsearch.html" rel="nofollow noreferrer">guide</a>.</p>
<p>Now, I am unable to perform any read or writ... | <p>Appears to be an issue with the disk space ( /usr/share/elasticsearch/data).
Verify that the persistent volume with the required size is available and is bound to the elasticsearch pod through PVC object.</p>
|
<p>I can't get my Ingress to use my TLS cert. I have created a self signed TLS cert using openssl for hostname myapp.com and added myapp.com to /etc/hosts.</p>
<p><code>openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365</code></p>
<p>I have verified the Ingress is using the TLS cert</p>
... | <p>When you are using a cert that is not signed by trusted certificates in the installed CA certificate store, you will get the error message:</p>
<pre><code>failed to verify the legitimacy of the server and therefore could not establish a secure connection to it
</code></pre>
<p>As a workaround, you can disable the st... |
<p>In Detail, the .JS file contains MongoDB commands like below,</p>
<pre class="lang-js prettyprint-override"><code>db = db.getSiblingDB('records')
db.createCollection("collection_new");
db.collection_new.insertMany([
{ capped : true, size : 5242880, max : 5000 },
{ capped : false, size : 5242880, max : ... | <p>You cannot make reference to a file from a configmap. As suggested in the comments, you can use an <a href="https://docs.helm.sh/docs/chart_template_guide/accessing_files/" rel="nofollow noreferrer">Helm template which make reference to a file</a>:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: my-c... |
<p>I'm probably missing something in my understanding of networking and gRPC. I want to start with an example to explain how I understand the networking.</p>
<p>I have a deployment with 3 replicas named app in default namespace
they have pod IP:</p>
<p><code>10.3.0.1</code>, <code>10.3.0.2</code>, <code>10.3.0.3</code>... | <p>I think you could find some answers from the <a href="https://github.com/grpc/grpc/blob/master/doc/load-balancing.md" rel="nofollow noreferrer">Load Balancing in gRPC</a>.</p>
<p>Load-balancing policies fit into the gRPC client workflow in between name resolution and the connection to the server.</p>
<p><a href="htt... |
<p>I'm using helm and given a yaml object I want to flatten it while applying some recursive formatting.</p>
<p>Given this:</p>
<pre class="lang-yaml prettyprint-override"><code>some_map:
with: different
indentation:
levels: and
nested:
sub:
maps: "42"
and_more:
maps: 42
</code>... | <p>Yes, it seems that <code>{{ define</code> supports recursive use of <code>{{ include</code>, although unknown to what depth</p>
<p>The PoC I whipped up to see if it could work</p>
<pre><code>{{- define "bob" -}}
{{- $it := . -}}
{{- $knd := kindOf . -}}
{{- if eq $knd "map" }}
{{- range (keys .) ... |
<p>I have an application which does this:</p>
<pre><code>subprocess.Popen(["python3", "-u", "sub-program-1.py"])
</code></pre>
<p>So Python program can start multiple long-lived processes on demand.</p>
<p>If I stop main Python program and start again, it knows that <code>sub-program-1.py<... | <p>TL;DR - This is a classical monolithic application scaling problem you can easily solve this by redesigning your application to a microservice architecture, since your application functionality is inherently decoupled between components. Once you've done that, it all really boils down to you deploying your applicati... |
<p><a href="https://i.stack.imgur.com/D5fPZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/D5fPZ.png" alt="enter image description here" /></a></p>
<p>I have been trying to setup minikube but the command is stuck at pulling base image since forever</p>
| <p>It's not stuck; it is just not showing the output of the downloading progress. It's an 800 MB file, it takes time to download.</p>
<p>See <a href="https://github.com/kubernetes/minikube/issues/7012" rel="noreferrer">https://github.com/kubernetes/minikube/issues/7012</a></p>
|
<p>I am following the tutorial here about kserve <a href="https://github.com/kserve/modelmesh-serving/blob/main/docs/quickstart.md" rel="nofollow noreferrer">https://github.com/kserve/modelmesh-serving/blob/main/docs/quickstart.md</a></p>
<p>Is this my docker&k8s issue? I have spent hours trying to debug but to no ... | <p>The image you try to pull exists and is available <a href="https://hub.docker.com/layers/mlserver/seldonio/mlserver/0.5.2/images/sha256-8c2244e2b51102d3bd7f814dc11775f304c8be5dca42ccb6a57b545d88bed1f9?context=explore" rel="nofollow noreferrer">here</a>. However, from what I see it's very big (<code>2.74 GB</code>). ... |
<p>Can we set min and max limit for deployments at deployment level, not at cluster or replica set level in kubernetes ?</p>
| <p>On deployment level <strong>it is not possible</strong>, but there is an option to do this indirectly. You should use a <strong>HorizontalPodAutoscaler</strong> (HPA for short):</p>
<blockquote>
<p>HPA automatically updates a workload resource (such as a Deployment or
StatefulSet), with the aim of automatically scal... |
<p>A few months back, I deployed the Elastic-Search (version - 8.0.1) on Kubernetes (GCP) as a service as External load balancer using this <a href="https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-deploy-elasticsearch.html" rel="nofollow noreferrer">guide</a>.</p>
<p>Now, I am unable to perform any read or writ... | <p>It seems, for some reason the Pod is not seeing the new volume Size. Have you tried <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/volume-expansion" rel="nofollow noreferrer">this</a>, for the GKE Volume expansion?</p>
<p>If the Pod is always in the <code>CrashLoopBackOff</code> s... |
<p>I am following the tutorial here about kserve <a href="https://github.com/kserve/modelmesh-serving/blob/main/docs/quickstart.md" rel="nofollow noreferrer">https://github.com/kserve/modelmesh-serving/blob/main/docs/quickstart.md</a></p>
<p>Is this my docker&k8s issue? I have spent hours trying to debug but to no ... | <p>As mentioned by @RafaΕ Leszko, The image β<strong>seldonio/mlserver:0.5.2</strong>β you are trying to pull is very large which possibly throws the error: <strong>ErrImagePull: context deadline error</strong>. You can still pull the image with <code>docker pull</code> after which the scheduling succeedes.</p>
<p>When... |
<p>I have a spring-boot application running over Kubernetes, Now I am trying to set up a horizontal pod auto scaler.</p>
<p>I have one doubt, without modifying any autoscalar thresholds, does auto scaler check pods only when they are ready(after the readiness probe succeeds) or even when readiness is not complete.</p>
... | <p>A <a href="https://github.com/jthomperoo/predictive-horizontal-pod-autoscaler" rel="nofollow noreferrer">Digital OCean Predictive Horizontal Pod Autoscaler</a> has the same kind of parameter: <a href="https://predictive-horizontal-pod-autoscaler.readthedocs.io/en/latest/reference/configuration/#cpuinitializationperi... |
<p>May be I am missing some basic here. My pod failing at executing the shell command</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: redis-rs01
labels:
name: redis-rs01
run: redis-rs01
app: redis
spec:
replicas: 3
selector:
matchLabels:... | <p>You need to format your command to separate the arguments properly, right now your entire shell command is being perceived as a "file that is a shell script" to be executed with "sh -c". And since there is no file named <code>mkdir /tmp && touch /tmp/date.log</code> the shell returns an e... |
<p>When deploying a set of SpringBoot microservice applications in a Kubernetes cluster, should I include any kind of service discovery client libraries in my SpringBoot application to leverage kubernetes-native-service-discovery? If not, how a caller service calls another microservice in the same cluster?</p>
<p>Thank... | <p>A service in kubernetes can be invoked as mentioned below for example an http service. An service has to be created and associated with pod. Please refer kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">services</a> documentation for various services.</... |
<p>I have a multinode kubernetes cluster with 6 pods (replicas, 8Gi, 4 CPU cores) running on different nodes residing in Auto Scaling Group. These pods contain an Application that serves REST API, and is connected to Redis.</p>
<p>For all the requests going through ALB configured via ingress, some requests are painful... | <p>I am not the questioneer but oddly enough ran into a similar issue that could not be attributed to anything obvious per se.</p>
<p>After a lot of debugging and turning every stone we finally disabled the Prometheus Operator scraping our pods by removing the required annotation. The "1 pod performance issue"... |
<p>I am using the RabbitMQ <a href="https://www.rabbitmq.com/kubernetes/operator/using-operator.html" rel="nofollow noreferrer">Kubernetes operator</a> for a dev-instance and it works great. What isn't great is that the credentials generated by the operator are different for everyone on the team (I'm guessing it genera... | <p>I figured it out. Looks like you can just add a secret configured like the below example and it'll work. I figured this out by reverse engineering what the operator generated. So, please chime in if this is bad.</p>
<p>The big thing to remember is the <code>default_user.confg</code> setting. Other than that, it's ju... |
<p>I'm trying to set the resources of my pod from a config map</p>
<pre><code>resources:
requests:
cpu:
valueFrom:
configMapKeyRef:
name: config
value: CPU_REQUEST
</code></pre>
<p>But get error "got map", expected "string"</p>
| <p>Resources cannot be configured through configmaps, they need to be configured as part of the <a href="https://k8s-examples.container-solutions.com/examples/Pod/Pod.html#resources_and_limits/" rel="nofollow noreferrer">podspec</a></p>
|
<p>I can't seem to figure out whey my nginx template is not using the values file when I pass it with the <code>helm template --debug nginx charts/transport-latency -f charts/transport-latency/values.yaml > .ignore/nginx-out.yaml</code> command.</p>
<p>Output using <code>--debug</code></p>
<pre><code>install.go:178:... | <p>If you are referencing a dependent chart (in your case, the <code>nginx</code> chart), then you must nest values for that subchart in its own block with the name of the dependency.</p>
<p>So, since you named the dependency <code>nginx</code> as per your <code>chart.yaml</code>:</p>
<pre><code>apiVersion: v2
name: tr... |
<p>I'm unable to wrap my head around the concepts of interconnectivity among <code>DNS</code>, <code>Ingress controller</code>, <code>MetalLb</code> and <code>Kubeproxy</code>.</p>
<p>I know what these resources/tools/services are for and get the concepts of them individually but unable to form a picture of them workin... | <p>The ingress-controller creates a <code>service</code> of type <code>LoadBalancer</code> that serves as the entry point into the cluster. In a public cloud environment, a loadbalancer like ELB on AWS would create the counter part and set the <code>externalIP</code> of that service to it's ip. It is like a service of ... |
<p>I'm following the <a href="https://www.youtube.com/watch?v=DgVjEo3OGBI" rel="nofollow noreferrer">tutorial</a> from Less Jackson about Kubernetes but I'm stuck around 04:40:00. I always get an 404 returned from my Ingress Nginx Controller. I followed everything he does, but I can't get it to work.</p>
<p>I also read... | <p>I found my solution. There was a process running on port 80 with pid 4: 0.0.0.0:80. I could stop it using <code>NET stop HTTP</code> in an admin cmd.</p>
<p>I noticed that running <code>kubectl get services -n=ingress-nginx</code> resulted a ingress-nginx-controll, which is fine, but with an external-ip . Running <c... |
<ol>
<li>Does traefik / traefik mesh can handle multi regional arquitecture to solve request to the right user region?</li>
<li>Any other self hosted solution recomendation?</li>
</ol>
<p><strong>Rules:</strong></p>
<ul>
<li>Each region is independent and one region downtime does'nt affect other region</li>
<li>User au... | <p><strong>LOCAL DATA STORAGE REQUIREMENT</strong></p>
<p>In some markets, there could be regulatory reasons for keeping a user's data stored within their home region. So if a European user has travelled to the USA, they should continue to be routed to European servers, and their data will remain in Europe.</p>
<p><str... |
<p>I want to install a previous, specific version of k8slens (<a href="https://k8slens.dev/" rel="nofollow noreferrer">https://k8slens.dev/</a>) but impossible for me to find this (neither for mac nor windows !) Do I have to download the source code and rebuild it? Even with this there is no "install" section... | <p>Yes, you can easily download the source code for a specific version <code>tag</code> and the compile and use it. The list of tags is <a href="https://github.com/lensapp/lens/tags" rel="nofollow noreferrer">here</a>.</p>
<p>Once you get the source code of your desired version you can generate the binary with :</p>
<p... |
<p>What is the difference between <code>env</code> and <code>envFrom</code> fields in kubernetes when referencing secrets? Thank you!</p>
| <p>Below is the <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">"env:"</a> sample which will load variables into container environment as environment variables which can referenced using "$DEMO_GREETING" then you wil... |
<p>I have 3 ingress namespace in AKS Cluster. One of standart ingress deploy file, the other two are internal and external modified versions of the original file. So right now I have 3 ingress and 3 external ip(one of internal with adding service annotations this line service.beta.kubernetes.io/azure-load-balancer-inte... | <p>If the ingress resource is regularly changing external IPs, this indicates you have more than one ingress controller in the cluster and have not specified an ingress class on the ingress resource.</p>
<p>As such, all ingress controllers in the cluster (which have not been restricted to namespace) will try to "f... |
<p>I'm currently trying to setup heketi on kubernetes, i need to create an endpoint like so (i'm using Ansible):</p>
<pre><code>- hosts: 'masters'
remote_user: kube
become: yes
become_user: kube
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: "Create gluster endpoints on kubern... | <p>An <code>Endpoints</code> resource (like a <code>Pod</code>, <code>Service</code>, <code>Deployment</code>, etc) is a <em>namespaced</em> resource: it cannot be created globally; it must be created inside a specific <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow... |
<p>Is it possible to create a Kubernetes cluster admin without the ability to modify/read certain namespace and its content?</p>
<p>I am talking about subtracting certain permissions from existing role.</p>
<p>thanks.</p>
| <p>To get the behavior you want you would need a <a href="https://en.wikipedia.org/wiki/Complement_(set_theory)" rel="nofollow noreferrer">set subtraction</a> of cluster-admin role minus the rules that you have defined. <a href="https://github.com/kubernetes/kubernetes/issues/70387" rel="nofollow noreferrer">It's not s... |
<p>Let say there's a deployment named my-deployment which is consisted of 3 pods, now we use port-forward forward a local port to this deployment :</p>
<pre><code>kubectl port-forward deployment/my-deployment 8888 9999
</code></pre>
<p>My question is : when I visit localhost:8888 serveral times then which pod would be ... | <p><code>when I visit localhost:8888 serveral times then which pod would be forwarded to ?</code></p>
<p>Will forward to the first pod sorted by name.</p>
<p><code>Always forward to a fixed pod(like first pod) ?</code></p>
<p>Fixed.</p>
<p><code>Or forward it by random ? Or use round-roubin strategy ?</code></p>
<p>Fix... |
<p>I'm using Kubernetes on Digitalocean cloud platform</p>
<p>the deckorized laravel app is running right now</p>
<p>and i need to run <code>php artisan optimize:clear</code> to all pods which are loading the app</p>
<p>how can i do that?</p>
<p><strong>Edit:</strong></p>
<p>I got the solution</p>
<p>First step connec... | <p>You can build a bash file like the below:</p>
<pre><code>#!/bin/bash
PODS=$(kubectl get pods -n my-production | grep php-fpm | awk -F' *|/' '$2 == $3 && $4 == "Running"' | awk {'print $1'} | column -t )
for POD in $PODS
do
echo $POD
kubectl -n my-production exec $POD -c php -- php artisan o... |
<p>Is the service affected when all masters are stopped?</p>
<p>OpenShift 4</p>
<ul>
<li>Infra Node 3</li>
<li>Master Node 3</li>
<li>Worker Node 3</li>
</ul>
<p>β» Router pods are in the Infra Node.</p>
<p>The work request is as follows.</p>
<ul>
<li><p>frontend(DC) -> api(DC)</p>
<ul>
<li>Internet -> Infra Node(... | <p>Yes, it is affected. Here's what's happening when you stop all the master nodes.</p>
<ol>
<li>The incoming traffic to the DC egress is being forwarded to the <code>Ingress</code> component of your Kubernetes/Openshift cluster. (Your <code>front-end</code>).</li>
<li>This is succeeding because the name resolution of ... |
<p>I built a service that utilizes docker pods to process data. The time it takes varies from as little as 15 minutes to as much as 1 hour.</p>
<p>My applications captures SIGTERM to ensure a graceful shutdown takes place when demand drops while Pods and Nodes are decommissioned.</p>
<p>In each docker image I placed c... | <p>We faced the same issue with AWS EKS and cluster-autoscaler - nodes were unexpectedly shut down, no preventive actions were working, and even the <strong>node</strong> annotation <code>cluster-autoscaler.kubernetes.io/scale-down-disabled=true</code> did not make any difference.</p>
<p>After two days of troubleshooti... |
<p>I'm trying to migrate Several spring boot services to EKS and they can't retrieve aws credentials from credentials chain and pods are failing with following error: <code>Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain</code></p>
<p>These are what I've tried so far:</p>
<... | <p>Problem was fixed.</p>
<p>Main issue was conflicting AWS SDK BOM version with individual models. Also previous version of BOM I was using wasn't supporting AWS SDK v2.x .</p>
<p>These are the main take aways from the issue:</p>
<ol>
<li><p>AWS SDK authenticate services using <a href="https://docs.aws.amazon.com/sdk-... |
<p>I'm using the latest version of google-kubernetes (1.22.8-gke.202) in a Kubernetes managed cluster. I also have a custom service account that has access to the "Artifact Registry Reader" scope that should grant it permission to pull private images from the repository - calling this <em>custom-service-accou... | <p>When checking for access to artifact registry, please check permission and scopes as per this <a href="https://cloud.google.com/artifact-registry/docs/access-control#gke" rel="nofollow noreferrer">documentation</a>.</p>
|
<p>I'm starting in Kubernetes and I'm trying to update the Image in DockerHub that is used for the Kubernetes's Pod creation and then with <code>kubectl rollout restart deployment deploymentName</code> command it should pull the newest image and rebuild the pods.
The problem I'm facing is that it only works when I spec... | <p>You can use <a href="https://github.com/ryandaniels/docker-script-find-latest-image-tag/blob/aed09da3813429cbe979e34a050a48c3b19a7002/docker_image_find_tag.sh" rel="nofollow noreferrer"><code>docker_image_find_tag.sh</code></a> to check if your image has a <code>latest</code> tag or not.<br />
It will show the tag/v... |
<p>I have kube-prometheus-stack running on a kubernetes cluster along with prometheus-blackbox-exporter. I want to monitor multiple http targets. I have tried setting this up with an servicemonitor but when I add a target the target does not get the right labels</p>
<p>The servicemonitor yaml:</p>
<pre><code>apiVersion... | <p>spec.endpoints is a <a href="https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ServiceMonitor" rel="nofollow noreferrer">list</a>. In yaml each lists element are defined with a <a href="https://docs.ansible.com/ansible/latest/reference_appendices/YAML... |
<p>K8S Version: 1.23</p>
<p>I have an hourly CronJob with 5 inner pods. After some time, part of these pods goes to shutdown and moved to the <code>Completed</code> state (it's expected), but the rest - still works, so have a <code>Running</code> state.</p>
<p>At the next hour, this CronJob will not be triggered due to... | <p>It appears that the reason you're letting the <code>Running</code> pods exist is that you expect those pods to take a long time before finishing. This means that the scheduling of those pods <em>should</em> be different from others, since they can take a longer time to finish.</p>
<p>You can split your <code>CronJob... |
<p>I am very new to azure kubernetes! Right now I am just playing around with it, trying to work out how to create things using kubectl.
I already have my cluster set up, and I have created a couple of pods using an existing container in our registry. I also created an ingress controller using azure application gateway... | <p>You can use the single YAML file and manage it as per the requirement of creating multiple files for different resources that are on you.</p>
<p>If you want to update the deployment you can simply update the YAML and run</p>
<pre><code>kubectl apply -f <filename>.yaml
</code></pre>
<p>Also, there is an issue ... |
<p>On AKS, I am getting a very strange error pulling an image from a public docker repository: <code>Failed to pull image "jeremysv/eventstore-proxy:latest": rpc error: code = InvalidArgument desc = failed to pull and unpack image "docker.io/jeremysv/eventstore-proxy:latest": unable to fetch descrip... | <p>First of all have you been able to pull images from your repo to AKS in the past? If yes, what is the difference between this time and the previous successful one?</p>
<p>If not, I look it up and it seems to be an error for which Azure is aware of. Both of those guys kind of had the same issue as you: <a href="https... |
<p>I'm running Docker Desktop with Kubernetes.</p>
<p>I can ssh to the node and I have other pods running on the node.</p>
<p>However, when I apply a StatefulSet to the cluster I get:</p>
<pre><code>0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 Preem... | <p>If you are applying the manifest defined <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#components" rel="noreferrer">here</a> as it is, the problem is in the below snippet, particularly with the <code>storageClassName.</code> Likely, your cluster does <strong>not</strong> have a sto... |
<p>I have deployment a postgresql stateful service in kubernetes, now mapped the <code>/bitnami/postgresql</code> to the NFS volumn like this way:</p>
<pre><code>spec:
volumes:
- name: dshm
emptyDir:
medium: Memory
- name: data-reddwarf-postgresql-postgresql-general
persistentVolumeClaim:
... | <p>You should definitely go with a separate volume.</p>
<p>Even if you manage to mount multiple times the same PV in different locations, each mount would still expose all the files and directory in the PV. If <code>/docker-entrypoint-preinitdb.d</code> contains a bunch of scripts and no actual data, you could use a <a... |
<p>I'm trying to setup a basic NATS service on my kubernetes cluster, according to their documentation, <a href="https://docs.nats.io/running-a-nats-service/nats-kubernetes" rel="nofollow noreferrer">here</a>. I executed the following code:</p>
<pre><code>$ helm install test-nats nats/nats
NAME: test-nats
LAST DEPLOYE... | <p>I have reproduced the set-up on my kubernetes cluster and have successfully deployed the nats box and started a <a href="https://docs.nats.io/nats-concepts/core-nats/pubsub/pubsub_walkthrough#1.-create-subscriber-1" rel="nofollow noreferrer">client subscriber</a> program in which subscribers listen on subjects, and ... |
<p>I have an application with different versions. The base resource file for each version is slightly different. But the patch which needs to be applied to the base file is same. What should be the best structure to apply the same patch to different base resource and have different output files respectively.</p>
<pre><... | <p>One way to do it would be to have a kustomization file in <code>/overlays/</code>, including patches and configurations from <code>dev/</code> and <code>staging/</code>. Eg:</p>
<pre><code>$> cat ./overlays/kustomization.yaml
resources:
- ./dev/foo.yaml
- ./staging/bar.yaml
patchesJson6902:
- target:
version... |
<p>What is the correct way to pass auth header in auth-url for external auth? Below is my current nginx ingress configοΌ</p>
<pre><code>nginx.ingress.kubernetes.io/auth-cache-key: $remote_user$http_authorization
nginx.ingress.kubernetes.io/auth-response-headers: Authorization
nginx.ingress.kubernetes.io/auth-signin: myd... | <p>Have you tried setting specifically the header inside the <code>auth-snippet</code> annotation?</p>
<pre class="lang-yaml prettyprint-override"><code>nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header Authorization $http_authorization;
</code></pre>
|
<p>Iβm trying to set up <code>argocd</code> in EKS cluster using helm. I want to use ALB as a load balancer. The UI is reachable through <code>http://node_ip:8080</code>, but not through the ALB or the LB that was created.</p>
<p>Here is my configuration:</p>
<pre><code> ingress:
enabled: true
annotations:
... | <p>Well, I have found the issue, and it was much simple than i thought.</p>
<p>Since the pods are listening to port 80, all I had to do is to change the <code>backend-protocol</code> to <code>HTTP</code>. That's it.</p>
|
<p>I don't understand how replication works in Kubernetes.</p>
<p>I understand that two replicas on different nodes will provide fault tolerance for the application, but I donβt understand this:</p>
<p>Suppose the application is given the following resources:</p>
<pre><code>---
apiVersion: v1
kind: Pod
metadata:
name... | <p>No, it won't get distributed one replica will start simply and the other will stay in <strong>pending</strong> state.</p>
<p>If you will describe that pending POD(replica) it show this error :</p>
<pre><code>0/1 nodes available: insufficient cpu, insufficient memory
</code></pre>
<blockquote>
<p>kubectl describe pod... |
<p>I'm trying to configure email alerts through grafana and I'm unable to find the grafana.ini file. I followed <a href="https://grafana.com/docs/grafana/next/setup-grafana/installation/kubernetes/#deploy-grafana-enterprise-on-kubernetes" rel="nofollow noreferrer">this</a> page to deploy a grafana instance on my local ... | <p>Depending on your environment, configuring Grafana using environment variables instead of editing <code>grafana.ini</code> might be an easier option.</p>
<p>The environment variable pattern is the following: <code>GF_<SectionName>_<KeyName></code></p>
<p>E.g., to configure SMTP, one would edit the follow... |
<p>I have the following data in my function $newdict</p>
<pre><code> modules:
module1:
enabled: true
module2:
enabled: false
module3:
enabled: true, etc
</code></pre>
<p>What is need to do is : check if module1 enabled, then set enabled for module2 as well. What I tried in _helpers.t... | <p>Helm's general style is that values are immutable. I'd avoid the <code>set</code> function here and stick to a more functional style.</p>
<p>It may help your setup that you can directly index things in dict (map) structures, or use the standard Go template <code>index</code> function. You don't need to iterate thr... |
<p>I have a Deployment that runs one container with a root user. It's perfectly clear that everything my application saves under <code>/data</code> will be ephemeral if I don't have any type of persistent volume and <code>volumeMounts</code> defined.</p>
<p>My question is what would be the purpose of specifying an <a h... | <p>One of the main features of the emptyDir is that it can be mounted on multiple containers inside the same Pod.
If you don't use this feature I guess there is not much to gain from it. If I remember correctly emptyDirs are preserved when the container inside the pod are restarted but not when the pod is re-scheduled.... |
<p>I'm creating kubevirt in minikube, initially kubevirt-operator.yaml fails with ImagePullBackOff. After I added secret in the yaml</p>
<pre><code>imagePullSecrets:
- name: regcred
containers:
</code></pre>
<p>all my virt-operator* started to run. virt-api* pods still shows ImagePullBackOff.
The error comes out as</... | <p>This docker image looks like it is in a private registry(and from oracle). And I assume the regcred is not correct. Can you login there with docker login? if so you can create regcred secret like this</p>
<pre><code>$ kubectl create secret docker-registry regcred --docker-server=<region-key>.ocir.io --docker-u... |
<p>I'm looking to get the kubelet_* metrics from EKS/GKE servers.</p>
<p>neither <code>metrics-server</code> or <code>kube-state-metrics</code> seem to provide them to prometheus. Information online suggests the metrics are coming from the kubelet itself, but I'm not precisely sure which software piece is usually used ... | <p>It's true that kubelet exposes <code>kubelet_*</code> metrics. By default they're available on port <code>10250</code>, path <code>/metrics</code>. Additionally, kubelet also has metrics in <code>/metrics/cadvisor</code>, <code>/metrics/resource</code> and <code>/metrics/probes</code> endpoints.</p>
<p>I'm running a... |
<p>I want to use k8s job to perform some scheduled tasks, as follows:</p>
<pre class="lang-yaml prettyprint-override"><code>containers:
- name: container-rgs4wl
image: 'alpine-curl:3.16.0'
command:
- |-
for i in `cat domains`
do
http_status=`curl -I -m 10 -o /de... | <p>You can consider it like, <strong>command</strong> is like the <strong>command</strong> we run in Linux, for example, <strong>printenv</strong>, <strong>grep</strong>, <strong>echo</strong> and you pass the <strong>argument</strong> into it that's <strong>args</strong>.</p>
<p>like <code>echo(command) "hello&qu... |
<p>I get this error:</p>
<blockquote>
<p>ERROR! couldn't resolve module/action 'kubernetes.core.k8s'. This often indicates a misspelling, missing collection, or incorrect module path.</p>
</blockquote>
<p>However, I thought I installed it and looks like it is installed:</p>
<pre><code>[me@server ansible]$ ansible-galax... | <p>Although you can follow this answer: <a href="https://stackoverflow.com/a/60867449/5508998">https://stackoverflow.com/a/60867449/5508998</a></p>
<p>I found that it only worked when you install those packages using <strong>sudo</strong>, so</p>
<pre><code>sudo pip install openshift pyyaml kubernetes
</code></pre>
|
<p>By default pods can communicate with each other in Kubernetes, which is unwanted should a pod be compromised. We want to use <strong>NetworkPolicies</strong> to control inbound (ingress) and outbound (egress) traffic to/from pods.</p>
<p>Specifically pods should ONLY be able to:</p>
<ul>
<li>Egress: Call services on... | <p>I have compared your Ingress with <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#allow-all-ingress-traffic" rel="nofollow noreferrer">K8 Doc</a> and Egress with this <a href="https://stackoverflow.com/a/57845666/19230181">SO</a> and <a href="https://kubernetes.io/docs/concepts/se... |
<p>Is there a Kubectl command or config map in the cluster that can help me find what CNI is being used?</p>
| <p>First of all checking presence of exactly one config file in <code>/etc/cni/net.d</code> is a good start:</p>
<pre><code>$ ls /etc/cni/net.d
10-flannel.conflist
</code></pre>
<p>and <code>ip a s</code> or <code>ifconfig</code> helpful for checking existence of network interfaces. e.g. <code>flannel</code> CNI should... |
<p>I have a pipeline which creates an image and pushes to Quay repository and then deploys to Openshift cluster. In my deployment-config file I have mentioned the image name as quay.:dev. So whenever a new image is created, it is created with same name and tag.
My question is will this pipeline and deployment make any ... | <p>You need to change the image tag on every run. As a general rule, in Kubernetes you want to avoid fixed image tags like <code>...:dev</code> or <code>...:latest</code>.</p>
<p>With the workflow you suggest, two things will happen.</p>
<p>First, updating the Kubernetes Deployment will have no effect. The new Deploy... |
<p>Not sure what I am missing. Please, find below all the config scripts I have used</p>
<pre><code>2022-07-21T07:26:56.903Z info service/collector.go:220 Starting otelcol... {"service": "my-prom-instance", "Version": "0.54.0", "NumCPU": 4}
2022-07-21T07:26:56.... | <p>the service account is defined with name otel-collector-sa, and your ClusterRoleBinding link to service account default</p>
|
<p>My quest is basically:</p>
<p>What is does the pipe {'|'} mean in a configmap?
Code Sample:
Taken from: <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/configmap/</a></p>
<pre><code>apiVersion: v1
kind: ConfigMap
metad... | <p>It's a multiline string. See <a href="https://yaml-multiline.info/" rel="nofollow noreferrer">https://yaml-multiline.info/</a> for examples</p>
|
<p>By default pods can communicate with each other in Kubernetes, which is unwanted should a pod be compromised. We want to use <strong>NetworkPolicies</strong> to control inbound (ingress) and outbound (egress) traffic to/from pods.</p>
<p>Specifically pods should ONLY be able to:</p>
<ul>
<li>Egress: Call services on... | <p>For those curious I ended with the following network policy:</p>
<pre><code>---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: deny-all
namespace: <K8S_NAMESPACE>
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v... |
<p>I'm trying to move my development environment to Kubernetes to be more in line with existing deployment stages. In that context I need to call a service by its Ingress DNS name internally, while this DNS name resolves to an IP unreachable from the cluster itself. I would like to create a DNS alias inside the cluste... | <p>You can use the core dns and add the entry over there using configmap</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
annotations:
labels:
eks.amazonaws.com/component: coredns
k8s-app: kube-dns
name: coredns
namespace: kube-system
data:
Corefile: |
domain-name:port {
errors
... |
<p>I have a Kubernetes deployment and I want to insert some conf parameters end of file while creating the pod. How can I do that ? It shouldn't restart the pod.</p>
| <p>You can either use the <code>command</code> directive to override the entrypoint of the container, or mount in the conf as a configmap, then edit that.</p>
<p>Here's an example of overriding the entrypoint -- more reading available <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argu... |
<p>I want to display the pod IP address in an nginx pod. Currently I am using an init container to initialize the pod by writing to a volume.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: init-demo
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: workdir
mountPath: /u... | <p>Nothing is changed, except how <code>command</code> is passed in the init container. See <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#run-a-command-in-a-shell" rel="nofollow noreferrer">this</a> for an explanation.</p>
<pre><code>apiVersion: v1
kind: Pod
metada... |
<p>Environment: MacBook Pro - Chip: Apple M1 Pro, macOS Monterey 12.2.1</p>
<p><strong>How do I run a docker MS SQL (any version) on Mac M1 and connect from Azure Data Studio?</strong></p>
<p>I was able to create a docker image of azure-sql-edge. Pod is running OK.</p>
<p>INFO: Connection opened from 127.0.0.1:57588 to... | <p>The following link should help on dockerizing SQLServer on Mac Arm-based machine.</p>
<pre><code>docker pull mcr.microsoft.com/azure-sql-edge
</code></pre>
<p>This would install SQLServer on Linux.
From there you can try to access the database using Azure Data Studio.</p>
<p>Details are in the url below.
<a href="ht... |
<p>I'm using the <a href="https://github.com/kubernetes-client/csharp" rel="nofollow noreferrer">C# client API</a> and I'm trying to:</p>
<ol>
<li>Get all pods associated with a given StatefulSet</li>
<li>Get the cluster IP address of each pod</li>
</ol>
<p>I am aware of <code>Kubernetes.CoreV1.ListNamespacedPodAsync</... | <p>A feature of Kubernetes StatefulSet is <em>Stable Network Identity</em>. This requires that additional <em>headless Services</em> are created, in addition to the <code>StatefulSet</code> resource.</p>
<p>When this is done, you would typically access these instances by their <strong>hostname</strong> instead of using... |
<p>Is there anyway to list all securityContext including default and defined:</p>
<ol>
<li>Pod Level</li>
<li>Container Level</li>
</ol>
<p>Using <code>kubectl get pod -o yaml</code> only show the defined in <code>spec.securityContext</code> and <code>spec.containers[*].securityContext</code> of manifest without the de... | <p>Here you are, source can be found <a href="https://medium.com/@pjbgf/kubectl-list-security-context-settings-for-all-pods-containers-within-a-cluster-93349681ef5d" rel="noreferrer">in this medium article</a>:</p>
<pre><code>kubectl get pods --all-namespaces -o go-template \
--template='{{range .items}}{{"pod... |
<p>I'm starting out with K8s and I'm stuck at setting up mongo db in replica set mode with local persistent volume. I'm using StorageClass, PersistentVolume and PersistentVolumeClaim.</p>
<pre><code>vincenzocalia@vincenzos-MacBook-Air server-node % kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY ST... | <p>It is a typo in <code>kubernets.io/hostname</code>. It should be <code>kubernetes.io/hostname</code> in the pv definition.</p>
<p>similar to this one:
<a href="https://stackoverflow.com/questions/52183750/error-while-using-local-persistent-volumes-in-statefulset-pod">Error while using local persistent volumes in sta... |
<p>I'm on Ubuntu linux VM and trying to run minikube on it.</p>
<p>I installed kubectl via homebrew and then installed minikube by following below installation guides:<br>
kubectl: <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux" rel="nofollow noreferrer">https://kubernetes.io... | <p>From <a href="https://github.com/kubernetes/minikube/issues/8363#issuecomment-637892712" rel="nofollow noreferrer">#8363</a> shared by <a href="https://stackoverflow.com/a/70451125/1235675">this answer</a>, I did <code>nano ~/.kube/config</code> and corrected the path..</p>
<pre class="lang-yaml prettyprint-override... |
<p>I have an application that accepts TCP traffic (not HTTP) and I'd like the ability to have the traffic load balanced to it. However, one requirement is that when a client makes a connection, we do not close that connection under any circumstances (ideally) since we are dealing with some clients with older technology... | <p>Unfortunately I haven't been able to get this functionality working with nginx. What I've ended up doing is writing my own basic TCP reverse-proxy that does what I need - if a connection to a backend instance is lost, it attempts to get a new one without interrupting the frontend connection. The traffic that we rece... |
<p>I have few contexts setup in K9s. How do I switch between them?</p>
<p>For example, I am in the <code>PROD</code> context, and I want change the context to <code>NONPROD</code>.</p>
<p>How do I do this using the shortcuts?</p>
| <p>You can switch to another context by typing <code>:ctx <context-name></code>. For example:</p>
<pre><code># Switch to the PROD context
:ctx PROD
# Switch to the NONPROD context
:ctx NONPROD
</code></pre>
<p>A full list of commands and keybindings are available <a href="https://k9scli.io/topics/commands/" rel=... |
<p>I am currently having issues trying to get Prometheus to scrape the metrics for my Minikube cluster. Prometheus is installed via the <code>kube-prometheus-stack</code></p>
<pre class="lang-bash prettyprint-override"><code>kubectl create namespace monitoring && \
helm repo add prometheus-community https://pro... | <h1>Solution to the problem</h1>
<p>After some thorough analysis of my various kubernetes clusters, I have found out the following errors exist:</p>
<h3>Docker Desktop Environment throws this:</h3>
<p><code>Warning Failed 6s (x3 over 30s) kubelet Error: failed to start container "node-exporter&qu... |
<p>I am running a small 3 node test kubernetes cluster (using kubeadm) running on Ubuntu Server 22.04, with Flannel as the network fabric. I also have a separate gitlab private server, with container registry set up and working.</p>
<p>The problem I am running into is I have a simple test deployment, and when I apply ... | <p>After going through many different solutions and lots of research and testing. The answer was actually very simple.</p>
<h3>Solution in my case</h3>
<p>The /etc/hosts file <em>MUST</em> contain the host for the registry (and possibly the entry for the gitlab instance as well) on <em>EVERY</em> node of the cluster i... |
<p>While trying to add/update a dependency to a helm chart I'm getting this error. No helm plugins are installed with the name <code>helm-manager</code>.</p>
<pre class="lang-sh prettyprint-override"><code>$ helm dep update ... | <p>I get this sometimes when there's a mismatch between my <code>Chart.yaml</code> and the configuration of my subchart dependencies.</p>
<p>For instance:</p>
<p><code>Chart.yaml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>dependencies:
- name: foo
...
- name: bar
...
</code></pre>
<p><code>values... |
<p>I wrote a <code>readiness_probe</code> for my pod by using a bash script. Readiness probe failed with Reason: Unhealthy but when I manually get in to the pod and run this command <code>/bin/bash -c health=$(curl -s -o /dev/null --write-out "%{http_code}" http://localhost:8080/api/v2/ping); if [[ $health -n... | <p>The probe could be failing because it is facing performance issues or slow startup. To troubleshoot this issue, you will need to check that the probe doesnβt start until the app is up and running in your pod. Perhaps you will need to increase the <code>Timeout of the Readiness Probe</code>, as well as the <code>Tim... |
<p>Suppose, I have several Kubernetes clusters and I have some namespaces in each of them.</p>
<p>Some of these namespaces are labeled <code>project: a</code> and others <code>project: b</code>.</p>
<p>Now I want to ensure that resources in namespaces labeled <code>project: a</code> can communicate with each other, but... | <p>Network policies are bound to the local cluster and don't work across clusters for now.</p>
|
<p>I have an application that accepts TCP traffic (not HTTP) and I'd like the ability to have the traffic load balanced to it. However, one requirement is that when a client makes a connection, we do not close that connection under any circumstances (ideally) since we are dealing with some clients with older technology... | <p>What you describe is how nginx works out of the box with http. However</p>
<ol>
<li>Nginx has a detailed understanding of http</li>
<li>HTTP is a message based protocol i.e. uses requests and replies</li>
</ol>
<p>Since nginx knows nothing about the protocol you are using, even if it uses a request/reply mechanism w... |
<p>How can I reset RESTART counts to zero in below Kubernetes command output. I know stats are saved in etcd, but how to reset/erase the data?</p>
<pre><code>/home/mytest>kubectl get pods -A -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE ... | <p>The only way to accomplish this is by restarting the pod.</p>
<p>Also, a feature to artificially reset the counter has been rejected.</p>
<p><a href="https://github.com/kubernetes/kubernetes/issues/50375" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/50375</a></p>
|
<p>Assume an application consisting of different web services implemented with ASP.NET Core, each of which is deployed as a Pod in a Kubernetes cluster (AKS to be exact). Now, suppose I want to secure the cluster-internal communication between those services via HTTPS. This requires me to:</p>
<ol>
<li>get TLS certific... | <p>For this purpose you should use <a href="https://www.cloudflare.com/en-gb/learning/access-management/what-is-mutual-tls/" rel="nofollow noreferrer">mTLS</a>. To archive this with an AKS Cluster you can easily active the <a href="https://learn.microsoft.com/en-us/azure/aks/open-service-mesh-about" rel="nofollow noref... |
<p>I wrote a bash script to automate the deployment of an application in a kubernetes cluster using helm and kubectl. I use <strong>cert-manager</strong> to automate issuing and renewing of TLS certificates, obtained by <strong>letsencrypt</strong>, needed by the application itself.</p>
<p>The script can deploy the app... | <p>I finally found out what the issue was..</p>
<p>Basically, I was installing a separate HAProxy ingress controller (haproxytech/kubernetes-ingress) per environment (test/prod), and therefore each namespace had its own ingress controller which I referenced in my manifests.
This should have worked in principle, but it ... |
<p>Background:</p>
<ul>
<li><code>kubectl</code> version- 1.24</li>
<li>Docker version- 20.10.17</li>
<li>MacOS Monterey v12.4</li>
</ul>
<p>Question:</p>
<p>I'm following <a href="https://blog.gruntwork.io/a-crash-course-on-kubernetes-a96c3891ad82" rel="nofollow noreferrer">this tutorial</a>, trying to set up a local ... | <p>It looks like you already have <code>nginx</code> running on port <code>80</code>(and <code>443</code>) on your system. Likely, another docker container outside kubernetes, or directly on your system. It already has taken port <code>80</code>, hence your LoadBalancer is in pending state.</p>
<p>Either stop that ngin... |
<p>I have 2 pods that are meant to send logs to Elastic search. Logs in /var/log/messages get sent but some reason service_name.log doesn't get sent - I think it is due to the configuration for Elastic search. There is a .conf file in these 2 pods that handle the connection to Elastic Search.</p>
<p>I want to make chan... | <p>To store non-confidential data as a configuration file in a volume, you could use <a href="https://kubernetes.io/docs/concepts/configuration/configmap/" rel="nofollow noreferrer">ConfigMaps</a>.</p>
<p>Here is an example of a Pod that mounts a ConfigMap in a volume:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
... |
<p>I've just finished setting up AKS with AGIC and using Azure CNI. I'm trying to deploy NGINX to test if I set the AKS up correctly with the following configuration:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-ingress
annotations:
... | <p>β’ As you said, your organization has a <strong>policy for enforcing TLS for securing encrypted communication over HTTPS</strong>. Therefore, when you create an <strong>βNGINXβ deployment through the βyamlβ file posted</strong>, you can see that the <strong>nginx application is trying to connect to the application ... |
<p>Is it possible to programatically set the sourcetype to be the namespace from where the logs were generated? I am using the fluentd plugin to send data to the Splunk http event collector. Elsewhere, it was recommended to use ${record['kubernetes']['namespace_name'] to set the index name to be the namespace name. ... | <p>If you have not defined a <code>sourcetype</code> in an appropriate <code>props.conf</code> (and associated <code>transforms.conf</code>), Splunk will try to determine the sourcetype based on heuristics</p>
<p>Those heuristics are not generally very accurate on custom data sources</p>
<p>Instead of trying to "p... |
<p>Is there a 'master switch' to enable/disable Keda and HPA?
I can enable/disable scaling rules by editing the replicacount to 0, but is there a main enalbe/disable field?</p>
<pre><code> cooldownPeriod: 1800
maxReplicaCount: 8
minReplicaCount: 2
pollingInterval: 300
</code></pre>
| <p>You can enable/disable scaling rules either by editing the replica count to 0 or you can use a single field called <strong>Pause autoscaling</strong>.</p>
<p><strong>Pause autoscaling</strong> lets you enable/disable autoscaling by using <strong>autoscaling.keda.sh/paused-replicas</strong> annotation. It can be usef... |
<p>We run an internal a healthcheck of the service every 5 seconds. And we run Kubernetes liveness probes every 1 second. So in the worst scenario the Kubernetes loadbalancer has up-to-date information every 6 seconds.</p>
<p>My question is what happens when a client request hits a pod which is broken but not seen by t... | <p>Not sure how your architecture is however LoadBalancers are generally set with the ingress controller like <strong>Nginx</strong> and etc.</p>
<p>Load Balancer backed by the ingress controller forwards the traffic to the <strong>K8s service</strong>, and the <strong>K8s</strong> service mostly manages the request ro... |
<p>Nginx can be configured to support the HAProxy proxy protocol for inbound traffic: <a href="http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_protocol" rel="nofollow noreferrer">http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_protocol</a></p>
<p>However, using <code>proxy_protocol... | <p><a href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt" rel="nofollow noreferrer">Proxy protocol specification</a> forbids this kind of mixing of proxy and non-proxy connections. The reason is that it would allow easy spoofing of ip addresses and other data.</p>
<p>Quote from the specification:</p>
<pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.