prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>We are deploying Jenkins on the K8s env, with 1 master and 4 worker nodes using calico network plugin, the pods are created on the time of Job run in Jenkins, but the issue is hostnames don't resolve, no error logs in Jenkins, on checking the pods, calico pod on master node is down, not sure if this is cause for the... | <p>What Sanjay M. P. shared worked for me, however I want to clarify what caused the problem, and why the solution work with some more detail.</p>
<p>First of all, I am running an ubuntu env, so what Piknik shared does not work, firewalld is only on centos / rhel systems. Even still, ufw was disabled on all nodes.</p>
... |
<p>I have a local image that runs fine this way:
<code>docker run -p 8080:8080 -v C:\Users\moritz\Downloads\1\imageService\examples1:/images -v C:\Users\moritz\entwicklung\projekte\imageCluster\logs:/logs imageservice</code></p>
<p>Now i want this to run as Kubernetes (using built in from Docker-for-Windows v1.19.7) de... | <p>As mentioned <a href="https://stackoverflow.com/questions/62812948/volume-mounts-not-working-kubernetes-and-wsl-2-and-docker/63524931#63524931">here</a>, you can use below hostPath to make it work on wsl2.</p>
<pre><code>// C:\someDir\volumeDir
hostPath:
path: /run/desktop/mnt/host/c/someDir/volumeDir
type: Dire... |
<p>My Pod is not appearing in the prometheus targets</p>
<p>the application is exposing metrics '/metrics'</p>
<p>I added a service monitor to expose the service</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: abc
# Change this to the ... | <p>make sure that your pod has a label called "app"</p>
<pre><code>Labels: app=<appname>
</code></pre>
<p>if you are using helpm chart add the label in the helper in {{chart-name}}\templates_helpers.tpl</p>
<pre class="lang-yaml prettyprint-override"><code>{{/*
Selector labels
*/}}
{{- define &qu... |
<p>I am configuring rails application in kubernates.I am using redis,sidekiq and Postgres DB.Below the yaml I am using.</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: dev-app
name: test-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: Dev-app
... | <p>you are not running right way container. ideally POD running must be single application if require multiple container then and then use the multiple container inside the single POD or deployment.</p>
<p>you should be deploying single container in single POD or deployment instead of 3 in single.</p>
<p>for logs issue... |
<p>We have <a href="https://en.wikipedia.org/wiki/Tarantool" rel="nofollow noreferrer">tarantool</a> in the Kubernetes cluster. One of tarantool's part has big in size. We need to be able to manage this separately from the main release.
Our idea is to divide by two namespaces. Is it possible? What problems will we have... | <p><strong>1:</strong> Our idea is to divide by two namespaces. Is it possible?</p>
<blockquote>
<p>No, because <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" rel="nofollow noreferrer">Namespaces</a> are a logical partitioning capability that enable one Kubernetes cluster to be ... |
<p>I hope you are doing well</p>
<p>Please, I can't create this <strong>Deployment</strong></p>
<p>I don't either know why or what can be the error.</p>
<p>It seems like some people have already had this error but I don't understand from the comment how they solve it.</p>
<p>I check into the Kubernetes documentation bu... | <p>it should be something like</p>
<pre><code>selector:
matchLabels:
tier: msvc
name: analysis-api
component: backend
</code></pre>
<p>instead</p>
<pre><code>selector:
matchLabels:
labels:
tier: msvc
name: analysis-api
component: backend
</code></pre>
|
<p>I would like some help to solve a particular Kubernetes + mTLS problem please.</p>
<p>How to make Kubernetes liveness probe work on a <strong>secure https mTLS health check endpoint</strong> please?</p>
<p>My application is a web application where a health check endpoint is exposed over a particular port, same port ... | <p>Can you try changing scheme: HTTP to HTTPS?</p>
<p>livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTPS
initialDelaySeconds: 10
periodSeconds: 10</p>
<p>If scheme field is set to HTTPS, the kubelet sends an HTTPS request skipping the certificate verification.</p>
|
<p>I have searched many websites and articles but not found any perfect answer. I am using <strong>eks version 1.18</strong>. I can see a few of the pods are "Evicted", but when trying to check the node I can see the error "(combined from similar events): failed to garbage collect required amount of imag... | <p>see if you can change the Kubernetes GC policies.
I guess the issues may be due to recent changes in the flags</p>
<p>the new ones are using the flags as <code>--eviction</code> syntax, can you check if that is the case with your setup causing the failure on clearing the space</p>
<p>Please refer to the docs here</p... |
<p><strong>Background</strong></p>
<p>We have a simple producer/consumer style application with Kafka as the message broker and Consumer Processes running as Kubernetes pods. We have defined two topics namely the in-topic and the out-topic. A set of consumer pods that belong to the same consumer group read messages fro... | <blockquote>
<p>"What could be causing this behavior where a message is consumed twice when a pod gets downscaled?"</p>
</blockquote>
<p>You have provided the answer already yourself: "[...] that a pod is getting downscaled after a consumer writes the message to the out-topic but before Kafka can commit ... |
<p>I created a key/value secret in openshift. I want to retrieve the value of that key/value pair.</p>
<p>i tried using</p>
<pre><code>oc describe secret ashish -n my-project
</code></pre>
<p>but it gave the value as shown below but i dont the value for my key it just shows 7bytes.</p>
<pre><code>Name: ashish
N... | <p>You can get key and value using "oc get secret/SECRETNAME -o yaml" simply, but you should decode the value by base64.
After you retrieve the key using "oc get -o yaml", the value can decode simply as follows.</p>
<pre><code>oc get secret ashish -n my-project \
-o go-template --template="{... |
<p>I'm new to Terraform and Helm world! I need to set up Istio on the AWS EKS cluster.
I'm trying to install Istio on top of EKS cluster using Terraform and Helm as a provider:
Below is the terraform code for the same:</p>
<pre><code>resource "kubernetes_namespace" "istio-system" {
metadata {
... | <p>yes, you have to create the IAM role also if you want to create it for workers you can also create the IAM for the same.</p>
<pre><code>resource "aws_iam_role" "eksproject-cluster" {
name = "terraform-eks-eksproject-cluster"
assume_role_policy = <<POLICY
{
"Version&quo... |
<p>I'm using helm 3.4.2 for upgrade my charts to my AKS cluster and I saw that every time I deploy something new, it creates a new secret called sh.helm.v... This is the first time I'm using helm.</p>
<p>I was reading the doc and found that at version 3.x helm is using secrets to store driver as default. Cool, but ever... | <p>So yes, There are few major changes in Helm3, comparing to Helm2.</p>
<ol>
<li><a href="https://v3.helm.sh/docs/faq/#secrets-as-the-default-storage-driver" rel="nofollow noreferrer">Secrets are now used as the default storage driver</a></li>
</ol>
<blockquote>
<p>In Helm 3, Secrets are now used as the default storag... |
<p>For one POD, three images has been created. The problem here is that there is no communication between containers within same pod. How should my application connected with these three containers?</p>
<p>My pod have below containers.</p>
<pre><code>[dev-application dev-app-nginx dev-app-redis]
</code></pre>
<p>Here I... | <p>Use <strong>localhost</strong> to communicate with other containers within the same pod.</p>
<p>E.g. the addresses to the containers are</p>
<ul>
<li>127.0.0.1:3000</li>
<li>127.0.0.1:80</li>
<li>127.0.0.1:6379</li>
</ul>
|
<p>I have a pipeline I am trying to implement the Kubernetes Manifest bake action using a Kustomize render. However when I run this I get the following error:</p>
<pre><code>##[error]Error: got file 'kustomization.yaml', but '/home/administrator/BA-L01/_work/80/s/Infrastructure/STARS.API.Web/overlays/devtest/kustomizat... | <p>As the error message says, your <code>kustomizationPath</code> must point to the directory where your <code>kustomization.yaml</code> is located - not to the <code>kustomization.yaml</code> file.</p>
<p>So your <strong>pipeline.yaml</strong> has to be:</p>
<pre><code>- task: KubernetesManifest@0
displayName: Creat... |
<p>I am currently trying to set up a GKE cluster and to configure an <code>HorizontalPodAutoscaler</code> based on a custom metric (GPU consumption).
I have two node-pools and I want to horizontally scale them based on the average GPU consumption of <strong>each</strong> <code>node_pool</code>. I have configured two id... | <p>So I think you are looking for metrics for your k8 cluster especially by <code>container_name</code> or <code>node_pool</code>.</p>
<p>You have five types of metrics you can use in an HPA object(autoscaling/v2beta2)</p>
<pre><code>k explain HorizontalPodAutoscaler.spec.metrics.type --api-version=autoscaling/v2beta2... |
<p>I'm doing a perf test for web server which is deployed on <code>EKS cluster</code>. I'm invoking the server using <code>jmeter</code> with different conditions (like varying thread count, payload size, etc..).
So I want to record <code>kubernetes</code> perf data with the timestamp so that I can analyze these data w... | <p>In line with @Jonas comment</p>
<p>This is the quickest way of installing Prometheus in you K8 cluster. Added Details in the answer as it was impossible to put the commands in a readable format in Comment.</p>
<ol>
<li>Add bitnami helm repo.</li>
</ol>
<pre><code>helm repo add bitnami https://charts.bitnami.com/bitn... |
<h1>Question</h1>
<p>Are there known available Fluentd daemonset for <strong>journald docker logging driver</strong> so that I can send K8S pod logs to Elasticsearch?</p>
<h2>Background</h2>
<p>As in <a href="https://github.com/kubernetes/kubernetes/pull/42470" rel="nofollow noreferrer">add support to log in kubeadm</a... | <p>docker log driver <code>journald</code> send docker logs to <code>systemd-journald.service</code></p>
<p>so, we need to make <code>systemd-journald</code> persistent save to <code>/var/log/journal</code></p>
<p>edit <code>/etc/systemd/journald.conf</code>:</p>
<pre><code>...
[Journal]
Storage=persistent
#Compress=ye... |
<p>I have set up a Google Cloud Platform kubernetes cluster (and Container Registry) with source code on GitHub. Source code is divided into folders with separate Dockerfiles for each microservice.</p>
<p>I want to set up CI/CD using GitHub actions.</p>
<p>As far as I understand, the <a href="https://github.com/actions... | <p>I just wanted to share my experience with GKE after posting this question and then implementing the GitHub action.</p>
<blockquote>
<p>How is the deployment performed?</p>
</blockquote>
<p>Basically, the workflow sets up a connection to GKE via <strong>gcloud</strong> CLI (this also sets up <strong>kubectl</strong> ... |
<p><strong>What I'm trying to solve :</strong> Have a Java microservice be aware of total number of Replicas. This replica count is dynamic in nature</p>
<p><strong>Problem:</strong> Kubernetes downward API has limited metadata that doesnt include this information. Is there a way to qausi-query a kubectl-like command n... | <blockquote>
<p>Kubernetes downward API has limited metadata that doesnt include this information. Is there a way to qausi-query a kubectl-like command natively from a container?</p>
</blockquote>
<p>You need to query the Kubernetes API server for info about the number of replicas for a specific Deployment. You can do ... |
<p>I am using terraform to create Kubernetes namespace. Sample below</p>
<pre><code>resource "kubernetes_namespace" "test1" {
metadata {
name = local.ns_name
}
}
</code></pre>
<p>I am trying to create Blue/Green kind of deployment using terraform following this <a href="https://www.hashicor... | <p>Terraform's model requires that each <code>resource</code> block belong to exactly one provider configuration, so there is no way to avoid declaring the resource twice, but you can at least reduce the amount of duplication that causes by factoring it out into a module and calling that module twice, rather than by du... |
<p>I have an issue with the DNS mapping in kubernetes.</p>
<p>We have some servers which can be accessed from internet. The global DNS translates these servers's domain names to public internet IPs.
Some services can't access through public IPs for security consideration.</p>
<p>From company internal, we add the DNS ma... | <p>It is now possible to add a <code>hostAliases</code> section directly in the description of the deployment.</p>
<p>As a full example of how to use the <code>hostAliases</code> section I have included the surrounding code for an example deployment as well.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVers... |
<p>We have installed only consul agents on k8 cluster using the helm charts.</p>
<p><a href="https://www.consul.io/docs/platform/k8s/helm.html" rel="nofollow noreferrer">https://www.consul.io/docs/platform/k8s/helm.html</a></p>
<p>We have a separate consul server installed on a cluster (this is non-k8 cluster) outsid... | <p>We are using <a href="https://www.consul.io/docs/k8s/helm#v-client-join" rel="nofollow noreferrer"><code>client.join</code></a> parameter in values file since we are using same setup - consul cluster running outside k8s. Consul-k8s is running in client only mode by setting <a href="https://www.consul.io/docs/k8s/hel... |
<p>How to configure VPN connection between 2 Kubernetes clusters.</p>
<p>The case is:
- 2 kubernetes clusters running on different sites
- OpenVPN connectivity between 2 clusters
- In both kubernetes clusters are installed openvpn running in separate container.</p>
<p>How to configure kubernetes clusters (vpn, routi... | <p>You can use <a href="https://submariner.io/getting-started/architecture/" rel="nofollow noreferrer">Submariner</a> to connect multiple clusters, it creates a secure and performant connection between the clusters on-premises and on public clouds, then you can export the services and access them across all clusters in... |
<p>I'm working with a Pod (Shiny Proxy) that talks to Kubernetes API to start other pods. I'm wanting to make this generic, and so don't want to hardcode the namespace (because I intend to have multiple of these, deployed probably as an OpenShift Template or similar).</p>
<p>I am using Kustomize to set the namespace on... | <p>If you don't want to hard-code a specific data in your manifest file, you can consider using <a href="https://kubectl.docs.kubernetes.io/guides/extending_kustomize/" rel="nofollow noreferrer">Kustomize plugins</a>. In this case, the <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/plugin/someteam.ex... |
<p>I know the below information is not enough to trace the issue but still, I want some solution.</p>
<p>We have Amazon EKS cluster.</p>
<p>Currently, we are facing the reachability of the Kafka pod issue.</p>
<p><strong>Environment:</strong></p>
<ul>
<li>Total 10 nodes with Availability zone ap-south-1a,1b</li>
<li>I ... | <p>I believe this problem is caused by AWS's NLB TCP-only nature (as mentioned in the comments).</p>
<p>In a nutshell, <a href="https://github.com/kubernetes/kubernetes/issues/66796#issuecomment-409066184" rel="nofollow noreferrer">your pod-to-pod communication fails when hairpin is needed</a>.</p>
<p>To confirm this i... |
<p>I am trying to create and run a pod using Airflow kubernetes pod operator.
The command below is tried and confirmed to be working and I am trying to replicate the same using the kubernetes pod operator locally</p>
<pre><code>kubectl run sparkairflow -n test-namespace --image=some-docker-repo.com:hello-world --servic... | <p>The KubernetesPodOperator contains a parameter <code>service_account_name</code> with which which you can specify the K8s service account. It is available for both Airflow v2 and v1.10, the latter is just not documented.</p>
<p>Example call (mostly taken from <a href="https://airflow.apache.org/docs/apache-airflow-p... |
<p>I use a self-hosted instance of GitLab to store my Docker images. As we've recently set up Project Access Tokens, we want to pull images on AKS using individual Secrets for each registry. It means that we have specific credentials for each image in "the same registry".</p>
<p>Problem is, Deployments have a... | <p>In source code I have found that it just tries all one by one, and returns the first one that succeedes.</p>
<p>I am not going to explain the whole process of how I have found this, but here is some of explaination/proof:</p>
<p>When <a href="https://github.com/kubernetes/kubernetes/blob/a55bd631728590045b51a4f65bba... |
<p>How does one add a where clause in PromQL?</p>
<p>I'm trying to construct a query that displays when an application running in Kubernetes has been up for more than one minute but I want to filter by namespace.</p>
<p>This is what my query looks like at the moment</p>
<pre><code>100 * (count(up == 1) BY (job, namespa... | <p>You would have to filter the metric "up" by the labels you want (namespaces) in your case it should look something like this:</p>
<pre><code>100 * count(up{namespace=~"default|jenkins"} == 1) > 1
</code></pre>
|
<p>I have a Vue.js application, and my deployment setup is very standard,</p>
<blockquote>
<p>Pod -> Service -> Ingress</p>
</blockquote>
<p>Here's the related code,</p>
<p><strong>Dockerfile</strong>:</p>
<pre><code>FROM node:lts-alpine AS build
WORKDIR /app
COPY . .
# Default build mode
ARG MODE=production
# ... | <p><strong>TL;DR</strong></p>
<p><strong>Remove/Modify the following annotation from <code>Ingress Prod</code>:</strong></p>
<ul>
<li><code>nginx.ingress.kubernetes.io/rewrite-target: /$2</code></li>
</ul>
<hr />
<h3>Explanation:</h3>
<p>The annotation that you are using (<code>rewrite-target: /$2</code>) is targeting ... |
<p>In the context of improving an API on Kubernetes, I am considering using a distributed hash table. My API always receives requests to an URL with this scheme:</p>
<pre><code>www.myapi.com/id
</code></pre>
<p>Reading the documentation of Istio, it seems pretty direct and easy to get what I want. Indeed, Istio handles... | <p>As I mentioned in comments if I understand correctly you're looking for a ConsistenHashLB path, there is <a href="https://istio.io/latest/docs/reference/config/networking/destination-rule/#LoadBalancerSettings-ConsistentHashLB-HTTPCookie" rel="nofollow noreferrer">documentation</a> about that.</p>
<p>There is also <... |
<h2>The problem</h2>
<p>It seems that deleting a pod by UID used to be possible, but has been removed (<a href="https://github.com/kubernetes/kubernetes/issues/40121" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/40121</a>).</p>
<p>It also seems one cannot <em><strong>get</strong></em> a pod by its r... | <p>This works as a <strong>get</strong> by UID:</p>
<blockquote>
<h2>Use kubectl <code>custom-columns</code></h2>
<p>List all PodName along with its UID of a namespace:</p>
<pre><code>$ kubectl get pods -n <namespace> -o custom-columns=PodName:.metadata.name,PodUID:.metadata.uid
</code></pre>
</blockquote>
<p>sou... |
<p>I have a task. I need to write python code to generate a yaml file for kubernetes. So far I have been using pyyaml and it works fine. Here is my generated yaml file:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
data:
info:
name: hostname.com
aio-max-nr: 262144
cpu:
cpuLogicalCores: 4
memory... | <p>The pipe makes the contained values a string. That string is not processed by YAML, even if it contains data with YAML syntax. Consequently, you will need to give a string as value.</p>
<p>Since the string contains data in YAML syntax, you can create the string by processing the contained data with YAML in a previou... |
<p>I have a Golang application running in Kubernetes which needs to persist a single string value outside of it's memory. In other words, if the application is redeployed or the pod is restarted - the value is not lost. I also need to be able to read and write this from golang regularly.</p>
<p>What is a good way to do... | <p>In Kubernetes, you have the following options to store data outside the POD (or actually to share data between PODs).</p>
<ol>
<li><strong>Persistent Volume</strong>: a shared filesystem, you share data as files</li>
<li><strong>ConfigMap/Secret</strong>: Kubernetes-based shared objects, you use Kubernetes API to st... |
<p>I have basic and fundamental question regards to Hashicorp Vault. I would like to inject some secrets (password to database) from Vault to container with Spring application.</p>
<p>I have prepared a specific annotations for using Vault with Kubernetes and everything works fine, saving PASSWORD variable as environmen... | <p>I think it definitely makes sense as the purpose is to avoid hard coding credentials in the spec.</p>
<blockquote>
<p>inject agent saves the file with PLAIN text password in the /vault
path, so everybody can see this secret.</p>
</blockquote>
<p>Even in bare metal servers or cloud instances, credentials are saved in... |
<p>I'm currently researching and experimenting with Kubernetes in Azure. I'm playing with AKS and the Application Gateway ingress. As I understand it, when a pod is added to a service, the endpoints are updated and the ingress controller continuously polls this information. As new endpoints are added AG is updated. As ... | <p>Azure Application gateway ingress is an ingress controller for your kubernetes deployment which allows you to use native Azure Application gateway to expose your application to the internet. Its purpose is to route the traffic to pods directly. At the same moment all questions about pods availability, scheduling and... |
<p>Can you please help me figure out why kubectl apply fails?
When I try to run <code>kubectl apply -k k8s/overlays/dev</code> it fails with error message "error: rawResources failed to read Resources: Load from path ../../base failed: '../../base' must be a file"
But if I run <code>kustomize build k8s/overla... | <p>Upgrading kubectl to v1.21.0 solved the issue.</p>
|
<p>I am trying to copy files from the pod to local using following command:</p>
<pre><code>kubectl cp /namespace/pod_name:/path/in/pod /path/in/local
</code></pre>
<p>But the <code>command terminates with exit code 126</code> and copy doesn't take place.</p>
<p>Similarly while trying from local to pod using following c... | <p><code>kubectl cp</code> is actually a very small wrapper around <code>kubectl exec whatever tar c | tar x</code>. A side effect of this is that you need a working <code>tar</code> executable in the target container, which you do not appear to have.</p>
<p>In general <code>kubectl cp</code> is best avoided, it's usua... |
<p>Is it possible with the Nginx ingress controller for Kubernetes to have an ingress rule that routes to different services based on if a query string exists? For example..</p>
<p>/foo/bar -> route to serviceA</p>
<p>/foo/bar?x=10 -> route to serviceB</p>
<pre class="lang-yaml prettyprint-override"><code>apiVers... | <p>I managed to find a working solution for what you described with two ingress objects. With the example that you provided ingress won't be able to direct you towards <code>service-b</code> since nginx does not match query string at all. This is very well explained <a href="https://stackoverflow.com/questions/15713934... |
<p>Need to move from use of minio client to a docker image having gcloud/gsutil and mysql images.</p>
<p>What i have currently:</p>
<ol>
<li>/tmp/mc alias set gcs1 <a href="https://storage.googleapis.com" rel="nofollow noreferrer">https://storage.googleapis.com</a> $ACCESS_KEY $SECRET_KEY</li>
<li>mysqldump --skip-lock... | <p>You'll need to generate a boto configuration file using <code>gsutil config -a</code>. If you also have gcloud auth credentials configured, you may have to tell gcloud to not pass those (non-HMAC) credentials to gsutil, as gsutil may not allow you to have multiple credential types active at once. You can do this by ... |
<p>I successfully deployed my Kubernetes app using <code>kubectl apply -f deployment.yaml</code>.
When I try to hit the URL endpoint, I'm getting an <code>nginx 404 Not Found</code> error page.</p>
<p>My next step is to open a <code>bash</code> shell on the docker instance that is running my app. How do I do this in K... | <p>As correctly stated by @David Maze:</p>
<blockquote>
<p>Your <code>kubectl get pods</code> command has a <code>--namespace</code> option; you need to repeat this in the <code>kubectl exec</code> command. – David Maze 12 hours ago</p>
</blockquote>
<p>If you've created your <code>Deployment</code>: <code>dpl-my-app</... |
<p>I am trying to connect to kubelet running on a "fake node" from a EKS fargate pod.</p>
<p>For example I have two nginx pods with IPs <code>10.0.0.1</code> and <code>10.0.0.2</code> hosted in two fake nodes with the same IPs <code>10.0.0.1</code> and <code>10.0.0.2</code>.</p>
<p>From the pod <code>10.0.0.1... | <p>So, on AWS Fargate, Pods and associated Nodes share the IP address:</p>
<pre><code>$ kubectl get pods -o=wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
foo 1/1 Running 0 94m 192.168.152.1... |
<p>Using Istio 1.9.2</p>
<pre><code>kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-d0 Ready control-plane,master 7d2h v1.20.5
k8s-d1 Ready <none> 7d2h v1.20.5
k8s-d2 Ready <none> 7d2h v1.20.5
kubectl get pods -n istio-sys... | <p>I found out that the problem was with istio-ingressgateway's service which didn't have a external ip. After setting it with the command bellow, it worked fine:</p>
<pre><code>kubectl patch svc istio-ingressgateway -n istio-system -p '{"spec":{"externalIPs":["__YOUR_IP__"]}}'
</code></pr... |
<p>I'm trying the official example <a href="https://kubernetes.io/docs/tutorials/stateless-application/guestbook/" rel="nofollow noreferrer">Example: Deploying PHP Guestbook application with MongoDB</a>.</p>
<p>Everything is good, but when I deploy a <code>ingress</code> for it, I can see next in chrome network debug (... | <p>You should be able to do this with the correct <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#rewrite" rel="nofollow noreferrer"><code>rewrite-rule</code></a> and <code>path</code> pattern:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name... |
<p>I would like to transform a <code>ClusterRoleBinding</code> in a <code>RoleBinding</code> using <code>kustomize-v4.0.5</code>, and also set the namespace field for the <code>RoleBinding</code> and in an additional <code>Deployment</code> resource with the same value.</p>
<p>I succeed in doing that using files below:... | <p>This is a community wiki answer. Feel free to expand it.</p>
<p>I have analyzed your issue and came to the following conclusions.</p>
<p>TL;DR: Unfortunately, the answer is: "not possible like you want it". The current workaround you are using with <code>sed</code> is the way to go. At the end of the day, ... |
<p>I have a pod that reads from an image that contains data within <code>var/www/html</code>. I want this data to be stored in a persistent volume. This is my deployment yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: app
spec:
replicas: 1
selector:
matchLabels:
... | <p>This is more a problem of visibility: If you mount an empty volume at a specific path, you won't be able to see, what was placed there in the container image.</p>
<p>From your question I assume that you want to be able to rollout updates by the means of a new container image, but at the same time retain variable dat... |
<p>I read in the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod" rel="nofollow noreferrer">Kubernetes docs</a> that from within a pod you can access the Kubernetes apiserver with the <code>kubernetes.default.svc</code> DNS name. This name does resolve ... | <p>In kubernetes a Service exists of a IP <strong>and port</strong> pair (or multiple). It does not represent anything. The IP is just virtual and not assigned to a network interface. This is the reason, why you can't ping a service (pings do not get sent to a specific port).</p>
<p>Using curl/nc/telnet to access/conne... |
<p>I have Prometheus setup via Helm from Terraform and it's is configured to connect to my Kubernetes cluster. I open my Prometheus but I am not sure which metric to choose from the list to be able to view the CPU/MEM of running pods/jobs.
Here are all the pods running with the command (<strong>test1</strong> is the ku... | <p><code>node_cpu_seconds_total</code> is a metric from <code>node-exporter</code>, the exporter that brings machine statistics and its metrics are prefixed with <code>node_</code>. You need metrics from <code>cAdvisor</code>, this one produces metrics related to containers and they are prefixed with <code>container_</... |
<p>Following the guide that google made for deploying an HPA in Google Kubernetes Engine: <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics</a></p>
<p>And adding the right permis... | <p>Resolved for me!</p>
<p>After a several of test, changing in the HPA yaml,</p>
<p>the metric from <code>Pod</code> to <code>External</code>, and the metric name with <code>custom.google.apis/my-metric</code>, it works!</p>
<pre><code>apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: my-... |
<p>Currently I do this:</p>
<pre><code>configMapGenerator:
- name: sql-config-map
files:
- "someDirectory/one.sql"
- "someDirectory/two.sql"
- "someDirectory/three.sql"
</code></pre>
<p>and I would like to do sth. like this:</p>
<pre><code>configMapGenerator:
- na... | <p>Nope.</p>
<p>See discussion around that feature in <a href="https://github.com/kubernetes-sigs/kustomize/issues/189#issuecomment-409042317" rel="nofollow noreferrer">comment on "configMapGenerator should allow directories as input"</a></p>
<p>The main reason:</p>
<blockquote>
<p>To move towards explicit de... |
<p>When a docker container is running it is sometimes helpful to look at <em>runtime configuration</em>.
What is the equivalent command for kubernetes?</p>
<p>I did a search on so for this and came up with some similar questions: See <a href="https://stackoverflow.com/search?q=What+is+the+kubernetes+equivalent">https... | <p>Kubernetes is a container orchestrator, so you'll not find container-level commands.</p>
<p>You can check the container logs:</p>
<pre><code>kubectl logs pod-name
Mon Jan 1 00:00:00 UTC 2001 INFO 0
Mon Jan 1 00:00:01 UTC 2001 INFO 1
Mon Jan 1 00:00:02 UTC 2001 INFO 2
</code></pre>
<p>You can describe a pod to se... |
<p>I'm trying to isntall Jenkins on Kubernetes using Helm 3 and following hte official instructions but running up against a permission issue.</p>
<pre><code>---
apiVersion: v1
kind: Namespace
metadata:
name: jenkins
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: jenkins-pv
namespace: jenkins
spec:
... | <p>I see that this happens when using <code>hostPath</code> Minikube one node cluster, like in the documentation. The issue is because the <code>/data/jenkins-volume</code> folder in the Minikube node is created with <code>root</code> ownership.</p>
<p>So, if you don't want to run as root with the <code>runAsUser: 0</c... |
<p>I have configured a Kafka cluster on Kubernetes using Strimzi. Using this article - <a href="https://itnext.io/kafka-on-kubernetes-the-strimzi-way-part-2-43192f1dd831" rel="nofollow noreferrer">https://itnext.io/kafka-on-kubernetes-the-strimzi-way-part-2-43192f1dd831</a>
But the security service in my company does n... | <p>As described in the Strimzi documentation - you have two options to choose from:</p>
<ol>
<li>You can provide your own CA for the cluster or clients certification authorities. For more details see <a href="https://strimzi.io/docs/operators/latest/full/using.html#installing-your-own-ca-certificates-str" rel="nofollow... |
<p>This is my code to add a picture to a worksheet. I get the picture as a byte from the database. .Net Core framework version is 2.2.104. This is an API project. In my locale, the code works well. I use the ClosedXML component 0.95.4 version as below.</p>
<pre><code>[HttpPost("GetTowel")]
public IActionResul... | <p>I have a Dockerfile like this:</p>
<pre><code>FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ...
.
.
.
FROM ... |
<p>I am learning about Kubernetes am trying move from docker-compose to use Kubernetes but having problem with connecting to MongoDB running on localhost. </p>
<p>I don't have any problems connecting using following docker-compose.yaml by using <code>'network_mode: "host"'</code></p>
<pre><code>//docker-compose.yaml
... | <p>Similar solution to <a href="https://stackoverflow.com/questions/50952240/connect-to-local-database-from-inside-minikube-cluster/67093139#67093139">Connect to local database from inside minikube cluster</a></p>
<p>The issue is <code>host.minikube.internal</code> (not <code>host.docker.internal</code> -- this one is ... |
<p>First of all I'm pretty new on all this (kubernetes, ingress, spark/zeppelin ...) so my apologies if this is obvious. I tried searching here, documentations etc but couldn't find anything.</p>
<p>I am trying to make the spark interpreter ui accessible from my zeppelin notebook running on kubernetes.
Following what I... | <p>You can create a new service and leverage the <strong>interpreterSettingName</strong> label of the spark master pod. When zeppelin creates a master spark pod it adds this label and its value is <strong>spark</strong>. I am not sure if it will work for more than one pods in a per user per interpreter setting. Below i... |
<p>I create a helm chart directory</p>
<p><code>helm create myChart</code></p>
<p>After updating the templates and values I run</p>
<p><code>helm template .</code></p>
<p>Everything looks as expected. Next, I want to output the manifest files into another directory</p>
<p><code>helm template . --output-dir ./test</code... | <p>I don't think there is such an option in the Helm command itself, but you can always run the following command.</p>
<pre><code>helm template myChart . --output-dir ./test && mv ./test/myChart/templates/* ./test && rm -r ./test/myChart
</code></pre>
|
<p>According to <a href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/</a></p>
<blockquote>
<p>Kubernetes uses QoS classes to make decisions about scheduling and evicting Pods.</p>
</... | <blockquote>
<p>My question is what is the link between QoS and scheduling?</p>
</blockquote>
<p>According to <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/</a></p>
<blockquote>
<p>kube-s... |
<p>I know how to use RBAC with X.509 certificates to identify a user of <code>kubectl</code> and restrict them (using <code>Role</code> and <code>RoleBinding</code>) from creating pods of any kind in a namespace. However, I don't know how I can prevent them from putting specific labels on a pod (or any resource) they'r... | <p>You can use the Kubernetes-native policy engine called <a href="https://kyverno.io/" rel="nofollow noreferrer">Kyverno</a>:</p>
<blockquote>
<p>Kyverno runs as a dynamic admission controller in a Kubernetes cluster. Kyverno receives validating and mutating admission webhook HTTP callbacks from the kube-apiserver and... |
<p>I have the following setup:</p>
<p>An <strong>azure kubernetes cluster</strong> with some nodes where my application (consisting of multiple pods) is running.
I'm looking for a good way to make a <strong>project-specific configuration file</strong> (a few hundred lines) <strong>available for two of the deployed cont... | <p>You can use a configmap for this, but the configmap includes your config file. You can create a configmap with the content of your config file via the following:</p>
<pre><code>kubectl create configmap my-config --from-file=my-config.ini=/path/to/your/config.ini
</code></pre>
<p>and the bind it as a volume in your p... |
<p>I'm new to Terraform. I need to set up Istio on the AWS EKS cluster. I thought of using Istio-Operator along with Terraform to do the same.</p>
<p>Below is the shell script to install Istio on EKS using Istio-Operator:</p>
<p>install-istio.sh</p>
<pre><code># Download and install the Istio istioctl client binary
# ... | <p>I believe you will encounter problems if using a local-exec provisioner like this.</p>
<p>Terraform does not play nice with resources it cannot reconcile. Especially when it comes to CRDs. Also, every time you will run <code>terraform apply</code>, you will run <code>istioctl init</code> over and over, which is prob... |
<p>What's the process for either preventing NGINX from responding to the Public IP, or to get it to redirect to somewhere else - like another URL.</p>
<p>I'm a little stumped as I can't seem to find much in the way of documentation anywhere for this situation. We're using cert-manager too.</p>
<p>Essentially a PEN Test... | <p>It's possible to solve this; easy for HTTP and difficult for HTTPS. The main problem is to issue a certificate for an IP address, not any issuer does that (letsencrypt for example doesn't), so you have to find one or try whichever you use now.</p>
<p>To handle unknown hosts (like an IP address) you can create an ing... |
<p>I deployed ignite 2.10.0 in google cloud kubernetes. It is working properly. Now I need to enable control center to it. [1] provides instructions to deploy control agent backend and frontend. After deploying them I created account and need to connect cluster to it. [2] given download option but not provide informati... | <p>Default ignite docker image doesn't contain control center files. I created new docker image using ignite docker image.</p>
<p>Following is the Dockerfile</p>
<pre><code>FROM apacheignite/ignite:2.10.0
WORKDIR /opt/ignite
RUN wget https://www.gridgain.com/media/control-center-agent/control-center-agent-2.9.0.1.zip
R... |
<p>Having issue while creating configmap for directories and sub-directory and files. For example having folder structure as like below</p>
<pre><code>.
├── build
│ └── book
│ └── book.txt
├── deploy
│ └── k8
│ └── deploy.txt
└── test
└── tablet
└── tab.txt
6 directories, 3 files
</code></p... | <p>Here the steps</p>
<pre><code>1) select your directory and make it as a tar file (i.e tar -zcvf file.tar.gz /tmp/file)
2) kubectl create configmap test-configmap --from-file=file.tar.gz --dry-run -o yaml >test-configmap.yaml
3) create volume mounts
- mountPath: /tmp/file.tar.gz
subPath: file.tar.... |
<p>I am trying to deploy a simple HTML file to Kubernetes and host it using Nginx as a test. I am running into issues when copying over my website files.</p>
<p><strong>Dockerfile</strong></p>
<pre><code>FROM nginx:alpine
COPY ./public /usr/share/nginx/html/
</code></pre>
<p>When I build this image and run it using <co... | <p>I know if is only this, but in the quick glance I can say the key value in your ingress template must be pointing to the service port, not to the pod container port. Check the right config below:</p>
<pre><code> kind: Service
apiVersion: v1
metadata:
name: k8site
spec:
selector:
ap... |
<p>Here is part of my <code>nginx.conf</code>:</p>
<pre><code> location ^~ /api/ {
#resolver kube-dns.kube-system.svc.cluster.local valid=5s; #don't work
resolver 10.244.64.10;
set $loadurl http://gateway-service.default.svc.cluster.local:55558/;
if ($http_namespace != "" ) ... | <p>@RichardSmith comment helped me!I should use <code>rewrite</code>.<br />
The configeration below work fine for me.</p>
<pre><code>location ^~ /api/ {
resolver kube-dns.kube-system.svc.cluster.local; #It working
if ($http_namespace != "" ) {
rewrite ^/api(.*)$ $1 break;
proxy_pass ht... |
<p>I have a Helm Chart. Which on deployment creates the following Kubernetes resources:</p>
<ol>
<li>A SSL enabled Service</li>
<li>A Container created with my Docker image which internally runs a Java process that communicates with the above service.</li>
<li>Kubernetes Secrets (SSL certificates and access keys), that... | <h2>TL;DR</h2>
<p>You can add the certificate to the keystore in an <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer"><code>initContainer</code></a>. The keystore can be shared between the <code>initContainer</code> and the <code>container</code> using a <a href="ht... |
<p>I have a grafana Loki logs that's in my cluster. I am able to see my logs but as at the moment, the cluster is no longer in use and I would like to delete it but I still have some logs I would like to extract Loki and maybe store it locally on my system, or Azure bucket.</p>
<p>Is there a way to extract this logs an... | <p>You could use <code>logcli</code> to connect to Loki. See this <a href="https://grafana.com/docs/loki/latest/getting-started/logcli/" rel="noreferrer">documentation</a>.</p>
<p>Example command:</p>
<pre><code>port-forward <my-loki-pod> 3100
logcli query '{ job="foo"}' --limit=5000 --since=48h -o raw... |
<p>I am getting the pod metrics through kubectl command</p>
<pre><code>➜ kubectl top pods
NAME CPU(cores) MEMORY(bytes)
api-6bd876fc8b-85dnx 72m 553Mi
ui-67b794cf8d-gcrg5 0m 1Mi
</code></pre>
<p>but I want to try through Java client <a href="https://github.com/kubernetes-clie... | <p>as blue man said, it is now possible to get this metrics<br />
Java Solution</p>
<pre class="lang-java prettyprint-override"><code>PodMetricsList list = new Metrics(client).getPodMetrics("playground");
for(PodMetrics podMetrics:list.getItems()){
for(ContainerMetrics containerMetrics:podMetrics.getCont... |
<p>I’m curious how to approach an upgrade/reboot situation with an application consuming messages from a Google Pub/Sub.</p>
<p>For example I am particularly interested in developing a Golang application that is deployed in Kubernetes running multiple pods and consumes messages form a Google Pub/Sub. My concern is how ... | <p>Kubernetes uses SIGTERM, waits 30 seconds, then SIGKILL. This gives your application an appropriate amount of time before completely killing it, which you can tweak using the <code>terminationGracePeriodSeconds: 60</code> field if the 30 second default is not enough (link 1).</p>
<p>You then need to add logic in you... |
<p>I've a docker container based ReactJS based app, a shell script is defined in docker image as the ENTRYPOINT, and I'm able to use docker run image-name successfully.</p>
<p>Now the task is to use this docker image for Kubernetes deployment using standard deployment.yaml file templates, something like following</p>
<... | <p>When you write this in a pod description:</p>
<pre><code> containers:
- name: my-app
imagePullPolicy: Always
image: my-docker-image
command: ["/bin/bash"]
args: ["-c","./entrypoint.sh;while true; do echo hello; sleep 10;done"]
</code></pre>
<p>... |
<p>I am working on a Kubernetes integration of the database Apache IoTDB which supports a Cluster mode. Currently, to start a cluster each node needs to know the IP adresses of all other nodes in its "ensemble" upfront, before starting.</p>
<p>I think the default approach to this in Kubernetes would generally... | <p>When a DNS address of a headless service is resolved, it returns a list of Pods (ie. IPs) from an underlying endpoint object. The endpoint object always holds the list of <strong>Ready</strong> pods.</p>
<p>So, you will get the list of <strong>Ready</strong> pods of that moment on resolving headless service DNS.</p>... |
<p>We have a few k8s clusters in AWS that were created using Kops.<br />
We are trying to improve security by setting up RBAC using service accounts and users.<br />
Unfortunately, some of our devs were given the master/admin certificates.<br />
Would it be possible to regenerate the master certificates without creatin... | <p>This is a community wiki answer based on a solution from a similar question. Feel free to expand it.</p>
<p>As already mentioned in the comments, the answer to your question boils down to the below conclusions:</p>
<ul>
<li><p>Currently there is no easy way to <a href="https://kops.sigs.k8s.io/rotate-secrets/" rel="... |
<p>I have four nodes</p>
<p><code>kubectl get nodes</code></p>
<pre><code>NAME STATUS AGE
adm-1 Ready 42s
adm-2 Ready 42s
adm-3 Ready 42s
</code></pre>
<p>So I want to stop these nodes temporarily, then restart them again</p>
<p>Note-This is not a GKE cluster</p>
| <hr />
<p>A node can also be marked as unschedulable and drained manually. Without going into specifics, this is done with the following <code>kubectl</code> commands.</p>
<p><code>kubectl cordon <node></code> # marks the node as unschedulable (but doesn’t do anything with pods running on that node).</p>
<p><code... |
<p>We're trying run a PostgreSQL in a minikube (1.18.1) Kubernetes (1.16.15) cluster so that the database is reset on every pod redeployment.</p>
<p>In our deployment template, we have:</p>
<pre class="lang-yaml prettyprint-override"><code>containers:
- name: mock-db
image: postgres:13
imagePullPolicy: "IfNo... | <p>Here is what I missed:</p>
<ul>
<li>the init script failed and</li>
<li>the container immediately restarted.</li>
</ul>
<p>No problem with the volume, at all.</p>
|
<p>I am trying to install the same chart two times in the same cluster in two different namespaces. However I am getting this error:</p>
<pre><code>Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "nfs-provisioner" in namespace "" exists ... | <p>I decided to provide a Community Wiki answer that may help other people facing a similar issue.<br />
I assume you want to install the same chart multiple times but get the following error:</p>
<pre><code>Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole &... |
<p>I know this question asked before and I checked them but still fails.</p>
<p>Pod name : postgresl-7c8b9-qs67z</p>
<p>File in the pod : /home/backup/db</p>
<p>So I want to try to copy "db" file to my local and I tried to commands below, but all of them giving the same error.</p>
<pre><code> kubectl cp defau... | <p>Currently there seems to be a <a href="https://github.com/kubernetes/kubernetes/issues/77310#issuecomment-600571650" rel="noreferrer">bug</a> in kubectl where <code>C:</code> is treaten as the pod name.</p>
<p>Just use a relative path for your local file. E.g:</p>
<pre><code>kubectl cp default/postgresl-7c8b9-qs67z:... |
<p>I am trying to deploy a simple HTML file to Kubernetes and host it using Nginx as a test. I am running into issues when copying over my website files.</p>
<p><strong>Dockerfile</strong></p>
<pre><code>FROM nginx:alpine
COPY ./public /usr/share/nginx/html/
</code></pre>
<p>When I build this image and run it using <co... | <p>So it looks like this was a case of the image not being pulled. I changed the commit tag from master to a hash and the site started working.</p>
<p>changing a variable in my ci pipeline from</p>
<p><code>IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG</code></p>
<p>to</p>
<p><code>IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI... |
<p>I am working with IBM Kubernetes Service and need to create a directory in the PVC. There are 2 PVCs which are already created. Can I use the same to create a directory or shall I create a new one as those two are already bound?</p>
<p>Also, I tried creating new PV using a PV yaml file, but it is getting killed as s... | <p>A PVC is a linkage between a volume (usually on a Block or NFS device) and your Kubernetes pod. Typically, when you bind a PVC to the pod, you mount it on a specific path within a container in the pod.</p>
<p>So, if you bound a PVC and mounted it to your container at <code>/foo</code>, then you should be able to wri... |
<p>I use the following code which works and installs helm charts.
I got a list of charts and it installs each chart (via loop) and wait (<code>upgradeAction.Wait = true</code>, see below ) that the chart is up and running (using the <code>wait=true</code> flag of the helm) and then install the next one, the problem is ... | <p>You could start goroutines for each chart you're installing (wrapping chart install code inside go routines) and then use <code>sync.WaitGroup</code> to wait all goroutines to finish. Something like this:</p>
<pre class="lang-golang prettyprint-override"><code>package main
import (
"fmt"
"os&... |
<p>I am provisioning a workload cluster with one control plane node and one worker node on top of openstack via Cluster API. However the kubernetes control plane failed to start properly in the control plane node.</p>
<p>I can see the kube-apiserver keeps exiting and recreating:</p>
<pre><code>ubuntu@ubu1910-medflavor-... | <p>If you want to see details of your kube-api SSL cert you can use <code>curl -k -v https://172.24.4.159:6443</code> or <code>openssl s_client -connect 172.24.4.159:6443</code></p>
<p>You didn't mention how you're provisioning your certificates. SSL in kubernetes is complicated beast and setting up certificates and a... |
<p>I created a namespace and a pod in it like this:</p>
<pre class="lang-sh prettyprint-override"><code># Create the namespace
kubectl create namespace one
# Create the pod (NOTE - Without a service)
kubectl run rest -n one --image nginx --labels app=rest --expose --port 80
</code></pre>
<p>I then created a second nam... | <p>Turns out this is because I'm using Calico. With the default Flannel used in k3d, the above <em>does</em> work. However, in Calico it creates cluster-wide IP addresses for pods, not IPs within each namespace. So the following works:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl exec -it call-rest -n tw... |
<p><code>microk8s</code> has been installed on an ubuntu machine. What is the command line to find the currently installed channel?</p>
| <p>You could try the below, this displays all the versions/channels, at the bottom you can see the version, somewhere in between in the o/p, there is a <strong>tracking</strong> field as shown below which should indicate the channel snap is tracking (you installed).</p>
<pre><code>snap info microk8s
</code></pre>
<p>ou... |
<p>While creating a deployment using command</p>
<pre><code>kubectl create deploy nginx --image=nginx:1.7.8 --replicas=2 --port=80
</code></pre>
<p>I am getting error <code>Error: unknown flag: --replicas</code></p>
<pre><code>controlplane $ kubectl version
Client Version: version.Info{Major:"1", Minor:"... | <p>You may try to put a blank character between -- and the commands
For example</p>
<p>kubectl create deploy nginx --image=nginx:1.7.8 -- replicas=2</p>
<p>It's work for me.</p>
|
<p>I created a Azure file share and I am able to connect to it using map network drive in my laptop having windows 10. I created a hello-world spring boot application with volume mount configurations for azure file share and trying to deploy in Kubernetes in docker-desktop. But my pod doesn't starts -</p>
<pre><code>he... | <p>You likely need to install a package that knows how to mount that file system. For NFS this may be nfs-common with Debian/Ubuntu.</p>
<p><code>sudo apt update && sudo apt install nfs-common -y</code></p>
|
<p>There are several metrics collected for cron jobs, unfortunately I‘m not sure how to use them properly.</p>
<p>I wanted to use the <code>kube_job_status_failed == 1</code> metrics. I can use a regex for <code>job=~“+.myjobname.+“</code> to aggregate all failed attempts for a cron job.</p>
<p>This is where i got stuc... | <p>This should give you the number of failed jobs matching the job name in 1h period:</p>
<pre><code>count_over_time(kube_job_status_failed{job=~“+.myjobname+.“}==1 [1h])
</code></pre>
|
<p>I have a project where we are consuming data from kafka and publishing to mongo. In fact the code base does only one task, may be mongo to kafka migration, kafka to mongo migration or something else.</p>
<p>we have to consume from different kafka topics and publish to different mongo collections. Now these are paral... | <p>A templating tool like <a href="https://helm.sh" rel="nofollow noreferrer">Helm</a> will let you fill in the environment-variable values from deploy-time settings. In Helm this would look like:</p>
<pre><code>env:
- name: EVENTS_TOPIC
value: {{ .Values.eventsTopic }}
- name: GROUP_ID
value: {{ .Values.g... |
<p>I have a very simple setup.
My .yaml-Configuration file for Kubernetes:</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
name: stdout-test
spec:
template:
spec:
priorityClassName: research-high
containers:
- name: container-stdout-test
image: <here comes my secret imag... | <p>After quite a few tries, I figured out how to see the stdout output. In the Kubernetes configuration file, I had to replace line <code>command: ["python3", "/workspace/main.py"]</code> with <code>command: ["python3", "-u", "/workspace/main.py"]</code>, which configur... |
<p>At page 67 of <a href="https://www.oreilly.com/library/view/kubernetes-up-and/9781492046523/" rel="nofollow noreferrer">Kubernetes: Up and Running, 2nd Edition</a>, the author uses the command below in order to create a <code>Deployment</code>:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl run alpaca-p... | <p>It is now preferred to use <code>kubectl create</code> to create a new <code>Deployment</code>, instead of <code>kubectl run</code>.</p>
<p>This is the corresponsing command to your <code>kubectl run</code></p>
<pre><code>kubectl create deployment alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue --replicas=2
</... |
<p>I am getting the error "<strong>400 Bad Request Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.</strong>"</p>
<p>What I am trying to achieve is :</p>
<p>1.<strong>Do... | <p>Can you please try adding this annotation to your ingress file?</p>
<pre><code>annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/backend-pr... |
<p>I don't understand how to apply hashicorp vault to inject secrets in my app.</p>
<p>The following link shows a couple of examples <a href="https://www.vaultproject.io/docs/platform/k8s/injector/examples" rel="nofollow noreferrer">https://www.vaultproject.io/docs/platform/k8s/injector/examples</a></p>
<p>I used the <... | <p>If you want to inject the vault secret into the deployment pod what you can do</p>
<p>There is one great project on Github Vault-CRD in java: <a href="https://github.com/DaspawnW/vault-crd" rel="nofollow noreferrer">https://github.com/DaspawnW/vault-crd</a></p>
<p>Vault CRD for sharing Vault Secrets with Kubernetes.... |
<p>I am unable to identify what the exact issue with the permissions with my setup as shown below. I've looked into all the similar QAs but still unable to solve the issue. The aim is to deploy Prometheus and let it <strong>scrape</strong> <code>/metrics</code> endpoints that my other applications in the cluster expose... | <blockquote>
<p>User "system:serviceaccount:default:default" cannot list resource "endpoints" in API group "" at the cluster scope"</p>
</blockquote>
<blockquote>
<p>User "system:serviceaccount:default:default" cannot list resource "pods" in API group "" ... |
<p>I have setup <strong>kops cluster on aws</strong> and also helm is installed in the cluster.</p>
<p>I am trying to install <a href="https://github.com/elastic/helm-charts/tree/master/elasticsearch" rel="nofollow noreferrer">easltic/elasticsearch</a> using the chart. I need to modify the default volume size for that ... | <p>You don't have a StorageClass named <code>standard</code> in your cluster. Use one of the storageClass from your list:</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
def... |
<p>I am a beginner to Kubernetes. I have created a secret file and referred it in deployment yaml file.</p>
<p>app-secret.yaml</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
name: app-secret
data:
username: YWRtaW4=
password: YWRtaW4=
</code></pre>
<p>deploy.yaml</p>
<pre><code>env:
- name: DEPLOY... | <p>Secret get stored with the <strong>base64</strong> <strong>encoded</strong> format when you create the secret. hile adding or injecting the secret into the pod or deployment Kubernetes by default decode the secret with <strong>base64</strong> so due to that you are getting the plain text from <strong>OS</strong> as ... |
<p>I have a project where we are consuming data from kafka and publishing to mongo. In fact the code base does only one task, may be mongo to kafka migration, kafka to mongo migration or something else.</p>
<p>we have to consume from different kafka topics and publish to different mongo collections. Now these are paral... | <blockquote>
<p>Is it wise to use multiple containers in one pod. Easy to distinguish, but as they are tightly coupled , i am guessing high chance of failure and not actually proper microservice design.</p>
</blockquote>
<p>You most likely want to deploy them as separate services, so that you can update or re-configure... |
<p>I am defining canary routes in mesh-virtual-service and wondering whether I can make it applicable for ingress traffic (with ingress-virtual-service) as well. With something like below, but it does not work (all traffic from ingress is going to non-canary version)</p>
<pre><code>apiVersion: networking.istio.io/v1alp... | <p>Well the answer is only partially inside the link you included. I think the essential thing to realize when working with Istio 'what even is Istio Service Mesh'. Service mesh is every pod with Istio envoy-proxy sidecar + all the gateways (gateway is standalone envoy-proxy). They all know about each other because of ... |
<p>I am new to this platform and this is my second question. For one month, I have been trying to set up a Kubernetes cluster using AWS unsuccessfully. But every day, I get a new error, but this time, I could not solve this error.</p>
<p>I am using Kali Linux in Virtual Box with Windows as a host. I am following a tuto... | <blockquote>
<p>unsupported architecture for instance type "t2.micro": i386</p>
</blockquote>
<p>Some EC2 t2.micro instances are actually 32-bit machines. See <a href="https://stackoverflow.com/a/11565748/213269">How to find if my Amazon EC2 instance is 32 bit or 64 bit?</a>.</p>
<p>Your Kubernetes container ... |
<p>I have a daily k8s cron job,
I need to have unique id for every created job, which is same on job restart in case of job failure.
Example:</p>
<pre><code>2021-04-10, restarts:0, id = 1234 -> failed
2021-04-10, restarts:1, id = 1234 -> failed
2021-04-10, restarts:2, id = 1234 -> failed
2021-04-11, restarts:... | <p><strong>Is there a way I generate such a variable ?</strong></p>
<p>Yes, with usage of UID. Every object created over the whole lifetime of a Kubernetes cluster has a distinct <code>UID</code>. It is intended to distinguish between historical occurrences of similar entities.</p>
<p>This UID then can be expose as <a... |
<p>I'm running a private GKE cluster with Cloud NAT. Cloud NAT has multiple static ip addresses assigned. Is it possible for me to tell a pod to always use one of those ip addresses as source ip?</p>
| <p>Answering the question:</p>
<blockquote>
<p>Is it possible in GKE to assign a specific outbound IP Address to a Pod when using Cloud NAT with multiple static IP addresses?</p>
</blockquote>
<p><strong>In short, no.</strong> There is no option to modify the <code>Cloud NAT</code> (and <code>Cloud Router</code>) in a ... |
<p>I have enabled the VPA on cluster as read only mode and tried to collect the VPA recommendation data. But I could not find a good documentation or any API details specific to the Vertical Pod Autoscaling. I have found it for the Horizontal Pod Autoscaler but not for the VPA.</p>
| <p>As I mentioned in comments</p>
<p>From what I see in the <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">python client library</a>, there is neither documentation or API created for Vertical Pod Autoscaler at this moment.</p>
<p>There is only documentation and API created for <a href=... |
<p>In the <code>create_namespaced_job</code> method there is no parameter that exists to define <code>preStop</code> and <code>postStart</code> handlers.</p>
<pre><code>V1Job create_namespaced_job(namespace, body, pretty=pretty, dry_run=dry_run, field_manager=field_manager)
</code></pre>
<p><a href="https://github.com/... | <blockquote>
<p>In the create_namespaced_job method there is no parameter that exists to define preStop and postStart handlers.</p>
</blockquote>
<p>The <code>preStop</code> and <code>postStart</code> handlers exists on the containers. You linked to the documentation for <a href="https://github.com/kubernetes-client/py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.