prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I have default nginx file which I am copying on /etc/nginx/sites-available/ location, when I do certain changes in default file the changes are not getting reflected in that file under pod.</p>
<p>I have mentioned the copy command to copy default file under /etc/nginx/sites-available/, wanted to know if this default... | <p>Not sure why you are using the Nginx and Node both in single Dockerfile</p>
<p>ideally, you should be running the single process inside the container.</p>
<pre><code>COPY ./nginx/default.conf /etc/nginx/nginx.conf
</code></pre>
<p>You can overwrite the file inside the Dockerfile like above.</p>
<pre><code>COPY defa... |
<p>I used Nats Streaming before for my microservices based on Docker and Kubernetes and node.js but because Nats Streaming is currently being deprecated I want to migrate to NATS and NATS JetStream.</p>
<p>This is the deployment yaml config file that I used for NATS Streaming server in my k8s folder which is using by s... | <p>After some trials and errors and some research, I realized that it is actually better to use Helm (Kubernetes package manager) to have a complete and correct manifest for things like NATS or Kafka or ElasticSearch, etc... So, after installing Helm Kubernetes package manager you can install NATS in your Kubernetes cl... |
<p>I have an ingress pod deployed with Scaleway on a Kubernetes cluster and it exists in the kube-system namespace. I accidentally created a load balancer service on the <code>default</code> namespace and I don't want to delete and recreate it a new one on the <code>kube-system</code> namespace so I want my Load balanc... | <p>At least three reasons why you need to re-create it properly (2 technical and advice):</p>
<ol>
<li><p><code>ExternalName</code> is used for accessing external services or services in other namespaces. The way it works is when looking up the service's name happens, CNAME will be returned. So in other words it works ... |
<p>Is it possible to have multiple databse in a cluster with Crunchydata (postgres)?
When I create a cluster with "pgo create cluster" command I can specify only one database.</p>
<pre><code> -d, --database string If specified, sets the name of the initial database that is created for th... | <p>This could be useful, however it stated:</p>
<blockquote>
<p>"It may make more sense to have each of your databases in its own
cluster if you want to have them spread out over your Kubernetes
topology."</p>
</blockquote>
<p><a href="https://github.com/CrunchyData/postgres-operator/issues/2655" rel="nofollo... |
<p>Let's say you are using either <em><strong>ServiceFabric</strong></em> or <em><strong>Kubernetes</strong></em>, and you are hosting a transaction data warehouse microservice (maybe a bad example, but suppose all it dose is a simple CQRS architecture consisting of Id of sender, receiver, date and the payment amount, ... | <blockquote>
<p>what will happen when we will scale out the microservices and a new microservice instances will be raise up? they will write to the same database?</p>
</blockquote>
<p>Yes, the instances of your service, all share the same logical database. To achieve high availability, you typically run a distributed d... |
<p>I have microservices running within EKS 1.22.
Is there a possible way to check the microservice communication also pod-to-pod communication within the cluster through CLI?</p>
| <p>Everything out of the box should work properly (assuming you have <a href="https://aws.amazon.com/eks/" rel="nofollow noreferrer">AWS EKS</a>).</p>
<p>I think this article - <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/" rel="nofollow noreferrer">Debug Services</a> has very helpf... |
<p>I am using Azure Kubernetes Services with K8S version 1.20.9 and have following K8S deployment</p>
<p>Version 1:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
namespace: test
name: busybox-deployment
labels:
app: busybox
spec:
replicas: 1
strategy:
type: RollingUpdate
selector:
... | <p>This is a known problem with <code>rollout undo</code>, reported here <a href="https://github.com/kubernetes/kubernetes/issues/94698" rel="nofollow noreferrer">#94698</a>, here <a href="https://github.com/kubernetes/kubernetes/issues/25236" rel="nofollow noreferrer">#25236</a>, and here <a href="https://github.com/k... |
<p>I have a Kubernetes cluster with three control and three worker nodes.
To install Ceph I'm using rook. After the installation, only the worker nodes are included in the Ceph cluster - but not the controller nodes.</p>
<p>The configuration snippet:</p>
<pre><code>storage: ... | <p>The root cause for the problem was, that the master nodes were tainted in a way that no 'normal' pod was allowed to run there.</p>
<p>Adapting the <code>cluster.yaml</code> configuration of rook and adding the following lines which explicitly allowed the ceph pods run also on master nodes solved the problem:</p>
<pr... |
<p>I am trying to pass JVM args to Docker image of Spring boot app on Kubernetes. Specifically, I wanted to pass these three arguments:</p>
<pre><code>-Djavax.net.ssl.trustStore=/certs/truststore/cacerts
-Djavax.net.ssl.trustStorePassword=password
-Djavax.net.debug=ssl
</code></pre>
<p>I tried adding it to "env&qu... | <p>To override the container's default <code>ENTRYPOINT</code> setting, I sometimes do the following:</p>
<pre class="lang-yaml prettyprint-override"><code>containers:
- name: my-container
image: mycontainer:latest
command: ["java"]
args: ["-Djavax...", "-Djavax...", "-j... |
<p>I am trying to use Ingress in minikube by <code>minikube addons enable ingress</code>. However, currently Ingress cannot be used with minikube when the driver is <code>docker</code> on macOS based on this <a href="https://github.com/kubernetes/minikube/issues/7332" rel="nofollow noreferrer">issue ticket</a>.</p>
<p>... | <p>My guess is 127.0.0.1 conflicts with the VM's internal 127.0.0.1 address, and that's why it's ignored. You might need to configure your proxy to be your host's network IP instead of 127.0.0.1? You might not even need to configure a proxy? Also, the Virtualbox driver gives me problems with VPN. I have the best luck w... |
<h3>Summary</h3>
<p>trying to get <code>minikube-test-ifs.com</code> to map to my deployment using minikube.</p>
<h3>What I Did</h3>
<p><code>minikube start</code><br>
<code>minikube addons enable ingress</code><br>
<code>kubectl apply -f <path-to-yaml-below></code><br>
<code>kubectl get ingress</code><br>
Added ... | <p><strong>Overview</strong></p>
<ul>
<li>Ingress addon for Minikube using docker driver only works on linux</li>
<li>Docker for Windows uses Hyper-V, therefore, if the Docker daemon is running, you will <b>not be able</b> to use VM platforms such as VirtualBox or VMware</li>
<li>If you have Windows Pro, Enterprise or ... |
<p>I want to use execute helm on a gitlab-runner on my kubernetes in gitlab pipelines.</p>
<p>My gitlab.ci.yaml:</p>
<pre><code># Deployment step
deploy:
stage: deploy
image: alpine/helm:latest
script:
- helm --namespace gitlab upgrade initial ./iot/
tags:
- k8s
- dev
</code></pre>
<p>What i have... | <p>Here's my step to address this issue:</p>
<p>First, create service account and custom role for your Gitlab Runner:</p>
<pre><code>kubectl create sa sa-runner -n gitlab
kubectl create role sa-runner-role -n gitlab --verb=get,list,watch,create,delete,patch --resource=pods,secret,pods/exec
kubectl create rolebinding sa... |
<p>For an application deployed in Kubernetes would there be any suggested guidance documentation for SAML integration? My search foo is deserting me.</p>
<p>Most documentation are for the Kubernetes itself and not the application. The application would not be aware of Kubernetes RBAC etc.</p>
| <p>In the <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authentication-strategies" rel="nofollow noreferrer">official documentation</a> you can find the following section:</p>
<blockquote>
<p>Kubernetes uses client certificates, bearer tokens, or an authenticating proxy to authenticat... |
<p>For various reasons I want to be able to use a proxied data table and replaceData while client side processing is being used i.e. <code>DT::renderDataTable(..., server = FALSE)</code>.</p>
<h2>Context</h2>
<p>I have a shiny application/dashboard that communicates to a database and presents information to a user. The... | <p>Here is a client-side approach, building up on @jpdugo17's answer and @TJGorrie's initial example, using the <code>stateSave</code> option to maintain the table state on re-rendering. <code>selectPage</code> and <code>updateSearch</code> can be used along with <code>dataTableProxy</code> - the state of <code>input$t... |
<p>I have a pod that has both node affinity and pod affinity. could some help me understand how would things behave in such a scenario?</p>
<p>Node 1:</p>
<pre><code> label:
schedule-on : gpu
</code></pre>
<p>Node 2:</p>
<pre><code> label:
schedule-on : gpu
</code></pre>
<p>Node 3:</p>
<pre><code>... | <p>It's the union of node affinity and pod affinity. since both the pod has the same topology key domain . hence making them in the same colocation the pods can get scheduled in different nodes but in same colocation .</p>
<p>When matching the topology key and placing the pod. Value of the key is also considered</p>
|
<p>There is an official manifest for the deployment of the daemonset <a href="https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearch/fluent-bit-ds.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/fluent/fluent-bit-kubernetes-logging/master/output/elasticsearc... | <blockquote>
<p>I don't understand why the Fluent-bit needs to read data from the folder <code>/var/lib/docker/containers</code>.</p>
</blockquote>
<p>Because that is where docker stores its <code>${container_id}-json.log</code> file when using the <a href="https://docs.docker.com/config/containers/logging/json-file/" ... |
<p>I’ve a PVC in RWX.
2 pods use this PVC.
I want to know which pods ask volume to the PVC and when. How can I manage that?</p>
| <p>As far as i know there is no direct way to figure out a PVC is used by which pod
To get that info possible workaround is grep through all the pods for the respective pvc :</p>
<pre><code>Ex:
- To display all the pods and their respective pvcs:
kubectl get pods -o jsonpath='{"POD"}{"\t"}{"PV... |
<p>My organization manages systems where each client is provisioned a VPS and then their tech stack is spun up on that system via Docker Compose.</p>
<p>Data is stored on-system, using Docker Compose volumes. None of the fancy named storage - just good old direct path volumes.</p>
<p>While this solution is workable, th... | <p>Where to begin: given what you're telling us, I would first look into my options to implement some SDS.</p>
<p>You're currently using local volumes, which you probably won't be able to do with Kubernetes - or at least shouldn't, if you don't want to bind your containers to a unique node.</p>
<p>The most easy way - w... |
<p>This is my <a href="https://kafka.js.org/docs/getting-started" rel="nofollow noreferrer">KafkaJs</a> based publisher client. I created a container image and submitted a <code>Pod</code> YAML to Strimzi broker.</p>
<pre class="lang-js prettyprint-override"><code>const { Kafka } = require('kafkajs')
async function cl... | <p>The logs show nothing because 1) Your code has no log output 2) Your code only send a single record, and then stops, so the container exits cleanly; it is not a long-running service. You'd have the same issues with a simple <code>docker run</code> command.</p>
<p>If you wanted a long-running service, you'd need to w... |
<p>This is my <a href="https://kafka.js.org/docs/getting-started" rel="nofollow noreferrer">KafkaJs</a> based publisher client. I created a container image and submitted a <code>Pod</code> YAML to Strimzi broker.</p>
<pre class="lang-js prettyprint-override"><code>const { Kafka } = require('kafkajs')
async function cl... | <p>you can bring up the pod in sleep mode and from there you can debug, use below yaml</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: clients
spec:
containers:
- name: clients
image: ghcr.io/org/clients:v0.0.0
imagePullPolicy: Always
command: ["sleep" , "100000000"]
</code... |
<p>Good morning. I am doing some tests with the new Google Cloud Kubernetes Engine's Autopilot mode. I know that it automates a lot of the machine resources' management, but I am not sure about what it automates. Does it only cares about provisioning the hardware resources that I set inside my PodSpec? Or does it also ... | <p>For GKE autopilot you need to create the <strong>HPA</strong> and <strong>VPA</strong> configuration</p>
<p>GKE autopilot will the scaling of <strong>Node</strong> by default</p>
<p>You can read more at : <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison" rel="nofollow n... |
<p>In Spring Boot 2.6.0 using Log4J2. I want to use env variables from external to log4j.propeties
but it is always taking local <code>application.propeties</code> file instead of real docker or Kubernetes env variables</p>
<p>File <code>application.properties</code></p>
<pre><code>spring.application.name=myapp
#Logge... | <p>In all your attempts you use a single source for the <code>filename</code> property. You need to use one of the <em>fallback</em> features of variable substitution:</p>
<ul>
<li><p>You can add a default value to your variable substitution using the syntax <code>${variable:-default}</code>:</p>
<pre><code>property.fi... |
<p>I'm trying to expose a website inside my Kubernetes Cluster. Therefor I created an Ingress that links to my Service and so to my Pod. Till this point, everything works perfectly fine.
But now when I start navigating on my Page the URL changes, but the shown site stays the “Homepage”.
How is it possible to navigate o... | <p>The issue is most likely coming from the rewrite that you have in your ingress manifest.</p>
<pre><code> nginx.ingress.kubernetes.io/rewrite-target: /
</code></pre>
<p>this means that when the ingress receives the request from the client it takes the <code>path</code> portion of the url and rewrites it to be <cod... |
<p>I recently hosted Jupyterhub in our K8s cluster. We set memory limits to 1GB so now all Jupyter notebook are with this configuration. But we have notebooks which are resource(memory and cpu) intensive and some notebooks are not resource intensive</p>
<p>So , is there anyway to assign different resource for multiple ... | <p>We use <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/jupyterhub/customizing/user-environment.html#using-multiple-profiles-to-let-users-select-their-environment" rel="nofollow noreferrer">profiles</a> to allow users to select from pods of different sizes. The pods are all deployed on large nodes, but u... |
<p>I have created a spring boot project which connects with Cloud SQL(MySQL).
I have deployed this in google cloud (cloudrun) and it is working in it.</p>
<p>now, I am trying to deploy the same container image of spring boot app in kubernates enigne GKE and i am expecting this will connect with mysql cloud sql instance... | <p>Not sure how you are passing the service account file but you can pass it using the <strong>Kubernetes</strong> secret or use the <strong>Service account</strong> and attach it to deployment.</p>
<pre><code>kubectl create secret generic google-application-credentials --from-file=./application-credentials.json
</code... |
<p>I've deployed pgadmin on Kubernetes and I'm trying to enable oauth2 as per the <a href="https://www.pgadmin.org/docs/pgadmin4/5.5/oauth2.html" rel="nofollow noreferrer">pgadmin docs</a></p>
<p>This is the oauth config which I've passed in:</p>
<pre class="lang-py prettyprint-override"><code>AUTHENTICATION_SOURCES = ... | <p>I think that in this case we can just use the OIDC endpoint to fetch userinfo. For gitlab it is: ttps://gitlab.com/oauth/userinfo. Therefore, you do not need <code>api</code> scope, just <code>openid email profile</code></p>
<p>So the following configuration actually works for me:</p>
<pre class="lang-py prettyprint... |
<p>I am new to Kubernetes, and trying to get apache airflow working using helm charts. After almost a week of struggling, I am nowhere - even to get the one provided in the apache airflow documentation working. I use Pop OS 20.04 and microk8s.</p>
<p>When I run these commands:</p>
<pre><code>kubectl create namespace ai... | <p>If you installed with helm, you can uninstall with <code>helm delete airflow -n airflow</code>.</p>
<p>Here's a way to install airflow for <strong>testing</strong> purposes using default values:</p>
<p>Generate the manifest <code>helm template airflow apache-airflow/airflow -n airflow > airflow.yaml</code></p>
<p... |
<p>I am in the learning phase of kubernetes and able to set up deployments, services etc. However I have got stuck on how to manage secrets.</p>
<p>Context</p>
<ol>
<li><p>I am using GKE for Kubernetes cluster</p>
</li>
<li><p>I am using helm charts for managing all deployment operations</p>
</li>
<li><p>I have created... | <blockquote>
<p>I do not want to create the secrets manually like this - kubectl
create secret generic pubsub-key
--from-file=key.json=PATH-TO-KEY-FILE.json , I want to do it through helm because say tomorrow if I move to another k8s cluster then I have
do it manually again</p>
</blockquote>
<p>You can create the <stro... |
<p>After almost 1 year without a problem, I realized that cert-manager can't produce certificates anymore.</p>
<p>I started seeing this error:</p>
<blockquote>
<p>Error from server: conversion webhook for cert-manager.io/v1alpha2,
Kind=Certificate failed: Post
"https://cert-manager-webhook.cert-manager.svc:443/con... | <p>I would suggest updating the version of <strong>Cert-manager</strong> you are running.</p>
<pre><code>helm install \
cert-manager jetstack/cert-manager \
--namespace mynamespace \
--version v0.15.1 \
--set installCRDs=true
</code></pre>
<p>do not forget to install the CRD.</p>
<p><code>Cert-manager</code> su... |
<p>I have configured 1 master 2 workers.
after installation successfully kubernetes. It is OK with worker1 joining cluster but I can not join worker2 to the cluster
because kubelet service is not running. <strong>It seems like the kubelet isn't running or healthy</strong></p>
<p><strong>sudo kubectl get nodes:</strong>... | <p>First, check if swap is diabled on your node as you MUST disable swap in order for the kubelet to work properly.</p>
<pre class="lang-sh prettyprint-override"><code>sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab
</code></pre>
<p>Also check out if kubernetes and docker cgroup driver is set to same.
From <... |
<p>I want to get the last time a secret was modified via the kube api. I cannot seem to find a way to access this information. I had a look at events but I cannot find any for Secrets.</p>
<p>An example would be I create a secret called my-secret, I then update this the next day but I want to know what time it was upda... | <p>The following command will give you the secret chronological history:</p>
<p><code>kubectl get secret <name> --namespace <namespace> --show-managed-fields -o jsonpath='{range .metadata.managedFields[*]}{.manager}{" did "}{.operation}{" at "}{.time}{"\n"}{end}'</code></p>
<p>... |
<p>How to implement memory state/session replications with K8S? For instance, a web shopping cart system replicates the user HTTP sessions among cluster nodes over the network so that if a node is down, a process in another node can take over the user sessions.</p>
<p>K8S has StatefulSet which uses the disk storages to... | <blockquote>
<p>How to implement memory state/session replications with K8S? For
instance, a web shopping cart system replicates the user HTTP sessions
among cluster nodes over the network so that if a node is down, a
process in another node can take over the user sessions.</p>
</blockquote>
<p>To store the state it's ... |
<p>I took a course a while ago on Kubernetes. I used my Ubuntu 20.04.3 LTS laptop to set up the environment for educational purposes.</p>
<p>I used microk8s as my Kubernetes distribution.</p>
<p>I recently noticed that there were the following processes using about 1/2 GB of memory:</p>
<pre><code>kube-apiserver
kube-c... | <p>You can remove the microk8s using following command in ubuntu:</p>
<pre><code>sudo snap remove microk8s
</code></pre>
<p>The above command should remove all the services from your laptop.</p>
|
<p>I would like to run a pod on one of my IoT devices.
Each one of those devices contains an environment variable I want this pod to use.
Is there any way to inject this env variable into the pod using build-in templating of <code>helm</code>/<code>kubectl</code>?
I was trying the following on my <code>deployment.yaml<... | <p>It's not possible to directly pass the host's env vars to the pods. I often do that by creating a ConfigMap.</p>
<ol>
<li><p>Create a ConfigMap with <code>from-lireral</code> option:</p>
<pre><code>kubectl create configmap testcm --from-literal=hostname=$HOSTNAME
</code></pre>
</li>
<li><p>Refer to that in the Pod's... |
<p>I have bunch of cron jobs that sit in an EKS cluster and would like to trigger them via HTTP call. Does such API exist from Kubernetes? If not, what else can be done?</p>
| <p>Every action in Kubernetes ca be invoked via rest API call. This is also stated as such in the <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/" rel="nofollow noreferrer">docs</a>.</p>
<p>There is a full <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#-strong-api-ov... |
<p>After almost 1 year without a problem, I realized that cert-manager can't produce certificates anymore.</p>
<p>I started seeing this error:</p>
<blockquote>
<p>Error from server: conversion webhook for cert-manager.io/v1alpha2,
Kind=Certificate failed: Post
"https://cert-manager-webhook.cert-manager.svc:443/con... | <p>Manually deleting secrets <code>cert-manager-webhook-ca</code> and <code>cert-manager-webhook-tls</code> may work in this case. Cert-manager controller will automatically create the deleted secrets afterwards.</p>
|
<p>I deployed a K8s <strong>StatefulSet</strong> with 30 replicas (or N replicas, where N is multiple of 3) in EKS Cluster.</p>
<p>EKS cluster is with 3 nodes, one node for one AZ, and I want to <em>guarantee</em> with Kubernetes Affinity/AntiAffinity the <strong>equal</strong> distribution of pods across different AZ.... | <p>While this is too possible with node affinity, a straight forward way is the use of topologySpreadContraints, here's the k8s <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#api" rel="nofollow noreferrer">documentation, diagrams and examples</a> to see it in action.</p>
|
<p>I need to test a scenario to see how my app deals with latency. My application is in K8S on Azure (AKS) and its connecting to a Postgres DB in Azure. Anyone know of any good tools that aren't too tricky to implement?</p>
| <p>I ended up created a haproxy VM and directing my db traffic through it. Then on the haproxy I used the network emulator linux tool to delay the traffic . It works really well</p>
<p><a href="https://wiki.linuxfoundation.org/networking/netem" rel="nofollow noreferrer">https://wiki.linuxfoundation.org/networking/netem... |
<p>I deployed a K8s <strong>StatefulSet</strong> with 30 replicas (or N replicas, where N is multiple of 3) in EKS Cluster.</p>
<p>EKS cluster is with 3 nodes, one node for one AZ, and I want to <em>guarantee</em> with Kubernetes Affinity/AntiAffinity the <strong>equal</strong> distribution of pods across different AZ.... | <p>You can always use selectors and default labels which you get from AWS. A simple pod spec example is here</p>
<pre><code>topologySpreadConstraints:
- maxSkew: 1
topologyKey: "topology.kubernetes.io/zone"
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: myapp
</c... |
<p>We are using GridGain Community edition : 8.8.10 and have created Ignite Cluster in Kubernetes using the Apache Ignite operator. We have enabled native persistence also.</p>
<p><a href="https://ignite.apache.org/docs/latest/installation/kubernetes/gke-deployment" rel="nofollow noreferrer">https://ignite.apache.org/d... | <p><strong>Apache Ignite</strong> uses <strong>Apache Lucene</strong> (currently it's 7.4.0) for text queries under the hood. In general Lucene-based indexes leverage various implementations of <a href="https://lucene.apache.org/core/7_4_0/core/org/apache/lucene/store/Directory.html" rel="nofollow noreferrer">org.apach... |
<p>I've created a cluster using terraform with:</p>
<pre><code>provider "google" {
credentials = "${file("gcp.json")}"
project = "${var.gcp_project}"
region = "us-central1"
zone = "us-central1-c"
}
resource "google_container_cluster" "primary" {
name = "${var.k8s_cluster_name}"
location = "us-ce... | <p>you should add "initial_node_count" (like <code>initial_node_count = 3</code>) to "google_container_node_pool" resourse.
<a href="https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#node_count" rel="nofollow noreferrer">Official documentation</a> say... |
<p>I have a haproxy as a load balancer running in k8s with a route to a service with two running pods. I want the server naming inside haproxy to correspond to the pod names behind my service. If I'm not mistaken the following configmap / annotation value should do exactly this: <code>https://haproxy-ingress.github.io/... | <p>Here are a few hints to help you out solving your issue.</p>
<h2>Be sure you know the exact version of your haproxy-ingress controller:</h2>
<p>Looking at the manifest files you shared, it's hard to tell which exact version of <code>haproxy-ingress-controller</code> container you are running in your cluster (btw, it... |
<p><strong>The context</strong></p>
<p>Let me know if I've gone down a rabbit hole here.</p>
<p>I have a simple web app with a frontend and backend component, deployed using Docker/Helm inside a Kubernetes cluster. The frontend is servable via nginx, and the backend component will be running a NodeJS microservice.</p>
... | <p>You mention that your frontend is based on Nginx.</p>
<p>Accordingly,Frontend must hit the <strong>public</strong> URL of backend.</p>
<p>Thus, backend must be exposed by choosing the service type, whether:</p>
<ul>
<li><strong>NodePort</strong> -> Frontend will communicate to backend with <code>http://<any-no... |
<p>I created a nginx ingress using <a href="https://kubernetes.github.io/ingress-nginx/deploy/#quick-start" rel="nofollow noreferrer">this link</a> using docker-desktop.</p>
<pre class="lang-sh prettyprint-override"><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/depl... | <p>this is because the prefix <code>/assinaturas</code> need to be omitted by an Nginx <strong>rewrite</strong>.. And that's explain why you got 404 (not found):</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-be-assinaturas
namespace: apps-space
annotations:
kubernetes.... |
<p>I have installed ingress controller via helm as a daemonset. I have configured the ingress as follows:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webapp-ingress
namespace: rcc
annotations:
haproxy.org/check: 'true'
haproxy.org/check-http: /serviceCheck
haproxy.org... | <p>I installed last <code>haproxy ingress</code> which is <code>0.13.4</code> version using helm.</p>
<p>By default it's installed with <code>LoadBalancer</code> service type:</p>
<pre><code>$ kubectl get svc -n ingress-haproxy
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) ... |
<p>When I launch a pod with the following limits/request:</p>
<pre><code> resources:
limits:
cpu: "3500m"
memory: "8192Mi"
ephemeral-storage: "5Gi"
requests:
cpu: "500m"
memory: "512Mi"
ephemeral-storage: "2Gi"
</code></pre>
<hr ... | <p><strong>Resource limits need to be equal to requested resources for GKE autopilot</strong></p>
<p>That is the default behavior of the GKE <strong>autopilot</strong>. <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#allowable_resource_ranges" rel="nofollow noreferrer">Read More</a>... |
<p>I tried everything to build a ReactJs app with NPM in a Jenkins pipeline running on Kubernetes.</p>
<p>When I try to build my project from Windows or even from Windows subsystem for Linux with an Ubuntu installation, everything work fine and NPM is able to install the packages and build de project from the package.j... | <p>I finally found a workaround. The build fail not because of errors but warnings.</p>
<p>The workaround is to remove the eslint configuration part</p>
<pre><code>"eslintConfig": {
"extends": "react-app"
}
</code></pre>
<p>When eslint is not active the result of the build is <strong>C... |
<p>A word of warning, this is my first posting, and I am new to docker and Kubernetes with enough knowledge to get me into trouble.
I am confused about where docker container images are being stored and listing images.</p>
<p>To illustrate my confusion I start with the confirmation that "docker images" indica... | <p>I will try to bring some clarity to you despite the fact your question already contains about 1000 questions (and you'll probably have 1000 more after my answer :D)</p>
<p>Before you can begin to understand any of this, you need to learn a few basic things:</p>
<ol>
<li><p>Docker produces images which are used by co... |
<p>Conditions:
I have a <em>3 tier application</em> to deploy using Kubernetes. I have created <strong>two namespaces</strong> for <em>backend</em> and <em>frontend</em> respectively.</p>
<p>Problem:
I want to know how would my <strong>backend</strong> talk to the <strong>frontend</strong> or vice versa.</p>
<p>In simp... | <p>applications can communicate with other services outside their namespace , just use the correct <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">dns name</a></p>
<pre><code><Service Aame>.<Namespace Name>.svc.cluster.local
</code></pre>
|
<p>Conditions:
I have a <em>3 tier application</em> to deploy using Kubernetes. I have created <strong>two namespaces</strong> for <em>backend</em> and <em>frontend</em> respectively.</p>
<p>Problem:
I want to know how would my <strong>backend</strong> talk to the <strong>frontend</strong> or vice versa.</p>
<p>In simp... | <p>There's two ways: internal-only and external.</p>
<p>For both, create a kubernetes service for the front and back end services.</p>
<p>For external, the service type must <code>LoadBalancer</code>. You install the <a href="https://github.com/kubernetes-sigs/external-dns" rel="nofollow noreferrer">External DNS</a> pl... |
<p>I have asp.net core web api app where I have implemented health checks when we deployed the app to Azure Kubernetes Services and the startup probe gets failed.</p>
<blockquote>
<p>startupProbe:
httpGet:
path: /health/startup
port: 32243
failureThreshold: 25
periodSeconds: 10</p>
</blockquote>
<p>I can see that inter... | <p>You can use <code>https</code> instead of <code>http</code> for the <code>httpGet.scheme</code> value of the <code>startupProbe</code>.</p>
|
<p>I try to run Prefect flow in IBM Cloud Kubernetes cluster. So I am setting up the Kubernetes Agent. I see errors when I do:</p>
<pre><code>kubectl apply -f prefect_agent.yaml
kubectl logs prefect-agent-778f997b7-hnsk2
[2021-12-07 12:34:14,399] INFO - agent | Registering agent...
Traceback (most recent call last):
... | <p>I found that the <code>- name: PREFECT__CLOUD__API_KEY value: {myapikey}</code>
this is generated by: <a href="https://docs.prefect.io/orchestration/concepts/api.html#authentication" rel="nofollow noreferrer">https://docs.prefect.io/orchestration/concepts/api.html#authentication</a></p>
<p>I used the Kubernetes clus... |
<p>I am fairly new to <code>Kubernetes</code> and have just deployed my first cluster to <code>IBM Cloud</code>. When I created the cluster, I get a dedicated ingress subdomain, which I will be referring to as <code><long-k8subdomain>.cloud</code> for the scope of this post. Now, this subdomain works for my app. ... | <p>For the NGINX ingress controller to route requests for your own domain's CNAME record to the service instead of the IBM Cloud one, you need a rule in the ingress where the <code>host</code> identifies your domain.</p>
<p>For instance, if your domain's DNS entry is <code>api.example.com</code>, then change the resour... |
<p>I want to change ndots default value from 5 to 3 in all pods in Kubernetes.
for example, this is the current resolv.conf output from one of my pods. How can I change the value of ndots from 5 to 3 in all current and future pods:</p>
<pre><code>[root@master01 ~]# kubectl exec test-7c9b9bc678-kfcsj -- cat /etc/resolv.... | <p>You can adjust this configuration in the pod's <code>dnsConfig</code> section. See more details <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config" rel="nofollow noreferrer">here</a>.</p>
<p>We are doing the same in the helm chart responsible for deploying applications i... |
<p>I have some Helm value files.</p>
<p>There are <code>value.yaml</code>, <code>value.dev.yaml</code>, <code>value.test.yaml</code>, ... file.</p>
<p>In <code>value.dev.yaml</code>:</p>
<pre><code>env:
"Environment" "development"
</code></pre>
<p>For some parameters in <code>value.yaml</code> fi... | <p>You can specify the <code>--values</code>/<code>-f</code> flag multiple times. The priority will be given to the <strong>last</strong> (right-most) file specified. For example, if both <code>myvalues.yaml</code> and <code>override.yaml</code> contained a key called 'Test', the value set in <code>override.yaml</code>... |
<p>I've an application running on k8s and would like to updated the java heapsize .
I've updated the JAVA_OPTS environnement variable and set it in the deployment file as below</p>
<pre><code>- name: JAVA_OPTS
value: "-Xmx768m -XX:MaxMetaspaceSize=256m"
</code></pre>
<p>but when i run the below ... | <p>I see that you used OpenJDK Alpine to deploy a JAVA application, so you need to use this environment "<strong>JAVA_TOOL_OPTIONS</strong>" instead of "<strong>JAVA_OPTS</strong>", something like:</p>
<pre><code>spec:
containers:
- name: jvm_options
image: xxx:xxx
env:
- name: JAVA_... |
<p>I have a web scraping app that is deployed on a kubernetes cluster on GCP and this app uses a proxy to connect to multiple browsers. So I need to assign a static ip address so that the proxy can do its job, but the problem here is that I can't figure out which address to give to the proxy server. I tried to give the... | <p>As your traffic comes into the cluster from single point you should be diverting the traffic from single point also which is Egress point.</p>
<p>I am not sure what you mean when you say egress but it will be Node IP mostly if you are running GKE default.</p>
<p>Kubernetes uses the Node IP as outgoing IP on which PO... |
<p>I have 1 question regarding migration from Nginx controller to ALB. Does k8s during migration will create a new ingress controller and switch smoothly services to new ingress or will delete an old one and after that will create a new ingress? Why I ask that, because we want to change ingress class and we would like ... | <ol>
<li>First, when transitioning from one infrastructure to another, it's best to pre-build the new infrastructure ahead of the transition so it will be ready to be changed.</li>
<li>In this specific example, you can set up the two IngressClasses to exist in parallel, and create the new ALB ingress with a different d... |
<p>Conditions:
I have a <em>3 tier application</em> to deploy using Kubernetes. I have created <strong>two namespaces</strong> for <em>backend</em> and <em>frontend</em> respectively.</p>
<p>Problem:
I want to know how would my <strong>backend</strong> talk to the <strong>frontend</strong> or vice versa.</p>
<p>In simp... | <p>You should create <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">services</a> for frontend and backend, and then you can communicate using:</p>
<ul>
<li>(Recommended) a <strong>DNS names of the services</strong> <code><service-name>.<namespace-name>.s... |
<p>I am trying create deployment using yaml file in <strong>kubernetes</strong> but facing this specific error:</p>
<p><strong>Error from server (BadRequest): error when creating ".\deployment_test.yaml": Deployment in version "v1" cannot be handled as a Deployment: v1.Deployment.Spec: v1.Deployment... | <p>There are some misconfigurations.</p>
<ol>
<li>apiVersion is missing in the first deployment</li>
<li>indentation below <code>metadata</code> is incorrect</li>
<li>You must include the <code>metadata.name</code> field</li>
<li><code>spec.selector.matchLabels</code> and <code>spec.template.metadata.labels</code> shou... |
<p>Conditions:
I have a <em>3 tier application</em> to deploy using Kubernetes. I have created <strong>two namespaces</strong> for <em>backend</em> and <em>frontend</em> respectively.</p>
<p>Problem:
I want to know how would my <strong>backend</strong> talk to the <strong>frontend</strong> or vice versa.</p>
<p>In simp... | <p>Your application will talk to each other using the <strong>Kubernetes service</strong>.</p>
<p>So generally traffic flows moves inside K8s cluster is like</p>
<pre><code>Incoming traffic to any specifc application > Kubernetes service > Kubernetes deployment > PODs > Containers
</code></pre>
<p>So now im... |
<p>The spring boot application is deployed on openshift 4. This application needs to create a file on the nfs-share.
The openshift container has configured a volume mount on the type NFS.
The container on openshift creates a pod with random userid as</p>
<pre><code>sh-4.2$ id
uid=1031290500(1031290500) gid=0(root) grou... | <h1>TL;DR</h1>
<p>You can use the <code>anyuid</code> security context to run the pod to avoid having OpenShift assign an arbitrary UID, and set the permissions on the volume to the known UID of the user.</p>
<hr />
<p><a href="https://cookbook.openshift.org/users-and-role-based-access-control/why-do-my-applications-ru... |
<p>I have configMap:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: my-app
data:
application.yaml: |-
config:
property1: 1
property2: 2
property3: 2
my-map-property:
a: b
c: d
e: f
g: h
</code></pre>
<p>now I want to update my ma... | <p>You can use yq + kustomize configMap generators. The downside is that Kustomize will mutate the config map name every time there is a change so you will have to "garbage collect" all unused config maps manually.</p>
<p>So you would have the following setup:</p>
<pre class="lang-yaml prettyprint-override"><... |
<p>I have a tool which is now available to be deployed on Kubernetes. A known person made a document on getithub where he asked to run two power shell files. <a href="https://github.com/tonikautto/qse-kubernetes-minikube" rel="nofollow noreferrer">source</a></p>
<p>When I run first file <code>0-install-tools.ps1</code... | <p>I had same problem. In my case solution is create new function in <strong>_helpers.tpl</strong></p>
<pre><code>{{/*
Nullable secret value
*/}}
{{- define "secretValue" -}}
{{- $value := . }}
{{- if $value }}
{{- printf "%s" $value | b64enc }}
{{- else }}
{{- printf &q... |
<p>I intend to add additional error message fields to a custom resource status. The fields are marked as</p>
<pre><code>ErrMsg string `json:"errmsg,omitempty"`
</code></pre>
<p>Does adding these fields require a new API version, or is is safe to just change the managing operator to fill these fields with valu... | <p>According to <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties" rel="nofollow noreferrer">this</a></p>
<blockquote>
<p>Additional fields may be added in the future.</p>
</blockquote>
<p>If your controller is only ever writing... |
<p>I tried multiple syntax including one given below , no luck yet</p>
<pre><code>kubectl exec -u root -it testpod -- bash
Error: unknown shorthand flag: 'u' in -u
See 'kubectl exec --help' for usage.
</code></pre>
<p>it is version 1.22</p>
| <ul>
<li>There is no option available in <code>kubectl exec</code> to mention the user</li>
<li>Because it is decided at either in the container image or in the pod.spec.containers.securityContext.runAsUser field</li>
<li>so to achieve what youy want is on a running container then do just <code>kubectl exec -it testp... |
<p>I'm trying to apply a terraform resource (helm_release) to k8s and the apply command is failed half way through.</p>
<p>I checked the pod issue now I need to update some values in the local chart.</p>
<p>Now I'm in a dilemma, where I can't apply the helm_release as the names are in use, and I can't destroy the helm_... | <p>You don't have to manually delete all the resources using <code>kubectl</code>. Under the hood the Terraform Helm provider still uses Helm. So if you run <code>helm list -A</code> you will see all the Helm releases on your cluster, including the <code>nginx-ingress</code> release. Deleting the release is then done v... |
<p>I'm working on this cloud project where we have several development repositories in GitHub and in each we have the overlays containing config files that are specific for a local K8S cluster, a dev Azure cluster and a prod Azure cluster.</p>
<p>In order to have different repos for these envs we use a repo with a kust... | <p>To clarify I am posting Community Wiki answer.</p>
<p>The solution you suggested in comment's section:</p>
<blockquote>
<p>We will have the deployments/namespaces/services manifests in the same repo as the application source code as well the an overlay with a customization with the necessary resources to fully deplo... |
<p>I want to use the <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/" rel="nofollow noreferrer">App-of-apps</a> practice with ArgoCD. So I created a simple folder structure like the one below. Then I created a project called <code>dev</code> and I created an app that will look i... | <h2>Posting comment as the community wiki answer for better visibility</h2>
<hr />
<p>It turns out that at the moment ArgoCD can only recognize application declarations made in ArgoCD namespace, but @everspader was doing it in the default namespace. For more info, please refer to <a href="https://github.com/argoproj/ar... |
<p>The command <code>kubectl get pods <POD NAME></code> will return the specific pod with that name. I wonder if there is a way that I can use part of the name, for instance, a command that returns all pods that start with <code>j</code>.</p>
| <p>In Linux Bash:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get pods | grep ^j
</code></pre>
<p>In Windows PowerShell:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get pods | Select-String '^j'
</code></pre>
|
<p>We can restart kubernetes deployment using kubectl rollout restart. I want to perform same action using kubernetes api server.</p>
| <p>You can use this Curl to restart using the API</p>
<pre><code>curl --location --request PATCH 'http://<K8s cluster IP>:6443/apis/apps/v1/namespaces/<Namespace name>/deployments/<Deployment name>?fieldManager=kubectl-rollout&pretty=true' \
--header 'Content-Type: application/strategic-merge-patc... |
<p>I have a Service configured to be accessible via HTTP.</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
name: myservice
spec:
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
</code></pre>
<p>And an Ngynx Ingress configured to make that internal service acc... | <p>It's expected behaviour since you've set <code>TLS</code> in your Ingress.</p>
<blockquote>
<p>Note that by default the controller <strong>redirects</strong> (308) to <strong>HTTPS</strong> if TLS <strong>is enabled</strong> for that ingress. If you want to disable this behavior globally, you can use ssl-redirect: &... |
<p>Do you know what is the annotation that we can use it on GKE to make a LoadBalancer service internal?. For example Azure (and AWS) supports the following annotation (shown in the YAML code snippet) to make a LoadBalancer service internal. I couldn’t find equivalent of it on GKE. For example naturally one may expect ... | <p>The equivalent can be found <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing#create" rel="nofollow noreferrer">here</a>.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: ilb-service
annotations:
networking.gke.io/load-balancer-type: "Internal"
lab... |
<p>I want to configure port forward <code>80</code>-><code>32181</code>, <code>443</code>-><code>30598</code>. <code>32181</code> and <code>30598</code> is <code>NodePort</code> of k8s ingress controller which i can establish connection correctly:</p>
<pre><code>$ curl http://localhost:32181
<html>
<head... | <p>To clarify I am posting Community Wiki answer.</p>
<p>The problem existed only during forwarding to a k8s service NodePort.</p>
<p>To solve the problem <strong>you have set up an External Nginx as a TCP Proxy.</strong></p>
<p>Here one can find <a href="https://docs.gitlab.com/charts/advanced/external-nginx/" rel="no... |
<p>What is the best way to enable BBR on default for my clusters?
In this <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/node-system-config" rel="nofollow noreferrer">link</a>, I didn't see an option for controlling the congestion control.</p>
| <p>Google BBR can only be enabled in Linux operating systems. By default the Linux servers uses Reno and CUBIC but the latest version kernels also includes the google BBR algorithms and can be enabled manually.</p>
<p>To enable it on CentOS 8 add below lines in /etc/sysctl.conf and issue command sysctl -p</p>
<p>net.co... |
<p>Do you know what is the annotation that we can use it on GKE to make a LoadBalancer service internal?. For example Azure (and AWS) supports the following annotation (shown in the YAML code snippet) to make a LoadBalancer service internal. I couldn’t find equivalent of it on GKE. For example naturally one may expect ... | <p>There are 2 annotations:</p>
<p>For GKE versions 1.17 and later, use the annotation:</p>
<pre><code>networking.gke.io/load-balancer-type: "Internal"
</code></pre>
<p>For earlier versions, use the annotation:</p>
<pre><code>cloud.google.com/load-balancer-type: "Internal"
</code></pre>
<p>Plus, I’m... |
<p>I'm new to kubernetes. I'm just wondering is there any downside if i'm set the value for kubernetes container resource requests and limits as max as possible like this?</p>
<pre><code>resources:
limits:
cpu: '3'
memory: 1Gi
requests:
cpu: '2'
memory: 256Mi
</code></pre>
| <p>You should set <code>requests</code> to the minimum values your pod needs and <code>limits</code> to the max you allow it to use. It helps Kubernetes to schedule pods properly.</p>
<p>If the <code>requests</code> value is too high, then Kubernetes may not have any node that fulfills these requirements and your pod m... |
<p>I'm using Kubernetes with kube-state-metrics and Prometheus/grafana to graph various metrics of the Kubernetes Cluster.</p>
<p>Now I'd like to Graph how many <strong>new</strong> PODs have been created per Hour over Time.</p>
<p>The Metric <code>kube_pod_created</code> contains the Creation-Timestamp as Value but ... | <p>PODs created in past hour</p>
<p><code>count ( (time() - sum by (pod) (kube_pod_created)) < 60*60 )</code></p>
|
<p>I have a Kubernetes cluster with multiple nodes in two different subnets (<code>x</code> and <code>y</code>). I have an IPsec VPN tunnel setup between my <code>x</code> subnet and an external network. Now my problem is that the pods that get scheduled in the nodes on the <code>y</code> subnet can't send requests to ... | <p>Posting this as a community wiki, feel free to edit and expand.</p>
<hr />
<p>There is no built-in functionality in kubernetes that can do it. However there are two available options which can help to achieve the required setup:</p>
<ol>
<li><strong>Istio</strong></li>
</ol>
<p>If services are well known then it's p... |
<p>Reading through "Kubernetes In Action" book, there is a kubectl command which creates a pod but does not deploy it:</p>
<pre><code>$ kubectl run kubia --image=dockeruser/kubia --port=8080 --generator=run/v1
replicationcontroller "kubia" created
</code></pre>
<p>The generator option is there to en... | <p>You don't need "generator" starting 1.17, you can use "create" like <code>kubectl create deployment kubia --image=dockeruser/kubia --port=8080</code></p>
|
<p>I found on microsoft documentation a yaml that consent to do everything in all resources inside a namespace. I modified this yaml to avoid delete verbs and it works fine:</p>
<pre><code> kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: myaksrole_useraccess
namespace: mynamespace
rules:
- ap... | <p>Let's check the <code>myaksrole_useraccess</code> Role from the original definition:</p>
<pre><code>kubectl describe role myaksrole_useraccess -n mynamespace
Name: myaksrole_useraccess
kind: Role
Labels: <none>
Annotations: <none>
PolicyRule:
Resources Non-Resource URLs Resource N... |
<p>I would like to know how exactly pods get an IP address, and how they distribute the pods to agent and master.</p>
<p>I have 1 master node and 2 agent nodes. my pods all are running well, but I am curious how the pods get an IP address.</p>
<p>some pods have IP cluster nodes, meanwhile, some have an ethernet IP addr... | <p>Based on your internal plugin your POD will get the IPs. Which again will be the internal IPs mostly.</p>
<p>There are different types of Network interfaces, we can use <strong>CNI</strong> as per need : <a href="https://kubernetes.io/docs/concepts/cluster-administration/networking/" rel="nofollow noreferrer">https:... |
<p>I'm trying to deploy a HA Keycloak cluster (2 nodes) on Kubernetes (GKE). So far the cluster nodes (pods) are failing to discover each other in all the cases as of what I deduced from the logs. Where the pods initiate and the service is up but they fail to see other nodes.</p>
<p>Components</p>
<ul>
<li>PostgreSQL D... | <h3>For Keycloak 17 and newer</h3>
<p>By default, those versions use DNS_PING as the discovery mechanism for JGroups (the underlying cluster mechanism) but you still need to activate it.</p>
<p>You'll need:</p>
<ul>
<li>a <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="... |
<p>I am trying to learn Google Kubernetes Engine. I am deploying a web app in Node.js on a cluster containing 6 sensitive environment variables. Locally I have them in an .env file that I have .gitignored. I push the code to github which creates a container on Cloud Build through a trigger.</p>
<p>I am using the graphi... | <blockquote>
<p>What is common/good practise to work with environmental variables on
GCP - in a easy and safe manner?</p>
</blockquote>
<p>Very easy documentation : <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/secret" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/concept... |
<p>I have the following Dockerfile:</p>
<pre class="lang-sh prettyprint-override"><code>FROM python:3-alpine
WORKDIR /usr/src/app
COPY requirements.txt .
RUN pip install -qr requirements.txt
COPY target-watch.py .
CMD ["python3", "./target-watch.py"]
</code></pre>
<p>If I deploy this to a Kubernetes... | <p>Your container image doesn't have bash so you should use /bin/sh instead of /bin/bash.</p>
<pre><code>docker run --rm -it --entrypoint /bin/sh docker-conveyor.xxx.com/myorg/my_cron_jobs:2021.12.08_03.51_abcdef
</code></pre>
<p>Alpine docker image doesn't have bash installed by default. You will need to add the foll... |
<p>The KubernetesPodOperator in my Airflow dag is trying to launch a pod using the following pod spec (replaced some config values with <code>xxx</code>):</p>
<pre><code>{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"... | <p>You have nested annotations and thats also what the error is telling you.</p>
<pre><code>v1.ObjectMeta.Annotations: ReadString: expects \" or n, but found {,
</code></pre>
<p>You are not allowed to do this.</p>
<pre class="lang-json prettyprint-override"><code>"annotations": {
"sidecar.isti... |
<p>I have Kubernetes with ClusterRoles defined for my users and permissions by (RoleBindings) namespaces.
I want these users could be accessed into the Kubernetes Dashboard with custom perms. However, when they try to log in when using kubeconfig option that's got this message:</p>
<pre><code>"Internal error (500)... | <p><strong>Update SOLVED:</strong></p>
<p>You have to do this:</p>
<ol>
<li>Create ServiceAccount per user</li>
</ol>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
name: NAME-user
namespace: kubernetes-dashboard
</code></pre>
<ol start="2">
<li>Adapt the RoleBinding adding this SA</li>
</ol>
<pre><code>k... |
<p>In Helm's v3 documentation: <a href="https://helm.sh/docs/chart_template_guide/accessing_files/" rel="nofollow noreferrer">Accessing Files Inside Templates</a>, the author gives an example of 3 properties (toml) files; where each file has only one key/value pair.</p>
<p>The configmap.yaml looks like this. I'm only a... | <p>Helm will read in that file, but it is (for good or bad) a <strong>text</strong> templating engine. It does not understand that you are trying to compose a YAML file and thus it will not help you. That's actually why you will see so many, many templates in the wild with <code>{{ .thing | indent 8 }}</code> or <code>... |
<p>I'm creating three EKS clusters using <a href="https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/latest" rel="nofollow noreferrer">this</a> module. Everything works fine, just that when I try to add the configmap to the clusters using <code>map_roles</code>, I face an issue.</p>
<p>My configuration... | <p>The aws-auth configmap is created by EKS, when you create a managed node pool. It has the configuration required for nodes to register with the control plane. If you want to control the contents of the configmap with Terraform you have two options.</p>
<p>Either make sure you create the config map before the managed... |
<p>I'm new to monitoring the k8s cluster with prometheus, node exporter and so on.</p>
<p>I want to know that what the metrics exactly mean for though the name of metrics are self descriptive.</p>
<p>I already checked the github of node exporter, but I got not useful information.</p>
<p>Where can I get the descriptions... | <p>There is a short description along with each of the metrics. You can see them if you open node exporter in browser or just <code>curl http://my-node-exporter:9100/metrics</code>. You will see all the exported metrics and lines with <code># HELP</code> are the description ones:</p>
<pre><code># HELP node_cpu_seconds_... |
<p>After creating a Service Account for Jenkins with the commands:</p>
<pre><code>kubectl -n jenkins create sa jenkins
kubectl create clusterrolebinding jenkins --clusterrole cluster-admin --serviceaccount=jenkins:jenkins
</code></pre>
<p>and adding the certificate in Jenkins (Manage Jenkins --> Configure System -->... | <p>This one is work for me
<code>kubectl create clusterrolebinding jenkins --clusterrole cluster-admin --serviceaccount=jenkins:default</code></p>
|
<p>Am in very early stages of exploring Argo with Spark operator to run Spark samples on the minikube setup on my EC2 instance.</p>
<p>Following are the resources details, not sure why am not able to see the spark app logs.</p>
<p><strong>WORKFLOW.YAML</strong></p>
<pre><code>kind: Workflow
metadata:
name: spark-argo... | <p>As Michael mentioned in his answer, Argo Workflows does not know how other CRDs (such as <code>SparkApplication</code> that you used) work and thus could not pull the logs from the pods created by that particular CRD.</p>
<p>However, you can add the label <code>workflows.argoproj.io/workflow: {{workflow.name}}</code... |
<p>For pod we keep it v1
When replicaset we keep it apps/v1.</p>
<p>Question is apps/v1 contains all the objects of v1 as well or what's the hierarchy? Can someone please explain ?</p>
| <p>The apiVersion is composed of two components: the<code>group</code> and the <code>version</code>.</p>
<p>The <code>version</code> indicates the levels of stability and support: if version contains <code>alpha</code>, the software may contains bugs and the feature may be dropped in future release; if version contains... |
<p>Now I am using <code>HostSNI(</code>*<code>)</code> to mapping the TCP service like <code>mysql\postgresql...</code> in traefik 2.2.1 in Kubernetes cluster v1.18 . beacuse I am in my local machine and did not have a valid certification. This is the config:</p>
<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind... | <p>For those needing an example of TCP with TLS passthrough and SNI routing</p>
<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: test-https
namespace: mynamespace
spec:
entryPoints:
- websecure # maps to port 443 by default
routes:
- match: HostSNI(`my.domain.com`)
... |
<p>I am writing a script, where I want to restart kubernetes pods with the scale-down scale-up method</p>
<pre><code>kubectl scale --replicas=0 myPod -n myNamespace
kubectl scale --replicas=3 myPod -n myNamespace
</code></pre>
<p>I would like the script to wait until the pods are <code>Running</code> - so I thought som... | <p>Write your condition in [ ] and get the value of command with ` or $. for example in your case:</p>
<pre><code>while [ "$(kubectl get pods --field-selector=status.phase=Running -n myNameSpace | grep -c myPod)" != 3 ]
do
sleep 1
echo "wait"
done
echo "All three pods is running a... |
<p>I want to execute a task in Argo workflow if a string starts with a particular substring.
For example, my string is <code>tests/dev-or.yaml</code> and I want to execute task if my string starts with <code>tasks/</code></p>
<p>Here is my workflow but the condition is not being validated properly</p>
<pre><code>apiVer... | <p>tl;dr - use this: <code>when: "'{{inputs.parameters.should-print}}' =~ '^tests/'"</code></p>
<p>Parameter substitution happens before the <code>when</code> expression is evaluated. So the when expression is actually <code>tests/dev-or.yaml startsWith 'tests/'</code>. As you can see, the first string needs ... |
<p>EDIT:
It was a config error, I was setting wrong kv name :/</p>
<p>As said in title I'm facing an issue with secret creation using SecretProviderClass.</p>
<p>I've created my aks and my kv (and filled it) on azure. then I'll proceed to follow <a href="https://learn.microsoft.com/en-us/azure/aks/csi-secrets-store-dri... | <p>you are using the clientId, but it should be the objectId form the kubelet identity:</p>
<pre><code>export KUBE_ID=$(az aks show -g <resource group> -n <aks cluster name> --query identityProfile.kubeletidentity.objectId -o tsv)
export AKV_ID=$(az keyvault show -g <resource group> -n <akv name>... |
<p>I try to deploy mongodb with helm and it gives this error:</p>
<pre><code>mkdir: cannot create directory /bitnami/mongodb/data : permision denied.
</code></pre>
<p>I also tried this solution:</p>
<pre><code>sudo chown -R 1001 /tmp/mongo
</code></pre>
<p>but it says no this directory.</p>
| <p>You have permission denied on <code>/bitnami/mongodb/data</code> and you are trying to modify another path: <code>/tmp/mongo</code>. It is possible that you do not have such a directory at all.
You need to change the owner of the resource for which you don't have permissions, not random (non-related) paths :)</p>
<p... |
<p>A Kubelet has several endpoint paths it listens on, such as <code>/metrics</code>, <code>/metrics/cadvisor</code>, <code>/logs</code>, etc. One can easily query these endpoints by running <code>kubectl get --raw /api/v1/nodes/<node-name>/proxy/<path></code> (after running <code>kubectl proxy</code>).</p>... | <p>Based on the information from different sources, below provided some endpoints for kubelet.</p>
<p>From the code of <a href="https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/kubelet/server/server.go#L85" rel="nofollow noreferrer">kubelet server</a>:</p>
<pre><code>/metrics
/metrics/cadvisor
/metrics/re... |
<p>I have a GKE cluster which doesn't scale up when a particular deployment needs more resources.
I've checked the cluster autoscaler logs and it has entries with this error:
<code>no.scale.up.nap.pod.zonal.resources.exceeded</code>. The <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-autoscaler... | <ul>
<li><p><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning#limits_for_clusters" rel="nofollow noreferrer">Limits for clusters</a> that you define are enforced based on the total CPU and memory resources used across your cluster, not just auto-provisioned pools.</p>
</li>
<li><p>W... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.