prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>My architecture looks like this:</p> <p><a href="https://i.stack.imgur.com/vxm5o.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vxm5o.jpg" alt="enter image description here" /></a></p> <p>Here, the HTTPS requests first go to the route53 service for DNS resolution. Route53 forwards the request to ...
<p>As you are using the NLB you can achieve <strong>End to end</strong> HTTPS also however it forces the service also to use.</p> <p>You can terminate at the LB level if you have multiple <strong>LB</strong> backed by clusters, leveraging the <strong>AWS cert manage</strong> with <strong>LB</strong> will be an easy way...
<p>I am trying to specify the windows location for the .kube/config file for the Go client application without specifying the absolute path.</p> <pre class="lang-golang prettyprint-override"><code>kubeconfig := flag.String(&quot;kubeconfig&quot;, &quot;%USERPROFILE%/.kube/config&quot;, &quot;location to the Kube config...
<p>The output of <code>flag.String</code> itself does not expand environment variables but you can use <code>os.ExpandEnv</code> to do that. However <code>os.ExpandEnv</code> requires you to use the Unix notation for environment variables, i.e. <code>$USERPROFILE</code> or <code>${USERPROFILE}</code>. You can get a cle...
<p>I am experiencing a lot of CPU throttling (see nginx graph below, other pods often 25% to 50%) in my Kubernetes cluster (k8s v1.18.12, running 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux).</p> <p>Due to backports, I do not know whether my cluster contains the Linux kernel bug describe...
<p>Recently, I'm working on debuging the cpu throttling issue, with the following 5 tests, I've tested out the bug in kernel (Linux version 4.18.0-041800rc4-generic)</p> <p>This test case is intended to hit 100% throttling for the test 5000ms / 100 ms periods = 50 periods. A kernel without this bug should be able to ha...
<p>Does anyone know what am I doing wrong with my kubernetes secret yaml and why its not able to successfully create one programatically?</p> <p>I am trying to programmatically create a secret in Kubernetes cluster with credentials to pull an image from a private registry but it is failing with the following:</p> <pre>...
<p>I was getting similar error when I was trying to create secret using client-go. The error actually tells that the encoded string has invalid e at the beginning of the value (so may be it's expecting '{' this at the beginning ).To solve this, the value should not be encoded into base64. Just use it as it is and that ...
<p>As the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#components" rel="noreferrer">documentation</a> states:</p> <blockquote> <p>For each VolumeClaimTemplate entry defined in a StatefulSet, each Pod receives one PersistentVolumeClaim. In the nginx example above, each Pod receives a s...
<p>You need to create a PV in order to get a PVC bound. If you want the PVs automatically created from PVC claims you need a Provisioner installed in your Cluster.</p> <p>First create a PV with at least the amout of space need by your PVC. Then you can apply your deployment yaml which contains the PVC claim.</p>
<p>I see the following error when I run my deployment:</p> <p><code>Error from server (NotFound): error when creating "n3deployment.yaml": namespaces "n2" not found</code></p> <p>My n3deployment.yaml has no reference to n2?</p> <p><strong>Step By Step</strong></p> <ol> <li>Ensure everything is empty</li> </ol> <pr...
<p>In my case, I was missing to have executed before:</p> <pre><code>kubectl create namespace n3 </code></pre>
<p>I am running load tests using K6 as a tool. I am sending 1000 requests per second to a .NET API (without database) that I deployed in Kubernetes. Sending this many requests impacts the performance of my application. This is noticeable in the request duration(as expected).</p> <p>The K8s cluster has two nodes and one...
<p>Did you make sure that the pods are scheduled one on each node? Otherwise, they could be both scheduled on the same node. For your test with one per node, a daemonset would be sufficient. Otherwise, consider topology spread constraints:</p> <pre><code>https://kubernetes.io/docs/concepts/scheduling-eviction/topology-...
<p>I'm trying to deploy my code placed in bitbucket repo to Kubernetes clusters available in google cloud. I've created a trigger which react when I push new changes to bitbucket repo.</p> <p>I mean:</p> <p><a href="https://i.stack.imgur.com/YkK1h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YkK1h...
<p>Not sure but if you look at the error it's trying to fetch the</p> <p><code>gcr.io/java-kubernetes-clusters-test/bitbucket.org/intivetechradar/technology-radar-be/SHORT_SHA</code> not <code>gcr.io/java-kubernetes-clusters-test/bitbucket.org/intivetechradar/technology-radar-be:SHORT_SHA</code> it's not using <code>:<...
<p>I am new in Kubernetes and stuck on the issue. I was trying to renew letsencrypt SSL certificate. But when I try to get certificate by running following command</p> <pre><code>kubectl get certificate </code></pre> <p>System throwing this exception</p> <pre><code>Error from server: conversion webhook for cert-manager...
<p>In my case, I was attempting to install an older version of <code>cert-manager</code> onto my cluster, and Simply pulling the latest version of <code>cert-manger</code> (1.10.1 at time of writing) and installing that worked.</p> <hr /> <p>When attempting to install an older version of <code>cert-manager</code> I saw...
<p>I have three servers:</p> <pre><code>1 master: 192.168.1.131 k8s 1 node: 192.168.1.132 k8s 1 rancher: 192.168.1.133 rancher 2.6 </code></pre> <p>I have created a docker image (private registry docker) on the node used <code>192.168.1.132:5000/test.</code> Both master and node pushed and pulled to the image. But used...
<p>You may try this out by adding one line to the <strong>daemon.json</strong> file</p> <p>The configuration file can be found at <em><strong>'C:\ProgramData\Docker\config\daemon.json'</strong></em>. You can create this file if it doesn't already exist.</p> <pre><code>&quot;insecure-registries&quot;: [ &quot;192.16...
<p>I'm using an Kubernetes server with API version (1.25.2) . When I try to do a kubectl command getting the below error</p> <pre><code>TRONBQQ2:~$ kubectl get nodes error: unknown flag: --environment error: unknown flag: --environment error: unknown flag: --environment error: unknown flag: --environment error: unknown...
<p>Try to check whether the the following command is printing the below options.</p> <pre><code>&gt;&gt;&gt;kubelogin -h Login to azure active directory and populate kubeconfig with AAD tokens Usage: kubelogin [flags] kubelogin [command] Available Commands: completion Generate the autocompletion scr...
<p>I am getting - when installing <a href="https://cilium.io" rel="nofollow noreferrer">Cilium</a>:</p> <pre><code>Warning FailedScheduling 4m21s (x17 over 84m) default-scheduler 0/1 nodes are available: 1 node(s) didn't match pod anti-affinity rules. preemption: 0/1 nodes are available: 1 node(s) didn't match pod ...
<p>Run <code>$ kubectl get pods</code> , it shows Pending status. (<code>kubectl get pods -o wide</code>)</p> <p>To describe the pod run <code>$ kubectl describe pod POD_NAME</code>, it shows a warning as part of events, if not works, try as suggested by @ <strong>Chris</strong> run <code>kubectl get pod &lt;name&gt; -...
<h3>First, I have created a service account <code>jenkins</code></h3> <pre><code>&gt; kubectl create serviceaccount jenkins serviceaccount/jenkins created </code></pre> <h3>Second, create a token for this service account.</h3> <pre><code>&gt; kubectl create token jenkins eyJhbGc****************iQS-AVXfIzA </code></pre>...
<p>The mechanism of service accounts and tokens has been changed (Moved to stable in v1.22).</p> <p>In the past, you have created a service account. Then in the first time you ran a pod with that service account, Kubernetes created a long-lived, never expired, token that resided in secret of type <code>kubernetes.io/se...
<p>I'm currently using Kubernetes Python Client V1 API. Since there is a way to list node details but I could not find which one is master</p> <pre class="lang-py prettyprint-override"><code>k8s_api = client.CoreV1Api() logger.info(&quot;Getting k8s nodes...&quot;) response = k8s_api.list_node() </code></pre>
<pre><code>k8s_api = client.CoreV1Api() response = k8s_api.list_node() # Loop through the nodes and check for the master node label for node in response.items: if &quot;node-role.kubernetes.io/master&quot; in node.metadata.labels: print(f&quot;Master node: {node.metadata.name}&quot;) </code></pre>
<p>I have my application <a href="https://myapp.com" rel="nofollow noreferrer">https://myapp.com</a> deployed on K8S, with an nginx ingress controller. HTTPS is resolved at nginx.</p> <p>Now there is a need to expose one service on a specific port for example <a href="https://myapp.com:8888" rel="nofollow noreferrer">h...
<p>Use sidecar proxy pattern to add HTTPS support to the application running inside the pod.</p> <p><strong>Refer the below diagram as a reference</strong></p> <p><a href="https://i.stack.imgur.com/aym8f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aym8f.png" alt="enter image description here" /><...
<p><strong>Intro</strong></p> <p>There is an option <code>--platform</code> for Docker image to be run and config <code>platform</code> for docker-compose.</p> <p>Also, almost in all official Docker images in hub.docker.com there is some of supported architectures in one tag.</p> <p>Example, Ubuntu official image:</p> ...
<h2>TLDR</h2> <ul> <li>Build multi-arch images supporting multiple architectures</li> <li>Always ensure that the image you're trying to run has compatible architecture</li> </ul> <hr /> <blockquote> <ol> <li>what &quot;platform/architecture&quot; for docker image does it really means? Like core basics. Links would be a...
<p>I try to install <code>gke-gcloud-auth-plugin</code> on a Mac M1 with zsh, following the gcloud <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl" rel="noreferrer">docs</a>.</p> <p>The installation ran without issue and trying to re-run <code>gcloud components install gke-gcl...
<p>I had the same error and here's how I fixed it.</p> <pre><code>brew info google-cloud-sdk </code></pre> <p>which produces:</p> <pre><code>To add gcloud components to your PATH, add this to your profile: for bash users source &quot;$(brew --prefix)/share/google-cloud-sdk/path.bash.inc&quot; for zsh users ...
<p>I am trying to run the following command on a pod from my local machine.</p> <pre><code>kubectl -n myns exec mypod -- /bin/bash -c &quot;err=$(tar -cvzf /tmp/logs_aj.tgz ${all_files} 2&gt;&amp;1) || ( export ret=$?; [[ $err == *&quot;No such file or directory&quot;* ]] || exit &quot;$ret&quot; )&quot; </code></pre> ...
<p>Your command contain nested double quotes so use single quotes instead:</p> <pre><code>kubectl -n myns exec mypod -- /bin/bash -c 'err=$(tar -cvzf /tmp/logs_aj.tgz ${all_files} 2&gt;&amp;1) || ( export ret=$?; [[ $err == *&quot;No such file or directory&quot;* ]] || exit &quot;$ret&quot; )' </code></pre>
<p>Auto-Scaling is OFF and Cluster-Upgrade is OFF but still dont know why cluster get restarted today morning. All Nodes got replace/change and All Pods got restarted</p> <p>Reason is that it got restarted due to node got upgrade from 1.22 to 1.23 version</p> <p>I have Regular Version in GKE Cluster</p>
<p>You should double-check with Google support (if you have a support plan), but I know from painful experience that if you're running a version of GKE that falls out of support, they may force-upgrade you to keep you within support, even if you have cluster upgrade turned off -- unless you use a maintenance exclusion....
<h2>Background</h2> <p>I have been playing around with GCP free plan. I am trying to learn how to apply gitops with IaC. To do so I'm trying to create the infrastructure for a kubernetes cluster using terraform, using google as the cloud provider.</p> <p>Managed to configure the Github Actions to apply the changes when...
<p>The <code>google_container_cluster</code> resource also allows you to specify disk usage. Update the configuration as follows:</p> <pre><code>resource &quot;google_container_cluster&quot; &quot;primary&quot; { name = &quot;k8s-cluster&quot; location = &quot;europe-west9&quot; # We can't create a cluster w...
<p>I want to write some tests for Kubernetes with python. This is a sample of my deployment file in Kubernetes:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment metadata: name: test-service namespace: test creationTimestamp: '2022-12-08T18:18:49Z' labels: app: test-...
<p>You can specify a default value for the <code>dict.get</code> method to make it fall back to the value when a given key does not exist.</p> <p>Assuming you want an empty string when either <code>labels</code> or <code>team</code> doesn't exist, you can change:</p> <pre><code>data['metadata']['labels']['team'] </code...
<p>I'm trying to set up a Harbor Registry in Kubernetes cluster locally in Minikube. I am using <a href="https://github.com/goharbor/harbor-helm" rel="nofollow noreferrer">https://github.com/goharbor/harbor-helm</a> and trying to set it up with the ingress controller. At the moment, I have not changed any defaults (the...
<p>I found out what the issue was: I needed to set the <code>ipFamily.ipv6.enabled</code> version to false:</p> <p><code>helm upgrade -i my-release harbor/harbor --set ipFamily.ipv6.enabled=false</code></p>
<p>I have a k8s cluster which contains 2 nodes. And in the cluster I deployed 2 pods for the same application. Due to some reason I have to deploy a service (NodePort IP) for each pod, so totally I have 2 services the application, for example the service NodePort IP is 192.142.1.11 and 192.142.1.12. And use these 2 ips...
<p>If your final goal is masters HA / users service load balancing in on-prem environment, then you can take a look on this two project:</p> <p><a href="https://kube-vip.io/" rel="nofollow noreferrer">Kubevip</a>: can do both (HA masters + LoadBalancer type for user workload).</p> <p><a href="https://github.com/metall...
<p>I'm building an app that spawns Jobs (batch/v1), I need to update my Custom Resource status with the Job status.</p> <p>I setup the controller with the following:</p> <pre class="lang-golang prettyprint-override"><code>func (r *JobsManagedByRequestedBackupActionObserver) SetupWithManager(mgr ctrl.Manager) error { ...
<p>The solution was really dead simple - when the object is not ready, then requeue it, wich for Job means to wait until it will be finished. Still I don't understand why the controller is not notified about a state change from: active=1 to active=0 and from failed=0 to failed=1</p> <p><strong>Example:</strong></p> <pr...
<p>I am trying to pass entire set of yamls from <code>values.yaml</code> in helm to the <code>templates</code>, so that whatever yaml inputs I pass in the values.yaml section goes in the templates yaml as it is :</p> <p>For example :</p> <p><code>values.yaml</code></p> <pre><code>... ... metallbConfig: |- apiVersion:...
<p>If you want to embed the yaml entirely, you don't need the <code>|-</code></p> <p>For example, I have this in <code>values.yaml</code></p> <pre class="lang-yaml prettyprint-override"><code>... probes: livenessProbe: httpGet: path: /ping port: 80 initialDelaySeconds: 15 periodSeconds: 60 ...
<p>`</p> <pre><code>rules: - verbs: - get - list apiGroups: - '' resources: - namespaces - pods - pods/log - verbs: - get - list apiGroups: - apps resources: - deployments </code></pre> <p>`</p> <p>I want to know difference between</p> <p>a...
<p>The API group in kubernetes identifies which API group needs to target. This is necessary as different API groups can have the same verbs and also Kubernetes is highly extensible and allows for the addition of new APIs that can have verbs and resource names that clash with other APIs.</p> <p>In the manifest file, ...
<p>I am using an <code>Ubuntu 22.04</code> machine to run and test Kubernetes locally. I need some functionality like <code>Docker-Desktop</code>. I mean it seems both <code>master</code> and <code>worker</code> nodes/machines will be installed by <code>Docker-Desktop</code> on the same machine. But when I try to insta...
<p>Prerequisites for installing kubernetes in cluster:</p> <ol> <li>Ubuntu instance with 4 GB RAM - Master Node - (with ports open to all traffic)</li> <li>Ubuntu instance with at least 2 GB RAM - Worker Node - (with ports open to all traffic)</li> </ol> <p>It means you need to create 3 instances from any cloud provide...
<p>In Kubernetes, I want start a PostgreSQL pod, create database, user and grant all privileges to the database to the user. So I came up with the following command:</p> <pre><code>kubectl run somepod --rm -i --restart=Never --image postgres:alpine --tty -- psql &quot;postgresql://postgres:somepass@localhost&quot; -c &...
<p>You can try something like this:</p> <pre><code>kubectl run test4 -i --tty --image=postgres --restart=Never --rm --command -- echo &quot;hello&quot; hello pod &quot;test4&quot; deleted </code></pre> <p>In your example, you are just executing a command in a running container, where postgres is started already.</p> ...
<p>I got a task, to create a helm-chart and use a kubernetes database operator that creates automatically credentials for the database.</p> <p>I don't really understand how is this possible.<br /> I found this operator in Operator hub: <a href="https://operatorhub.io/operator/postgresql-operator-dev4devs-com" rel="nofo...
<p>i am not much fan of operators not writing unless required or keeping it as the last option.</p> <p>To understand it easily consider it like there are different types of operator</p> <ul> <li>Helm-based operator</li> <li>Ansible operator</li> <li>Go, python other language-based operators</li> </ul> <p>Which use the ...
<p>I have my application <a href="https://myapp.com" rel="nofollow noreferrer">https://myapp.com</a> deployed on K8S, with an nginx ingress controller. HTTPS is resolved at nginx.</p> <p>Now there is a need to expose one service on a specific port for example <a href="https://myapp.com:8888" rel="nofollow noreferrer">h...
<p>It is not a best practices to expose custom port over internet.</p> <p>Instead, create a sub-domain (i.e <a href="https://custom.myapp.com" rel="nofollow noreferrer">https://custom.myapp.com</a>) which point to internal service in port 8888.</p> <p>Then to create separate nginx ingress (not ingress controller) which...
<h2>Problem statement</h2> <p>The kubernetes metrics server starts, but doesn't collect metrics. When running <code>$ kubectl top pods</code> it returns <code>error: Metrics not available for pod &lt;namespace&gt;/&lt;deployment&gt;</code>.</p> <h2>Artificats</h2> <p>I'm using the following <code>metrics.yml</code></p>...
<p>I think I found the solution. I overlooked the following comment: <a href="https://github.com/kubernetes-sigs/metrics-server/issues/1061#issuecomment-1239227118" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/metrics-server/issues/1061#issuecomment-1239227118</a></p> <p>It turns out that Docker-Desktop...
<p>I am trying to create an application in Kubernetes (Minikube) and expose its service to other applications in same clusters, but i get connection refused if i try to access this service in Kubernetes node.</p> <p>This application just listen on HTTP <code>127.0.0.1:9897</code> address and send response.</p> <p>Below...
<p>you need to change <code>127.0.0.1:9897</code> to <code>0.0.0.0:9897</code> so that application listens to all incoming requests</p>
<p>From what I understand, with the above configuration, it is possible to have 2 pods that exist in the cluster associated with the deployment. However, the old Pod is guranteed to be in the 'Terminated' state. An example scenario is updating the image version associated with the deployment.</p> <p>There should not be...
<p>It depends on your <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy" rel="nofollow noreferrer">update strategy</a>. Many times it's desired to have the new pod running and healthy before you shut down the old pod, otherwise you have downtime which may not be acceptable as per b...
<p>I'm trying to containerize a python application, where I used the Kubernetes package. My Dockerfile is:</p> <pre class="lang-bash prettyprint-override"><code>FROM python:3.10.6 ADD App_pod.py . ADD config.yml ~/.kube/config RUN pip3 install requests beautifulsoup4 RUN pip3 install kubernetes RUN apt-get install -y...
<p>A couple of issues:</p> <ul> <li><code>~</code> has a special meaning on Linux; it is a shortcut to the user's home directory. I think <code>~</code> is not available for the destination path of a Dockerfile <code>ADD</code> (or <code>COPY</code>) command. You should use a specific path instead</li> <li>It's not adv...
<p>I need to execute <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-token-em-" rel="nofollow noreferrer">this operation</a> from my (.NET) application. How do I figure out which <a href="https://kubernetes.io/docs/reference/" rel="nofollow noreferrer">k8s API to map</a> this comman...
<p>You can read the API docs: <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#tokenrequest-v1-authentication-k8s-io" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#tokenrequest-v1-authentication-k8s-io</a></p> <p>You can also inpsect what kub...
<p>I am following Kubernetes documentations on <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">secret</a>. I have this <code>secret.yaml</code> file:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: mysecret type: Opaque data: val1: YXNkZgo= stringData: val...
<pre><code>volumeMounts: - name: myval mountPath: /etc readOnly: true </code></pre> <p>Instead of /etc <strong>directory</strong>, try mount as a single file:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: nginx type: Opaque stringData: val1: asdf --- apiVersion: v1 kind: Pod metadata: name: nginx...
<p>I understand that a service of type ExternalName will point to a specified deployment that is not exposed externally using the specified external name as the DNS name. I am using minikube in my local machine with docker drive. I created a deployment using a custom image. When I created a service with default type (C...
<blockquote> <p>According to my understanding service of type ExternalName should be accessed when using the specified external name. But I wasn't able to do it. Can anyone say how to access it using its external name?</p> </blockquote> <p>You are wrong, external service is for making external connections. Suppose if y...
<h1>edited</h1> <p>I find myself frequently looking to see if something has stopped happening. To do this, it helps to see events in chronological order...</p> <p><a href="https://stackoverflow.com/a/55858337/8656552">This solution</a> <em>seems</em> to work, but the formatting still drives me insane...</p> <p>The solu...
<p>I'd convert everything to seconds first and then print it as <code>HH:MM:SS</code>, e.g.:</p> <pre><code>$ cat tst.awk BEGIN { split(&quot;h m s&quot;,denoms) fmts[&quot;s&quot;] = fmts[&quot;m&quot;] = fmts[&quot;h&quot;] = &quot;%02d&quot; mults[&quot;s&quot;] = 1 mults[&quot;m&quot;] = 60 mult...
<p>I am using an <code>Ubuntu 22.04</code> machine to run and test Kubernetes locally. I need some functionality like <code>Docker-Desktop</code>. I mean it seems both <code>master</code> and <code>worker</code> nodes/machines will be installed by <code>Docker-Desktop</code> on the same machine. But when I try to insta...
<p>The hostname does nothing about node roles.</p> <p>If you do <code>kubeadm init</code>, the node will be a <code>master</code> node (currently called <code>control plane</code>).</p> <p>This node can also be used as a <code>worker</code> node (currently called just a <code>node</code>), but by default, Pods cannot b...
<p>My team and I are new to Kubernetes and are experimenting with running a few applications on it.</p> <p>For proof of concept, we have a running <a href="https://docs.k3s.io/" rel="nofollow noreferrer">Lightweight Kubernetes (K3s)</a> install, which presumably does not have the full range of CRDs available on a stand...
<p>Most likely the problem is not related to missing CRDs but to the kubernetes version. I assume you are using the latest K3S version, which is <a href="https://github.com/k3s-io/k3s/releases/tag/v1.25.4%2Bk3s1" rel="nofollow noreferrer">v1.25.4</a>. <code>PodDisruptionBudget</code> was moved from <code>policy/v1beta1...
<p>I deployed the consul client on my k8s cluster using helm .</p> <pre><code>sudo helm install hi-consul hashicorp/consul -n consul-client -f config.yaml </code></pre> <p><a href="https://i.stack.imgur.com/43o2k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/43o2k.png" alt="enter image description...
<p>You can delete the POD with <code>kubectl delete &lt;POD name&gt; -n &lt;Namespace name&gt;</code></p> <p>If you want all pods to be restarted you can use the <code>kubectl rollout restart deployment &lt;deployment name&gt; -n &lt;Namespace name&gt;</code></p>
<p>I'm using the GKE cluster and using the release version as a Regular channel. I noticed that the pods are restarting due to the GKE's auto-upgrade feature. In my cluster, I have a deployment of NiFi in the cluster couldn't bear continuous reboots because of some internal functionality. I know that's not the expected...
<p>Yes. Maintenance exclusions will stop upgrades to your cluster, depending on what you specify. If you specify NO upgrades allowed during the interval, then you are only allowed to set a 30-day window max (the window can be longer if you specify certain parts can be upgraded -- e.g. allow patch upgrades, allow minor...
<p>I am trying to enable kubernetes for Docker Desktop. Kubernetes is however failing to start.</p> <p>My log file shows:</p> <pre><code>cannot get lease for master node: Get &quot;https://kubernetes.docker.internal:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/leases/docker-desktop&quot;: x509: certifica...
<p>Below work around can help you resolve your issue.</p> <p>You can solve this by</p> <ul> <li>Open ~.kube\config in a text editor</li> <li>Replace <a href="https://kubernetes.docker.internal:6443" rel="nofollow noreferrer">https://kubernetes.docker.internal:6443</a> to https://localhost:6443</li> <li>Try connecting a...
<p>We want to get all the pods in the cluster so we are using something like following:</p> <pre><code>pods, err := client.CoreV1().Pods(&quot;&quot;).List(context.Background(), metav1.ListOptions{}) </code></pre> <p>This code will receive all the pods in the cluster.</p> <p>My question is: If there is a code or lib wh...
<p>As @CoolNetworking suggested,there is a single lib or code that will get you all the pods with their owner reference, but you can use k8s API to retrieve the owner references for each pod. You can then use the k8s API to retrieve the owner object for each owner reference. This will allow you to create a hierarchical...
<p>I have a kubernetes cluster in Amazon EKS, Autoscaling is set. So when there is load increase a new node spin-up in the cluster and spin-down with respect to load-running. We are monitoring it with Prometheus and send desired alerts with Alertmanager.</p> <p>So help me with a query that will send alerts whenever Aut...
<p>The logic is not so great, but this works for me in a non-EKS Self Hosted Kubernetes Cluster on AWS EC2s.</p> <pre><code>(group by (kubernetes_io_hostname, kubernetes_io_role) (container_memory_working_set_bytes ) * 0 </code></pre> <p>The above query fetches the currently up nodes and multiplies them by 0,</p> <pre>...
<p>Since 3 days, I have a problem with a deployment in kubernetes. I would like to deploy two react-js application : the first in <a href="http://app.my-domain.com" rel="nofollow noreferrer">http://app.my-domain.com</a> and the other in <a href="http://app.my-domain.com/shop" rel="nofollow noreferrer">http://app.my-dom...
<p>I think the simple solution for this, is to use one ingress resource with this domain (app.my-domain.com) and reference the two services with their fqdn : first-service.my-namespace-1.svc.cluster.local, second-service.my-namespace-2.svc.cluster.local.</p> <p>I am very interested in another solution.</p>
<p>I have <code>yaml</code> with lines:</p> <pre><code>accounts: service: - id: account1 username: foo password: bar - id: account2 username: foo1 password: bar1 </code></pre> <p>It's default values for my app. But I want to change it in <code>ConfigMap</code>. I do something like that...
<p>If your app, works and can read the yaml as in your example you can create a configMap from your yaml file like so:</p> <p>kubectl create configmap myconfigmap --from-file=myfile.yaml --dry-run=client -o yaml &gt; output-configmap-file.yaml</p> <p>where myfile.yaml is your yaml file.</p> <p>this will create locally...
<p>We are using the following to authenticate:</p> <pre><code>import base64 import boto3 import string import random from botocore.signers import RequestSigner class EKSAuth(object): METHOD = 'GET' EXPIRES = 60 EKS_HEADER = 'x-k8s-aws-id' EKS_PREFIX = 'k8s-aws-v1.' STS_URL = 'sts.amazonaws.com' ...
<p>Your <code>EKSAuth</code> class works. Just checked it with my cluster.</p> <p>Here is a working (simpler) snippet instead of the second one.</p> <pre><code>import base64 import tempfile import kubernetes import boto3 from auth import EKSAuth cluster_name = &quot;my-cluster&quot; # Details from EKS eks_client = b...
<p>Can somebody explain the difference in tooling between Crossplane and Cluster API from the perspective of a managed kubernetes platform provision ?</p> <p><a href="https://github.com/kubernetes-sigs/cluster-api" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/cluster-api</a></p> <p>I was using crossplan...
<p><strong>Cluster API</strong></p> <p>Cluster API is one of the projects in CNCF that you can use the create and manage the <strong>Kubernetes</strong> clusters. it's more like Kubeadm, kind, k3s, minikube(not for prod usecase) with <strong>YAML</strong> config &amp; CLI.</p> <p>You can create the YAML file and provis...
<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>By default EKS compute mode group, will have the default cluster Security Group attached which is created by AWS. Even if you provide additional security group to EKS cluster during the creation, that additional security group will not be attached to compute instances. So, to get this working, you have to use Launch...
<p>In CI, with gcp auth plugin I was using gcloud auth activate-service-account ***@developer.gserviceaccount.com --key-file ***.json prior to execute kubectl commands. Now with gke-gcloud-auth-plugin I can’t find any equivalent to use a gcp service account key file. I've installed <code>gke-gcloud-auth-plugin</code> a...
<p>You will need to set the env variable to use the new plugin before doing the <code>get-credentials</code>:</p> <pre class="lang-bash prettyprint-override"><code>export USE_GKE_GCLOUD_AUTH_PLUGIN=True gcloud container clusters get-credentials $CLUSTER \ --region $REGION \ --project $PROJECT \ --internal-ip </co...
<p>I've a GCP GKE cluster with version '1.22.12-gke.300'. There are around 20 nodes distributed in 4 node pools. The cluster was created a month before and last day I noticed that all of my nodes are rebooted/restarted. When I see the details of the node using command <code>kubectl get nodes</code>, I'm seeing this res...
<p>I received the answer to my question on this <a href="https://serverfault.com/questions/1078073/find-out-why-a-kubernetes-cluster-was-restarted-on-google-cloud">link</a> from the above comment. I'll just explain the scenario for others to benefit.</p> <p>I created a cluster on GKE with the Release channels as &quot...
<p>I am not able to install Kibana with simple helm command which used to work earlier.</p> <p>&quot;helm install kibana elastic/kibana -n kibana&quot;</p> <p>Are there any recent changes in kibana helm? Do we need to create elasticseach-master-certs and elasticsearch-credentials secrets prior to kibana install now.</p...
<p>As per the latest release notes, For Kibana 8.XX version they have enabled authentication and TLS by default. For me I already had elasticsearch installed which is serving on http port so we have to enable TLS in elasticsearch first. As the Kibana-elasticseach communication must be tls enabled as per latest kibana r...
<p>I'm trying to follow their docs and create this pod monitoring i apply it and i see nothing in metrics</p> <p>what am i doing wrong?</p> <pre><code>apiVersion: monitoring.googleapis.com/v1 kind: ClusterPodMonitoring metadata: name: monitoring spec: selector: matchLabels: app: blah namespaceSelector: ...
<p>As mentioned in the offical <a href="https://cloud.google.com/stackdriver/docs/managed-prometheus/setup-managed" rel="nofollow noreferrer">documnentation</a>:</p> <p>The following manifest defines a PodMonitoring resource, prom-example, in the NAMESPACE_NAME namespace. The resource uses a Kubernetes label selector t...
<p>I'm still a Kubernetes newbie but I am already confronted with what I think is a mammoth task. My company is hosting a Kubernetes cluster. Because of internal policies, we are obliged to have everything georedundand. Which means we are supposed to build a second cluster (identical to the already existing one) in a d...
<p>Kubernetes is already a distributed system, by design.</p> <p>It is more common to run a Kubernetes cluster by using <strong>3</strong> data centers - since it is built upon consensus algorithms like <a href="https://raft.github.io/" rel="nofollow noreferrer">raft</a>. This replaces older ways to run systems by usin...
<p>I'd like to import the output of:</p> <pre><code>kubectl get pods -o json </code></pre> <p>into a python pandas dataframe. This should contain also all containers and there resource request and limits.</p> <p>My code starts as follows:</p> <pre><code>import json import numpy as np import pandas as pd import os pods_...
<p>Here is an example how you can extract the data of interest to the dataframe. The output is only an example (as you didn't specify the required output in the question):</p> <pre class="lang-py prettyprint-override"><code>import json import pandas as pd # open the Json data from file (or use os.popen): with open(&qu...
<p>I'm trying to connect to a kubernetes cluster running on my Windows PC from my Mac. This is so I can continue to develop from my Mac but run everything on a machine with more resources. I know that to do this I need to change the kubectl context on my Mac to point towards my Windows PC but don't know how to manually...
<p>From your MAC try if the port is open: Like nc -zv 192.168.yourwindowsIp 6443. If it doest respond Open, you have a network problem. Try this.</p> <pre><code>clusters: - cluster: server: https://192.168.1.XXX:6443 name: windows-docker-desktop insecure-skip-tls-verify: true </code></pre> <p>directly in th...
<p>I have a problem <strong>deploying with Terraform a node group in an EKS cluster</strong>. The error looks like one plugin is having problems but I do not know how to resolve it.</p> <p>If I see the EC2 in the AWS console (web), I can see the instance of the cluster but I have this error in the cluster.</p> <p>The ...
<p>There is also a quick way to troubleshoot such issues. You could use &quot;AWSSupport-TroubleshootEKSWorkerNode&quot; Runbook. This Runbook is designed to help troubleshooting EKS worker node that failed to join an EKS cluster. You need to go to AWS Systems Manager -&gt; Automation -&gt; Select the Runbook -&gt; Exe...
<p>Hello Fellow Developers,</p> <p>I am new to software development and looking forward to doing transitioning to software development.</p> <p>I am learning new skills and tools to scale up and I came across DOCKER and KUBERNETES</p> <p>I have completed my backend with spring boot, java and MYSQL I just wanted to know ...
<p>Try the follwoing Dockerfile. It performs a multi-stage build where in the first stage, your code is compiled to an executable. Then in the next stage, only the parts necessary for running your application are copied so that your Docker image has less size than if you copied all your uncompiled and compiled code in ...
<p>I'm configuring app to works in Kubernetes google cloud cluster. I'd like to pass parameters to <code>application.properties</code> in Spring boot application via <code>configMap</code>. I'm trying to pass value by <strong>Environment Variable</strong>.</p> <p>I've created config map in google cloud Kubernetes clust...
<p>You can read properties from the environment, but that could require a bit of coding &amp; refactoring (depending on the rest of your code) to import and use such values, i.e. into a <code>Properties</code> object.</p> <p>If you want to use an <code>application.properties</code> file directly you're better off mount...
<p>I know that the kubelet reports that the node is in diskpressure if there is not enough space on the node.<br /> But I want to know the exact threshold of diskpressure.<br /> Please let me know the source code of the kubelet related this issue if you could.<br /> Or I really thanks for your help about the official d...
<p>Disk pressure is a condition indicating that a node is using too much disk space or is using disk space too fast, according to the thresholds you have set in your Kubernetes configuration.</p> <p>DaemonSet can deploy apps to multiple nodes in a single step. Like deployments, DaemonSets must be applied using kubectl ...
<p>I'm trying to troubleshoot an issue I'm having in kubernetes where after a job fails, the associated pod seemingly disappears and I can't view the logs. The job still exists though.</p> <p>But that's not what my question is about. In reading through the documentation, it seemingly uses the terms &quot;terminated&quo...
<p>As @karthikeayan said, Delete and Terminate are the same. And yes, your pods got deleted because activeDeadlineSeconds exceeded.</p> <p>if your job have some error but you restartPolicy is not Never, so your job created pods will be deleted</p> <p>restartPolicy can be set: This indicates that kubernetes will restart...
<p>I am learning kubernetes in my home network. which is configured like this:</p> <pre><code>-192.168.1.1(router) -192.168.1.30(ubuntu machine 1, master node) -192.168.1.71(ubuntu machine 2, worker node) </code></pre> <p>My router ip 192.168.1.1 can not be modified. When I execute <code>sudo kubeadm init --po...
<p>Use another IP-range (private) for your cluster, like 10.10.x.x. Do not use the network on which your nodes a runing.</p> <pre><code>--pod-network-cidr=10.10.10.0/24 </code></pre> <p>This will create a range of 255 ipaddresses each node can use for the pods, when they starts. so called clusterIps.</p> <p>You need a...
<p>I have AKS with nginx load balancer (ingress controller) installed with helm as the entry point to my cluster.</p> <p>I want to preserve the real IP addresses from clients for further whitelisting with <code>nginx.ingress.kubernetes.io/whitelist-source-range</code> on certain paths of specific services.</p> <p>I fou...
<p>I also made a github issue with the same question here: <a href="https://github.com/kubernetes/ingress-nginx/issues/9402" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/9402</a></p> <p>And the discussion on the kuberenetes stack took me to the following link: <a href="https://www.asykim...
<p>It would be useful for me to be able to define at a higher level a way to determine a set of nodes that a set of pods should run ontop of.</p> <p>Is there a way to use kustomize so that i can specify what nodeSelectors a deployment should have?</p>
<p>OP asks for a way for all pods to run on a pre-defined set of nodes. So, adding to @yee379, you may define a patch to be applied to multiple generic resources at once like this:</p> <pre class="lang-yaml prettyprint-override"><code>patches: - patch: |- kind: not-important metadata: name: not-im...
<p>I am trying to setup grafana on kubernetes and need to use mysql as its backend to store dashboards and its config instead of persistent volume. Is there any way around to achieve it?</p> <p>Tried grafana helm charts expecting any variable to use mysql as backend but could not find any.</p>
<p>Yes Grafana supports the Mysql, Postgress</p> <p><a href="https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#database" rel="nofollow noreferrer">https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#database</a></p> <p>You can set the value at <strong>grafana.ini</strong></p>...
<pre><code>Warning SyncLoadBalancerFailed 54s (x4 over 91s) service-controller Error syncing load balancer: failed to ensure load balancer: Multiple tagged security groups found for instance i-05f3a11329a20bb93; ensure only the k8s security group is tagged; the tagged groups were sg-08ca90265d3402e6c(education-eks-...
<p>Add in eks module will fix issue.</p> <pre><code>node_security_group_tags = { &quot;kubernetes.io/cluster/${var.cluster_name}&quot; = null } </code></pre> <h2>Ref:</h2> <p><a href="https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1986" rel="nofollow noreferrer">https://github.com/terraform-aws...
<p>When we use <code>PM2</code> in cluster mode, we can find out the instance number inside node app using <code>process.env.NODE_APP_INSTANCE</code>, but how we can find that inside a kubernetes cluster without <code>pm2</code>. I'm looking for similar like find replica instance number or etc.</p> <p>Imagine a node ap...
<p>I found that when use <code>Statefulset</code> instead of the <code>Deployment</code> then it's possible to inject the determinable POD name as an environment variable.</p> <pre><code> ... containers: ... env: - name: &quot;POD_NAME&quot; valueFrom: fieldRef: fieldPath: m...
<p>I need the URI of requests that reach my <code>myapp</code> pods to be rewritten to remove the prefix <code>/foo</code> from the path. For example, a URI <code>/foo/bar</code> should be received as <code>/bar</code>. I am using a GCP load balancer that routes traffic directly to pods. I am not using Istio ingress, s...
<p>I found <a href="https://github.com/istio/istio/issues/22290#issuecomment-1317595537" rel="nofollow noreferrer">https://github.com/istio/istio/issues/22290#issuecomment-1317595537</a> which shows how to write a custom <code>EnvoyFilter</code> to do path rewriting and adapted it to my needs. I'm not at all sure if th...
<p>I am following <a href="https://www.datapacket.com/blog/build-kubernetes-cluster#chapter6" rel="nofollow noreferrer">this guide</a> to expose a service running on my bare metal k8s cluster to the world.</p> <p>The guide suggests using <a href="https://github.com/metallb/metallb" rel="nofollow noreferrer">metallb</a>...
<p>Specify a single IP using CIDR notation. your-ip/32 (192.168.10.0/32 for example)</p>
<p>I am new to Kubernetes, so this might be obvious, but in a deployment yaml, why do we have to define the labels in the deployment metadata, then define the same labels in the template metadata, but match those separately in the selector?</p> <p>Shouldn't it be obvious that the template belongs to the deployment it's...
<p>Let's simplify labels, selectors and template labels first.</p> <ul> <li>The Labels in the metadata section are assigned to the deployment itself.</li> <li>The Labels in the <code>.spec.template</code> section are assigned to the pods created by the deployment. These are actually called PodTemplate labels.</li> <li>...
<p>etcd: enabled: true name: etcd replicaCount: 3 pdb: create: false image: repository: &quot;milvusdb/etcd&quot; tag: &quot;3.5.0-r7&quot; pullPolicy: IfNotPresent</p> <p>service: type: ClusterIP port: 2379 peerPort: 2380</p> <p>auth: rbac: enabled: false</p> <p>persistence: enabled: true storageClass: accessMode: Rea...
<p>This error comes because you dont have a Persistent Volume. A pvc needs a a pv with at least the same capacity of the pvc.</p> <p>This can be done manually or with a Volume provvisioner.</p> <p>The most easy way someone would say is to use the local storageClass, which uses the diskspace from the node where the pod ...
<p>I am new to Kubernetes, so this might be obvious, but in a deployment yaml, why do we have to define the labels in the deployment metadata, then define the same labels in the template metadata, but match those separately in the selector?</p> <p>Shouldn't it be obvious that the template belongs to the deployment it's...
<p>Technically, the parameter <code>matchLabels</code> decides on which Pods belongs to the given Deployment (and the underlying ReplicaSet). In practice, I have never seen a Deployment with different <code>labels</code> than <code>matchLabels</code>. So, the reason might be the uniformity between other Kubernetes reso...
<p>I'm running the example in chapter &quot;Service Discovery&quot; of the book &quot;Kubernetes up and running&quot;. The original command to run a deployment is <code>kubectl run alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue --replicas=3 --port=8080 --labels=&quot;ver=1,app=alpaca,env=prod&quot;</code>, howev...
<p>There is no way to promote it however you can change label and all those stuff but instead of that you can create the new deployment delete the existing POD.</p> <p>So easy step you can take input of existing running POD to YAML file first</p> <pre><code>kubectl get pod &lt;POD name&gt; -o yaml &gt; pod-spec.yaml </...
<p>I have Gitlab Kubernetes integration in my <code>Project 1</code> and I am able to access the <code>kube-context</code> within that project's pipelines without any issues.</p> <p>I have another project, <code>Project 2</code> where I want to use the same cluster that I integrated in my <code>Project 1</code>.</p> <p...
<p><a href="https://about.gitlab.com/releases/2022/12/22/gitlab-15-7-released/#share-cicd-access-to-the-agent-within-a-personal-namespace" rel="nofollow noreferrer">GitLab 15.7</a> (December 2022) suggests an alternative approach, which does not involve creating a new agent per project</p> <blockquote> <h2>Share CI/CD ...
<p>I am trying to deploy a pod in kubernetes and link a service to it so I can access it via web browser.</p> <p>The pod specification is the following:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment metadata: name: visualizer-nautic labels: app: visualizer spec: re...
<p>The nodeport is on your kubernetes node. Accessing from your local machine wont work. Use http://masternodeipaddress:nodeport.</p> <p>You can add a hostentry in your local hosts file like:</p> <pre><code>masternodeipaddress mytestdomain.local </code></pre> <p>then access <a href="http://mytestdomain.local:nodeport" ...
<p>When there's more than one search result from <code>/</code> filter command, how do you navigate to next item? Basically I'm looking for F3 (next search result) equivalent in k9s. Commands listed <a href="https://k9scli.io/topics/commands/" rel="noreferrer">here</a> does not seem to include what I'm looking for...</...
<p>Narain's answer works when searching in a list of resources but when looking at yaml the interaction is slightly different:</p> <ol> <li>Press <code>/</code></li> <li>Type search term, press enter</li> <li>Press <code>n</code> to go to next, <code>shift-n</code> to go to previous match</li> </ol> <p>Edit: I realize ...
<p>I'm new to k8s and I'm trying to build a distributed system. The idea is that a stateful pod will be spawened for each user.</p> <p>Main services are two Python applications <code>MothershipService</code> and <code>Ship</code>. MothershipService's purpose is to keep track of ship-per-user, do health checks, etc. <co...
<p>One possibility is to use the <code>kubectl port-forward</code> command to expose the pod port locally on your system. For example, if I'm use this deployment to run a simple web server listening on port 8000:</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: labels: app: example name: example sp...
<p>I have deployed a Cloud SQL proxy and a service attached to it in Kubernetes. Both the proxy and the service are listening on port 5432. Other pods are not able to establish a connection to the Cloud SQL database through the proxy, but when I port forward to the pod of the proxy or to the service, I am able to conne...
<p>CloudSQL Proxy listens on localhost by default. If you want to expose it via a service, you'll want to add <code>--address 0.0.0.0</code> to your cloud_sql_proxy command options.</p>
<p>I am trying to install PGO (Postgres Operator) in k8s. I am following <a href="https://access.crunchydata.com/documentation/postgres-operator/5.3.0/quickstart/" rel="nofollow noreferrer">this</a> documentation. At the 2nd step when I run following command</p> <pre><code>kubectl apply --server-side -k kustomize/insta...
<p><strong>To fix your issue make sure kubectl integration like below :</strong></p> <p>As <strong>@Ralle</strong> commented, Check versions. <strong>Kustomize v2.1.0 and v3.0.0+, and is included in kubectl 1.21+</strong>, for more information please look at the <a href="https://github.com/kubernetes/kubernetes/issues/...
<p>I know that deployment uses replicaset underneath it, has revision control, creates another replicaset during rolling upgrade/downgrade.</p> <p>I want to know what is the scenario in which only replicaset can be used and deployment can't be used.</p>
<p>ReplicaSet's purpose is to maintain a stable set of replica Pods running at any given time and it checks how many pods need to maintain bases on which it creates or deletes the pods. ReplicaSet then fulfills its purpose by creating and deleting Pods as needed to reach the desired number. ReplicaSets can be used inde...
<p>kubectl version /home/lenovo/.local/bin/kubectl: line 1: syntax error near unexpected token <code>&lt;' /home/lenovo/.local/bin/kubectl: line 1: </code><Code>NoSuchKey</Code>The specified key does not exist.No such object: kubernetes-release/release//bin/linux/amd64/kubectl'</p>
<p>I cleared kubectl from <code>/usr/local/bin</code></p> <p>and also from <code>/home/$USER/.local/bin</code></p> <p>And run the commands below:</p> <pre class="lang-bash prettyprint-override"><code>curl -LO &quot;https://dl.k8s.io/release/v1.24.7/bin/linux/amd64/kubectl&quot; curl -LO &quot;https://dl.k8s.io/v1.24.7...
<p>One of the things I noticed is that Helm charts that require persistence (e.g. Postgres) contain a persistent volume claim but not a default persistent volume.</p> <p>It seems that it is assumed that this should not be part of the Helm chart and should be provisioned separately.</p> <p>Is there some best practice or...
<p>Stateful apps' helm charts assume volumes were provisioned beforehand using storage static provisioning or on-demand using dynamic provisioning.</p> <p>Storage provisioning includes storage allocation, creation of PV object and binding it to the storage. This is usually done manually by storage admins for static pro...
<p>I have been trying to install kubernetes in Oracle cloud server.<br /> I followed <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/" rel="noreferrer">the kubernetes instruction</a>.</p> <p>Output of <code>kubectl config view</code> :</p> <pre class="lang-yaml prettyprin...
<p><a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/#tls-certificate-errors" rel="noreferrer">TLS certificate errors</a></p> <p>The following error indicates a possible certificate mismatch.</p> <pre><code># kubectl get pods Unable to connect to the server: x509: c...
<p>I'm a beginner in kubernetes, and when I was reading the book, I found that it is not recommended to use hostpath as the volume type for production environment, because it will lead to binding between pod and node, but if you don't use hostpath, then if you use other volume types, when reading and writing files, wil...
<p>hostpath is, as the name suggests, reading and writing from a place on the host where the pod is running. If the host goes down, or the pod gets evicted or otherwise removed from the node, that data is (normally) lost. This is why the &quot;binding&quot; is mentioned -- the pod must stay on that same node otherwise ...
<ol> <li>Figure out what is the correct way to scale up the remote function.</li> <li>Figure out scaling relations between replicas of the remote function, Flink <code>parallelism.default</code> configuration, ingress topic partition counts together with message partition keys. What is the design intentions behind this...
<p>There are two things happening here...</p> <ol> <li>Each partition in your topic is assigned to a sub-task. This is done round-robin, so if you have 5 topic partitions and 5 sub-tasks (your parallelism) then every sub-task is reading from a single different topic partition.</li> <li>Records being read from the topic...
<p>I have a task to automate the uploading of AKS logs (control plane and workload) to the Azure storage account so that they can be viewed later or may be an alert notification to the email/teams channel in case of any failure. It would have been an easy task if the log analytics workspace would have been used however...
<p>A better approach for achieving this would be deploying a <a href="https://github.com/fluent/fluentd-kubernetes-daemonset" rel="nofollow noreferrer">fluentd daemonset</a> in your cluster and use the <a href="https://github.com/htgc/fluent-plugin-azurestorage" rel="nofollow noreferrer">azure storage plugin</a> to upl...
<p>I have a problem. In my kubernetes cluster, I am trying to run my Rails application. I got the image loaded, but now I want to write a custom command. The default command in my Dockerfile is:</p> <pre><code>CMD [&quot;bundle&quot;, &quot;exec&quot;, &quot;rails&quot;, &quot;server&quot;, &quot;-b&quot;, &quot;0.0.0....
<p>Use <code>entrypoint</code> for that:</p> <pre><code>services: app: build: . entrypoint: ./entrypoint.sh command: bundle exec rails s -p 3000 -b 0 ports: - 3000:3000 </code></pre> <pre class="lang-bash prettyprint-override"><code># entrypoint.sh #!/bin/bash set -e # is this still an issue? r...
<p>In Jenkins, I want to understand why &quot;docker ps&quot; is not running inside my container despite I redact my Jenkins file like this :</p> <pre><code>podTemplate(serviceAccount: 'jenkins', containers: [ containerTemplate( name: 'docker', image: 'docker', resourceRequestCpu: '100m', ...
<p>Even if you run Jenkins inside a docker container, you must install docker inside.</p> <p>Best way create a new Dockerfile and install docker inside.</p> <pre><code>FROM jenkins/jenkins ARG HOST_UID=1004 ARG HOST_GID=999 USER root RUN apt-get -y update &amp;&amp; \ apt-get -y install apt-transport-https ca-cer...
<p>I'm working in a company that uses Github Actions and Argocd.(using argocd helm chart). Needless to say that the Github repo is private and argocd is in an internal network that used by the company only.</p> <p>The flow of what we want to do is that when we deploy the app and the deployment succeeded - Trigger anoth...
<p>The best approach would be to use a <a href="https://argo-cd.readthedocs.io/en/stable/user-guide/resource_hooks/" rel="nofollow noreferrer">post sync hook</a>.</p> <p>Why is it necessary to run the tests in a GitHub actions workflow? Since the application is already deployed to the cluster, wouldn't it make more sen...
<p>We need to configure health check for our service which uses apscheduler to schedule and run the jobs. The idea is to check if apscheduler is running jobs fine at the specified time or working as expected.</p> <p>We tried scheduler.running, but it shows true when it's not able to pick next jobs. Any suggestions here...
<p>You can use add_listener() and can listen to only particular types of events by giving the appropriate mask argument to add_listener(), OR’ing the different constants together. The listener callable is called with one argument, the event object.</p> <p>Example:</p> <pre><code>def my_listener(event): if event.exc...
<p>I have a container with pytorch. The container is 3GB. When i run 20 instances of this container it takes 60GB of disk space. I basically have 20 copies of the same library. Is it possible not to have separate copies of the filesystem of the container. If the container fs is set to readonly would that help? Im runni...
<blockquote> <p>Is it possible not to have separate copies of the filesystem of the<br /> container.</p> </blockquote> <p>Yes, you can do that.</p> <p>You can have the <code>ReadOnlyMany</code> file system or <code>ReadWriteMany</code> file system.</p> <p><strong>Hostpath</strong></p> <p>You can also leverage the <stro...
<p>I am trying to familiarise myself with kubernetes, and want to run a k8s stack on some low spec hw (think raspberry pi).</p> <p>I found what <a href="https://www.linuxtechi.com/install-kubernetes-on-ubuntu-22-04/" rel="nofollow noreferrer">appears to be a great guide to set up kubernetes un Ubuntu</a> but I ran into...
<p>From minikube <a href="https://minikube.sigs.k8s.io/docs/start/" rel="nofollow noreferrer">documentation</a>: <code>minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes</code></p> <p>If you want to learn more about Kubernetes, I suggest reading and implementing <a href="https:...
<p>I am trying to add ELK to my project which is running on kubernetes. I want to pass by filebeat -&gt; logstach then elastic search. I prepared my filebeat.yml file and in my company the filebeat is configured as an agent in the cluster which i don't realy know what it means? I want to know how to configure the fileb...
<p>You can configure the Filebeat in some ways.</p> <p>1 - You can configure it using the DeamonSet, meaning each node of your Kubernetes architecture will have one POD of Filebeat. Usually, in this architecture, you'll need to use only one filebeat.yaml configuration file and set the inputs, filters, outputs (output t...
<p>I have a Kubernetes cluster, with Artifactory as my internal registry and proxy to pull images from external private registries. How do I authenticate to these external private registries when I want to pull an image from my Kubernetes cluster? Normally in Kubernetes, this is done by using image pull secrets, howeve...
<p>Taking the comment by @Ivonet as the base - you configure the auth against the remote repository source in Artifactory itself. You can see the <a href="https://www.jfrog.com/confluence/display/JFROG/Advanced+Settings#AdvancedSettings-RemoteCredentials" rel="nofollow noreferrer">docs here</a>.</p> <p>Once Artifactory...
<p>I am trying to dynamic lookup available namespaces and able to create secrets in the namespaces using below helm chart.</p> <blockquote> <p>templates/secrets.yaml</p> </blockquote> <pre><code>{{ range $index, $namespace := (lookup &quot;v1&quot; &quot;Namespace&quot; &quot;&quot; &quot;&quot;).items }} apiVersion: ...
<p>When you reference the named template &quot;imagePullSecret&quot; inside the range, the context &quot;.&quot; you are providing refers to the body of the loop, which does not have the &quot;Values&quot; attribute.</p> <p>Try providing the root context instead:</p> <pre class="lang-yaml prettyprint-override"><code>{{...
<p>I want to create a service account in Kubernetes v1.25.5 using this tutorial <a href="https://devopscube.com/kubernetes-api-access-service-account/" rel="nofollow noreferrer">https://devopscube.com/kubernetes-api-access-service-account/</a></p> <p>Full log:</p> <pre><code>root@node1:~# kubectl create namespace devop...
<p>Blog you are following is from <strong>June 5, 2021</strong> might be using the old k8s release, while in <strong>2022-12-08</strong> <strong>1.24</strong> relased and you are using the <strong>1.25</strong></p> <p>In <strong>1.24</strong> Kubernetes release there is change which don't auto crate the secret when you...
<p>My query is pretty much what the title says, I have a local file say <code>file.txt</code> and I want to copy it into <code>pod1</code>'s container <code>container1</code>.</p> <p>If I was to do it using kubectl, the appropriate command would be :</p> <p><code>kubectl cp file.txt pod1:file.txt -c container1</code></...
<p>Here's how I finally managed to do it :</p> <pre><code>package main import ( &quot;context&quot; &quot;fmt&quot; &quot;os&quot; &quot;path/filepath&quot; &quot;k8s.io/client-go/kubernetes&quot; &quot;k8s.io/client-go/kubernetes/scheme&quot; corev1 &quot;k8s.io/api/core/v1&quot; &quo...
<p>SpringBoot 2.3 introduced a feature to create OCI/Docker images by running <code>./gradlew bootBuildImage</code> instead of having a <code>Dockerfile</code> and execute <code>docker build .</code></p> <p>When building on a Gitlab build server that is running inside a Kubernetes cluster there is no Docker daemon ava...
<p>It is possible by using <a href="https://podman.io/" rel="nofollow noreferrer">Podman</a>. Podman includes a daemon that implements a Docker-compatible API. On a local machine this can be started via <code>podman system service --time 0 tcp://0.0.0.0:2375</code>.</p> <p>When running in Kubernetes (or generally in a ...
<p>I have a kubernetes cluster in Azure (AKS) with the log analytics enabled. I can see that a lot of pods are being killed by OOMKilled message but I want to troubleshoot this with the log analytics from Azure. My question is how can I track or query, from the log analytics, all the pods that are killed by the <code>O...
<p>The reason is somewhat hidden in the <code>ContainerLastStatus</code> field (JSON) of the <code>KubePodInventory</code> table. A query to get all pods killed with reason <code>OOMKilled</code> could be:</p> <pre><code>KubePodInventory | where PodStatus != &quot;running&quot; | extend ContainerLastStatusJSON = parse...