Question stringlengths 65 39.6k | QuestionAuthor stringlengths 3 30 ⌀ | Answer stringlengths 38 29.1k | AnswerAuthor stringlengths 3 30 ⌀ |
|---|---|---|---|
<p>I have tried to list pods based on labels</p>
<pre><code> // Kubernetes client - package kubernetes
clientset := kubernetes.NewForConfigOrDie(config)
// create a temp list for storage
var podslice []string
// Get pods -- package metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pods, ... | Pradeep Padmanaban C | <p>You may just be able to set using the <code>ListOptions</code> parameter.</p>
<pre><code>listOptions := metav1.ListOptions{
LabelSelector: "app=foo",
}
pods, _ := clientset.CoreV1().Pods("").List(listOptions)
</code></pre>
<p>If you have multiple labels, you may be able to perform thi... | Sankar |
<p>I have a simple Spring Boot application, deployed on k8s (2 pods).
Briefly described this application takes messages from producer and process them to the consumer. Nothing complicated. </p>
<p>UPD: </p>
<ul>
<li>java version: 1.8.172</li>
<li>javaMemoryOpts: -Xmx2048m -XX:+UnlockExperimentalVMOptions -XX:+UseCGro... | yevtsy | <p>The answer from mk_sta is helpful and all the information you need is probably in those documents, but I feel it is worth summarising the main points in a full answer.</p>
<p>Your -Xmx2048m (2Gb) option is setting the maximum heap size, but the application will use more memory than this - the Metaspace, the Garbage... | Dick Chesterwood |
<p>I have create cron job in kubernetes and I have ssh key in one of pod directory. when I am executing from command line its working fine, but when I am manually triggered , cron job is not recognizing .ssh folder .</p>
<pre><code>scp -i /srv/batch/source/.ssh/id_rsa user@server:/home/data/openings.csv /srv/batc... | Sanjay Chintha | <p>When you log into a remote host from your container, the remote host key is unknown to your SSH client inside the container</p>
<p>usually, you're asked to confirm its fingerprint:</p>
<pre><code>The authenticity of host ***** can't be established.
RSA key fingerprint is *****.
Are you sure you want to continue c... | Kartoch |
<p>We have an issue in an AKS cluster running Kubernetes 1.13.5. The symptoms are:</p>
<ul>
<li>Pods are randomly restarted</li>
<li>The "Last State" is "Terminated", the "Reason" is "Error" and the "Exit Code" is "137"</li>
<li>The pod events show no errors, either related to lack of resources or failed liveness chec... | Phyxx | <p>This issue appears to have been resolved by updating to AKS 1.13.7, which includes an update to Moby 3.0.6. Since updating a few days ago we have not seen containers killed in the manner described in the Docker bug at <a href="https://github.com/moby/moby/issues/38768" rel="nofollow noreferrer">https://github.com/mo... | Phyxx |
<p>I'm trying out a very simple Istio setup on a Docker Desktop Kubernetes installation.</p>
<p>I have 2 Spring boot micro services and have deployed these 2 services in my K8s "cluster" without any replication. All I have in my YAML file is the Service and Deployment for both services.</p>
<p>I have installed istio ... | ViV | <p>Istio is a Service Mesh, as such it isn't responsible for service discovery. A service mesh adds functionality to the Service -> Service traffic (monitoring, routing, etc). So when running on a Kubernetes cluster, Kubernetes continues to be responsible for service discovery, as you've observed.</p>
<p>As Arghya's a... | Dick Chesterwood |
<p>I am trying to copy the first container argument in a pod definition to an environment variable. This is my pod template file.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: test
image: nginx
co... | Harshith Bolar | <p>Only a limited number of fields are available using <code>fieldRef</code>.</p>
<p>From <a href="https://kubernetes.io/docs/concepts/workloads/pods/downward-api/#available-fields" rel="nofollow noreferrer">the documentation</a>:</p>
<blockquote>
<p>Only some Kubernetes API fields are available through the downward AP... | larsks |
<p>I am new to Istio and I have learned a lot and applied to my project which consist of many Microservices. I am stuck in Authentication when it comes to using Istio</p>
<p>So the issue is this. Istio offers authentication which involves using Oauth google, Oauth or any other provider. and Once we do this, we can set... | BoeingK8 | <p>Try the AuthService project here which seems to aim to improve this area of Istio, which is at the moment pretty deficient IMO:</p>
<p><a href="https://github.com/istio-ecosystem/authservice" rel="nofollow noreferrer">https://github.com/istio-ecosystem/authservice</a></p>
<p>I think the Istio docs imply that it su... | Dick Chesterwood |
<p>I want to know How much volume is available to each of <code>EC2</code> instances in an <code>EKS</code> cluster?</p>
<p>According to <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html" rel="nofollow noreferrer">this page</a>, There are two types of <code>AMI</code>s:</p>
<ol>
<li><code... | HsnVahedi | <p>You’re using instances of type T2.small. This instance type is EBS-backed only and doesn’t have an instance store option.</p>
<p>According to the documentation that you mentioned, the size limit for an EBS-backed instance’s root device is 16 TiB. The actual size however depends on the volume sizes that you configure... | Dennis Traub |
<p>I have a few kubernetes service accounts.</p>
<p>I want to login kubernetes dashboard.</p>
<pre><code>$kubectl get sa -n kubernetes-dashboard
NAME SECRETS AGE
whitebear 0 9m37s
default 0 15m
kubernetes-dashboard 0 15m
</code></pre>
<p>However ... | whitebear | <p>Tokens are not generated by default for ServiceAccounts since Kubernetes version 1.22. To create a long-lived ServiceAccount token in a Secret, see <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-an-api-token-for-a-serviceaccount" rel="nofollow noreferrer"... | larsks |
<p>I just installed Helm v3.4.2 and the command below prints many packages as DEPRECATED in the description:</p>
<p><code>helm search repo stable</code></p>
<p>Output:</p>
<pre><code>stable/acs-engine-autoscaler 2.2.2 2.1.1 DEPRECATED Scales worker nodes within agent pools
stable... | user2668735 | <p>The underlying reason "why" is that the CNCF no longer wanted to pay the costs in hosting a single monolithic repository:</p>
<p><a href="https://www.cncf.io/blog/2020/10/07/important-reminder-for-all-helm-users-stable-incubator-repos-are-deprecated-and-all-images-are-changing-location/" rel="noreferrer">h... | Dick Chesterwood |
<p>I have an application with multiple services called from a primary application service. I understand the basics of doing canary and A/B deployments, however all the examples I see show a round robin where each request switches between versions. </p>
<p>What I'd prefer is that once a given user/session is associat... | gunygoogoo | <p>We've been grappling with this because we want to deploy test microservices into production and expose them only if the first request contains a "dark release" header.</p>
<p>As mentioned by Jonas, cookies and header values can in theory be used to achieve what you're looking for. It's very easy to achieve if the s... | Dick Chesterwood |
<p>I'm working with Kubernetes 1.26 on the server side (EKS) and kubectl client 1.27.1.</p>
<p>I have a job define in this way:</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
name: build
spec:
template:
spec:
restartPolicy: Never
volumes:
.....
containers:
- name: ... | david.perez | <p>I think you missed this section of the documentation:</p>
<blockquote>
<p>An entire Pod can also fail, for a number of reasons, such as when the pod is kicked off the node (node is upgraded, rebooted, deleted, etc.), or if a container of the Pod fails and the .spec.template.spec.restartPolicy = "Never". <s... | larsks |
<p>Is it possible to promote a Kubernetes worker node to master to quickly recover from the loss of a master (1 of 3) and restore safety to the cluster? Preferably without disrupting all the pods already running on it. Bare metal deployment. Tx.</p>
| David Tinker | <p>It doesn't look like a worker node can be promoted to master in general. However it is easy to sort out for a specific case:</p>
<ul>
<li>Control plane node disappears from the network</li>
<li>Node is manually deleted: <code>k delete node2.example.com --ignore-daemonsets --delete-local-data</code></li>
<li>Some tim... | David Tinker |
<p>Whats the best approach to provide a .kube/config file in a rest service deployed on kubernetes?</p>
<p>This will enable my service to (for example) use the kuberntes client api.</p>
<p>R</p>
| Raster R | <p>Create service account:</p>
<pre><code>kubectl create serviceaccount example-sa
</code></pre>
<p>Create a role:</p>
<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: default
name: example-role
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
... | Maciek Sawicki |
<p>We are just getting started with k8s (bare metal on Ubuntu 20.04). Is it possible for ingress traffic arriving at a host for a load balanced service to go to a pod running on that host (if one is available)?</p>
<p>We have some apps that use client side consistent hashing (using customer ID) to select a service inst... | David Tinker | <p>I finally got this figured out. This was way harder than it should be IMO! <strong>Update: It's not working. Traffic frequently goes to the wrong pod.</strong></p>
<p>The service needs <code>externalTrafficPolicy: Local</code> (see <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-... | David Tinker |
<p>I have simple helm chart. I have a <code>labels:</code> block that I need to refer in a <code>Deployment</code></p>
<p>Here's my <code>values.yaml</code></p>
<pre><code>labels:
app: test-app
group: test-group
provider: test-provider
</code></pre>
<p>And in the <code>templates/deployment.yaml</code> I nee... | Jananath Banuka | <p>Iterating over a mapping is covered in the "<a href="https://helm.sh/docs/chart_template_guide/variables/" rel="nofollow noreferrer">Variables</a>" documentation:</p>
<blockquote>
<p>For data structures that have both a key and a value, we can use range to get both. For example, we can loop through .Values... | larsks |
<p>I've been experimenting with <a href="https://github.com/heptio/contour" rel="nofollow noreferrer">contour</a> as an alternative ingress controller on a test GKE kubernetes cluster.</p>
<p>Following the contour <a href="https://github.com/heptio/contour/blob/master/docs/deploy-options.md" rel="nofollow noreferrer">... | James Healy | <p>Probably you have GLBC ingress configured (<a href="https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/gce.md#how-do-i-disable-the-gce-ingress-controller" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/gce.md#how-do-i-disable-the-gce-ingress-controller</a>)</p>
... | Maciek Sawicki |
<p>item.Status.ContainerStatuses.RestartCount doesn't exist. I cannot find the command. Reinstalling the nuget-package or updating it did not work either.</p>
<p>Down there I added the problem I have and the package I use. Sorry if my english is kinda rusty.</p>
<p><a href="https://i.stack.imgur.com/hKkTa.png" rel="nof... | Lukas Zauner | <p><code>ContainerStatuses</code> is a collection of <code>ContainerStatus</code>, not a <code>ContainerStatus</code> itself. You must choose from which container you want the <code>RestartCount</code>, per example:</p>
<pre><code> int restarts = item.Status.ContainerStatuses[0].RestartCount;
</code></pre>
| Gusman |
<p>Could some one please help me with this..
I would like to understand a bit about the apiGroups & its usage in below Role definition.</p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
name: example.com-superuser
rules:
- apiGroups: ["example.com"]
re... | bala sreekanth | <p>An api group groups a set of resource types in a common namespace. For example, resource types related to Ingress services are grouped under the <code>networking.k8s.io</code> api group:</p>
<pre><code>$ kubectl api-resources --api-group newtorking.k8s.io
NAME SHORTNAMES APIVERSION NAMESPA... | larsks |
<p>I'm trying to communicate via grpc between two microservices internally on kubernetes, but I'm getting a connection refused error.</p>
<p>These are the yaml files of the services that are trying to communicate.</p>
<pre class="lang-yaml prettyprint-override"><code>---
apiVersion: v1
kind: Service
metadata:
labels:... | MrDoekje | <p>QUARKUS_GRPC_SERVER_HOST should be 0.0.0.0 instead of localhost</p>
| Luca Burgazzoli |
<p>I am trying to access a service listening on a port running on every node in my bare metal (Ubuntu 20.04) cluster from inside a pod. I can use the real IP address of one of the nodes and it works. However I need pods to connect to the port on their own node. I cant use '127.0.0.1' inside a pod.</p>
<p>More info: I a... | David Tinker | <p>Comment from @mdaniel worked. Tx.</p>
<p>Edit coredns deployment. Add this to the container after volumeMounts:</p>
<pre><code>env:
- name: K8S_NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
</code></pre>
<p>Edit coredns config map. Add to bottom of the Corefile:</p>
<pre><code>consul {
errors... | David Tinker |
<p>I have setup a kubernetes cluster locally by minikube. I have the Postgres service running in the cluster. I am trying to run a Flask app that connects to the Postgres database using psycopg2, fetch records and expose them on a REST endpoint.</p>
<p>I am getting this erorr in gunicorn logs -</p>
<pre><code>[2022-12-... | Masquerade | <p>Looking at <a href="https://www.psycopg.org/docs/module.html" rel="nofollow noreferrer">the documentation</a>, it looks like you need to remove the port from the <code>host</code> argument and use the <code>port</code> argument:</p>
<pre><code>def get_db_connection():
conn = psycopg2.connect(host="postgres-... | larsks |
<p>How can I use ingress to proxy a kubernetes external url address?
Before I used nginx as a proxy, the configuration is as follows.</p>
<pre><code> location /index.html {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_pass http://172.19.2.2:8080/index.html;
... | liyao | <p>Here is a nice article from Google Cloud about how to create services for external endpoints: <a href="https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-mapping-external-services" rel="nofollow noreferrer">https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-mapping-external-servic... | cewood |
<p>I created a managed Postgres database in Google Cloud. This database got a external IP address.
In a second step I created a Kubernetes cluster.
In the k8s I want access this external database. Therefore I created a service without label selector but with a external endpoint pointing to my Postgres-database.</p>
<... | Thomas Seehofchen | <p>The problem was discussed <a href="https://github.com/txn2/kubefwd/issues/35" rel="noreferrer">here</a> and there is a solution to set up port forwarding to a service without selector/pod (e.g. ExternalName service) by deploying a proxy pod inside K8s:</p>
<pre><code>kubectl -n production run mysql-tunnel-$USER -it... | Aldekein |
<p>Is there anyway to get all logs from pods in a specific namespace running a dynamic command like a combination of awk and xargs?</p>
<pre><code> kubectl get pods | grep Running | awk '{print $1}' | xargs kubectl logs | grep value
</code></pre>
<p>I have tried the command above but it's failing like <code>kubectl log... | placplacboom | <p>Think about what your pipeline is doing:</p>
<p>The <code>kubectl logs</code> command takes as an argument a <em>single</em> pod name, but through your use of <code>xargs</code> you're passing it <em>multiple</em> pod names. Make liberal use of the <code>echo</code> command to debug your pipelines; if I have these p... | larsks |
<p>I need to grab some pod information which will be used for some unit tests which will be run in-cluster. I need all the information which kubectl describe po gives but from an in cluster api call. </p>
<p>I have some working code which makes an api call to apis/metrics.k8s.io/v1beta1/pods, and have installed the m... | sensedata1 | <p>Looking at the <a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubectl/pkg/describe/versioned/describe.go#L668" rel="nofollow noreferrer">describePod</a> and <a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubectl/pkg/describe/describe.go#L693" rel="n... | cewood |
<p>I believe that I must create multiple <code>Ingress</code> resources to achieve the desired effect, but must ask, is it possible to have multiple rewrite annotations with nginx (community) controller for the same host?</p>
<p>I have the following, but it won't work, as I understand it, because there is no way to li... | Ben | <p>TL;DR; you're not really meant to be able to configure multiple rewrites for the kubernetes/ingress-nginx controller type. Although it is possible to hack this together in a limited fashion using regex based rewrites with capture groups, as explained in this answer I posted to <a href="https://stackoverflow.com/a/57... | cewood |
<pre><code>$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.6", GitCommit:"9f8ebd171479bec0ada837d7ee641dec2f8c6dd1", GitTreeState:"clean", BuildDate:"2018-03-21T15:21:50Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"... | Eric Francis | <p>The issue is that the container does not exist (see the CrashLoopBackOff).</p>
<p>One of the things that I do with init containers (assuming you have the source) is to put a sleep 600 on failure in the entrypoint. At least for debugging. This lets you exec into the container to poke around to see the cause of the ... | Warren Strange |
<p>I have job failure alerts in prometheus, which resolves itself right after 2 hours I got the alert where the alert actually is not resolved. How come Prometheus resolves it? Just so you know, this is only happening with this job alert.</p>
<p>Job Alert:</p>
<pre><code> - alert: Failed Job Status
expr: increase(... | cosmos-1905-14 | <p><code>kube_job_status_failed</code> is a gauge representing the number of failed job pods at a given time. The expression <code>increase(kube_job_status_failed[30m]) > 0</code> asks the question: "have there been new failures in the last 30 minutes?" If there haven't, it won't be true, even if old failu... | Jason S |
<p>I am trying to understand how we can create circuit breakers for cloud run services,Unlike in GKE we are using istio kind of service mesh how we implement same thing cloud Run ?</p>
| Aadesh kale | <p>On GKE you'd <a href="https://cloud.google.com/traffic-director/docs/configure-advanced-traffic-management#circuit-breaking" rel="nofollow noreferrer">set up a circuit breaker</a> to prevent overloading your legacy backend systems from a surge in requests.</p>
<p>To accomplish the same on Cloud Run or Cloud Function... | Frank van Puffelen |
<p>In this application, nodejs pods are running inside kubernetes, and mongodb itself sitting outside at host as localhost.</p>
<p>This indeed not good design, but its only for dev environment. In production a separte mongodb server will be there, as such option to have a non loopback ip in endpoint, so will not be a p... | GLK | <p>I'm running on docker for windows, and for me just using <code>host.docker.internal</code> instead of <code>localhost</code> seems to work fine.</p>
<p>For example, my mongodb connection string looks like this:</p>
<pre><code>mongodb://host.docker.internal:27017/mydb
</code></pre>
<p>As an aside, my <code>hosts</cod... | joniba |
<p>I just started to use Rancher and request to correct me for any wrong terminology.</p>
<p>Earlier I was using minikube on Macbook which provide SSH easily using <code>minikube ssh</code> for troubleshooting. As I am newbie to Rancher Desktop and wanted to do SSH on Rancher Desktop node similar to minikube.</p>
<p>I ... | Ashish Kumar | <p>On recent versions (1.3 on) you can use the <code>rdctl</code> utility, which ships with Rancher Desktop, and run <code>rdctl shell COMMAND</code> or <code>rdctl shell</code> to ssh into the VM.</p>
| Eric |
<p>I wanted to check my mongo database, not sure which database my application is putting the data. Basically i have configured a very simple tasks application using a python flask api(deployed in gke) which in turn connects to a mongo database in the same gke cluster. The application works fine.
I referred to this lin... | bionics parv | <p>First things first, it is not advisable to run MongoDB as a <code>Deployment</code>, also some folks do refrain using Stateful apps in Kubernetes in general such as Databases because it can lead into many problems and it is a hard thing to manage. Some managed services really helps such as Atlas for MongoDB.</p>
<p>... | Ernani Joppert |
<p>eks server endpoint is <strong>xxxxxxxxxxx.xxx.eks.amazonaws.com</strong> and I've created a yml file with a deployment and service object. </p>
<pre><code>[ec2-user@ip-]$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
fakeserver NodePort 10.100.235.246 <none... | Ratul | <p>You should be using your Worker Node's IP (one of the nodes if you have more than one), not the EKS server endpoint. The EKS server endpoint is the master plane, meant to process requests pertaining to creating/deleting pods, etc.</p>
<p>You also need to make sure that the Security Group of your Node's will allow t... | nacho10f |
<pre><code>echo "import /opt/tomcat/webapps/identityiq/WEB-INF/config/BLANKIdentity.xml" | /opt/tomcat/webapps/identityiq/WEB-INF/bin/iiq console)
</code></pre>
<p>This command works if kubectl exec -it [container] -n [namespace] -- /bin/bash and then run it from the console.</p>
<p>However, if I try to: <co... | thepip3r | <p>When you run <code>kubectl exec ... <somecommand> | <anothercommand></code>, anything after the <code>|</code> is execute <strong>on your local host</strong>, not inside the remote container. It's just a regular shell <code>a | b | c</code> pipeline, where <code>a</code> in this case is your <code>kubect... | larsks |
<p>Can EKS Fargate be used in a private EKS cluster which has no outbound internet access?</p>
<p>According to the AWS documentation, the aws-alb-ingress controller is not supported for private EKS clusters with no outbound internet access:</p>
<p><a href="https://docs.aws.amazon.com/eks/latest/userguide/private-cluste... | ramen123 | <p>That paragraph in the docs has changed as-of mid/end October, and now says</p>
<blockquote>
<p>AWS Fargate is supported with private clusters. You must include the STS VPC endpoint. For more information, see VPC endpoints for private clusters. <em>You can use the AWS load balancer controller to deploy AWS Applicatio... | TBBle |
<p>I have a 3rd party docker image that I want to use (<a href="https://github.com/coreos/dex/releases/tag/v2.10.0" rel="nofollow noreferrer">https://github.com/coreos/dex/releases/tag/v2.10.0</a>). I need to inject some customisation into the pod (CSS stylesheet and PNG images). </p>
<p>I haven't found a suitable way... | agentgonzo | <p>One way would be to mount 1 or more volumes into the desired locations within the pod, seemingly <code>/web/static</code>. This however would overwrite the entire directly so you would need to supply all the files not just those you wish to overwrite.</p>
<p>Example:</p>
<pre><code>apiVersion: v1
kind: Pod
metadat... | justcompile |
<p>I am writing a bash script and I need the kubectl command to get all the namespace in my cluster based on a particular label.</p>
<pre><code>kubectl get ns -l=app=backend
</code></pre>
<p>When I run the command above I get:
<code>no resources found</code></p>
| Philcz | <blockquote>
<p>only the pods in the ns have that label. wondering if there's a way I can manipulate kubectl to output only the ns of the pods that have that label</p>
</blockquote>
<p>You can combine a few commands to do something like:</p>
<pre><code>kubectl get pods -A -l app=backend -o json |
jq -r '.items[]|.me... | larsks |
<p>I deployed a EKS cluster and I'd like to add more IAM users to the role. I read this doc <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html</a> and it mentioned how to map IAM users or roles to k8... | Joey Yi Zhao | <p>You can't. You can only map roles and users. Directly from the <a href="https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html" rel="nofollow noreferrer">documentation</a> you linked:</p>
<blockquote>
<ol start="3">
<li>Add your IAM users, roles, or AWS accounts to the configMap. You cannot add IAM gr... | Mark Loeser |
<p>I have an application with multiple services called from a primary application service. I understand the basics of doing canary and A/B deployments, however all the examples I see show a round robin where each request switches between versions. </p>
<p>What I'd prefer is that once a given user/session is associat... | gunygoogoo | <p>You can do this with Istio using <a href="https://istio.io/docs/tasks/traffic-management/request-routing/#route-based-on-user-identity" rel="nofollow noreferrer">Request Routing - Route based on user identity</a> but I don't know how mature the feature is. It may also be possible to route based on cookies or header ... | Jonas |
<p>I want to auto scale my pod in <strong>kubernetes</strong>. after some research I understand that i should use <strong>heapster</strong> for monitoring. what tested document you can suggest.
how can i test it?
i know i should use some stress test but does any one has document about it?
thanks</p>
| yasin lachini | <p>Heapster is EOL. <a href="https://github.com/kubernetes-retired/heapster" rel="nofollow noreferrer">https://github.com/kubernetes-retired/heapster</a></p>
<blockquote>
<p>RETIRED: Heapster is now retired. See the deprecation timeline for more information on support. We will not be making changes to Heapster.</p>
... | dmcgill50 |
<p>I am trying to follow this tutorial:
<a href="https://www.digitalocean.com/community/tutorials/how-to-create-a-kubernetes-cluster-using-kubeadm-on-ubuntu-18-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-create-a-kubernetes-cluster-using-kubeadm-on-ubuntu-18-04</a></p>
<p>Impo... | transient_loop | <p>I think what made it work is that I set the master's hostname to its <strong>public</strong> DNS name, and then used that as <code>--control-plane-endpoint</code> argument..., without <code>--apiserver-advertise-address</code> (but with the <code>--apiserver-bind-port</code> as I need to run it on another port).</p>... | transient_loop |
<p>I am trying to install velero and minio for my k8s cluster. I have one master and 2 worker nodes.
I have issue with NodePort service.</p>
<p>Overall pods are working and Node Port service is also running but when I try to access the minio Dashboard from browser It change Port number. I thought that issue is with my ... | tauqeerahmad24 | <p>We need to tell Minio to use a static console port. We can do that by providing the <code>--console-address</code> argument to the <code>minio server</code> command. Here's an example Deployment that I have used to run Minio locally:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: De... | larsks |
<p>Google has ]this cool tool <code>kubemci</code> - <code>Command line tool to configure L7 load balancers using multiple kubernetes clusters</code> with which you can basically have a HA multi region Kubernetes setup. Which is kind of cool.</p>
<p>But let's say we have an basic architecture like this:</p>
<ul>
<li>... | gerasalus | <p>This is a classic architecture scenario that has no easy solution. Making data available in multiple regions is a challenging problem that major companies spend a lot of time and money to solve.</p>
<ul>
<li><p>PostgreSQL does not natively support multi-master writes. Your idea of a replica located in the other reg... | Mani Gandham |
<p>I am getting below error in Jenkins while deploying to kubernetes cluster:</p>
<blockquote>
<p>ERROR: ERROR: java.lang.RuntimeException: io.kubernetes.client.openapi.ApiException: java.net.UnknownHostException: **.azmk8s.io: Name or service not known
hudson.remoting.ProxyException: java.lang.RuntimeException: i... | Anil Kumar P | <p>Have you deployed AKS private cluster (<a href="https://learn.microsoft.com/en-us/azure/aks/private-clusters" rel="nofollow noreferrer">document</a>)? If so, jenkins needs to be in the private network to access k8s cluster. </p>
<p>If this is not private cluster, check the network setting of jenkins to see it is ab... | Atul |
<p>I am using Azure Kubernetes. I installed Istio 1.6.1. It installed the Istio-ingressgateway with LoadBalancer. I don't want to use Istio ingressgateway because I want to kong ingress. </p>
<p>I tried to run below command to change istio-ingress services from LoadBalancer to ClusterIP but getting errors.</p>
<pre><... | Vikas Kalra | <p>The better option would be to reinstall istio without ingress controller. Do not install default profile in istio as it will install ingress controller along with other component. Check the various settings as mentioned in the installation page of <a href="https://istio.io/latest/docs/setup/install/istioctl/" rel="n... | Atul |
<p>We have one cluster where it seems that namespaces never want to be deleted completely and now can't re-create custom-metrics namespace to be able to collect custom metrics to properly setup HPA. I fully understand that I can create another namespace with all custom-metrics resources, but a little concerned with the... | Alex Smirnov | <p>I did something similar to rahul.tripathi except the curl did not work for me - I followed <a href="https://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e" rel="noreferrer">https://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-i... | saranicole |
<p>I want to remove a few environment variables in a container with kustomize? Is that possible? When I patch, it just adds as you may know.</p>
<p>If it's not possible, can we replace environment variable name, and secret key name/key pair all together?</p>
<pre><code> containers:
- name: container1
env:
... | cosmos-1905-14 | <p>If you're looking remove that <code>NAMESPACE</code> variable from the manifest, you can use the special <code>$patch: delete</code> directive to do so.</p>
<p>If I start with this Deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: example
spec:
template:
spec:
containers:
... | larsks |
<p>I'm trying to write logs to an Elasticsearch index from a Kubernetes cluster. Fluent-bit is being used to read stdout and it enriches the logs with metadata including pod labels. A simplified example log object is</p>
<pre><code>{
"log": "This is a log message.",
"kubernetes": {
"labels": {
"app": "... | rpf3 | <p>I opted to use the Logstash mutate filter with the <code>rename</code> option as described here:</p>
<p><a href="https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-rename" rel="nofollow noreferrer">https://www.elastic.co/guide/en/logstash/current/plugins-filters-muta... | rpf3 |
<p>I have the following chartInflator.yml file:</p>
<pre><code>apiVersion: builtin
kind: ChartInflator
metadata:
name: project-helm-inflator
chartName: helm-k8s
chartHome: ../../../helm-k8s/
releaseName: project-monitoring-chart
values: ../../values.yaml
releaseNamespace: project-monitoring-ns
</code></pre>
<p>When I... | joesan | <p>I think you may have found some outdated documentation for the helm chart generator. The canonical documentation for this is <a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md" rel="nofollow noreferrer">here</a>. Reading that implies several changes:</p>
<ol>
<li><p>Include the infla... | larsks |
<p>Referencing the bookinfo yaml here :
My gateway looks like :</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: bookinfo-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
name: https
number: 443
protocol: htt... | Jim | <p>In Istio, VirtualService TLS Match does not contains URI based routing (<a href="https://istio.io/latest/docs/reference/config/networking/virtual-service/#TLSMatchAttributes" rel="nofollow noreferrer">link</a>) . TLS is kind of opaque connection which can perform only host based routing (as hostname is present in th... | Atul |
<p>I'm trying to have a rule listening to a specific path containing a dollar sign like this:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: metadata-ingress
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "... | Dunge | <p>I can't reproduce your problem, but I thought I walk through my test setup and you can tell me if anything is different. For the purpose of testing different paths, I have two deployments using the <a href="https://hub.docker.com/r/traefik/whoami" rel="nofollow noreferrer"><code>traefik/whoami</code></a> image (this... | larsks |
<p>I have a web solution (angular application connecting to rest services) deployed in Kubernetes. I don't use any http sessions in my solution.</p>
<p>On upgrade of my rest services, I need to have both my pods with rest service version 1 and with rest service with version 2 available. Is there any way to setup a gat... | Elena | <h2>Separate components by deployment cycle</h2>
<p>I would recommend to separate <strong>frontend</strong> app and REST <strong>backend</strong>. (I don't know if you have this already)</p>
<p>By separation, you can roll out new versions independently, with a deployment cycle for each app.</p>
<h2>Two Deployment or... | Jonas |
<p>I'm reading through <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/access-authn-authz/authentication/</a>, but it is not giving any concrete commands and it is mostly focusing when we want to create everything from scra... | user2085124 | <p>The documentation which referred is for authentication with k8s (for api accesses). This is not for application layer authentication.</p>
<p>However I can suggest one way to implement application layer authentication without changing the service at all. You can redirect the traffic to nginx (or any other reverse pro... | Atul |
<p>I'm porting a node/react/webpack app to k8s, and am trying to configure a development environment that makes use of the hot-reloading feature of webpack. I'm hitting an error when running this with a shared volume on <code>minikube</code>: </p>
<pre><code>ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js?{"data... | Ben | <p>My hypothesis was borne out--the node modules were being built for the container, but overwritten by the <code>volumeMount</code>. The approach that worked best at this point was to do the requirements building as the entrypoint of the container, so that it would run when the container started up, rather than only a... | Ben |
<p>I have some stateless applications where I want one pod to be scheduled on each node (limited by a node selector). If I have 3 nodes in the cluster and one goes down then I should still have 2 pods (one on each node).</p>
<p>This is exactly what DaemonSets do, but DaemonSets have a couple of caveats to their usage ... | bcoughlan | <h1>Design for Availability</h1>
<blockquote>
<p>If I have 3 nodes in the cluster and one goes down then I should still have 2 pods (one on each node).</p>
</blockquote>
<p>I understand this as that you want to design your cluster for <strong>Availability</strong>. So the most important thing is that your replicas ... | Jonas |
<p>I have read about the various ways to run tasks periodically in a K8s cluster, but none of them seem to work well for this specific case. I have a deployment "my-depl" that can run an arbitrary number of pods and the task needs to execute periodically inside each pod (basically a shell command that "n... | ulim | <p>I think the simplest solution is to run <code>crond</code> (or an alternative of your choice) in a sidecar container (that is, another container in the same pod). Recall that all containers in a pod share the same network namespace, so <code>localhost</code> is the same thing for all containers.</p>
<p>This means yo... | larsks |
<p>I started last month in a new company. Where I will be responsible for the infrastructure and the backend of the SAAS.</p>
<p>We currently have one droplet/instance per customer. In the current phase of the company it is a good choice. But in the future when the number of instances grow, it will be difficult to mai... | Michael Tijhuis | <p>If you are serious about scaling, then you should <strong>rethink your application architecture</strong>. The most expensive part of computing is memory (RAM), so having dedicated memory per-customer will not allow you to scale.</p>
<p>Rather than keeping customers separate by using droplets, you should move this l... | John Rotenstein |
<p>Please correct me if I'm wrong. Up to my understanding, advantage of containers is that those don't need to supply the whole OS and they also don't need to execute it (but instead they utilize underlying OS which is provided e.g. by Docker) which leads to the saving of the resources -especially the memory.</p>
<p>My... | Gladik | <p>Short answer: you can pick any base image that's compatible with whatever is running inside your container.</p>
<blockquote>
<p>advantage of containers is that those don't need to supply the whole OS and they also don't need to execute it (but instead they utilize underlying OS which is provided e.g. by Docker)</p>
... | Max |
<p>I want to pass a certificate which is stored in the cluster as a secret. I have this piece of code failing:</p>
<pre><code>method(param1, param2, os.environ['CERTIFICATE']){
# param1: Does something
# param2: Does something
# param3: local path to pem cert used for auth
}
</code></pre>
<p>Error is th... | HC LW | <p>Why are you exposing the private key in an environment variable if your application expects a file? Just <a href="https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-pod-that-has-access-to-the-secret-data-through-a-volume" rel="nofollow noreferrer">mount the secret as a f... | larsks |
<p>I have a Security-group <code>Apple</code> which is attached to my application EKS worker nodes i.e. EC2 instances.
I have another Security-group <code>Mango</code> which is attached to the database EC2 instance, also EKS cluster.</p>
<p>When I whitelist <code>Apple</code> Security-group in <code>Mango</code>, the a... | Red Bottle | <p>When the rules of a Security Group refer to another Security Group, traffic will be permitted but <strong>only for the private IP address of instances</strong>.</p>
<p>If you are referring to the public IP address of the EC2 instance with the database, then the traffic goes out of the Internet Gateway and back 'into... | John Rotenstein |
<p>I am doing some practices. one of the test cases i tried to override the values of port value. while doing that getting an error as <strong>replace operation does not apply: doc is missing key: /spec/ports/port: missing value.</strong></p>
<pre><code>patches:
- target:
kind: Service
name: cdq-ui-servic... | Vijay | <p>You are trying to modify <code>/spec/ports/port</code>, but there is no such path in a Kubernetes service. Recall that a service looks like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app.kubernetes.io/name: MyApp
ports... | larsks |
<blockquote>
<p>I have connected a Kubernetes cluster in Gitlab as a project cluster
<a href="https://gitlab.com/steinKo/gitlabcicd/-/clusters/142291" rel="nofollow noreferrer">https://gitlab.com/steinKo/gitlabcicd/-/clusters/142291</a>
I want to acsess this cluster in Pulumi
Folow thw dcumentaion can I use Look up an ... | stein korsveien | <p>You can get access to the cluster using the following code:</p>
<pre class="lang-js prettyprint-override"><code>import * as gitlab from "@pulumi/gitlab";
const projectCluster = gitlab.ProjectCluster.get("mycluster", "clusterid");
</code></pre>
<p>where <code>mycluster</code> is the nam... | Piers Karsenbarg |
<p>I would like to use <code>kubectl</code> to print out all key-value pairs in my Secrets. I cannot figure out how to do this in one line with the <code>-o --jsonpath</code> flag or by piping into <code>jq</code>. I could certainly make a script to do this but I feel there must be a better way, given that the kubernet... | s g | <p>I read this question as asking for how to decode <em>all secrets</em> in one go. I built on the accepted answer to produce a one-liner to do this:</p>
<pre><code>kubectl get secrets -o json | jq '.items[] | {name: .metadata.name,data: .data|map_values(@base64d)}'
</code></pre>
<p>This has the added benefit of listi... | saranicole |
<p>In dag script</p>
<pre><code>PARAM = {
'key1' : 'value1',
'key2' : 'value2'
}
t1 = KubernetesPodOperator(
task_id=task_id,
name=task_name,
cmds=["pipenv", "run", "python3", "myscript.py"],
env_vars={
'GCS_PROJECT': GCS_PROJECT,
'GCS_BUC... | zZzZ | <p>Environment variables are <em>strings</em>. You cannot pass a structured variable like a dictionary in an environment variable unless you first convert it into a string (e.g, by serializing it to JSON). You could do this:</p>
<pre><code>t1 = KubernetesPodOperator(
task_id=task_id,
name=task_name,
cmds=[&... | larsks |
<p>I am running python application on K8s cluster in Stateless mode.</p>
<p>Right now we are using configmap & secret to store environment variables data. Using configmap and Secrets adding an environment variable to container os and application get it from os.</p>
<pre><code>app.config['test'] = os.environ.get("... | Harsh Manvar | <p>You can check <a href="https://learn.hashicorp.com/vault/identity-access-management/vault-agent-k8s" rel="nofollow noreferrer">Vault Agent with Kubernetes</a>. You may have to do some Kubernetes distro specific steps as well. </p>
| Kunal Deo |
<p>I am new to Kubernetes, I am looking to see if its possible to hook into the container execution life cycle events in the orchestration process so that I can call an API to pass the details of the container and see if its allowed to execute this container in the given environment, location etc.</p>
<p>An example che... | Kiran | <p>You can possibly set up an <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#imagepolicywebhook" rel="nofollow noreferrer">ImagePolicy</a> admission controller in the clusters, were you describes from what registers it is allowed to pull images.</p>
<p><a href="https://github.c... | Jonas |
<p>I have a deployment in which I want to populate pod with config files without using ConfigMap. </p>
| user9263173 | <p>You could also store your config files on a <code>PersistentVolume</code> and read those files at container startup. For more details on that topic please take a look at the K8S reference docs: <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">https://kubernetes.io/d... | Tommy Brettschneider |
<p>I've build a npm react-app that connects to a REST-backend using a given url.
To run the app on kubernetes, I've distributed the app and put it into an nginx container.
The app starts nicely, but I want to make the backend url configurable without having to rebuild the container image every time.
I don't know how to... | Urr4 | <p>You have several methods to achieve your objective</p>
<ul>
<li><a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">Use environment variables</a></li>
</ul>
<pre><code> apiVersion: v1
kind: Pod
metadata:
name: pod-name
... | mdaguete |
<p>Any example appsmith yaml for deploying appsmith since I don't want use helm in prod environment?</p>
| Duanjax | <p>There's no official direct YAML files for deploying Appsmith on Kubernetes today. The Helm chart at helm.appsmith.com, and as documented at <a href="https://docs.appsmith.com/getting-started/setup/installation-guides/kubernetes" rel="nofollow noreferrer">https://docs.appsmith.com/getting-started/setup/installation-g... | sharat87 |
<p>I've got a problem doing automatic heap dump to a mounted persistent volume in Microsoft Azure AKS (Kubernetes).</p>
<p>So the situation looks like this:</p>
<ul>
<li>Running program with parameters -Xmx200m causes out of memory
exception</li>
<li>After building, pushing and deploying docker image in AKS after few... | CodeDog | <p>I think the problem is the entrypoint.sh command. </p>
<pre><code>> java --help
Usage: java [options] <mainclass> [args...]
(to execute a class)
or java [options] -jar <jarfile> [args...]
(to execute a jar file)
</code></pre>
<p>Note that anything after the -jar are arguments pass... | DanLebrero |
<pre><code>apiVersion: v1
kind: Service
metadata:
name: my-emp
labels:
run: my-emp
spec:
ports:
– port: 80
protocol: TCP
targetPort: 8888
type: NodePort
selector:
run: my-emp
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-emp
spec:
replicas: 2
template:
m... | harish hari | <p>The problem is that you have "–" (an <a href="https://www.fileformat.info/info/unicode/char/2013/index.htm" rel="nofollow noreferrer">en dash</a>) where you want "-" (a <a href="https://www.fileformat.info/info/unicode/char/2d/index.htm" rel="nofollow noreferrer">hyphen</a>).</p>
<p>I'm guessing you wrote this in a... | Jordan Running |
<p>The only requirement in Kubernetes networking docs is to open firewall between pods. How does pod to service connectivity works, as service cluster ip range and pod cidrs are different?</p>
| user6317694 | <p>Services has an <em>virtual IP</em> assigned. When a Pod communicates with a Service, the Kubeproxy on the local node replaces the virtual IP with an IP to one of the pods that represents the service.</p>
<p><strong>An example:</strong>
E.g. Pod-A on Node-A want to send a request to Service-B. Service-B is for exam... | Jonas |
<p>I am playing around with writing a CRD for kubernetes, and am having trouble getting the code-generator to work. In particular, generating deepcopy functions is failing for a particular struct, which has reference to a <code>batch.JobTemplateSpec</code>. Commenting out that line fixes my issue.</p>
<p>I've already ... | user3769061 | <p>I experienced this issue trying to replicate the steps in <a href="https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/" rel="nofollow noreferrer">https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/</a> and found that I needed to change directory to avoid this... | William Rose |
<p>I am developing a series of microservices using Spring Boot and plan to deploy them on Kubernetes.</p>
<p>Some of the microservices are composed of an API which writes messages to a kafka queue and a listener which listens to the queue and performs the relevant actions (e.g. write to DB etc, construct messsages for... | Swordfish | <p>You can do as you describe, with environment variables, or you may also be interested in building your app with different profiles/bean configuration and make two different images.</p>
<p>In both cases, you should use two different Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deploy... | Jonas |
<p>An operator I'm building needs to talk to other Kubernetes clusters, are there any best practices on how to do that from within the operator that runs on Kubernetes?</p>
<p>Using <code>k8s.io/client-go/tools/clientcmd</code> package I can call <code>BuildConfigFromFlags</code> method passing <code>masterURL</code> ... | Galder Zamarreño | <p>Turns out it's quite easy to do, just call the following with the master URL and the token to access it:</p>
<pre><code>cfg, err := clientcmd.BuildConfigFromFlags(os.Getenv("MASTERURL"), os.Getenv("KUBECONFIG"))
cfg.BearerToken = os.Getenv("BEARERTOKEN")
</code></pre>
<p>It might also require:</p>
<pre><code>cfg.... | Galder Zamarreño |
<p>Note: this is more a bash/shell script issue than Kubernetes.</p>
<p>So I have one replica of a pod, and so <code>kubectl get pods</code> will only return one active replica.</p>
<p>Conceptually what I want to do is simple. I want to do a <code>kubectl logs my-pod-nnn1</code> with a watcher, HOWEVER when that pod t... | Oliver Williams | <p>as a rough outline for what you'll need to do, if I've read your needs right</p>
<pre class="lang-sh prettyprint-override"><code>slm-log-continue() {
while true ; do
PODLINE=$(kubectl get pod | grep regional-wkspce | grep Running | awk '/^regional-wkspce-.*/{print $1}')
if [[ -z "$PODLINE" ]]; th... | Michael Speer |
<p>I am trying to deploy an application to GCP on kubernetes, however, the deployment fails with the error <code>the job spec is invalid ... the field is immutable</code>.</p>
<p>In the migration job, I have a section of bash in the following format:</p>
<pre><code>args:
- |
/cloud_sql_proxy -instan... | David Essien | <p>I got the message <code>the job spec is invalid ... the field is immutable</code> for a different reason and wanted to briefly share it here.</p>
<p>I was trying to apply this yaml file:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
spec:
selector:
matchLabels:
app: application-name
..... | Lukasvan3L |
<p>Let's say we have a number of Kubernetes configuration files in a folder <code>kubernetes</code> and we want to apply them all:</p>
<pre><code>kubectl apply -f kubernetes -n MyNamespace
</code></pre>
<p>Some of these files contain environment variables which need to be substituted first (no <a href="https://github.c... | Max | <p>This works:</p>
<pre><code>for f in *.yaml; do envsubst < $f | kubectl apply -f -; done
</code></pre>
| Max |
<p>I have a node.js Project which I run as Docker-Container in different environments (local, stage, production) and therefor configure it via <code>.env</code>-Files. As always advised I don't store the <code>.env</code>-Files in my remote repository which is Gitlab. My production- and stage-systems are run as kuberne... | Daniel | <p>You should avoid copying <code>.env</code> file into the container altogether. Rather feed it from outside on runtime. There's a dedicated prop for that: <a href="https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option" rel="noreferrer">env_file</a>. </p>
<pre><code>web:
env_file:... | jayarjo |
<p>I have a kubernetes deployment with the below spec that gets installed via helm 3.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: gatekeeper
spec:
replicas: 1
template:
spec:
containers:
- name: gatekeeper
image: my-gatekeeper-image:some-sha
args:
... | Sankar | <p>It is not possible to do this without mounting a persistent volume. But the creation of persistent volume can be backed by just an in-memory store, instead of a block storage device. That way, we do not have to do any extra lifecycle management. The way to achieve that is:</p>
<pre><code>apiVersion: v1
kind: Config... | Sankar |
<p>I'm getting a <code>directory index of "/src/" is forbidden</code> error when setting up Docker Nginx configuration within Kubernetes. Here is the error from the Kubernetes logs.</p>
<pre><code>/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoi... | stevetronix | <p>I solved my error by changing my Angular <code>build</code> <code>outputPath</code> to <code>"dist"</code> rather than the default <code>"dist/my-project"</code> that was configured with the Angular installation.</p>
<pre><code>"architect": {
"build": {
"... | stevetronix |
<p>I want to disable basic auth only on a specific subpath of my App. How this can be done?</p>
<p>e.g.</p>
<p><strong>All subpaths should be basic auth secured:</strong></p>
<pre><code>/
</code></pre>
<p><strong>This path should be an exception and public reachable:</strong></p>
<pre><code>/#/public
</code></pr... | Tim Schwalbe | <p>The path you're trying to use ( <code>/#/public</code> ) never reachs the server, the client send only <code>/</code>. That's the reason why you are unable to disable de auth. </p>
<p>The symbol (#) is a separator for URL fragment identifier. The <a href="https://www.ietf.org/rfc/rfc2396.txt" rel="nofollow noreferr... | mdaguete |
<p>I tried to automate the rolling update when the configmap changes are made. But, I am confused about how can I verify if the rolling update is successful or not. I found out the command </p>
<pre><code>kubectl rollout status deployment test-app -n test
</code></pre>
<p>But I guess this is used when we are performi... | programmingtech | <h2>ConfigMap generation and rolling update</h2>
<blockquote>
<p>I tried to automate the rolling update when the configmap changes are made</p>
</blockquote>
<p>It is a good practice to <strong>create new</strong> resources instead of <strong>mutating</strong> (update in-place). <a href="https://kubernetes.io/docs/... | Jonas |
<p>I want to implement custom logic to determine readiness for my pod, and I went over this: <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.kubernetes-probes.external-state" rel="noreferrer">https://docs.spring.io/spring-boot/docs/current/reference/html/actuator... | Hummus | <p>To expand KrzysztofS's answer:</p>
<p>First, create a custom health indicator like this:</p>
<pre class="lang-java prettyprint-override"><code>import java.util.concurrent.atomic.AtomicBoolean;
import org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator;
import org.springframework.boot.availabi... | izogfif |
<p>I have a client that is calling the Kubernetes REST API using the library from <a href="https://github.com/kubernetes-client/csharp" rel="nofollow noreferrer">https://github.com/kubernetes-client/csharp</a>. When I pass in client certificate credentials, I get the following error:</p>
<pre><code>System.Net.Http.Htt... | Phyxx | <p>The trick to solving this was to configure the properties on the private key. In particular, the <code>X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable</code> flags needed to be set.</p>
<pre><code>var context = Yaml.LoadFromString<K8SConfiguration>(config... | Phyxx |
<p>Have been trying to setup Kubeflow on bare metal (on prem etc) on a shared server i.e. not my laptop. I followed the <a href="https://www.kubeflow.org/docs/started/k8s/kfctl-k8s-istio/" rel="nofollow noreferrer">Kubeflow Deployment with kfctl_k8s_istio</a> setup instructions which all well.</p>
<p>Under "Access Kub... | CpILL | <p>So, in the end i went with k3s as it is a one-liner to setup</p>
<pre class="lang-sh prettyprint-override"><code>curl -sfL https://get.k3s.io | sh -
</code></pre>
<p>and there are <a href="https://rancher.com/docs/k3s/latest/en/installation/install-options/" rel="nofollow noreferrer">many options</a> which you can s... | CpILL |
<p>After learning that we should have used a <code>StatefulSet</code> instead of a <code>Deployment</code> in order to be able to attach the same persistent volume to multiple pods and especially pods on different nodes, I tried changing our config accordingly.</p>
<p>However, even when using the same name for the vol... | raucao | <p>OK, so I spent quite some time trying out all kinds of different configs until finally learning that GCE persistent disks simply don't support <code>ReadWriteMany</code> to begin with.</p>
<p>The <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/persistent-volumes" rel="nofollow noreferrer">GKE docs... | raucao |
<p>I am wondering about Kubernetes's secret management. I have a process that generates a lot of secrets that only need to live for a short while.</p>
<p>I would like for these secrets to come from Vault or a similar service in the future. However, for right now, I don't have the time to implement this. </p>
<p>If so... | Aaron | <p>Kubernetes has no notion of secret lifetime.</p>
<ul>
<li><p>you can implement a <code>CronJob</code> in charge of checking then deleting secret in specific namespace(s) if the secret is older that a specific time.</p></li>
<li><p>you can create all your secrets in a temporary namespace, destroying the namespace wi... | Kartoch |
<p>We are having problem with several deployments in our cluster that do not seem to be working. But I am a bit apprehensive in touching these, since they are part of the kube-system namespace. I am also unsure as what the correct approach to getting them into an OK state is. </p>
<p>I currently have two daemonsets th... | Andreas | <p>A DaemonSet is creating a pod in each node of your Kubernetes cluster.</p>
<p>If the Kubernetes scheduler cannot schedule any pod, there are several possibilities:</p>
<ul>
<li>Pod spec has a too high memory requests resource for the memory node capacity, look at the value of <code>spec.containers[].resources.reques... | Kartoch |
<p>I have 2-3 machine learning models I am trying to host via Kubernetes. I don't get much usage on the models right now, but they are critical and need to be available when called upon.</p>
<p>I am providing access to the models via a flask app and am using a load balancer to route traffic to the flask app.</p>
<p>E... | echan00 | <blockquote>
<p>Isn't this the job of the load balancer? To make sure requests are routed appropriately?</p>
</blockquote>
<p>Yes, you are right. But...</p>
<blockquote>
<p>replicas: 1</p>
</blockquote>
<p>You only use a single replica, so the load balancer has no options to route to other <em>instances</em> of ... | Jonas |
<p>I am having difficulty getting a kubernetes livenessProbe exec command to work with environment variables.
My goal is for the liveness probe to monitor memory usage on the pod as well as also perform an httpGet health check.</p>
<p>"If container memory usage exceeds 90% of the resource limits OR the http respon... | david_beauchamp | <p>Looks like the shell is seeing your whole command as a filename to execute.</p>
<p>I would remove the outer quotes</p>
<pre><code>livenessProbe:
exec:
command:
- sh
- -c
- |-
used=$(awk '{ print int($1/1.049e+6) }' /sys/fs/cgroup/memory/memory.usage_in_bytes);
thresh=$(awk '{ print int(... | Andrew McGuinness |
<p>I have a StatefulSet that has 2 replicas. I want to create an endpoint to be able to reach any of this replica, passing it hostname id, and in a way that if I scale it to more replicas, the new pods need to be reachable.</p>
<p>I can do this creating an Ingress like this:</p>
<pre><code>apiVersion: voyager.appscod... | fabriciols | <p>You need a program (operator) listening to the Kubernetes API, and patching the ingress resource every time teh number of pods in the statefull set.</p>
<p>Using go:</p>
<ul>
<li>watching a resource: <a href="https://medium.com/programming-kubernetes/building-stuff-with-the-kubernetes-api-part-4-using-go-b1d0e3c1c... | Kartoch |
<p>While running this command k</p>
<blockquote>
<p>kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml</p>
</blockquote>
<p>I am getting this error</p>
<blockquote>
<p>Error from server (NotFound): error when deleting
"samples/bookinfo/networking/bookinfo-gateway.yaml": the server could
not f... | Salman | <p>Upgrading to latest kubectl solved the issue</p>
| Salman |
<p>Using kubectl command line, is it possible to define the exact pod name?</p>
<p>I have tried with</p>
<pre><code>kubectl run $pod-name --image imageX
</code></pre>
<p>However, the resulted pod name is something like <code>$pod-name-xx-yyy-nnn</code>.
So without using a yaml file, can I define the pod name using k... | sqr | <p><code>kubectl run</code> creates a <em>Deployment</em> by default. A <em>Deployment</em> starts a <em>ReplicaSet</em> that manages the pods/replicas... and therefore has a generated <em>pod name</em>.</p>
<h2>Run pod</h2>
<p>To run a single pod you can add <code>--restart=Never</code> to the <code>kubectl run</cod... | Jonas |
<p>We are on Kubernetes 1.9.0 and wonder if there is way to access an "ordinal index" of a pod with in its statefulset configuration file. We like to dynamically assign a value (that's derived from the ordinal index) to the pod's label and later use it for setting pod affinity (or antiaffinity) under spec.</p>
<p>Alte... | Raj N | <p><a href="https://github.com/kubernetes/kubernetes/issues/30427" rel="noreferrer">Right now</a> the only option is to extract index from host name</p>
<pre><code>lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "export INDEX=${HOSTNAME##*-}"]
</code></pre>
| Maciek Sawicki |
<p>In my Kubernetes installation, I can see cAdvisor reports a measurement called "container_cpu_load_average_10s" for each pod/container. I get values such as 232, 6512 and so on.</p>
<p>So, what is the unit of measure for CPU load here? To me "CPU Load" and "CPU Usage" are used interchangeably, so I can't understand... | Michel Gokan Khan | <p>It is the number of tasks. A very nice explanation can be found here: <a href="https://serverfault.com/questions/667078/high-cpu-utilization-but-low-load-average">https://serverfault.com/questions/667078/high-cpu-utilization-but-low-load-average</a></p>
| Michel Gokan Khan |
<p>I have an applications Docker image which starts a mongodb instance on a random port. When I create a kubernetes Pod with application image; application gets successfully initialized and a mongodb instance gets up on a random port as <strong>localhost:port</strong> without any error.</p>
<p>However, when I create a... | Jaraws | <p>Instead of listening on <code>localhost:port</code>, you should try configure MongoDB to listening on <code>0.0.0.0:port</code>. This has helped me when having a similar issue with another app.</p>
<h2>Configure MongoDB to listen to all interfaces</h2>
<p>Your <code>mongod.conf</code></p>
<pre><code># /etc/mongod... | Jonas |
<p>Can anybody let me know how to config
kubernetes pods to send alert to slack channel ?</p>
<p>Thanks in Advance
Rishabh Gupta</p>
| Rishabh Gupta | <p>Kubernetes dosn't provide out of the box slack integration.</p>
<p>There are few projects that you can use:</p>
<ul>
<li><p><a href="https://hub.kubeapps.com/charts/stable/kube-slack" rel="nofollow noreferrer">https://hub.kubeapps.com/charts/stable/kube-slack</a> - runs on Kubernetes, watches for evnets and sends ... | Maciek Sawicki |
<p>I used kubeadm to deploy my Kubernetes dashboard.
When I tried to deploy the <em>nginx-ingress-controller</em> in my dev namespace with default service-account, I was getting <em>liveness probe</em> and readiness failing with status code.</p>
<p>nginx-ingress-controller image is</p>
<pre><code>gcr.io/google_containe... | krish123 | <p>You're most likely adding too little resources try removing the resources for debugging</p>
| Ami Mahloof |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.