Question stringlengths 65 39.6k | QuestionAuthor stringlengths 3 30 ⌀ | Answer stringlengths 38 29.1k | AnswerAuthor stringlengths 3 30 ⌀ |
|---|---|---|---|
<p>I have been trying to deploy Kafka with schema registry locally using Kubernetes. However, the logs of the schema registry pod show this error message:</p>
<pre><code>ERROR Server died unexpectedly: (io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain:51)
org.apache.kafka.common.errors.TimeoutException: Time... | Cassie | <pre><code>org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata
</code></pre>
<p>can happen when trying to connect to a broker expecting SSL connections and the client config did not specify;</p>
<pre><code>security.protocol=SSL
</code></pre>
| Anders Eriksson |
<p>I am struggling to programmatically access a kubernetes cluster running on Google Cloud. I have set up a service account and pointed <code>GOOGLE_APPLICATION_CREDENTIALS</code> to a corresponding credentials file. I managed to get the cluster and credentials as follows:</p>
<pre class="lang-py prettyprint-override"... | Lucas | <p>As per the error:</p>
<blockquote>
<p>pods is forbidden: User "12341234123451234567" cannot list resource
"pods" in API group "" at the cluster scope: Required
"container.pods.list" permission.</p>
</blockquote>
<p>it seems evident the user credentials you are trying to use, does not have permission on listi... | Nagaraj Tantri |
<p>I have a flask api and I am trying to improve it identifying which function calls in the api definition takes the longest time whenever call it. For that I am using a profiler as highlighted in this <a href="https://dev.to/yellalena/profiling-flask-application-to-improve-performance-4970" rel="nofollow noreferrer">r... | monte | <p>If you want to automate this process or it's simply hard to figure out connectivity for running <code>kubectl exec ...</code>, one idea would be to use <a href="https://kubernetes.io/docs/concepts/workloads/pods/#how-pods-manage-multiple-containers" rel="nofollow noreferrer">a sidecar container</a>. So your pod cont... | Oleg |
<p>I've been having a hell of a time trying to figure-out how to serve multiple models using a yaml configuration file for K8s.</p>
<p>I can run directly in Bash using the following, but having trouble converting it to yaml.</p>
<pre><code>docker run -p 8500:8500 -p 8501:8501 \
[container id] \
--model_config_f... | Roland Wang | <p>What you are passing on seems to be the arguments and not the command. Command should be set as the entrypoint in the container and arguments should be passed in args. Please see following link.
<a href="https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/" rel="nofollow norefe... | gordanvij |
<p>Am I wondering if there is a way to read and write to Kubernetes parameter store from a nodejs app?</p>
<p>I would like to persist/invalidate/refresh an access token and share it across multiple instances during runtime. Can't find any good docs on how to do it exactly.</p>
| Jacobdo | <p>Amazon provides the <a href="https://aws.amazon.com/sdk-for-node-js/" rel="nofollow noreferrer">AWS SDK for node.js</a>, which also includes a class for <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SecretsManager.html" rel="nofollow noreferrer">SecretsManager</a>.</p>
| Simon |
<p>Kubernetes version: 1.13.4 (same problem on 1.13.2).</p>
<p>I self-host the cluster on digitalocean.</p>
<p>OS: coreos 2023.4.0</p>
<p>I have 2 volumes on one node:</p>
<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBind... | ik9999 | <p>Seems like this is safe to ignore message that was recently removed (Feb 20) and will not occur in future releases: <a href="https://github.com/kubernetes/kubernetes/pull/73901" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/pull/73901</a></p>
| itaysk |
<p>I have 2 pods created. one is grafana and another is influx pod. I need to configure influx in grafana. I did see the below example. I got bit confused by the way its configured. Below is deployment and service file.</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: influxdb
labels:... | Hacker | <p>I can explain what's happening and why this works, but I still think this configuration doesn't make sense.</p>
<p>The Deployment creates a Pod that runs InfluxDB which listens by default on port 8086. The <code>containerPort</code> here is purely informational, see the following from the <a href="https://kubernete... | itaysk |
<p>I'm using dns names for my backend servers in my hsproxy.cfg like</p>
<pre><code>backend s0
server server0 server0.x.y.local:8080
backend s1
server server1 server1.x.y.local:8080
</code></pre>
<p>The name resolution works fine after startup. But as soon as the ipadress of a backendserver changes, requests... | Jens | <p>Seems to be correct that HAProxy does cache the resolved IP unless you tell it otherwise.</p>
<p>As you already found the configuration using a resolver and a custom check interval should do the trick (<code>resolvers dns check inter 1000</code> and <code>hold valid</code>), but you are also right that this require... | Simon |
<p>I am using Docker for Mac but currently only using it for its Kubernetes cluster. The Kubernetes cluster's single node is named <strong>docker-for-desktop</strong>.</p>
<p>I'm currently going through a Kubernetes tutorial on Persistent Volumes (<a href="https://kubernetes.io/docs/tasks/configure-pod-container/confi... | Stephen | <p>Comment in the OP should get credit for this but i'll add again so i find it easier in a few months:</p>
<pre><code>docker run -it --rm --privileged --pid=host justincormack/nsenter1
</code></pre>
<p>From <a href="https://github.com/justincormack/nsenter1/blob/master/README.md" rel="noreferrer">https://github.com/... | Luke W |
<p>We have a deployment of Kubernetes in Google Cloud Platform. Recently we hit one of the well known issues related on a problem with the kube-dns that happens at high amount of requests <a href="https://github.com/kubernetes/kubernetes/issues/56903" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/i... | Veselin Iordanov | <p>As of 2019/12/10, GKE now supports through the <code>gcloud</code> CLI in beta:</p>
<blockquote>
<h1>Kubernetes Engine</h1>
<ul>
<li>Promoted NodeLocalDNS Addon to beta. Use <code>--addons=NodeLocalDNS</code> with <code>gcloud beta container clusters create</code>. This addon can be enabled or disabled on ... | Patrick Decat |
<p>Am using AKS for my cluster</p>
<p><strong>Scenario</strong>:
We have multiple API's (say svc1, svc2 & svc3 accessible on port 101, 102, 103).
These API links need to be exposed to client and are also used internally in application.</p>
<p><strong>Question</strong>:
I want to expose this to both external & i... | Sunil Agarwal | <p>Well, I was able to fix the issue without using NodePort/ClusterIP.</p>
<p>Solution is pretty simple but seems its not documented.</p>
<p>Only thing we have to do is have multiple tags where 1 tag is same as of external load balancer and other tag you have same matching service.</p>
<p>This will map your replicaset ... | Sunil Agarwal |
<p>I am trying to utilize Rancher Terraform provider to create a new RKE cluster and then use the Kubernetes and Helm Terraform providers to create/deploy resources to the created cluster. I'm using this <a href="https://registry.terraform.io/providers/rancher/rancher2/latest/docs/resources/cluster_v2#kube_config" rel=... | Suhas Potluri | <p>Generally speaking, Terraform always needs to evaluate provider configurations during the planning step because providers are allowed to rely on those settings in order to create the plan, and so it typically isn't possible to have a provider configuration refer to something created only during the apply step.</p>
<... | Martin Atkins |
<p>Is there a Kubectl command or config map in the cluster that can help me find what CNI is being used?</p>
| YoMar | <p>First of all checking presence of exactly one config file in <code>/etc/cni/net.d</code> is a good start:</p>
<pre><code>$ ls /etc/cni/net.d
10-flannel.conflist
</code></pre>
<p>and <code>ip a s</code> or <code>ifconfig</code> helpful for checking existence of network interfaces. e.g. <code>flannel</code> CNI should... | Tombart |
<p>I am setting up GPU monitoring on a cluster using a <code>DaemonSet</code> and NVIDIA DCGM. Obviously it only makes sense to monitor nodes that have a GPU.</p>
<p>I'm trying to use <code>nodeSelector</code> for this purpose, but <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselecto... | MasterScrat | <p><a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity" rel="nofollow noreferrer">Node Affinity</a> was the solution:</p>
<pre><code>spec:
template:
metadata:
labels:
app: dcgm-exporter
annotations:
prometheus.io/scrape: 'true'
... | MasterScrat |
<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... | krisnik | <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... | Martin Atkins |
<p>I have a simple <code>cloudbuild.yaml</code> file which runs a Bazel command. This command returns a Kubernetes configuration in form as a log output.</p>
<p>My goal is to take the output of the first step and apply it to my Kubernetes cluster.</p>
<pre><code>steps:
- name: gcr.io/cloud-builders/bazel
args: ... | Florian Ludewig | <p>Here's how to mount the volume:</p>
<p><a href="https://cloud.google.com/cloud-build/docs/build-config#volumes" rel="nofollow noreferrer">https://cloud.google.com/cloud-build/docs/build-config#volumes</a></p>
<p>Basically add:</p>
<pre><code> volumes:
- name: 'vol1'
path: '/persistent_volume'
</code></pre>... | Lance Sandino |
<p>I am running Rancher Desktop on my ubuntu laptop.
I have a container running mongodb in a kubernetes container:</p>
<pre><code>$ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/mongo-deployment-7fb46bd85-vz9th 1/1 Running ... | Andrei Diaconescu | <p>i found a solution: it seems that the ip returned by
<code>kubectl get node -o wide</code>
is not usable to acess services from the kubernetes node, in Rancher Desktop (it is working in other kubernetes cluster named "kind" (<a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">https://kind.sigs.k8... | Andrei Diaconescu |
<p>I already created my secret as recommend by Kubernetes and followed the tutorial, but the pod isnt with my secret attached.</p>
<p>As you can see, i created the secret and described it.
After i created my pod.</p>
<pre><code>$ kubectl get secret my-secret --output="jsonpath={.data.\.dockerconfigjson}" | base64 --... | KpsLok | <p>You did not get as far as secrets yet. Your logs say</p>
<blockquote>
<p>Failed to pull image "my-private-repo.com/my-image:latest": rpc error: code = Unknown desc = Error response from daemon: Get <a href="https://my-private-repo.com/v1/_ping" rel="nofollow noreferrer">https://my-private-repo.com/v1/_ping</a>: d... | Andrew Savinykh |
<p>NodePort
This way of accessing Dashboard is only recommended for development environments in a single node setup.</p>
<p>Edit kubernetes-dashboard service.</p>
<p>$ kubectl -n kube-system edit service kubernetes-dashboard
You should see yaml representation of the service. Change type: ClusterIP to type: NodePort a... | Anton Patsev | <p>you can change it like this</p>
<pre><code>kubectl patch svc kubernetes-dashboard --type='json' -p '[{"op":"replace","path":"/spec/type","value":"NodePort"}]'
</code></pre>
| sfgroups |
<p>I have installed the minikube, deployed the hello-minikube application and opened the port. Basically I have followed the getting started tutorial at <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#quickstart" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/learning-environment/mi... | Karel Frajták | <p>Found the solution in another <a href="https://stackoverflow.com/questions/40767164/expose-port-in-minikube">thread</a> - port forwarding</p>
<pre><code>kubectl port-forward svc/hello-minikube 31191:8080
</code></pre>
<p>The first port is port that you will use on your machine (in the browser) and 8080 is the port... | Karel Frajták |
<p>We're serving our product on AWS EKS where the service is created of type <code>LoadBalancer</code>. The ELB IP is assigned by AWS and this is what is being shared to the client.</p>
<p>However, when we re-deploy the service when we're making some changes/improvements, the ELB IP changes. Since this is causing us to... | cai | <p>You can use elastic ip as is described here <a href="https://stackoverflow.com/questions/66902641/how-to-provide-elastic-ip-to-aws-eks-for-external-service-with-type-loadbalancer">How to provide elastic ip to aws eks for external service with type loadbalancer?</a>, and here <a href="https://docs.aws.amazon.com/es_e... | TlmaK0 |
<p>I'm creating a Kubernetes Service Account using terraform and trying to output the token from the Kubernetes Secret that it creates.</p>
<pre><code>resource "kubernetes_service_account" "ci" {
metadata {
name = "ci"
}
}
data "kubernetes_secret" "ci" {
metadata {
name = "${kubernetes_service_account.c... | Ellis Percival | <p>This works:</p>
<pre><code>resource "kubernetes_service_account" "ci" {
metadata {
name = "ci"
}
}
data "kubernetes_secret" "ci" {
metadata {
name = kubernetes_service_account.ci.default_secret_name
}
}
output "ci_token" {
sensitive = tr... | Patrick Decat |
<p>I would like to resolve the kube-dns names from outside of the Kubernetes cluster by adding a stub zone to my DNS servers. This requires changing the cluster.local domain to something that fits into my DNS namespace.</p>
<p>The cluster DNS is working fine with cluster.local. To change the domain I have modified the ... | Marcus | <p>I had a similar problem where I have been porting a microservices based application to Kubernetes. Changing the internal DNS zone to cluster.local was going to be a fairly complex task that we didn't really want to deal with.</p>
<p>In our case, we <a href="https://coredns.io/2018/01/29/deploying-kubernetes-with-co... | simon |
<p>I have a google kubernetes engine cluster with multiple namespaces. Different applications are deployed on each of these namespaces. Is it possible to give a user complete access to a single namespace only?</p>
| Keerthi hegde | <p>Yes, Kubernetes has a built-in RBAC system that integrates with Cloud IAM so that you can control access to individual clusters and namespaces for GCP users.</p>
<ol>
<li>Create a Kubernetes <code>Role</code></li>
</ol>
<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: YOUR_NAME... | Travis Webb |
<p>I installed <code>minikube</code> and started <code>Jenkins</code> inside a <code>pod</code>. I am able to create a new job and execute it inside a dynamically created <code>maven container</code>. However. I have a folder in my <code>host</code> machine which is a <code>Mac</code> based and I need that folder insid... | Damien-Amen | <p>Option 1.</p>
<p><a href="https://kubernetes.io/docs/setup/minikube/#interacting-with-your-cluster" rel="nofollow noreferrer">https://kubernetes.io/docs/setup/minikube/#interacting-with-your-cluster</a></p>
<p>configure kubectl on your MAC, then use <code>kubectl cp <hostdir> <podname>:<dir></cod... | sfgroups |
<p>I'm deploying some microservices in gcp kubernentes. I don't know if I need to pay to download images from docker hub by network stuff.</p>
<ol>
<li>How it could affect my billing if I use docker hub instead of google image registry?</li>
<li>Could I save money if I use image registry on gcp instead of docker hub?<... | Alejandro Molina | <p>Container Registry uses <a href="https://cloud.google.com/container-registry/pricing#storage" rel="nofollow noreferrer">Cloud Storage under the hood</a> to store your images, which <a href="https://cloud.google.com/storage/pricing#storage-pricing" rel="nofollow noreferrer">publishes its pricing info in this table</a... | Travis Webb |
<p>I see that kubernets uses pod and then in each pod there can be multiple containers.</p>
<p>Example I create a pod with</p>
<pre><code>Container 1: Django server - running at port 8000
Container 2: Reactjs server - running at port 3000
</code></pre>
<p>Whereas</p>
<p>I am coming for docker background</p>
<p>So in do... | Santhosh | <p>No, a Pod is not like a PC/VM with Ubuntu on it.</p>
<p>There is no intermediate layer between your host and the containers in a pod. The only thing happening here is that the containers in a pod share some resources/namespaces in the host's kernel, and there are mechanisms in your host kernel to "protect"... | Chris Trahey |
<p>I want to export <em>already templated</em> Helm Charts as YAML files. I can not use Tiller on my Kubernetes Cluster at the moment, but still want to make use of Helm Charts. Basically, I want Helm to export the YAML that gets send to the Kubernetes API with values that have been templated by Helm. After that, I wil... | j9dy | <p>We need logs to check the <code>Unauthorized</code> issue.</p>
<p>But you can easily generate templates locally:</p>
<pre><code>helm template mychart
</code></pre>
<blockquote>
<p>Render chart templates locally and display the output.</p>
<p>This does not require Tiller. However, any values that would normally
be lo... | Amrit |
<p>I have helm 3 template created using <code>helm create microservice</code> command. it has below files.</p>
<pre><code>/Chart.yaml
./values.yaml
./.helmignore
./templates/ingress.yaml
./templates/deployment.yaml
./templates/service.yaml
./templates/serviceaccount.yaml
./templates/hpa.yaml
./templates/NOTES.txt
./tem... | sfgroups | <p>I copied the <code>ingress.yaml</code> file to, chart created older version helm. this value was missing in <code>_helpers.tpl</code> file. Now I copied new version of hellpers.tpl file. deployment works now.</p>
| sfgroups |
<p>I'm frequently installing multiple instances of an umbrella Helm chart across multiple namespaces for testing. I'd like to continue using the randomly generated names, but also be able to tear down multiple releases of the same chart in one command that doesn't need to change for each new release name.</p>
<p>So f... | Taylor D. Edmiston | <p>I wanted to see if I could achieve the same result using <a href="https://stedolan.github.io/jq/" rel="nofollow noreferrer">jq</a> instead of awk.</p>
<p>I'm not an expert on jq so there might simpler methods. <strong>Test with a dry run!</strong></p>
<p>Assuming Bash:</p>
<pre><code>CHARTID=foo-platform-0.2.1
he... | Mark McLaren |
<p>I want to change config of log on Golang application which run on K8S,
I’ve tried the following code locally and it works as expected
I'm using viper to watch for config file changes</p>
<p>This is the config map with the log configuration </p>
<pre><code>apiVersion: v1
kind: ConfigMap
data:
config.yaml: 'log.le... | Jenny M | <p>envFrom creates environment variables from the config map. There is no file that changes. If you exec into the container you'll probably see an environment variable named config.yaml or CONFIG.YAML or similar (don' t know if it works with dots).</p>
<p>You are probably better of if you mount config.yaml as a file i... | Andreas Wederbrand |
<p>I am trying to configure Kubernetes on docker-for-desktops and I want to change the default network assigned to containers. </p>
<blockquote>
<p>Example: the default network is <code>10.1.0.0/16</code> but I want <code>172.16.0.0/16</code>. </p>
</blockquote>
<p>I changed the docker network section to <code>Subn... | Justin | <p>Kubernetes also has a subnet that it uses and a corresponding network setting, which defaults to <code>10.1.0.0/16</code>, but this setting is not exposed in the Docker for-win UI. In <a href="https://github.com/docker/for-win/issues/1667#issuecomment-367357067" rel="nofollow noreferrer">docker/for-win issue #1667: ... | Peter V. Mørch |
<p>I'm just trying to create a simple service account. Theoretically, kubectl automatically creates the secret and token for service accounts... But, not in my case... I've done this in <code>kube-system</code>, <code>default</code>, and new/other namespaces.</p>
<pre><code>me@mymachine ~ % kubectl create serviceaccoun... | icetnet | <p><strong>Disclaimer</strong>: This answer will not "fix" the automatic creation of secrets for service accounts, but shows how you can associate a secret to a service account.</p>
<p>For the newer Docker Desktop 4.8.1 (for Mac), you can create the secret manually:</p>
<pre><code>kubectl apply -f - <<E... | camikiller |
<p>We use spring-boot(2.5.6) in kubernetes</p>
<p>Many of the dependencies we use include healthchecks for instance RedisHealthIndicator,CouchbaseHealthIndicator etc</p>
<p>When one of these health checks fails and the overall application health fails, the pod is restarted by kubernetes.</p>
<p>However there is no indi... | wesleyjconnor | <p>I've fought with this awhile myself. I'm not sure why they've taken that stance on logging health failures, but what is worse is the current implementation is incredibly unfriendly to try and inject that kind of functionality into.</p>
<p>In the end, the work around I settled on involved wrapping the health contribu... | mrusinak |
<p>I have a dynamic <code>PersistentVolume</code> provisioned using <code>PersistentVolumeClaim</code>.</p>
<p>I would like to keep the PV after the pod is done. So I would like to have what <code>persistentVolumeReclaimPolicy: Retain</code> does.</p>
<p>However, that is applicable to <code>PersistentVolume</code>, not... | Ondra Žižka | <p>This is not the answer to the OP, but the answer to the personal itch that led me here is that I don't need <code>reclaimPolicy: Retain</code> at all. I need a <a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/" rel="noreferrer"><code>StatefulSet</code></a> instead. Read on if thi... | Peter V. Mørch |
<p>Being new to Kubernetes, I am trying to make a simple .NET Core 3 MVC app run on Kubernetes and reply on port 443 as well as port 80. I have a working Docker-Compose setup which I am trying to port to Kubernetes.</p>
<p>Running Docker Desktop CE with nginx-ingress on Win 10 Pro.</p>
<p>So far it is working on port... | TheRoadrunner | <p>The solution turned out to be the addition of a second kind of certificate.</p>
<p>Instead of using the secrets file above (where I pasted the contents of my certificates files), I issued kubectl to use my certificate files directly:</p>
<pre><code>kubectl create secret tls mvcsecret-tls --key MyCert.key --cert My... | TheRoadrunner |
<p>I am having a lot of issues configuring My Dockerized Django + PostgreSQL DB application to work on Kubernetes Cluster, which I have created using Google Cloud Platform.</p>
<p>How do I specify DATABASES.default.HOST from my settings.py file when I deploy image of PostgreSQL from Docker Hub and an image of my Djang... | Stefan Radonjic | <p>You will have to create a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">service</a> (cluster ip) for your postgres pod to make it "accessible". When you create a service, you can <a href="https://kubernetes.io/docs/concepts/services-networking/service/#dns" rel=... | Amrit |
<p>I am trying to deploy an Apache Ignite cluster in Kubernetes. The documentation suggests using TcpDiscoveryKubernetesIpFinder to facilitate the Ignite node discovery in a Kubernetes environment. However, I could not find this class in Apache Ignite for .Net. Is it migrated to .Net at all? If not, how can I use in my... | Alex Avrutin | <p>You can combine Java-based (Spring XML) configuration with .NET configuration.</p>
<ol>
<li><p>Configure <code>TcpDiscoveryKubernetesIpFinder</code> in Spring XML file (see <a href="https://apacheignite.readme.io/docs/kubernetes-ip-finder" rel="nofollow noreferrer">https://apacheignite.readme.io/docs/kubernetes-ip-... | Pavel Tupitsyn |
<p>Anyone know difference between those two?
For now only difference I see is that regional require >= 3 zones.</p>
| Andriy Kopachevskyy | <p>Found good explanation <a href="https://www.terraform.io/docs/providers/google/r/container_cluster.html#additional_zones" rel="noreferrer">here</a></p>
<blockquote>
<p>A "multi-zonal" cluster is a zonal cluster with at least one
additional zone defined; in a multi-zonal cluster, the cluster master
is only pre... | Andriy Kopachevskyy |
<p>I have a pre-upgrade hook in my Helm chart that looks like this:</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
name: "{{.Release.Name}}-preupgrade"
labels:
heritage: {{.Release.Service | quote }}
release: {{.Release.Name | quote }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
annotations:... | James Isaac | <blockquote>
<p>my docker container, called "lcm_hooks"</p>
</blockquote>
<p>Your hook has one container which is not called <code>lcm_hooks</code>, you called it <code>pre-upgrade-job</code>. I'm mentioning this because perhaps you forgot to include a piece of code, or misunderstood how it works.</p>
<blockquote>
... | itaysk |
<p>We have microservice with identity server 4. When user login to the app, and we restart pod with this microservice, then somehow token is still valid (user can browse app) but when he click logout then there is call to endsession which removes the token and redirection to logout page (but since there is no token we ... | kosnkov | <p>Since you're not properly persisting your persisted grants, signing credentials and data protection keys then you will get all sorts of odd behavior when you scale across multiple processes or restart an instance. You must address these considerations before deploying into this sort of environment.</p>
<p>I suspect... | mackie |
<p>I have an API written in Go that has been Dockerised and runs in a Kubernetes cluster on GKE.</p>
<p>At the moment my API server does not handle any shutdown scenarios such as a Pod dying or being purposefully brought down.</p>
<p>What set of UNIX signals should I expect to trap to gracefully shutdown the server a... | Andy Fusniak | <p>Kubernetes sends a <code>SIGTERM</code> signal. So the graceful shutdown may look like this:</p>
<pre><code>package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"syscall"
)
func main() {
var srv http.Server
idleConnsClosed := make(chan struct{})
go func() {
... | Alex Pliutau |
<p>I have defined a couple of case classes for JSON representation but I am not sure whether I did it properly as there a lot of nested case classes.
Entities like spec, meta and so on are of type JSONObject as well as the Custom object itself.</p>
<p>Here is all the classes I have defined:</p>
<pre><code> case clas... | Cassie | <p>The reason you can't derive a decode for <code>CustomObject</code> is because of the <code>labels: Object</code> member. </p>
<p>In circe all decoding is driven by static types, and circe does not provide encoders or decoders for types like <code>Object</code> or <code>Any</code>, which have no useful static inform... | Travis Brown |
<p>I know that the rule in KUBE-MARK-MASQ chain is a mark rule:</p>
<pre><code>iptables -t nat -nvL KUBE-MARK-MASQ
Chain KUBE-MARK-MASQ (123 references)
pkts bytes target prot opt in out source destination
16 960 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 ... | Jesse Stutler | <p>To see all rules <code>iptables-save</code> output is useful.</p>
<p><code>iptables</code> processing chart might help understand this:
<a href="https://i.stack.imgur.com/l8RkC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l8RkC.png" alt="iptables" /></a></p>
<p>(<a href="https://upload.wikimedi... | Tombart |
<p>Hello I have a problem in kubernetes. When I do a nslookup from a pod I get correct ip:</p>
<pre><code>~ kubectl -n exampleNamespace exec -it pod/curl -- nslookup exampleService.exampleNamespace
Defaulting container name to curl.
Use 'kubectl describe pod/curl -n exampleNamespace' to see all of the containers in thi... | D. O. | <p>It seams that there are some problems with <code>Alpine</code> and <code>Kubernetes</code> dns resolution as reported at some sites:</p>
<ul>
<li><a href="https://www.openwall.com/lists/musl/2018/03/30/9" rel="nofollow noreferrer">https://www.openwall.com/lists/musl/2018/03/30/9</a></li>
<li><a href="https://stackov... | TlmaK0 |
<p>I'm running microk8s (installed via <code>snap install microk8s --classic</code>) across a local multinode cluster and <a href="https://snapcraft.io/spark-client" rel="nofollow noreferrer">spark-client</a> (installed via <code>snap install spark-client --edge</code>). Two of the nodes are WSL2 (Ubuntu) on Windows 11... | mentics | <p>Good news and bad news...</p>
<p>I deleted the images on all the nodes:</p>
<p><code>microk8s.ctr images delete ghcr.io/canonical/charmed-spark:3.4.0-22.04_edge</code></p>
<p>to force it to pull the latest.</p>
<p>Now all the nodes behave the same. They all fail. I'll assume that some bug was introduced last week. T... | mentics |
<p>I have an OpenShift, cluster, and periodically when accessing logs, I get:</p>
<pre><code>worker1-sass-on-prem-origin-3-10 on 10.1.176.130:53: no such host" kube doing a connection to 53 on a node.
</code></pre>
<p>I also tend to see <code>tcp: lookup postgres.myapp.svc.cluster.local on 10.1.176.136:53: no such ho... | jayunit100 | <h1>Yes, DNS on every node is normal in openshift.</h1>
<p>It does appear that its normal for an openshift ansible deployment to deploy <code>dnsmasq</code> services on every node. </p>
<h2>Details.</h2>
<p>As an example of how this can effect things, the following <a href="https://github.com/openshift/openshift-ans... | jayunit100 |
<p>I have a local minikube installation. I want to change the authentication mechanism for the api-server and restart and test it out. All the documentation I have read lacks this information.</p>
| Vaibhav Ranglani | <p>Yes you can. The kubernetes API Server, Controller manager, and scheduler are all run as static manifests in minikube.</p>
<p>So, in fact, in your example: Any change to the manifest will <em>automatically</em> lead to them being restarted instantly.</p>
<p>In order to make the modification, just use <code>vi</co... | jayunit100 |
<p>I have the following Google Cloud Build pipeline:</p>
<pre><code># gcloud builds submit --config cloud-build/cloudbuild.yaml --substitutions=_GIT_USER="<your user>",_GIT_PASS="<your password here>,_GIT_TAG="<tag name>"
steps:
# Git
- name: 'gcr.io/cloud-builders/git'
args: ['clone', 'https://${_... | Evgeni Dimitrov | <p>Is there a reason you’re reapplying they deployment? Or are you doing that just one time? you could just use the built in command to replace / update the image instead of reapplying the config (if that’s what you’re doing)</p>
<p><code>kubectl set image deployment/my-deployment mycontainer=myimage</code></p>
<p>Or... | Lance Sandino |
<p>thanks for checking out my topic.</p>
<p>I'm currently working to have kustomize to download the resource and base files from our git repository.
We have tried a few options some of them following the documentation and some of them not, see below. But anyhow still not able to download from our remote repo and while ... | Gabriele Hausmann | <p>Use <code>bases</code> instead of <code>resources</code>:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/ecr/?ref=release-1.0
resources:
- rbac.yaml
- manifest.yaml
</code></pre>
<p>add th... | TlmaK0 |
<p>I'm now trying to run a simple container with shell (/bin/bash) on a Kubernetes cluster.</p>
<p>I thought that there was a way to keep a container running on a Docker container by using <code>pseudo-tty</code> and detach option (<code>-td</code> option on <code>docker run</code> command).</p>
<p>For example,</p>
... | springwell | <p>Containers are meant to run to completion. You need to provide your container with a task that will never finish. Something like this should work:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
name: ubuntu
spec:
containers:
- name: ubuntu
image: ubuntu:latest
... | Joel B |
<p>I am running docker for Mac in latest Mojave. Tried to enable Kubernetes from the preferences. Since then the message is just 'kubernetes is starting'. But it never completes. I am confused as to what has to be done.
Is there anything that I need to change in the network config part? </p>
<p>Just before this, I tri... | Sony Joseph | <p>For me was very useful:</p>
<ol>
<li>stop docker for desktop</li>
<li>remove the folder <code>~/Library/Group\ Containers/group.com.docker/pki</code></li>
</ol>
<pre><code> rm -rf ~/Library/Group\ Containers/group.com.docker/pki
</code></pre>
<ol start="3">
<li>start docker for destkop</li>
</ol>
<p>Found <a href=... | freedev |
<p>I have a Kubernetes pod using a readiness probe, and tied with the service this ensures that I don't receive traffic until I'm ready.</p>
<p>I'm using Spring Actuator as the health endpoint for this readiness probe.</p>
<p>But i'd like to trigger some actions whenever the pod is deemed ready by the kubelet. </p>
... | Asgeir S. Nilsen | <p>Perhaps <strong><em>implement your own HealthCheck</em></strong>. When you find that everything is ok for the first time, run your code.</p>
<p>I use a static variable firstHealthCheckOK is checked. Your logic should run only once.</p>
<p>I am assuming you are running Spring-boot 2.x and are calling a readiness pr... | rjdkolb |
<p>I have deployed Kafka using Helm and Minikube. I need to build a producer in Scala for that broker IP-address and host are required. I have defined NodePort service to expose Kafka to the outside world. I set up broker as minkube-ip:service-node-port, however, I get connection exception.
What is wrong with the confi... | Cassie | <p>The error is from the deserialiser trying to connect to the Schema Registry</p>
<p><code>props.put("schema.registry.url", "http://0.0.0.0:8081")</code></p>
<p>should read</p>
<p><code>props.put("schema.registry.url", "http://<hostname of Schema Registry resolvable from Connect node>:8081")</code></p>
| Robin Moffatt |
<p>I would like to scale (up and down) deployment from PODs. In other words, how PODs in the namespace will send a Kubernetes API call in order to scale the deployment?</p>
<p>I have created a role and assign it to a service account with the following privileges in order to send API calls:</p>
<pre><code>apiVersion: ... | user10573594 | <p>Using Kubernetes v1.16.13 on GKE.</p>
<p>I found that
If you give <code>patch</code> permission for <code>deployments/scale</code> resource, you can do <code>PATCH /apis/apps/v1/namespaces/default/deployments/{name}/scale</code>.</p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {n... | hiroshi |
<p>I'm running a pod in kubernetes, with hugepages allocated in host and hugepages defined in the pod. The kubernetes worker is in a VM. The VM (host) has huge pages allocated. The pod fails to allocate hugepages though. Application gets SIGBUS when trying to write to the first hugepage allocation.</p>
<p>The pod defin... | emartin | <p>This is <a href="https://github.com/kubernetes/kubernetes/issues/71233" rel="nofollow noreferrer">a known problem</a> in K8s.</p>
<p>The culprit is that kubelet doesn't update /sys/fs/cgroup/hugetlb/kubepods/hugetlb.2MB.limit_in_bytes upon Node Status Update which happens every 5 minutes by default. Yet it updates t... | versale |
<p>We have two Kubernetes clusters and has deployed internal NGINX ingress controllers. So they are not publicly accessible. The NGINX ingress controller has private IP assigned to it. I will be implementing Azure Front Door and I'd like to know if we can add the private IP address of the NGINX ingress controller as th... | Container-Man | <p>Azure Front Door premium supports securing origins with <a href="https://learn.microsoft.com/en-us/azure/frontdoor/private-link" rel="nofollow noreferrer">private link</a>. I'm not certain if you can directly use a private link with your internal NGINX ingress controllers, but if you can't you can always set up an ... | Narthring |
<p>When trying to run a pod that uses docker image from a private docker registry. I am getting the following error:</p>
<pre><code>Warning Failed 24s (x2 over 40s) kubelet, minikube Failed to pull image "registry.hub.docker.com/repository/docker/projecthelloworld/helloworld-container:V1": rpc error: c... | tintin | <p>Found the issue, the deployment file's image property had a dns name <code>hub.docker.com</code> along with the uri path <code>/repository/docker/</code></p>
<pre><code>image: registry.hub.docker.com/repository/docker/projecthelloworld/helloworld-container:V1
</code></pre>
<p>Removing it got it working, it shou... | tintin |
<p>I have a preemptible node pool of size 1 on GKE. I've been running this node pool with size 1 for almost a month now. Every day the node restarts after 24 hours and rejoins the cluster. Today it restarted but did not rejoin the cluster.</p>
<p>Instead, I noticed that according to <code>gcloud compute instances list... | Dmitry Minkovsky | <p>We were experiencing a similar problem on GKE with preemptible nodes, seeing error messaging like these from the nodes:</p>
<pre><code>Extend the docker.service configuration to set a higher pids limit
Docker command line is updated. Restart docker to pick it up
level=info msg="Processing signal 'terminated'&qu... | GrandVizier |
<p>I'm think I'm about to reinvent the wheel here. I have all the parts but am thinking: Somebody must have done this (properly) before me.</p>
<p>We have a a jenkins CI job that builds <code>image-name:${BRANCH_NAME}</code> and pushes it to a registry. We want to create a CD job that deploys this <code>image-name:${BR... | Peter V. Mørch | <p><code>kbld</code> can also be used "fully" with helm...</p>
<p>Yes, the <a href="https://carvel.dev/kbld/" rel="nofollow noreferrer">docs</a> suggest:</p>
<pre><code>$ helm template my-chart --values my-vals.yml | kbld -f - | kubectl apply -f -
</code></pre>
<p>But this also works:</p>
<pre><code>$ cat kbl... | Peter V. Mørch |
<p>We're trying to set up a spot node group in EKS with lower and higher capacity instance types, (e.g. <code>instance_types = ["t3.xlarge", "c5.4xlarge"]</code>), but ... only the t3 is used, even if we specify more CPU than it has to offer. Pods still try to use it and just hang.</p>
<p>How do we ... | hellified | <p>An AWS AutoScalingGroup has the ability to put weights on the instance types, but that functionality isn't built into EKS. So what's happening is that the ASG is designed to create the first instance type if possible, and doesn't get impacted by your K8s workload requests, and therefor will always be the first type ... | GrandVizier |
<p>I am running a Kubernetes CronJon with a HTTPS GET using curl command. Token has to be retrieved before any POST or GET commands.
Setting these env var locally in my <code>.bashrc</code> file and running the curl command works fine when I test locally.</p>
<pre class="lang-sh prettyprint-override"><code># ~/.bashrc:... | kddiji | <p>You forgot to escape one double quote here:</p>
<pre><code>... \"deviceId\":\"$uuid\"}" https:/ ...
^
</code></pre>
<p>Escaping this will fix the YAML. However, the value will not be correct because as you can see, your original command already needs escape sequenc... | flyx |
<p>I am not sure where else to turn as all example I have seen I have pretty much copied and still cannot get it to work. The connector will not install and states empty password. I have validted each step and cannot get it to work. Here are the steps I have taken.</p>
<h1>Container</h1>
<pre class="lang-sh prettypri... | nitefrog | <p>The config param needed for the mySQL connector is:</p>
<p><code>database.allowPublicKeyRetrieval: true</code></p>
<p>That resolved the issue.</p>
| nitefrog |
<p>When I ssh directly inside my pod, and run the following on the command line: <code>curl -v --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" https://kubernetes.default.svc.cluster.local/apis/batch/v1/watch/namespaces/k... | thatguyjono | <p>Have you tried to actually read from this stream? Private fields can be confusing, so I would suggest to try <a href="http://docs.guzzlephp.org/en/stable/request-options.html#stream" rel="nofollow noreferrer">the public interface</a> and see what you get:</p>
<pre><code>$body = $response->getBody();
while (!$bod... | Alexey Shokov |
<p>I have set up 3 node kubernetes using 3 VPS and installed rook/ceph.</p>
<p>when I run</p>
<pre><code>kubectl exec -it rook-ceph-tools-78cdfd976c-6fdct -n rook-ceph bash
ceph status
</code></pre>
<p>I get the below result</p>
<pre><code>osd: 0 osds: 0 up, 0 in
</code></pre>
<p>I tried</p>
<pre><code>ceph device ls
<... | jeril | <p>I have similar problem that OSD doesn't appear in <code>ceph status</code>, after I install and teardown for test multiple times.</p>
<p>I fixed this issue by running</p>
<pre><code>dd if=/dev/zero of=/dev/sdX bs=1M status=progress
</code></pre>
<p>to completely remove any information on such raw block disk.</p>
| j3ffyang |
<p>I have a configMap inside a helm chart:</p>
<pre><code>---
apiVersion: v1
kind: ConfigMap
metadata:
name: card-template
data:
card.tmpl: |-
{{- if .Values.customMessageCardTemplate }}
{{ toYaml .Values.customMessageCardTemplate | indent 4 }}
{{- else }}
{{ .Files.Get "card.tmpl" | indent 4 }}
{{- end }}
</code><... | AnjK | <p>It just does exactly what you tell it to. <code>customMessageCardTemplate</code> contains a string, so <code>toYaml</code> encodes it as double-quoted YAML string. While doing so, it replaces special characters such as line endings and double quotes with escape sequences.</p>
<p>Since you're pasting into a block sc... | flyx |
<p>I'd like to run a particular Kubernetes job whenever the pod of particular deployment restarts.</p>
<p>In particular, I have a Redis deployment. It is not backed by permanent storage. When the pod in the Redis deployment restarts, I'd like to populate some keys in Redis.</p>
<p>Is there a way to trigger a job on p... | Laizer | <p>The best option comes to my mind is an k8s operator - A simple python/go script watches your target pod (by label, name, namespace, etc.) and performs some actions when the state changes.</p>
<p>An operator is just a deployment with special features. There are various ways to implement, one of them is <a href="https... | Amrit |
<p>Two years ago while I took CKA exam, I already have this question. At that time I only could do was to see k8s.io official documentation. Now just curious on generating pv / pvc / storageClass via pure kubectl cli. What I look for is similar to the similar logic as deployment, for example:</p>
<pre><code>$ kubectl c... | Ming Hsieh | <h2>TL;DR:</h2>
<p>Look, bookmark and build index your brain in all yaml files in this Github directory (content/en/examples/pods) before the exam. 100% legal according to CKA curriculum.</p>
<p><a href="https://github.com/kubernetes/website/tree/master/content/en/examples/pods/storage/pv-volume.yaml" rel="nofollow nor... | Ming Hsieh |
<p>I am seeing a very strange issue trying to start the official <code>postgres:14.6-alpine</code> image on Kubernetes.</p>
<p>For reference the official postgres image allows for configuring the initialization script using the <code>POSTGRES_USER</code>, <code>POSTGRES_PASSWORD</code>, and <code>POSTGRES_DB</code> env... | knpwrs | <p>I think this had to do with a specific setting I had enabled for Docker Desktop for Mac:</p>
<p><a href="https://i.stack.imgur.com/7f60o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7f60o.png" alt="Docker Desktop Settings" /></a></p>
<p>I had changed from the default value (<code>gRPC FUSE</cod... | knpwrs |
<p>Create <code>yaml-bomb.yaml</code> file:</p>
<pre><code>apiVersion: v1
data:
a: &a ["web","web","web","web","web","web","web","web","web"]
b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a]
c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b]
d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c]
e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d]
f: &a... | maxwell jiang | <p>This is a <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack" rel="noreferrer">billion laughts attack</a> and can only be fixed in the YAML processor.</p>
<p>Note that the Wikipedia is wrong here when it says</p>
<blockquote>
<p>A "Billion laughs" attack should exist for any file format that can contai... | flyx |
<p>I have installed docker-registry on Kubernetes via helm.</p>
<p>I am able to docker push to <code>docker push 0.0.0.0:5000/<my-container>:v1</code> using port-forward.</p>
<p>Now how do I reference the images in the registry from a deployment.yaml?</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deploym... | Chris G. | <p>You need to get the <strong>cluster-ip</strong> of your local docker registry. </p>
<p>You will find this in the dashboard - just visit the registry pod page and then to the associated <code>service</code>. Replace your image spec's <code>0.0.0.0</code> with the cluster ip. Also make sure the <code>port</code> matc... | Amrit |
<p>I am trying out the capability where 2 pods deployed to the same worker node in EKS are associated to different service accounts. Below are the steps</p>
<ul>
<li>Each service account is associated to a different role one with access to SQS and other without access.</li>
<li>Used eksutil to associate OIDC provider ... | rajesh kumar | <p>So, there are a few things required to get IRSA to work:</p>
<ol>
<li>There has to be an OIDC provider associated with the cluster, following the directions <a href="https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html" rel="nofollow noreferrer">here</a>.</li>
<li>The IAM role... | asthasr |
<p>There are a vast majority of tutorials and documentation on the web where Flask is running in development state. The log looks like this in development mode:</p>
<pre><code>* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
... | mr.bjerre | <p>As <a href="http://flask.pocoo.org/docs/1.0/deploying/" rel="nofollow noreferrer">Flask's documentation</a> states:</p>
<blockquote>
<p>Flask’s built-in server is not suitable for production</p>
</blockquote>
<p>Why WSGI? It's <a href="https://www.python.org/dev/peps/pep-0333/" rel="nofollow noreferrer">a standa... | imsky |
<p>Our global Prometheus scrape interval on k8s is <code>60s</code>, but I want one application has <code>300s</code> scrape interval.</p>
<p>I attach the following to my pod so the metrics are <strong>scraped</strong>.</p>
<pre><code>prometheus.io/scrape: 'true'
prometheus.io/port: '{{ .Values.prometheus.port }}'
prom... | Holm | <p>I would like to add some details. If you use the official Prometheus Helm charts, this should be in your <code>values-prometheus.yaml</code> file:</p>
<pre><code># extra scraping configs
# | is required, because extraScrapeConfigs is expected to be a string
extraScrapeConfigs: |
- job_name: 'kubernetes-service-end... | Alex Fedulov |
<p>I would like to grant one user only the "get" privilege of "kubectl" command. I suppose it should be done with RBAC, anyone can advise it, thanks.</p>
| James Pei | <p>Create a <code>allow-get.yaml</code> file with the next content and change <code>my-user</code> by your user, and run <code>kubectl apply -f allow-get.yaml</code></p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: allow-get
rules:
- apiGroups:
- ""
resources:
- "*"
... | TlmaK0 |
<p>If I have a buggy app in a container that is constantly writing to an emptyDir volume it could use up all the space on the worker node and affect the performance of other pods / containers on the node. Thus breaking the expectation that containers are isolated from each other what one container does should not negat... | ams | <p>You can set <code>sizeLimit</code> on the volume (see <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#emptydirvolumesource-v1-core" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#emptydirvolumesource-v1-core</a>). Setting this will, once t... | imsky |
<p>I am new to Google Cloud Platform and the following context:</p>
<p>I have a Compute Engine VM running as a MongoDB server and a Compute Engine VM running as a NodeJS server already with Docker. Then the NodeJS application connects to Mongo via the default VPC internal IP. Now, I'm trying to migrate the NodeJS appl... | Felipe Antero | <p>In my case traffic from GKE to GCE VM was blocked by Google Firewall even thou both are in the same network (default).</p>
<p>I had to whitelist cluster pod network listed in cluster details:</p>
<p><code>Pod address range 10.8.0.0/14</code></p>
<p><a href="https://console.cloud.google.com/kubernetes/list" rel="nor... | Dariusz Bacinski |
<p>I am currently facing a situation where I need to deploy a small cluster (only 4 pods for now) which will be containing 4 different microservices. This cluster has to be duplicated so I can have one PRODUCTION cluster and one DEVELOPMENT cluster.</p>
<p>Even if it's not hard from my point of view (Creating a cluste... | Emixam23 | <p>So my question is:</p>
<p>How are you triggering these builds? Manually? GitHub Trigger? HTTP Trigger using the REST API?</p>
<p>so you're almost there for the building/pushing part, you would need to use substitution variables <a href="https://cloud.google.com/cloud-build/docs/configuring-builds/substitute-variab... | Lance Sandino |
<p>I've created a Kubernetes deployment. However, there seem to be additional pods running - that I'm hoping to be able to delete the unnecessary ones. </p>
<p>I see no need to run the dashboard container. I'd like to remove it to free up CPU resources.</p>
<p>How can I disable this container from starting up? Prefe... | Chris Stryczynski | <h2>Update 2023-03</h2>
<p>To have a clean removal you must to delete a lot of objects. Overtime removing the dashboard has been a common problem, so you can now do this:</p>
<pre><code>kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
</code></pre>
<p>If you do... | freedev |
<p>In order to a service work, it needs an environment variable called <code>DSN</code> which prints to something like <code>postgres://user:password@postgres.svc.cluster.local:5432/database</code>. This value I built with a <code>ConfigMap</code> resource:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
nam... | Rodrigo Souza | <p>Digging into Kubernetes Docs I was able to find. According to <a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config" rel="nofollow noreferrer">Define Environment Variables for a Container</a> :</p>
<blockquote>
<p... | Rodrigo Souza |
<p>I'm using k8s 1.11.2 to build my service, the YAML file looks like this:</p>
<p><strong>Deployment</strong></p>
<pre><code>apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: nginx-test
namespace: default
labels:
- type: test
spec:
replicas: 1
selector:
matchLabels:
- type: test
templ... | 李向朋 | <p><a href="http://www.yamllint.com/" rel="noreferrer">yamllint.com</a> is a dubious service because it does not tell us which YAML version it is checking against and which implementation it is using. Avoid it.</p>
<p>More importantly, while your input may be valid YAML, this does not mean that it is a valid input for... | flyx |
<p>While joining the centos 7 node to cluster 1.9.0, <code>kubeadm join</code> command gives this error message.</p>
<p><code>Failed to request cluster info, will try again: [Get https://10.10.10.10:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate has expired or is not yet valid]</code></p>... | sfgroups | <p>The root cause of the issue is my node didn't have the correct time. after configuring NTP service node was able to join the master.</p>
| sfgroups |
<p>I'm running a spring boot inside a pod with the below configurations.</p>
<p>Pod limits:</p>
<pre><code>resources:
limits:
cpu: "1"
memory: 2500Mi
requests:
cpu: "1"
memory: 2500Mi
</code></pre>
<p>command args:</p>
<pre><code>spec:
containers:
- args:
- -c
- ln -sf /dev/stdou... | k_vishwanath | <p>The -Xmx flag only controls Java heap memory, which is space available for your own Java objects when running your code. If you run out, JVM will do garbage collection to make space. If you still ran out, you get an OutOfMemoryException thrown.</p>
<p>Java JVM also uses a bunch of other memory internally for stuff ... | Hitobat |
<p>I'm running the kafka kubenetes helm deployment, however I am unsure about how to install a custom plugin.</p>
<p>When running custom plugin on my local version of kafka I mount the volume <code>/myplugin</code> to the Docker image, and then set the plugin path environment variable.</p>
<p>I am unsure about how to... | Sam Palmer | <p>Have a look at the last few slides of <a href="https://talks.rmoff.net/QZ5nsS/from-zero-to-hero-with-kafka-connect" rel="noreferrer">https://talks.rmoff.net/QZ5nsS/from-zero-to-hero-with-kafka-connect</a>. You can mount your plugins but the best way is to either build a new image to extend the <code>cp-kafka-connect... | Robin Moffatt |
<p>I'm trying to exec kubernetes pod using the Websocket, as per the kubernetes document it can be achieved through passing the <strong>Bearer THETOKEN</strong></p>
<p>When using bearer token authentication from an http client, the API server expects an Authorization header with a value of Bearer THETOKEN</p>
<p>Her... | anish | <p>I never used websocket with kubernetes before, but here is the documentation about the token authentication method for websocket browser clients <a href="https://github.com/kubernetes/kubernetes/pull/47740" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/pull/47740</a></p>
<p>You must to send toke... | TlmaK0 |
<p>We are using a Apache-Kafka deployment on Kubernetes which is based on the ability to label pods after they have been created (see <a href="https://github.com/Yolean/kubernetes-kafka" rel="noreferrer">https://github.com/Yolean/kubernetes-kafka</a>). The init container of the broker pods takes advantage of this featu... | Marcus Rickert | <p>It was pointed out in one of the comments that the issue may be caused by a missing permission even though the error message does not insinuate so. We officially filed a ticket with Docker and actually got exactly this result: In order to be able to set/modify a label from within a pod the default user of the namesp... | Marcus Rickert |
<p>I have created a headless statefull service in kubernates. and cassandra db is running fine.</p>
<pre><code>PS C:\> .\kubectl.exe get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
cassandra None <none> 9042/TCP 50m
kubernetes 10.0.0.1 <none> 443/TCP ... | parag mangal | <p>Looks like your service not defined with NodePort. can you change service type to <code>NodePort</code> and test it.</p>
<p>when we define svc to NodePort we should get two port number for the service.</p>
| sfgroups |
<p>I created an headless service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: myapp-service-headless
spec:
ports:
- port: 80
selector:
app: myapp
clusterIP: None
</code></pre>
<p>From Kubernetes dashboard I can see its <code>Internal endpoints</code>:</p>
<pre><code>myapp-service-headles... | online | <p>There is two option to expose the service outside, you can use the ingress controller to connect to the server. </p>
<p>The simple method is change your service type to NodePort, then you should be able access server using NodeIP and service external port number.</p>
<p>here is the more info.</p>
<p><a href="http... | sfgroups |
<p>In my single master Kubernetes 1.15 cluster, some of the pods shows in NotReady status. some pods in Ready and in NotReady status?</p>
<p>How to clean up pods in NotReady status?</p>
<pre><code> # crictl pods
POD ID CREATED STATE NAME NA... | sfgroups | <p>I was able to remove NotReady pods using <code>crictl</code> command.</p>
<pre><code>crictl pods|grep NotReady|cut -f1 -d" "|xargs -L 1 -I {} -t crictl rmp {}
</code></pre>
| sfgroups |
<p>I would like to be able to access and manage a GKE (kubernetes) cluster from a Google Cloud function written in python.
I managed to access and retrieve data from the created cluster (endpoint, username, and password at least), however I dont know how to use them with the kubernetes package api.</p>
<p>Here are my ... | Ab. C. | <p>You can use a bearer token rather than using basic authentication:</p>
<pre><code>from google.auth import compute_engine
from google.cloud.container_v1 import ClusterManagerClient
from kubernetes import client
def test_gke(request):
project_id = "my-gcp-project"
zone = "my-zone"
clu... | Dustin Ingram |
<p>I have a java application that runs inside a Kubernetes pod.</p>
<p>The application performs several tasks (<code>taskA</code>, <code>taskB</code>, etc.). The application supports running multiple instances in different pods. All the pods are doing the same tasks. </p>
<p>However, there is a task that should on... | Ahmed A | <p>After researching David's answer, I found the Kubernetes blog recommends a way to do leader election:</p>
<p><a href="https://kubernetes.io/blog/2016/01/simple-leader-election-with-kubernetes/" rel="nofollow noreferrer">https://kubernetes.io/blog/2016/01/simple-leader-election-with-kubernetes/</a></p>
<p>Newer artic... | Alexander Taylor |
<p>im Running Kubernetes (minikube) on Windows via Virtualbox. I've got a Services running on my Host-Service i dont want to put inside my Kubernetes Cluster, how can i access that Services from Inside my Pods?</p>
<p>Im new to to Kubernetes i hope this Questions isnt to stupid to ask.</p>
<p>I tried to create a Se... | pro sp | <p>I think the Ubuntu image test is most informative here.</p>
<p>From the error message I think the problem is in the MySQL config. You must configure server to listen on port of your host IP address (i.e. not localhost or socketfile).</p>
<p>In addition, you must also ensure that IP address from pod subnets are all... | Hitobat |
<p>Is it possible to <strong>access machine environments inside dockerfile</strong>? I was thinking passing the SECRET as build ARG, like so:</p>
<p>docker-compose:</p>
<pre class="lang-yaml prettyprint-override"><code>version: '3.5'
services:
service:
...
build:
...
args:
SECRET: ${SECRET... | Gustavo Santamaría | <p>The secrets should be used during run time and provided by execution environment.</p>
<p>Also everything that is executing during a container build is written down as layers and available later to anyone who is able to get access to an image. That's why it's hard to consume secrets during the build in a secure way.<... | Slava Semushin |
<p>I am new in Airflow and kubernetes.</p>
<p>I have deployed airflow following this guide: <a href="https://docs.bitnami.com/tutorials/deploy-apache-airflow-azure-postgresql-redis/" rel="nofollow noreferrer">https://docs.bitnami.com/tutorials/deploy-apache-airflow-azure-postgresql-redis/</a></p>
<p>I understand that t... | J.C Guzman | <p>I'm assuming you used the <a href="https://github.com/bitnami/charts/tree/master/bitnami/airflow" rel="nofollow noreferrer">Bitnami Helm chart</a> to deploy Airflow into Kubernetes.</p>
<p>In the values file, the config setting <code>airflow.worker.replicas</code> controls how many worker pods will be deployed. The ... | Hitobat |
<p>I am trying to push my container up to GCP Kubernetes in my cluster. My pod runs locally but it doesn't want to run on GCP. It comes back with this error <code>Error response from daemon: No command specified: CreateContainerError</code></p>
<p>It worked if I run it locally in docker but once I push it up to the co... | soniccool | <p>It was a malformed character in my Dockerfile and caused it to crash.</p>
| soniccool |
<p>We have created service and ingress files for our deployment below.
However, when we try to reach our app through the ingress controller, we have seen that our static files such as JS and CSS cannot be loaded on the website. Aside from this, when we try to reach with NodePort, we have seen that the app was loaded pe... | thenextgeneration | <p>It looks like the ingress controller listens on port 80 (and that's why HTML pages are loaded) but they have links that point to port 3000 (and that's why everything works with NodePort). In other words, I suspect that you have to modify the pages to not use hardcoded port.</p>
| Slava Semushin |
<p>I'm trying to implement EFK stack (with Fluent Bit) in my k8s cluster. My log file I would like to parse sometimes is oneline and sometimes multiline:</p>
<pre><code>2022-03-13 13:27:04 [-][-][-][error][craft\db\Connection::open] SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service no... | Murakami | <p>Starting from Fluent Bit v1.8, You can use the <code>multiline.parser</code> option as below.
docker and cri multiline parsers are predefined in fluent-bit.</p>
<pre><code>[INPUT]
Name tail
Path /var/log/containers/*.log
multiline.parser docker, cri
Tag kube.*
Mem_Buf_Limit 5M... | Kavinda Gayashan |
<p>Lets say I need to create environment variables or ConfigMap entries like this:</p>
<pre><code>- name: JDBC_URL
value: "jdbc:db2://alice-service-a:50000/db1"
- name: KEYCLOAK_BASE_URL
value: "http://alice-keycloak:8080/auth"
</code></pre>
<p>Where <code>alice-</code> is the namePrefix. How do... | Peter V. Mørch | <p>I'm afraid I've come up against one of the limitations of Kustomize.</p>
<p><a href="https://blog.argoproj.io/the-state-of-kubernetes-configuration-management-d8b06c1205" rel="nofollow noreferrer">The State of Kubernetes Configuration Management: An Unsolved Problem | by Jesse Suen | Argo Project</a> has this to say... | Peter V. Mørch |
<p>I have ingress-nginx configured with ingress resources that are host specific so how can I access <a href="http://appX.my.example.com" rel="nofollow noreferrer">http://appX.my.example.com</a> both from my desktop browser and also from within other pods inside the cluster, that also need to access <a href="http://app... | Peter V. Mørch | <p>Here's what I've come up with:</p>
<p>I've created a wildcard certificate in a real DNS entry in a domain I own. Something like</p>
<pre><code>*.local.mydomain.dk. IN A 127.0.0.1
</code></pre>
<p>Now the trick is to get coredns (the DNS server in the kubernetes cluster) to resolve <code>*.local.mydomain.dk</code> to... | Peter V. Mørch |
<p>I have a application pod where I am logging log messed to a file a specific location.</p>
<p>I have already shared this location to other pod using emptyDir volumeMount.</p>
<p>I am getting standard stdout & stderr in my ELF stack - dashboard. How do I capture my custom logs?</p>
<pre><code>apiVersion: extens... | Sampath Maddula | <p>Kubernetes will send all the logs to nodes /var/log etc. You need hostPath volume for fluentd daemoset to pick it up and send to your logger. <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir" rel="nofollow noreferrer">EmptyDir</a>, as the name suggest, will be empty when the pod is scheduled to... | Amrit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.