prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I created a cronjob with the following spec in GKE:</p>
<pre><code># cronjob.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: collect-data-cj-111
spec:
schedule: "*/5 * * * *"
concurrencyPolicy: Allow
startingDeadlineSeconds: 100
suspend: false
successfulJobsHistoryLimit: 3
failed... | <p>From the error shared, I can tell that the image is not being pulled from Artifact Registry, and the reason for failure is because, by default, GKE pulls it directly from Docker Hub unless specified otherwise. Since there is no collect_data image there, hence the error.</p>
<p>The correct way to specify an image sto... |
<p>i'm trying to use Velero to backup an AKS cluster but for some reason i'm unable to set the backup location in velero.</p>
<p>i'm getting the error below
<a href="https://i.stack.imgur.com/uLakt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uLakt.png" alt="Error no storage account key found in e... | <p>turns out it was the brackets in the install command that was causing the issue</p>
<pre><code>--backup-location-config resourceGroup=resourcegroupname,storageAccount=storageAccount,storageAccountKeyEnvVar=AZURE_STORAGE_ACCOUNT_ACCESS_KEY[,subscriptionId=numbersandlettersandstuff] \
</code></pre>
<p>removed the brac... |
<p>In kubernetes, I have the following service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: test-service
namespace: default
spec:
ports:
- name: tcp
protocol: TCP
port: 5555
targetPort: 5555
- name: udp
protocol: UDP
port: 5556
targetPort: 5556
sel... | <p>You can enable <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/" rel="nofollow noreferrer">feature gates</a> <code>MixedProtocolLBService</code>. For instructions on how to enable function gates, see below.</p>
<ul>
<li><a href="https://stackoverflow.com/questions/59814862/ho... |
<p>I'm trying to figure out how to dynamicly provide SSL Certificates for gRPC Server and Client across Kubernetes clusters.</p>
<p>My current implementation asserts that the CA-certificate (for client), certificate and key for the server are provided inside the pod.
The certs will be created inside kubernetes as secre... | <p>When you say server running in K8s, it will be service and deployment.</p>
<p>If K8s internal app(client) connecting to the server it must be using service name as DNS, if you are using any service mesh <strong>mTLS</strong> traffic would be encrypted if enabled.</p>
<p>When you say ingress gateway, is it mean Nginx... |
<p>When I deployment IPFS-Cluster on Kubernetes, I get the following error (these are <code>ipfs-cluster</code> logs):</p>
<pre><code> error applying environment variables to configuration: error loading cluster secret from config: encoding/hex: invalid byte: U+00EF 'ï'
2022-01-04T10:23:08.103Z INFO service ipfs-... | <p>To clarify I am posting community Wiki answer.</p>
<hr />
<p>To solve following error:</p>
<pre><code>no such file or directory
</code></pre>
<p>you used <code>runAsUser: 0</code>.</p>
<hr />
<p>The second error:</p>
<pre><code>error applying environment variables to configuration: error loading cluster secret from ... |
<p>How can I <strong>mount</strong> service account token,
we are using a chart which doesn't support it and after a hour the chart is failing.</p>
<p><a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume" rel="nofollow noreferrer">https://kubernetes... | <p>There's no issue for Vector agent to access the token, but the token will now expire within an hour by default; compare to previous where it has no expiry. When the token has past the validity time, the agent application needs to reload the token from the mounted token volume (previously was a secret volume). The ch... |
<p><a href="https://i.stack.imgur.com/gVffU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gVffU.png" alt="This is the image of the steps that needs to be done using a dockerfile and a kubernetes file." /></a></p>
<p><a href="https://i.stack.imgur.com/xm0GC.png" rel="nofollow noreferrer"><img src="h... | <p>Assuming that you have Docker and Kubernetes solutions setup and ready.</p>
<p>First, as mentioned by the others, the best option is just to use <a href="https://github.com/wkrzywiec/aston-villa-app/blob/master/Dockerfile" rel="nofollow noreferrer">Dockerfile from the repo</a> instead of writing your own:</p>
<pre><... |
<p>I used the following yaml to create a postgres deployment in my kubernetes cluser.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: database-secret
namespace: todo-app
data:
# todoappdb
db_name: dG9kb2FwcGRiCg==
# todo_db_user
username: dG9kb1... | <p>You have an error in your <code>Secret</code>. If you base64-decode these values:</p>
<pre><code>data:
# todoappdb
db_name: dG9kb2FwcGRiCg==
# todo_db_user
username: dG9kb19kYl91c2VyCg==
# password
password: cGFzc3dvcmQK
</code></pre>
<p>You will find that they all include a terminal <code>\n</code> char... |
<p>I have 2 kubernetes cluster in 2 region</p>
<p>2 kubeconfig file are <strong>kube1.kubeconfig</strong> and <strong>kube2.kubeconfig</strong></p>
<p>I'm using python to call to kubernetes cluster using kubernetes-client python</p>
<p>I see it will load the config from the env <strong>KUBECONFIG</strong></p>
<p>but my... | <p>You can create separate clients from different <code>kubeconfig</code>s using <code>new_client_from_config_dict</code> function:</p>
<pre class="lang-py prettyprint-override"><code>def make_k8s_client(kubeconfig: dict) -> kubernetes.client.CoreV1Api:
api_client = kubernetes.config.new_client_from_config_dict(... |
<p>When a POD is terminating, how to get correct status <strong>Terminating</strong> using Kubernetes <strong>REST</strong> API. I am not able to figure it out.
But <strong>kubectl</strong> always report correct status, and it also uses REST API to do that.</p>
<p>What magic am I missing in REST API ? does it call tw... | <p>You are not the <a href="https://github.com/kubernetes/kubernetes/issues/22839" rel="nofollow noreferrer">first person to ask this question</a>. The answer appears to be that <code>kubectl</code> inspects <code>metadata.deletionTimestamp</code>; if this exists (and, presumably, has a non-null value) then the pod is ... |
<p>This should be fairly easy, or I might doing something wrong, but after a while digging into it I couldn't find a solution.</p>
<p>I have a Terraform configuration that contains a <a href="https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret" rel="nofollow noreferrer">Kubernetes ... | <p>You need to add in the Terraform Lifecycle ignore changes meta argument to your code. For data with API token values but also annotations for some reason Terraform seems to assume that, that data changes every time a plan or apply or even destroy has been run. I had a similar issue with Azure KeyVault.</p>
<p>Here i... |
<p>Following this K8s page <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/" rel="nofollow noreferrer">here</a> on how to use multiple schedulers,and <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/" rel="nofollow noreferrer">this</a>, all I coul... | <ul>
<li>when i check documentation for daemonset.spec i do not see a <code>schedulerName</code> at all as following :</li>
</ul>
<pre><code>kubectl explain daemonset.spec
KIND: DaemonSet
VERSION: apps/v1
RESOURCE: spec <Object>
DESCRIPTION:
The desired behavior of this daemon set. More info:
htt... |
<p>My goal is to create an environment variable for the pod out of a mounted secret volume. I want to skip the intermediate step with creating Kubernetes secret (and refer the k8s secret for the env) so nothing is stored on the etcd storage.</p>
<p>I am using the CSI Driver to mount the secrets of my Azure Key Vault. T... | <p>Environment set in a shell session (like the one in your command) is local to that session only.</p>
|
<p>This deployment creates 1 pod that has init container in it. The container mounts volume into tmp/web-content and writes 1 single line 'check this out' to index.html</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: test-init-container
namespace: mars
spec:
replicas: 1
selector:
matchLa... | <p>Its because of the <code>mountPath</code>:</p>
<blockquote>
<p>The root directive indicates the actual path on your hard drive where
this virtual host's assets (HTML, images, CSS, and so on) are located,
ie /usr/share/nginx/html. The index setting tells Nginx what file or
files to serve when it's asked to display a ... |
<p>I have a requirement to delete all pods for <code>service1-deployment</code> when container restart happens in <code>service2-deployment</code>.</p>
<p>I found out that we can do it through <a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" rel="nofollow noreferrer">li... | <p><strong>Disclaimer</strong> - as mentioned in the comments, you should avoid this solution (<a href="https://softwareengineering.stackexchange.com/questions/411082/should-microservices-be-independent/411136#411136">microservices should be independent</a>) until you really have no other choice.</p>
<hr />
<p>You can... |
<p>I am trying to follow this instruction to monitoring my prometheus</p>
<p><a href="https://logiq.ai/scraping-nginx-ingress-controller-metrics-using-helm-prometheus/" rel="nofollow noreferrer">https://logiq.ai/scraping-nginx-ingress-controller-metrics-using-helm-prometheus/</a></p>
<p>anyhow, I got a problem when try... | <p>For k8s resources, <code>metadata.name</code> is a <code>required</code> field. You must provide the <code>metadata.name</code> in resource YAML before applying it.</p>
<p>In case of <code>metadata.namespace</code>, if you don't provide it, it defaults to <code>default</code> namespace.</p>
<p>I think you have some ... |
<p>I have a AWS NLB ingress-controller and an ingress rule which routes traffic between an API and an SPA. The ingress-controller works perfectly on HTTP, but on HTTPS I'm getting a <code>400 Bad request - plain HTTP request sent to HTTPS port</code></p>
<p>If I understand it correctly, after TLS has been terminated th... | <p>I just lost an entire day troubleshooting this and it turned out to be the ports configuration in the Service created by Helm. The targetPort in the https configuration needs to be 80 instead of the reference "https".</p>
<p>Before:</p>
<pre><code> ports:
- name: http
port: 80
protocol: TC... |
<p>In Kubernetes I have a load balancer and 2 web apps (with names <code>UI</code> and <code>Kuard</code>) that are both publicly available through services and ingress rules similar to:</p>
<p><strong>Kuard Service:</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
annotations:
kubectl.kubernetes.io... | <p>What you want is not possible.</p>
<p>When accessing a service from a browser, you are making request from outside your cluster. For this you need external IP.</p>
<p>The internal cluster address (<code><service-name>:<port></code>) is for internal communication only (e.g. pod to pod) , and is resolved b... |
<p>We have a go lang service which will go to redis, to fetch data for each request and we want to read data from redis slave node as well. We went through the documentation of redis and go-redis library and found that, in order to read data from redis slave we should fire readonly command from redis side. We are using... | <p>I`ve done it setting the option RouteRandomly: true</p>
|
<p>Instead of navigating a namespace via e.g. <code>:service</code>, then <code>:pod</code> etc, I would like to see everything that's in the namespace in a single view. As if you would type <code>kubectl -n argocd get all</code>.</p>
<p>Can't find the info in the docs. Is this even possible?</p>
<p>Thanks for any sugg... | <p>Posting community wiki answer based on GitHub topic - <a href="https://github.com/derailed/k9s/issues/771" rel="nofollow noreferrer">Show multiple resource types without having to switch</a>. Feel free to expand it.</p>
<hr />
<p>That's true, there is no information about this in the documentation because simply the... |
<p>I'm new to Gitlab and Kubernetes and I'm wondering what the difference between a Gitlab runner and a Gitlab agent is.</p>
<p>On gitlab it says an agent is used to connect to the cluster, run pipelines, and deploy applications.<br />
But with a regular runner you could just have a pipeline that invokes <code>kubectl<... | <p>The GitLab Agent (for Kubernetes) is the way GitLab interacts with the Kubernetes cluster (<a href="https://docs.gitlab.com/ee/user/clusters/agent/" rel="nofollow noreferrer">https://docs.gitlab.com/ee/user/clusters/agent/</a>) and is used to allow GitLab to generate GitLab runners which are like Jenkins agents (<a ... |
<p>Please, I have an issue on a golang web application.
I don’t understand why is happening</p>
<p>Here is the code of the http handler</p>
<p>[Updated from the comment of @colm.anseo about using context]</p>
<pre class="lang-golang prettyprint-override"><code>func (h *HttpServer) GenerateMobileApp(w http.ResponseWrite... | <p>There's a couple of things of note:</p>
<ul>
<li>capturing <code>stdout</code> and <code>stderr</code> seems brittle (error handling from goroutine will not propagate properly)</li>
<li>long running executable may cause request timeout issues</li>
</ul>
<hr />
<p>to capture <code>stdout</code> and <code>stderr</code... |
<p>Is there a way to fetch a specific argo workflow age in seconds using <code>kubectl</code> command?</p>
<p>I've a requirement for comparing the argo workflow age. If the workflow age is greater than 24 hours I need to terminate the workflow.</p>
| <p>You should probably use <a href="https://github.com/argoproj/argo-workflows/blob/master/examples/timeouts-workflow.yaml" rel="nofollow noreferrer">Argo Workflow's built-in, declarative timeout feature</a>:</p>
<pre class="lang-yaml prettyprint-override"><code>spec:
activeDeadlineSeconds: 86400
</code></pre>
<p>Tha... |
<p>UPDATE:
The issue persists but I used another way (sub-domain name, instead of the path) to 'bypass' the issue:</p>
<pre><code>ubuntu@df1:~$ cat k8s-dashboard-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: k8s-dashboard-ingress
namespace: kubernetes-dashboard
annotations:
nginx... | <p>This is happening as you are using /grafana and this path does not exist in the grafana application - hence 404. You need to first configure grafana to use this context path before you can forward your traffic to /grafana.</p>
<p>If you use / as path, it will work. That's why curl 10.96.148 works as you are not addi... |
<p>I have problem with running docker in kubernetes runner.
I've installed kubernetes runner with helm and set privileged mode to true</p>
<pre><code>runners:
config: |
[[runners]]
[runners.kubernetes]
namespace = "{{.Release.Namespace}}"
image = "ubuntu:20.04"
pr... | <p>You need to mount the host's docker socket:</p>
<pre><code>[runners.kubernetes]
image = "ubuntu:18.04"
privileged=true
[[runners.kubernetes.volumes.host_path]]
name = "docker-socket"
mount_path = "/var/run/docker.sock"
read_only = false
host_path = "/var/run/d... |
<p>I have problem with running docker in kubernetes runner.
I've installed kubernetes runner with helm and set privileged mode to true</p>
<pre><code>runners:
config: |
[[runners]]
[runners.kubernetes]
namespace = "{{.Release.Namespace}}"
image = "ubuntu:20.04"
pr... | <p>Thank you for your hint about mounting docker.sock.</p>
<p>this worked for me</p>
<pre><code>runners:
config: |
[[runners]]
[runners.kubernetes]
image = "ubuntu:20.04"
privileged = true
[[runners.kubernetes.volumes.empty_dir]]
name = "docker-emptydir"
... |
<p>I have created a persistent volume claim where I will store some ml model weights as follows:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: models-storage
spec:
accessModes:
- ReadWriteOnce
storageClassName: model-storage-bucket
resources:
requests:
storage: 8Gi
</co... | <p>To mount cloud storage bucket you need to install <a href="https://ofek.dev/csi-gcs/getting_started/" rel="nofollow noreferrer">Google Cloud Storage driver</a> (<strong>NOT</strong> the persistent disk nor file store) on your cluster, create the StorageClass and then provision the bucket backed storage either dynami... |
<p>I am encountering problems when using <code>nodeSelector</code> in my Kubernetes manifest. I have a nodegroup in EKS with the label <code>eks.amazonaws.com/nodegroup=dev-nodegroup</code>. This node has a name with the corresponding ip, as usual in AWS. If I set the <code>nodeName</code> in the manifest, everything w... | <p><code>Yes, otherwise it would not deploy the pod when I set the nodeName instead</code></p>
<p>For EBS volume it can only mount to a node once. The second time you run a pod trying to mount the <strong>same volume on the same node</strong> you will get this error. For your case, you should delete the pod that curren... |
<p>trying to open Postgres port <code>5432</code> so it can be accessible from my local machine. the port is only open from kubernetes pods.</p>
<pre><code>127.0.0.1:5432 <====> kubernetes-pod <=====> Postgres Server
</code></pre>
<p>basically I want to make port 5432 accessible via my local machine, the po... | <p>The easiest and best way to accomplish this is using <code>socat</code> in a pod.</p>
<p>You can use the <a href="https://hub.docker.com/r/alpine/socat" rel="noreferrer"><code>alpine/socat</code> container image</a> to create the pod. Then use port-forward into this pod which will forward the connections to the targ... |
<p>I have tried so many times to run skaffold from my project directory. It keeps me returning the same error: 1/1 deployment(s) failed</p>
<p><a href="https://i.stack.imgur.com/WL3DP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WL3DP.png" alt="deployment and service creates or configures but Wait... | <p>Okay! I resolved the isses by re-installing the docker desktop and not enabling Kubernetes in it. I installed Minikube and then I ran <code>skaffold dev</code> and this time it was not giving error in <em><strong>deployments to stabilize...</strong></em> stage. Looks like Kubernetes desktop is the culprit? I am not ... |
<p>I get an error when I install the helm chart I created.</p>
<p>helm install -f values.yaml --dry-run testbb ./</p>
<p>I change the indent and make it like yamls. I use "kubectl get -o yaml" many times, but it doesn't work.</p>
<p>Line 50 in yaml file contains volume <strong>name: frontend-http</strong></p... | <p>Try swapping "configMap" and "name":</p>
<pre><code> volumes:
- name: frontend-http-volume
configMap:
defaultMode: 420
name: frontend-http
{{- if .Values.persistentVolume.enabled }}
- name: data-storage
persistentVolumeClaim:
c... |
<p>When running the following command:</p>
<pre class="lang-sh prettyprint-override"><code>helm upgrade --cleanup-on-fail \
-- install $releaseName $dockerHubName/$dockerHubRepo:$tag \
-- namespace $namespace \
-- create-namespace \
-- values config.yaml
</code></pre>
<p>I get the following error:</p>
<... | <p>Based on information from the <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/jupyterhub/customizing/user-environment.html#choose-and-use-an-existing-docker-image" rel="nofollow noreferrer">jupyterhub for kubernetes site</a>, to use a different image from jupyter/docker-stacks, the following steps are r... |
<p>I have three K8s clusters; staging, sandbox, and production. I would like to:</p>
<ol>
<li>Trigger a pipeline to build and deploy an image to staging, if a merge request to <code>master</code> is created</li>
<li>Upon a successful deploy of staging, I would like the branch to be merged into <code>master</code></li>
... | <blockquote>
<p>Trigger a pipeline to build and deploy an image to staging, if a merge
request to master is created</p>
</blockquote>
<p>For first you can create rules like</p>
<pre><code>only:
- merge_requests
except:
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master"
</code></... |
<p>I'm trying to override the node selector for a <code>kubectl run</code>.</p>
<pre><code>kubectl run -it powershell --image=mcr.microsoft.com/powershell:lts-nanoserver-1809-20211215 --restart=Never --overrides='{ "apiVersion": "v1", "spec": { "template": { "spec": { &... | <p><code>kubectl run</code> is a command to start a <code>Pod</code>. You can read more about it <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands" rel="nofollow noreferrer">here</a></p>
<pre><code>kubectl run -it powershell --image=mcr.microsoft.com/powershell:lts-nanoserver-1809-2021121... |
<p>I have my own hosted Kubernetes cluster where I store my secrets in vault. To give my microservices access to the secrets managed by vault, I want to authenticate my microservices via their service accounts. The problem I'm facing is that vault rejects the service accounts (JWTs) with the following error:</p>
<pre><... | <p>This kind of error can be caused by a recent change to <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-issuer-discovery" rel="nofollow noreferrer">Service Account Issuer Discovery</a> in Kubernetes 1.21.</p>
<p>In order to mitigate this issue, there are a ... |
<p>I'm containerizing an existing application and I need a basicauth for a single path prefix, currently I have the following Ingress configuration:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: service-auth
spec:
basicAuth:
secre... | <p>As you can read in <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">this documentation</a>:</p>
<p>Each path in Ingress must have the appropriate path type. Paths without an explicit <code>pathType</code> will not be validated. There are three supported path types:... |
<p>I'm new to docker and k8s. Topic with ports is hard to understand for me...
Basically, I know that we assign ports to containers for access to the container.</p>
<p>What is the difference between publishing port: <code>8080:80</code> and <code>127.0.0.1:8080:80</code>?</p>
<p>(<em>Because I'm new in docker and my qu... | <blockquote>
<p>What is the difference between publishing port: 8080:80 and 127.0.0.1:8080:80?</p>
</blockquote>
<p>The difference is very well explained <a href="https://www.howtogeek.com/225487/what-is-the-difference-between-127.0.0.1-and-0.0.0.0/#:%7E:text=0.0?-,127.0" rel="nofollow noreferrer">here</a>:</p>
<block... |
<p>I know there are many questions concerning this aspect... but until now I could not find any answers. I tried two images (Apache Solr and Neo4J). Tried different namespaces, clusterIP, edit /etc/hosts, ingress, tunnel, minikube ip and all my requests got no response.</p>
<p>I tried these images standalone in Docker ... | <p>As mentioned in comments and in this <a href="https://stackoverflow.com/questions/40767164/expose-port-in-minikube">post</a>, the way you would expose app running in minikube via NodePort is my running the command:</p>
<p><code>minikube service <SERVICE_NAME> --url</code></p>
<p>Which prints out url you can pa... |
<p>I am looking for any existing implementation of sharing a read only in-memory cache across pods on the same node. This setup would allow fast access without the need to load the entire cache into each pods memory.</p>
<p>Example: 1GB lookup dictionary is kept up to date, each pod has read access to the data allowing... | <p>You could use <a href="https://kubernetes.io/docs/concepts/policy/pod-security-policy/#host-namespaces" rel="nofollow noreferrer"><code>hostIPC</code></a> and/or <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer"><code>hostPath</code></a> mounted on <code>tmpfs</code>, ... |
<p>I'm trying to set up an SSL certificate for Kong 2.7 installed in Kubernetes but I am not getting this to work as expected. I tried to follow this <a href="https://support.konghq.com/support/s/article/How-to-setup-Kong-to-serve-an-SSL-certificate-for-API-requests" rel="nofollow noreferrer">guide</a>. Even looking fo... | <p>You just miss the <code>@</code> on the curl command to upload files</p>
<pre><code>curl -X POST http://kong-admin:8001/certificates -F "cert=@kong.lan.pem" -F "key=@kong.lan.key" -F "snis[0]=mydomain.net"
</code></pre>
<pre><code>curl -X POST http://localhost:8001/certificates -F "... |
<p>I have a k8s deployment that pulls an image based on the <em>digest</em> rather than the <em>tag</em>.</p>
<p>Why? I have multiple lower k8s namespaces which all pull from the same Docker repo. I don't want a bug fix for <em>ns-dv</em> to accidentally replace with an image pushed for <em>ns-qa</em>. So I'd like to k... | <p>A digest uniquely identifies an image. A tag points to a digest. So, you cannot have multiple images that have the same tag. The difference is, a tag may be updated to point to a different digest. Two different tags can point to the same digest.</p>
<p>So you either have to use the digests, or different tags for eac... |
<p>I just tried to go over the getting started guide of Argocd found here <a href="https://argo-cd.readthedocs.io/en/stable/getting_started/" rel="noreferrer">https://argo-cd.readthedocs.io/en/stable/getting_started/</a>.<br />
I did steps 1 and 2 and then ran the command <code>argocd login --core</code> to skip steps ... | <p>Although the <code>configmap</code> is in the <code>argocd</code> namespace, if <code>argocd</code> is not your <em>current</em> namespace, it won't work. To make sure it is, run :</p>
<pre><code>kubectl config set-context --current --namespace=argocd
</code></pre>
<p>That solved it for me. Command from <a href="htt... |
<p>while using both HPA and Cluster Autoscaler in Kubernetes, I have this scenario below.</p>
<p>Maximum 3 pods can fit into a single node. I have setup HPA min replica as 15, and max as 39. So, at first, I only had total 5 nodes which can accomodate all 15 pods. However, as load increases, more than 15 pods have spun ... | <p>I think this is known about. Some projects such as <a href="https://github.com/kubernetes-sigs/descheduler" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/descheduler</a> have spun up to try to reoptimise spreads. I haven't checked out the descheduler yet, but it does sound like something that may help... |
<p>I am trying to setup ArgoCD for gitops. I used the ArgoCD helm chart to deploy it to my local Docker Desktop Kubernetes cluster. I am trying to use the app of apps pattern for ArgoCD.</p>
<p>The problem is that when I apply the yaml to create the root app, nothing happens.
Here is the yaml (created by the command <c... | <p>the problem is you have to use the below code in your manifest file in <strong>metadata</strong>:</p>
<blockquote>
<p>just please change the namespace with the name your <strong>argocd</strong> was deployed in that namespace. (default is argocd)</p>
</blockquote>
<pre><code>metadata:
namespace: argocd
</code></pre... |
<p>I am trying to configure my K8s app with TLS. I have 2 containers in that pod, one is OAuth2.0 proxy container and the other container has my backend code.</p>
<p>I am using OAuth2.0 for doing that. So basically, in the OAuth2.0 proxy pod, I provide tls-cert-file and tls-key-file. As I am using OAuth2.0 for authoris... | <p>After some more tinkering I figured out what was wrong. The error I mentioned above basically means that we're trying to send HTTPS request to a server that typically takes HTTP request.</p>
<p>In my OAuth proxy conf, I had changed <code>upstream</code> to <code>https</code> whereas it should be <code>HTTP</code>.</... |
<p>How to add a service_account.json file to kubernetes secrets? I tried</p>
<p><code>kubectl create secret generic service_account.json -n sample --from-file=service_account=service_account.json</code></p>
<p>but it returns an error failed to create secret Secret "service_account.json" is invalid: metadata.n... | <p>You can't use <code>service_account.json</code> as the (metadata) name for a Kubernetes resource. Here's the documentation on permitted <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/names/" rel="nofollow noreferrer">Object Names and IDs</a></p>
<p>You can use:</p>
<pre class="lang-sh pre... |
<p>Very simple question, I have a front-end app running in kubernetes. I would like to create a back-end containerized app that would also be in kubernetes obviously.</p>
<p>User actions in the frontend would need to trigger the execution of a command on the backend (<code>echo success!</code> for example). The UI also... | <p>That depends on your application how you are planning.</p>
<p>Some people host frontend on bucket and from there send HTTP request to backend or so.</p>
<p>You can keep frontend and backend in different PODs or in a single POD also.</p>
<p>For example, if you are using the Node JS with express, you can run as simple... |
<p>I am extremly new to Traefik 2 Ingress controller, which is deployed by my Cloud provider: (Chart here: <a href="https://github.com/civo/kubernetes-marketplace/tree/master/traefik2" rel="nofollow noreferrer">https://github.com/civo/kubernetes-marketplace/tree/master/traefik2</a>).</p>
<p>I got my app <code>frontend<... | <p>I don't have all the answers to your question but I can maybe help with showing how I deploy Traefik:</p>
<p>I am using Traefik as a helm chart watched by FluxCD to implement GitOps only for infrastructure.</p>
<p>I leverage the wildcard to match any entry, and then my applications can choose any ingress route witho... |
<p>Is there way how to setup wildcard certificate in Kong-Ingress-Controller to be used in each Ingress?</p>
<p>I have Kong installed from chart:</p>
<pre><code>$ helm repo add kong https://charts.konghq.com
$ helm repo update
$ helm install kong/kong --generate-name --set ingressController.enabled=true --set admin.en... | <p>In the Kong ingress controller, there is a plugin to auto manage <strong>HTTPS</strong> certificate and get from let's encrypt.</p>
<p>How you can use the <a href="https://cert-manager.io/docs/" rel="nofollow noreferrer">cert-manager</a> with the <strong>Kong</strong> ingress and it will do it for you.</p>
<p><a hre... |
<p>I have a secret which contains very sensitive information.
I want to make sure that this secret can only be accessed by a certain service account and nobody else.</p>
<p>Using RBAC, I can tell which user can access which resources. But is there some way where I can tell that this secret can only be accessed by this ... | <ul>
<li><p>as far as i know , There is no straight forward way to get that info (might require write a script to that iterates through rolebindings & clusterrolebindings).</p>
</li>
<li><p>Recently found a plugin called <code>kubectl who-can</code> on <a href="https://github.com/aquasecurity/kubectl-who-can" rel="... |
<p>I want to parse the following structure using go:</p>
<pre><code>---
prjA:
user1:
metadata:
namespace: prj-ns
spec:
containers:
- image: some-contaner:latest
name: containerssh-client-image
resources:
limits:
ephemeral-storage: 4Gi
... | <p>This is a problem with the input - and maybe not a very clear error message.</p>
<p>The <code>imagePullSecrets</code> must be specified using the key <code>name</code> like:</p>
<pre><code>imagePullSecrets:
- name: docker-registry-secret
</code></pre>
<p>I leave the question as it might help other people who run i... |
<p>I am dealing with a fairly simple question.</p>
<p>Assume we have a Kubernetes cluster and several namespaces (say, default, monitoring, A, B, C). These namespaces are logically separated from one another via NetworkPolicies. That means, A cannot see what is going on in default, monitoring, B, C. Analogous things ca... | <p>Namespaces are a way to organize clusters into virtual sub-clusters — they can be helpful when different teams or projects share a Kubernetes cluster. Any number of namespaces are supported within a cluster, each logically separated from others <strong>but with the ability to communicate with each other</strong>.</p... |
<p>I have a django deployment on kubernetes cluster and in the <code>readinessProbe</code>, I am running <code>python</code>, <code>manage.py</code>, <code>migrate</code>, <code>--check</code>. I can see that the return value of this command is 0 but the pod never becomes ready.</p>
<p>Snippet of my deployment:</p>
<pr... | <p>The solution for the issue is to increase <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes" rel="nofollow noreferrer"><code>timeoutSeconds</code> parameter, which is by default set to 1 second</a>:</p>
<blockquote>
<ul>
<li><code>timeoutS... |
<p>I am trying to add an header to all my requests being answered by my service, I am using Lua EnvoyFilter to do so. But the filter is not being applied to the sidecar-proxy, when I try to do configDump I dont find my filter nor the header in the resonses which I had added. I have manually labelled the pod & the d... | <p>Seems like an occasional error with EnvoyFilters on Minikube, after deleting & re-applying it magically started to work.
<a href="https://github.com/istio/istio/issues/8261" rel="nofollow noreferrer">https://github.com/istio/istio/issues/8261</a>
<a href="https://github.com/istio/istio/issues/8616" rel="nofollow... |
<p>I'm looking to create a custom Kubernetes controller; I do mean <strong>controller</strong> in this case because I'm not looking to create a CRD, and thus, not an operator. Basically, it would be similar to the <a href="https://github.com/kubernetes-incubator/external-dns" rel="nofollow noreferrer">External DNS</a> ... | <p>I know this is an old question, but for anyone interested, here's a simple operator without CRD: <a href="https://github.com/busser/label-operator" rel="nofollow noreferrer">https://github.com/busser/label-operator</a></p>
<p>This operator uses only the Pod kind:</p>
<pre><code>// SetupWithManager sets up the contro... |
<p><strong>updated:</strong></p>
<p>To reproduce the issue is very simple with a few steps:</p>
<ol>
<li>Install it on your Ubuntu server by running the following command:</li>
</ol>
<blockquote>
<p>/bin/bash -c "$(curl -fsSL <a href="https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby" rel="no... | <p>First things first, this is a docker-compose stack, not Kubernetes.
If you take a look at the script you execute, you can see that <a href="https://github.com/PostHog/posthog/blob/153b58d9f906fb6f99df942364017738b565d068/bin/deploy-hobby#L77" rel="nofollow noreferrer">it's downlowading docker compose</a> and then <a... |
<p>I am trying to get a volume mounted as a non-root user in one of my containers. I'm trying an approach from <a href="https://stackoverflow.com/a/51195446/1322">this</a> SO post using an initContainer to set the correct user, but when I try to start the configuration I get an "unbound immediate PersistentVolumn... | <p><code>1 pod has unbound immediate PersistentVolumeClaims.</code> - this error means the pod cannot bound to the PVC on the node where it has been scheduled to run on. This can happen when the PVC bounded to a PV that refers to a location that is not valid on the node that the pod is scheduled to run on. It will be h... |
<p>I am running into a very strange issue, I cannot set single quotes that are required by Content-Security-Policy. I assume I was running an older version of ingress which only got updated after I disabled and re-enabled it (microk8s).</p>
<pre><code> nginx.ingress.kubernetes.io/configuration-snippet: |
add_h... | <p>Changes has been appeared exactly in <a href="https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v1.0.5" rel="nofollow noreferrer">1.0.5</a> related to sanitizing annotation inputs.</p>
<p>You may want to check <a href="https://github.com/kubernetes/ingress-nginx/issues/7837#issuecomment-969750366" ... |
<p>my deployment.yml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: kazi-db
spec:
selector:
matchLabels:
app: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: mysql
spec:
containers:
- image: mysql/mysql-server:8.0
n... | <p>If you tried multiple times i would suggest trying deleting everything first and applying changes again mainly PV and PVC. There could be changes in PVC, PVC old files exist which causes issues.</p>
<p>So try by deploying everything again and also check MySQL image you are using doesn't have any issue and running wi... |
<p>We have our frontend application deployed on cloudfront & backend API's are hosted on kubernetes (EKS).</p>
<p>We have use cases where we are using backend APIs from cloudfont (front-end). We don't want to expose Backend API publicly which is obvious.</p>
<p>So now the question is how should we implement above u... | <p>You have multiple options to follow however more depends on you.</p>
<p><strong>Option : 1</strong></p>
<p>Change origin of frontend service instead of <strong>S3</strong> use <strong>EKS</strong> as the origin with <strong>CloudFront</strong>.</p>
<p>This might require extra things to set up and manage so not a goo... |
<p>I'm trying to configure an HA kubernetes cluster within AWS, and I've been having no luck using an ELB for the control plane (right now an NLB with a TLS listener, but have tried with an ALB and HTTPS as well). No matter what I do, it always fails on the wait-control-plane step. If I bump up the verbosity of the out... | <p>I answered a similar question here: <a href="https://stackoverflow.com/a/70799078/9284676">https://stackoverflow.com/a/70799078/9284676</a></p>
<p>When using ELB for your <code>--control-plane-endpoint</code> in a HA master scenario, you need to create a <code>Target Group</code> using type <code>IP addresses</code>... |
<p>I have 2 services in kubernetes, one is mtls, the other is tls.
I'm trying to configure an ingress for them.
I want to configure the ssl passthrough for the mtls service but leave the tls service without ssl-passthrough, it doesn't need client certificate.</p>
<p>I configured 2 ingress at the same hostname, with two... | <p>You want to use 2 services on the same host with the annotation <code>nginx.ingress.kubernetes.io/ssl-passthrough: "true"</code> for one of them.</p>
<p>This will not work because with SSL Passthrough the proxy doesn't know the path to where route the traffic.</p>
<p>From <a href="https://kubernetes.github... |
<p>Alright, various permutations of this question have been asked and I feel terrible asking; I'm throwing the towel in and was curious if anyone could point me in the right direction (or point out where I'm wrong). I went ahead and tried a number of <a href="https://github.com/kubernetes/ingress-nginx/tree/main/docs/e... | <p>The problem you reported in your most recent comment is resolved by looking at the <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">rewrite example</a> in the nginx-ingress documentation.</p>
<p>The <code>rewrite-target</code> annotation configures the ingress such tha... |
<p>I was just checking the network driver used for <code>google kubernetes engine</code>. It seems <code>calico</code> is the default GKE driver for network policy.</p>
<pre><code> networkPolicyConfig: {}
clusterIpv4Cidr: 172.31.92.0/22
createTime: '2022-01-18T19:41:27+00:00'
--
networkPolicy:
enabled: t... | <p>Calico is only used for Network Policies in GKE. By default GKE uses a Google Network Plugin. You also have the option to enable Dataplane <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/dataplane-v2" rel="nofollow noreferrer">V2</a> which is eBPF Based.</p>
<p>In both cases the Plugins are managed... |
<p>Instead of using Google Cloud or AWS Storage buckets; how do we create our own scalable storage bucket?</p>
<p>For example; if someone was to hit a photo 1 billion times a day. What would be the options here? Saying that the photo is user generated and not image/app generated.</p>
<p>If I have asked this in the wron... | <p>As an alternative to GKE or AWS objects storage, you could consider using something like <a href="https://min.io/" rel="nofollow noreferrer">MinIO</a>.</p>
<p>It's easy to set up, it could run in Kubernetes. All you need is some PersistentVolumeClaim, to write your data. Although you could use emptyDirs to evaluate ... |
<p>What is the best approach to passing multiple configuration files into a POD?
Assume that we have a legacy application that we have to dockerize and run in a Kubernetes environment. This application requires more than 100 configuration files to be passed. What is the best solution to do that? Create hostPath volume ... | <blockquote>
<p>Create hostPath volume and mount it to some directory containing config files on the host machine</p>
</blockquote>
<p>This should be avoided.</p>
<p>Accessing hostPaths may not always be allowed. Kubernetes may use PodSecurityPolicies (soon to be replaced by OPA/Gatekeeper/whatever admission controller... |
<p>I am trying to deploy a <code>mongo db</code> deployment together with service, as follows:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-deployment
labels:
app: mongo
spec:
replicas: 1
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
... | <p>To solve this issue I had to run an older <code>mongo-db</code> docker image version (4.4.6), as follows:</p>
<pre><code>image: mongo:4.4.6
</code></pre>
<p>Reference:</p>
<p><a href="https://github.com/docker-library/mongo/issues/485" rel="noreferrer">Mongo 5.0.0 crashes but 4.4.6 works #485</a></p>
|
<p>I have deployed an EKS cluster with a private endpoint (with the help of vpc endpoints). There is no public endpoint and there is no internet gateway.</p>
<p>I need to understand how to access the Kubernetes API from an EC2 instance launched in one of the private subnets in the same VPC. I am using Session Manager w... | <p>There are several ways to achieve this:</p>
<ul>
<li>If you have an on-premise sever in your on-premise network that is connected to the underlying VPC of the EKS cluster (You can connect them via AWS VPN or Direct Connect), you can configure your <code>kubectl</code> to connect via this private connectivity. <stron... |
<p>I have deployed an EKS cluster with a private endpoint (with the help of vpc endpoints). There is no public endpoint and there is no internet gateway.</p>
<p>I need to understand how to access the Kubernetes API from an EC2 instance launched in one of the private subnets in the same VPC. I am using Session Manager w... | <p><code>...how to access the Kubernetes API from an EC2 instance launched in one of the private subnets in the same VPC.</code></p>
<p>Typically you use SSM connect on the EC2 console to start a session with the EC2 instance launched in the private subnet, and interact with your fully private cluster from there.</p>
|
<p>I have series of deployments on k8s that deploys same server binary but different in spec like memory limit, etc. each deployments only 1 pod to run, and want to schedlule pods for these deployments so that each VMs are only scheduled single pod.</p>
<p>because some deployments require larger memory than others, we ... | <p>I could solve the problem.</p>
<p>The reason that above settings do not work well is I put each deployment in different namespace, as described in <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity" rel="noreferrer">https://kubernetes.io/docs/concep... |
<p>I am struggling with the following issues. I have 2 services running. I am using a wildcard for handling subdomains. See the example conf below:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
kubernetes.io/ingress.cla... | <p>Also redirecting requests from <code>www.foo.bar</code> can be achieved by also specifying the hostname. Please note that the order of the hosts does matter as they are translated into the Envoy filter chain. Therefore, the wildcard host should be the last host.</p>
<pre class="lang-yaml prettyprint-override"><code>... |
<p>I have project written in Django Restframework, Celery for executing long running task, Redis as a broker and Flower for monitoring Celery task. I have written a <code>Dockerfile</code> & <code>docker-compose.yaml</code> to create a network and run this services inside containers.</p>
<p><em><strong>Dockerfile</... | <p>After <code>kompose convert</code> your <em>flower-service.yaml</em> file have duplicate ports - that's what the error is saying.</p>
<pre class="lang-yaml prettyprint-override"><code>...
ports:
- name: "5555"
port: 5555
targetPort: 5555
- name: 5555-tcp
port: 5555
targetP... |
<p>I did a</p>
<pre><code>kubeadm alpha certs renew
</code></pre>
<p>but after that, no pods get started. When starting from a Deployment, <code>kubectl get pod</code> doesn't even list the pod, when explicitly starting a pod, it is stuck on <code>Pending</code>.</p>
<p>What am I missing?</p>
| <p>Normally I would follow a pattern to debug such issues starting with:</p>
<ol>
<li>Check all the certificate files are rotated by <code>kubeadm</code> using <code>sudo cat /etc/kubernetes/ssl/apiserver.crt | openssl x509 -text</code>.</li>
<li>Make sure all the control plane services (<code>api-server</code>, <code>... |
<p>I'm completely new to Prometheus and trying to implement an HPA for a use case.</p>
<p>Our use-case is application/pod will be processing jobs from a queue asynchronously. Each pod will pull as many jobs as it can and once they have reached a limit it must start to autoscale.</p>
<p>To achieve this there are two app... | <p>If I'd need to choose one of your approaches I would probably choose the first approach.</p>
<p>But I'd probably change the path here.</p>
<p>Instead of using the applications' metrics to decide how many jobs/pods you need I would probably use the queue's metrics.</p>
<p>For that, I used <a href="https://keda.sh/" r... |
<p>I'm using kustomize to pipe a manifest to kubectl on a new k8s cluster (v1.17.2). This includes CRDs, but other objects are unable to find them. For example:</p>
<pre><code>unable to recognize "STDIN": no matches for kind "Certificate" in version "cert-manager.io/v1alpha2"
unable to recognize "STDIN": no matches fo... | <p>Kustomize does not, yet, have a way to control order of object creation. If you are piping straight into kubectl then you have to either separate the CRDs into their own app so that you apply CRDs, wait for them to finished and then apply the resources that depend on them. Or you run the apply twice.</p>
<p>When usi... |
<p>Is there any way to limit the access to Kubernetes Service of type LoadBalancer from outside the cluster?</p>
<p>I would like to expose my database's pod to the Internet using the LoadBalancer service that would be accessible only for my external IP address.</p>
<p>My Kubernetes cluster runs on GKE.</p>
| <p>You can use <code>loadBalancerSourceRanges</code> to filter load balanced traffic as mentioned <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/security-overview#filtering_load_balanced_traffic" rel="noreferrer">here</a>.</p>
<p>Here is the simple example of Service in front of Nginx Ingress control... |
<p>I have deployment and I want to replace "path" value in liveness probe section. What is correct path for this in kustomize?</p>
<pre><code>- patch: |-
- op: replace
path: ??????????
value:
https://xyz.staging.something.eu/ping
</code></pre>
<hr />
<pre><code> apiVersion: v1
k... | <p>It is the yaml path. You follow the nodes from the parent down to the leaf-node you want to specify.</p>
<p>Since you want the <code>path</code> node on <code>httpGet</code> of <code>livenessProbe</code> it will end with <code>livenessProbe.httpGet.path</code>.</p>
<p>The parent node of livenessProbe is a bit tricki... |
<p>I am trying to add liveness and readinessprobe for zookeeper using bitnami/zookeeper image, but the pod creation is failing, please let me know what values need to be added in liveness and readiness probe.</p>
<p>Below is the value that I have tried with.</p>
<pre><code>livenessProbe:
enabled: true
initi... | <p>The Kubernetes Probes as the livenessProbe and readinessProbe require a <code>handler</code> which is used for the probe. Kubernetes supports multiple handler types, e.g. a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-http-request" r... |
<p>If i deploy Postgres in a statefulSet <strong>without</strong> using replicas (just one pod) and i kill the node that the stateful set is running on will I be able to start up the node and reconnect to a persisted database</p>
<p>Here is an example configuration:
<a href="https://medium.com/@suyashmohan/setting-up-p... | <p>The database will be persisted if the Pods make use of persisted volume storages. Ephemeral Volumes are <strong>not</strong> persisted and should not be used to save a db, as the name says, there is no long-term guarantee about durability.</p>
<p>But if your Pod saves the database on a persisted volume of some sort ... |
<p>I need to copy dump data from pod to local. Below the commands I am trying but I am getting error: <code>unexpected EOF</code></p>
<pre><code>kubectl cp device-database-79fc964c8-q7ncc:tmp /Users/raja
error: unexpected EOF
or
kubectl cp device-database-79fc964c8-q7ncc:tmp/plsql_data/prod.dump /Users/raja/prod.dump... | <p>For newer versions of kubectl, adding a retries=-1 flag may resolve the issue:</p>
<pre><code>kubectl cp --retries=-1 pod-www-xxx-yyy-zzz:/path/to/remote/dir ~/local/dir
</code></pre>
|
<p>I am using the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/" rel="nofollow noreferrer">official kubernetes dashboard</a> in Version <code>kubernetesui/dashboard:v2.4.0</code> to manage my cluster and I've noticed that, when I select a pod and look into the logs, the length o... | <p>AFAIK, it is not possible with <code>kubernetesui/dashboard:v2.4.0</code>. On the <a href="https://github.com/kubernetes/dashboard/blob/master/docs/common/dashboard-arguments.md" rel="nofollow noreferrer">list of dashboard arguments</a> that allow for customization, there is no option to change the amount of logs di... |
<p>It may sound like a naive question, I am running some load testing on one of the deployments on k8s. So to get an idea of the CPU utilization, I opened LENS HPA and CPU utilization is being shown like this</p>
<p><a href="https://i.stack.imgur.com/8SHmR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.... | <p>It means probably the same as the output from the <code>kubectl describe hpa {hpa-name}:</code></p>
<pre><code>$ kubectl describe hpa php-apache
Name: php-apache
...
Metrics: ( current / target )
resource cpu on pods (a... |
<p>I have created a persistent volume:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "C:/Users/xxx/Desktop/pv"
</code></pre>
<p>An... | <p>StatefulSets requires you to use storage classes in order to bind the correct PVs with the correct PVCs.</p>
<p>The correct way to make StatefulSets mount local storage is by using local type of volumes, take a look at the procedure below.</p>
<hr />
<p><strong>First</strong>, you create a storage class for the loca... |
<p>Along with the container image in kubernetes, I would like to update the sidecar image as well.</p>
<p>What will be the <code>kubectl</code> command for this process?</p>
| <p>Assumed you have a deployment spec look like this:</p>
<pre><code>...
kind: Deployment
metadata:
name: mydeployment
...
spec:
...
template:
...
spec:
...
containers:
- name: application
image: nginx:1.14.0
...
- name: sidecar
image: busybox:3.15.0
... |
<p>I would like to run an application in local cluster for development purposes with <code>kind</code> using <code>docker</code>. Based on the description <code>https://kind.sigs.k8s.io/docs/user/quick-start/</code> I defined the cluster</p>
<pre><code>kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: con... | <p>I found a solution, I turned out to be that I placed <code>extractPortMappings</code> inside <code>worker</code> node instead of <code>control-plane</code>. It's weird that it doesn't fail but after moving this part to correct place it started to work!</p>
<p>So the solution is to change to this:</p>
<pre><code>kind... |
<p>Along with the container image in kubernetes, I would like to update the sidecar image as well.</p>
<p>What will be the <code>kubectl</code> command for this process?</p>
| <p>kubernetes have the command <code>set image</code> that allow you to update an image to the expected version</p>
<p>the syntax is</p>
<pre><code>kubectl set image deployment/{deployment-name} {container name}:{image:version}
</code></pre>
<p>with a sample it look like</p>
<pre><code>kubectl set image deployment/ngin... |
<p>I am trying to setup a Local Persistent volume using local storage using WSL. But the pod STATUS stops at <strong>Pending</strong>.</p>
<p>The <code>kubectl describe pod <pod-name></code> gives below error.</p>
<p><code>Warning FailedMount 21s (x7 over 53s) kubelet MountVolume.NewMounter i... | <p>If running on a Rancher Kubernetes Engine (RKE) cluster, this problem can arise from the fact that each kubelet also runs as a container. Thus, it does not see the filesystem of the node it runs on.</p>
<p>The solution is to add extra bind mounts (for <code>kubelet</code> service) when configuring the cluster in <co... |
<p>I tried combining things I have found on the syntax but this is as close as I can get. It creates multiple stages but says they have no steps.</p>
<p>I can get it to run a bunch of parallel steps on the same agent if I move the agent syntax down to where the "test" stage is defined but I want to spin up se... | <p>To run your dynamically created jobs in parallel you will have to use scripted pipeline syntax.<br />
The equivalent syntax for the declarative <code>kubernetes</code> agent in the scripted pipeline is <code>podTemplate</code> and <code>node</code> (see full <a href="https://plugins.jenkins.io/kubernetes/" rel="nofo... |
<p>I've developed a python script, using <a href="https://github.com/kubernetes-client/python/" rel="nofollow noreferrer">python kubernetes-client</a> to harvest Pods' internal IPs.</p>
<p>But when I try to make an http request to these IPs, from another pod, I get <code>Connection refused</code> error.</p>
<p>I spin u... | <p>I guess you missed the port number here</p>
<p>It should be like this</p>
<p><code>curl POD_IP:PORT/stats</code></p>
|
<p>I am trying to autoscale a deployment and a statefulset, by running respectivly these two commands:</p>
<pre><code>kubectl autoscale statefulset mysql --cpu-percent=50 --min=1 --max=10
kubectl expose deployment frontend --type=LoadBalancer --name=frontend
</code></pre>
<p>Sadly, on the minikube dashboard, this error... | <p>First of all, could you please verify if the API is working fine? To do so, please run <code>kubectl get --raw /apis/metrics.k8s.io/v1beta1</code>.</p>
<p>If you get an error similar to:</p>
<p>“<code>Error from server (NotFound)</code>:”</p>
<p>Please follow these steps:</p>
<p>1.- Remove all the proxy environment ... |
<p>I am trying to deploy a SparkJava REST app in a Kubernetes container on my Windows machine.</p>
<ul>
<li>Windows 10</li>
<li>Kubernetes v1.22.5</li>
<li>(edit) base image: openjdk:8-alpine</li>
</ul>
<p>I am trying to read in a properties file when the app starts. I have created a volume mount in my YAML that point... | <p>Posted community wiki answer based on the <a href="https://github.com/kubernetes/kubernetes/issues/59876" rel="nofollow noreferrer">topic with similar issue on the GitHub</a>. Feel free to expand it.</p>
<hr />
<p>The solution is to add <code>/run/desktop/mnt/host</code> before the <code>/c/users/<some-folder>... |
<p>Sounds like a silly question but I see Mi in yml files but what I'm familiar with is MiB. Are the two the same?</p>
| <p>As described in the official reference, <code>Mi</code> is just a prefix so the actual unit will be <code>MiB</code>.</p>
<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#memory-units" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/assig... |
<p>Wanted your guidance on an issue while executing a Kubernetes YAML file.
My kubectl version is as follows:</p>
<pre><code> Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clea... | <p>I would like to add that according to the K8 <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/" rel="noreferrer">deprecation guide</a>, the <code>networking.k8s.io/v1beta1</code> API versions of <code>Ingress</code> is no longer served as of v1.22.</p>
<p>Changes include:</p>
<ol>
<li>The ba... |
<p>I need a help with EKS managed node group.
I've created a cluster with one additional sg. Inside of this cluster I've created managed node group. All code is stocked in terraform. Once managed node group creates new instance, only one security group is attached (SG created by AWS). Is it somehow a way to attach also... | <p>If you are using terraform stock module, you can only add the additional security group in your terraform code and re-apply. Using the EKS console is <a href="https://github.com/aws/containers-roadmap/issues/1588" rel="nofollow noreferrer">work-in progress</a> (you can help to upvote).</p>
|
<p>I have a Kubernetes cluster and I'm deploying my app there with Helm. Everything works fine, but one aspect, the Job update. As I've read, the Jobs are immutable and that's why they can't be updated, but I don't get, why is helm not creating a new job as it does for the Pods?</p>
<p>In the end, I want to achieve tha... | <p>You can use helm hooks here.
Official Link: <a href="https://helm.sh/docs/topics/charts_hooks/" rel="nofollow noreferrer">https://helm.sh/docs/topics/charts_hooks/</a></p>
<p>Once job is completed with "helm install", helm hook should delete it. Once you perform "helm upgrade", a new job should b... |
<p>We're using binami redis-cluster</p>
<p>We have 2 different datacenter serving users from 2 regions. Both are connected via AWS direct connect. How can we expand our Redis cluster with another node from another EKS (Kubernetes) Cluster? So the API server on another EKS cluster can read from Redis much faster.</p>
<p... | <p>The way Redis Open Source Cluster works - it spreads keys across multiple Redis instances (Shards), so running some of the shards/nodes in another region would speed up access to some keys and significantly slow down for others.</p>
<p>You might consider running read-only replicas in the other region, but it would b... |
<p>I have a Kubernetes cluster in which I have multiple ingress controllers. I have deleted the source file of one ingress controller. How can I delete the ingress controller that I don't want further ??</p>
| <p>first of all, you can follow below steps without manifest files:</p>
<ol>
<li>get the namespace which your ingress controller installed in</li>
</ol>
<pre class="lang-sh prettyprint-override"><code> kubectl get ns
</code></pre>
<p>for example : ingress-nginx</p>
<p>2- remove all resources in this namespace</p>
<... |
<p>I want that my api deployment pods will be spread to the whole cluster's nodes.
So I came up with this:</p>
<pre><code>spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
... | <p>This is the right implementation:</p>
<pre><code> affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
... |
<p>I think that you can configure this in the <code>-service.yaml</code>. For example I have a frontend and a backend. The frontend should be public and my backend should be private. So how do you set up two microservices that communicate with each other, one being public and one private, using Kubernetes?</p>
<p>front... | <p>You should use <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">ClusterIP type</a> for the private / internal services which will make your application only available within the cluster:</p>
<blockquote>
<ul>
<li><code>ClusterIP</c... |
<p>Env:</p>
<pre class="lang-sh prettyprint-override"><code>❯ sw_vers
ProductName: macOS
ProductVersion: 11.6.1
BuildVersion: 20G224
❯ minikube version
minikube version: v1.24.0
commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b
</code></pre>
<p>I made a self-signed certificate example on NGINX pod. Omitting to cre... | <p>I completely recreated your configuration for minikube on Linux. Your Kubernetes configuration is fine. And I got the same response - <code>301 Moved Permanently</code>.</p>
<p>After that, I changed these lines in the <code>default.conf</code> file:</p>
<pre class="lang-yaml prettyprint-override"><code>location / {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.