Question
stringlengths
65
39.6k
QuestionAuthor
stringlengths
3
30
Answer
stringlengths
38
29.1k
AnswerAuthor
stringlengths
3
30
<p>I am in the process of migrating a traditional nginx-fronted reverse proxy to a Kubernetes cluster with Traefik. The end goal is to move everything onto microservices but that might take a while. In the meantime, how do I create an IngressRoute CRD that routes to a legacy system hosted outside the cluster? This woul...
ystan-
<p>Found the answer while solving an unrelated problem - turns out Traefik isn't involved in the equation at all - the IngressRoute should remain as-is while the standard Kubernetes service needs to use the type <code>ExternalName</code> instead of <code>ClusterIP</code>/<code>NodePort</code>/<code>LoadBalancer</code>....
ystan-
<p>I have a containerized app that use Apache Ignite thick client. This uses bi directional communication with the Ignite cluster outside of Kubernetes. When it connects to Ignite it advertises it's I.P and port to Ignite. Ignite connects back to thick client for discovery/stats and other management tasks.</p> <p>Obvio...
user432024
<p>As Chris pointed out, init containers is the only way to do this... Though it would have been nice for Service Api to expose it as env var.</p> <pre><code>apiVersion: apps/v1 kind: Deployment metadata: labels: run: my-app name: my-app spec: replicas: 1 selector: matchLabels: run: my-app templ...
user432024
<p>When I SSH onto a <strong>running</strong> Docker container in a Kubernetes cluster and run <code>os.getenv(&quot;HOSTNAME&quot;)</code> from within a python interpreter, I am able to see the name of the <strong>deployment</strong> being used.</p> <p>But if I try and run <code>os.getenv(&quot;HOSTNAME&quot;)</code> ...
Felipe
<p>The problem was that I was running scripts in the <code>RUN</code> step of the <code>Dockerfile</code>.</p> <p>This means that this code runs at <strong>image build time</strong>, so whatever Environment variables I was able to retrieve were those of the build-time environment.</p> <p>I was able to correctly retriev...
Felipe
<p>I keep seeing <code>Back-off restarting failed container</code> when try to use docker official image <a href="https://hub.docker.com/_/hello-world" rel="nofollow noreferrer">https://hub.docker.com/_/hello-world</a> to create any pod\deployment. When I switch to other images like <code>nginx</code> everything works ...
Chen Zhao
<p><code>hello-world</code> image is not a long-running process: it just outputs text and stops.</p> <p>Kubernetes Pod is by default expecting long-running processes, and if it stops it automatically restart the container.</p> <p>This behavior is defined by the <a href="https://kubernetes.io/docs/concepts/workloads/pod...
zigarn
<p>I'm using the <code>kubectl rollout</code> command to update my deployment. But since my project is a NodeJS Project. The <code>npm run start</code> will take some take(a few seconds before the application is actually running.) But Kubernetes will drop the old pods immediately after the <code>npm run start</code> is...
Zichzheng
<p>Use a startup probe on your container. <a href="https://docs.openshift.com/container-platform/4.11/applications/application-health.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/4.11/applications/application-health.html</a> . Pods don't count as &quot;ready&quot; until all of their con...
David Ogren
<p>I need help with making the XFS quotas work in Kubernetes on DigitalOcean.</p> <p>My problem essentially is that the <code>xfs_quota</code> tool seems to work only when one has also an access to the disk device, not only to the mounted volume. However, whatever I try, I can't seem to get access both to the device an...
Aleš Krajník
<p>Timo here from the Managed Kubernetes (DOKS) team at DigitalOcean.</p> <p>What you are missing is the host system mount of the <code>/dev</code> directory. If you add both</p> <pre><code> volumes: - name: device-dir hostPath: path: /dev </code></pre> <p>and</p> <pre><code>volumeMounts: - name: device-dir ...
Timo Reimann
<p>According to the <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes" rel="nofollow noreferrer">Kubernetes documentation</a>,</p> <blockquote> <p>If the readiness probe fails, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match t...
user11081980
<h2>What are readiness probes for?</h2> <p>Containers can use readiness probes to know whether the container being probed is <em>ready</em> to start receiving network traffic. If your container enters a state where it is still alive but cannot handle incoming network traffic (a common scenario during startup), you want...
Highway of Life
<p>I want Ingress to redirect a specific subdomain to one backend and all others to other backend. Basically, I want to define a rule something like the following:</p> <blockquote> <p>If subdomain is <code>foo.bar.com</code> then go to <code>s1</code>, for all other subdomains go to <code>s2</code></p> </blockquote>...
fyelci
<p>This is now possible in <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#hostname-wildcards" rel="nofollow noreferrer">Kubernetes</a> with nginx:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: ingress.kubernetes.io/ssl-redirect: &quot;false&quot; ...
Nathaniel Ford
<p>I have a scenario where I need to push application logs running on EKS Cluster to separate cloudwatch log streams. I have followed the below link, which pushes all logs to cloudwatch using fluentd. But the issue is, it pushes logs to a single log stream only.</p> <blockquote> <p><a href="https://github.com/aws-sa...
Divy
<p><a href="https://collectord.io" rel="nofollow noreferrer">Collectord</a> now supports AWS CloudWatch Logs (and S3/Athena/Glue). It gives you flexibility to choose to what LogGroup and LogStream you want to forward the data (if the default does work for you).</p> <ul> <li><a href="https://collectord.io/docs/cloudwat...
outcoldman
<p>I'm creating a web application, where I'm using Kubernetes, in my backend application I have a server that listens to socket connections on port 3000, I deployed my application (front and back) and it works fine I can get data by HTTP requests ... now I want to establish a socket connection with my backend applicati...
Sandukhan
<p>Each deployment (frontend and backend) should have its own service.</p> <p>Ingress (web) traffic would be routed to the frontend service:</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Service metadata: name: frontend-svc spec: selector: app: frontend ports: - protocol: TCP ...
Highway of Life
<p>I have created a custom Splunk forwarder image.</p> <p>Image name: <code>vrathore/splunkuniversalforwarder</code></p> <p>I have verified that the log is pushing to the server. I am using dummy log present in my host (<code>c/Users/var/log</code>). If I run this Docker command:</p> <pre><code>docker run --name spl...
gamechanger17
<p>You need to define an emptyDir type volume and attach it to both containers. Assuming that the logs from the app are under <code>/var/log/myapp/</code> (I have added the second container as well)</p> <pre><code>spec: revisionHistoryLimit: 5 strategy: type: RollingUpdate rollingUpdate: maxUnavailab...
outcoldman
<p>in my k8s system I have a nginx ingress controller as LoadBalancer and accessing it to ddns adress like hedehodo.ddns.net and this triggering to forward web traffic to another nginx port. Now I deployed another nginx which works on node.js app but I cannot forward nginx ingress controller for any request to port 300...
tuker
<p>Each host cannot share multiple duplicate paths, so in your example, the request to host: <code>hedehodo.ddns.net</code> will always map to the first service listed: <code>my-nginx:80</code>.</p> <p>To use another service, you have to specify a different path. That path can use any service that you want. Your ingres...
Highway of Life
<p>I have issue with deploying angular app on minikube. I am not able to expose the running angular container on browser.</p> <p>Below are my setup files.</p> <h2>Minikube start command</h2> <pre><code>$ minikube start --driver=docker </code></pre> <h2>Dockerfile</h2> <pre><code>FROM node:10-alpine AS node WORKDIR...
Kavinkumar
<p>The problem seems to be the use of the <code>docker</code> driver: the minikube IP is a container IP and cannot be accessed outside of the docker host.</p> <p>The only way to expose the nodePort outside would be to publish the port on the <strong>running</strong> minikube container (which only expose this: <code>12...
zigarn
<p>I have to convert an existing <code>nodejs</code> application to run on the RedHat OpenShift container platform. Currently, the application is run as follows:</p> <pre><code>node index.js $HOME/arg1.json $HOME/arg2.json </code></pre> <p>Using files for arguments is <strong>important</strong> for this application s...
cogitoergosum
<p>You mention in your first comment the requirement that filenames be specified at runtime. Something like this will work:</p> <pre><code>ENV work /app WORKDIR $work COPY ./arg1.json ./arg2.json $work/ CMD["node", "index.js", "./arg1.json", "arg2.json"] </code></pre> <p>Runtime command:</p> <pre><code>docker run -...
Rondo
<p>we recently updated our AKS cluster from 1.17.x to 1.19.x and recognised that the format of our custom application logs in <code>/var/lib/docker/containers</code> changed.</p> <p>Before the update it looked like this: <a href="https://i.stack.imgur.com/0GJio.png" rel="nofollow noreferrer"><img src="https://i.stack.i...
sschoebinger
<p>The format of the logs are defined by the container runtime. It seems before you were parsing logs from docker container runtime, and now it is containerd (<a href="https://azure.microsoft.com/en-us/updates/azure-kubernetes-service-aks-support-for-containerd-runtime-is-in-preview/" rel="noreferrer">https://azure.mic...
outcoldman
<p>I am running a Dev Linux machine and setting up a local Kafka for development on Kubernetes(moving from docker-compose for learning and practicing pourposes) with <a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">Kind</a> and everything works fine but I am now trying to map volumes from Kafka and Zookeep...
groo
<p>I finally sort it out. I had 2 main issues in my initial setup, which are now fixed.</p> <p>Folders used to persist data on local host need to be created beforehand so they have the same <code>uid:guid</code> from the one used to create the initial Kind cluster, if this is not in place the folders will not have the ...
groo
<p>I'm trying to use a container that contains a Java tool to do some DB migrations on a MySQL database in a Kubernetes Job.</p> <p>When I run the container locally in Docker (using a MySQL container in the same network), the tool runs as expected. And if I create a Pod using the container and set the command arguments...
wtfc63
<p>The problem was that Istio doesn't play nice with Kubernetes Jobs (I forgot to mention that Istio is active on the Namespace, sorry).</p> <p>Once I added a short delay (<code>sleep 5</code> before starting the Java tool), the connection could be established.</p> <p>But then I had another issue: After the container t...
wtfc63
<p>I want to create a ReplicaSet with separate pods.</p> <h3><code>Pods</code></h3> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Pod metadata: name: user-pod labels: app: user-pod spec: containers: - name: user-container image: kia9372/store-user </code></pre> <h3><code>Rep...
Mr-Programer
<p>matchlabels is missing. Also your pod definition does not define a matching label.</p> <p>Have a look at the docs for a proper setup: <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/</a></p...
Aydin K.
<p>I'm working on a project where I need to spawn 1 instance per user (customer).</p> <p>I figured it makes sense to create some sort of manager to handle that and host it somewhere. Kubernetes seems like a good choice since it can be hosted virtually anywhere and it will automate a lot of things (e.g. ensuring instanc...
Pithikos
<p>I've done some progress and thought to share.</p> <p>Essentially you need to interact with Kubernetes REST API directly <strong>instead of applying a static yaml or using <code>kubectl</code></strong>, ideally with one of the numerous clients out there.</p> <p>In our case there's two options:</p> <ol> <li>Create a n...
Pithikos
<p>Following this <a href="https://github.com/maciekrb/gcs-fuse-sample" rel="nofollow noreferrer">guide</a>,I am trying to run gcsfuse inside a pod in GKE. Below is the deployment manifest that I am using:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: gcsfuse-test spec: replicas: 1 ...
Amit Yadav
<p>Edit Apr 26, 2022: for a further developed repo derived from this answer, <strong>see <a href="https://github.com/samos123/gke-gcs-fuse-unprivileged" rel="nofollow noreferrer">https://github.com/samos123/gke-gcs-fuse-unprivileged</a></strong></p> <p>Now it finally is possible to mount devices without <code>privilege...
Petrus Repo
<p>I have a k8s cluster with an ingress nginx as a reverse proxy. I am using letsencrypt to generate TLS certificate</p> <pre><code>apiVersion: cert-manager.io/v1alpha2 kind: ClusterIssuer metadata: name: letsencrypt spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: ****** privat...
soling
<p><em>Warning! Please plan OS upgrade path. The below advice should be applied only in emergency situation to quickly fix a critical system.</em></p> <p>Your team missed OS update or <code>ca-certificates</code> package update. Below solution works on old Debian/Ubuntu systems.</p> <p>First check if you have offending...
gertas
<p>We have helm charts to deploy our application. We use a <code>configuration.json</code> file for application properties and load them to config map. But users typically use their own configuration file. </p> <p>Default configuration.json file is packaged inside helm charts under data directoty. This file is read as...
Dheeraj Joshi
<p>Adding custom configuration to a values file and execute <code>helm install</code> using <code>-f</code> flag is a solution.</p> <p>customValues.yaml</p> <pre><code>overrideConfig: true customConfig:{ //Add your custom json here as variable value } </code></pre> <p>Config map yaml </p> <pre><code>#If custom valu...
Dheeraj Joshi
<p>I have a Google Kubernetes cluster with its associated VM instance. How can I change the image of the disk used by that VM instance to Windows Server Edition? I know it's possible to create a VM instance from a Windows Server Image, but how do I change the current image of my existing VM instance to a Windows Server...
Harry Stuart
<p>As of writing this answer(December 2018), Google Kubernetes engine supports two operating systems:</p> <ul> <li>Container-Optimized OS (from Google) </li> <li>Ubuntu</li> </ul> <p>More details about supported image types you can find <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/node-images" re...
Caner
<p>Some kubernetes resources have a length limit of 63 characters (presumably because they need to be valid DNS names). Which are they?</p>
AndreKR
<p>Those are <strong>at least</strong>:</p> <ul> <li>Pod names</li> <li>Service names</li> <li>The name part of a label key</li> </ul> <pre><code> labels: example.com/environment: production &lt;-- the string "environment" </code></pre> <ul> <li>The label value</li> </ul> <pre><code> ...
AndreKR
<p>When I browse my website from Chrome, it says that the certificate is invalid, and if I check the details, this is what I see:</p> <pre><code>Issued to: Common Name (CN) test.x.example.com Organization (O) cert-manager Organizational Unit (OU) &lt;Not Part Of Certificate&gt; Issued by: Common Name (CN) ...
rubik
<p>I finally solved the issue mostly by editing the Certificate configuration. I also switched from an Issuer to a ClusterIssuer but that should not have any impact on this issue. I think the problem was ACME verification.</p> <p>Here is my new ClusterIssuer:</p> <pre><code>apiVersion: certmanager.k8s.io/v1alpha1 kin...
rubik
<p>First day helm user here. Trying to understand how to build common templates for k8s resources. Let's say I have 10 cron jobs within single chart, all of them different by args and names only. Today 10 full job manifests exists and 95% of manifest content is equal. I want to move common part in template and create 1...
Georgy Gobozov
<p>Solution found</p> <p><strong>Option 1</strong> Use example from helm github <a href="https://github.com/helm/charts/tree/master/incubator/common" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/incubator/common</a> Solution based on yaml merging and values override. Pretty flexible, allow you...
Georgy Gobozov
<p>I use <a href="https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.24.1" rel="noreferrer">nginx-ingress-controller:0.24.1</a> (<a href="https://github.com/kubernetes/ingress-nginx/issues/1809" rel="noreferrer">Inspired by</a>)</p> <p>I would like to set a DNS A record to LB IP address, so it would conn...
ses
<p>You can split your ingress into two where one defines <code>path: /*</code> with necessary annotation and another ingress that defines <code>path: /c/</code>.</p> <p>The problem with your single ingress is that its annotations that you want to apply to <code>path: /*</code> only gets applied to other paths as well....
hers19
<p>Guess you have deployed a service which's using certificates in order to create tls/https communications.</p> <p>So, I need to deploy java client containers which have to trust with these certificates.</p> <p>Nevertheless, java looks up in truststores in order to check whether the certificate is valid.</p> <p>As ...
Jordi
<p>RedHat has a tutorial on how to do this on OpenShift:</p> <p><a href="https://developers.redhat.com/blog/2017/11/22/dynamically-creating-java-keystores-openshift/" rel="noreferrer">https://developers.redhat.com/blog/2017/11/22/dynamically-creating-java-keystores-openshift/</a></p> <p>It uses OpenShifts built in CA...
James Roper
<p>I'm trying to bootstrap the k8s cluster using weave as cni plugin which was originally configured without --pod-cidr and weave plugin</p> <pre><code>root@kube1:/etc/systemd/system/kubelet.service.d# kubectl get no NAME STATUS ROLES AGE VERSION kube1 Ready master 31m v1.18.2 kube2 Ready &lt;n...
JPNagarajan
<p>By default Weave Net uses its own IP allocator, which can be configured via the environment variable <code>IPALLOC_RANGE</code>. <a href="https://www.weave.works/docs/net/latest/kubernetes/kube-addon/#-changing-configuration-options" rel="nofollow noreferrer">Link to docs</a></p> <p>If you change the CNI config on ...
Bryan
<p>I have an anti-affinity rule that asks kubernetes to schedule pods from the same deployment onto <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#always-co-located-in-the-same-node" rel="nofollow noreferrer">different nodes</a>, we've used it successfully for a long time.</p> <pre><code>a...
Brad Koch
<p>There's a slight difference between the syntax of required and preferred, note the reference to <code>podAffinityTerm</code> in the error message path:</p> <pre><code>spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey </code></pre> <p>The corr...
Brad Koch
<p>I have a situation where I would like to run two kubernetes clusters in the same AWS VPC sharing subnets. This seems to work okay except the weave CNI plugin seems to discover nodes in the other cluster. These nodes get rejected with "IP allocation was seeded by different peers" which makes sense. They are differen...
cchanley2003
<p>There is a demo <a href="https://github.com/weaveworks-experiments/demo-weave-kube-hybrid" rel="nofollow noreferrer">here</a> where Weave Net is run across multiple clusters. This demo was shown in the keynote for KubeCon 2016.</p> <p>The most important part is <a href="https://github.com/weaveworks-experiments/dem...
Bryan
<p>My understanding is that setting the <code>Service</code> type to <code>LoadBalancer</code> creates a new Azure Load Balancer and assigns an IP address to the <code>Service</code>. Does this mean that I can have multiple Services using port 80? If the app behind my <code>Service</code> (an ASP.NET Core app) can hand...
Muhammad Rehan Saeed
<p>There is a nice article <a href="https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0" rel="noreferrer">here</a> which describe the differences on Service(Load Balancer) and Ingress.</p> <p>In summary, you can have multiple Service(Load Balancer) in the ...
Diego Mendes
<p>I am writing an Operator for Kubernetes using the Operator SDK and have a question about logging (I am still rather new to Go).</p> <p>I have setup a logger in my controller that I have attached a UUID to as a Trace ID</p> <pre><code>func (r *MyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resul...
apr_1985
<p>Not at all sure of this answer and I too wonder why logging and logging sinks are built so complex (refer <a href="https://dave.cheney.net/2015/11/05/lets-talk-about-logging" rel="nofollow noreferrer">https://dave.cheney.net/2015/11/05/lets-talk-about-logging</a> which I found reffered in logr <a href="https://pkg.g...
Alex Punnen
<p>I'm trying to run Ceph on (micro)K8s which running on my Ubuntu WSL distory.</p> <p>OSD pods are not being created because there is no supported device is available (see logs below).</p> <p>Ceph is configured to <a href="https://rook.io/docs/rook/v1.5/ceph-common-issues.html#osd-pods-are-not-created-on-my-devices" r...
a11hard
<p>Took me a couple days to sort out but, to get this working you need to:</p> <ul> <li>Get the developer preview of Windows 10 so you have the --mount option for WSL</li> <li>Create a VHDX on your Windows Host. You can do this through your Disk Manager and creating a dynamic VHDX under the actions menu.</li> <li>Mount...
a11hard
<p>I'm installing pod network addon flannel to my cluster.</p> <p>On the official kubernetes doc, the url to install flannel add-on is</p> <pre><code>kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/62e44c867a2846fefb68bd5f178daf4da3095ccb/Documentation/kube-flannel.yml </code></pre> <p>and on the g...
Vincent
<p>They are the same document, but potentially different versions. You can view the <a href="https://github.com/coreos/flannel/commits/master/Documentation/kube-flannel.yml" rel="nofollow noreferrer">version history</a>, and observe that <code>62e44c867a28</code> is (as of this answer) the second-most-recent version.</...
Bryan
<p>My deployment pod was evicted due to memory consumption:</p> <pre><code> Type Reason Age From Message ---- ------ ---- ---- ------- Warning Evicted 1h kubelet, gke-XXX-default-pool-XXX The node was low ...
Mugen
<p>Even though the node has 3.75 GB of total memory, is very likely that the capacity allocatable is not all 3.75 GB.</p> <p>Kubernetes reserve some capacity for the system services to avoid containers consuming too much resources in the node affecting the operation of systems services .</p> <p>From the <a href="http...
Diego Mendes
<p>I have deployed some simple services as a proof of concept: an nginx web server patched with <a href="https://stackoverflow.com/a/8217856/735231">https://stackoverflow.com/a/8217856/735231</a> for high performance.</p> <p>I also edited <code>/etc/nginx/conf.d/default.conf</code> so that the line <code>listen 80;</c...
ssice
<p>If I understood correctly, you did run the load testing on same cluster/nodes as your pods, this will definitely have an impact on the overall result, I would recommend you split the client from the server on separate nodes so that one does not affect each other.</p> <p>For the values you reported, is clearly visib...
Diego Mendes
<h2>Question</h2> <p>Can I get nginx to call another microservice inside of AKS k8s prior to it routing to the requested api? - the goal being to speed up requests (fewer hops) and simplify build and deployment (fewer services).</p> <h2>Explanation</h2> <p>In our currently deployed Azure AKS (Kubernetes) cluster, we...
Kieron
<p>ProxyKit (<a href="https://github.com/damianh/ProxyKit" rel="nofollow noreferrer">https://github.com/damianh/ProxyKit</a>) could be a good alternative to nginx - it allows you to easily add custom logic to certain requests (for example I lookup API keys based on a tenant in URL) and you can cache the responses using...
Jakub Konecki
<p>we have couchbase cluster deployed on Openshift. Couchbase web console is opening but we are not able to add buckets to it. For that we have to mention buckets in Ymal file and then redeploy using openshift operator. Is it the general behavior or we can add buckets without re-deployment of cluster ??</p>
Gurmeet
<p>Yes, that's the intended behavior. Much of the cluster management, like buckets and adding of nodes, is under the control of the operator.</p> <p>It is possible to <a href="https://docs.couchbase.com/operator/current/couchbase-cluster-config.html#disablebucketmanagement" rel="nofollow noreferrer">disable bucket ma...
Matt Ingenthron
<p>How does kubernetes pod gets IP instead of container instead of it as CNI plugin works at container level?</p> <p>How all containers of same pod share same network stack?</p>
Bharath Thiruveedula
<p>Containers use a feature from the kernel called <strong><em>virtual network interface</em></strong>, the virtual network Interface( lets name it <strong>veth0</strong>) is created and then assigned to a namespace, when a container is created, it is also assigned to a namespace, when multiple containers are created w...
Diego Mendes
<p>I'm trying to create a user in a Kubernetes cluster.</p> <p>I spinned up 2 droplets on DigitalOcean using a Terraform script of mine.</p> <p>Then I logged in the master node droplet using <code>ssh</code>:</p> <pre><code>doctl compute ssh droplet1 </code></pre> <p>Following this, I created a new cluster and a na...
Stephane
<blockquote> <p>But this is only some client side configuration as I understand.</p> <p>What command I should use to create the user ?</p> </blockquote> <p>Kubernetes doesn't provide user management. This is handled through x509 certificates that can be signed by your cluster CA.</p> <p>First, you'll need to create a K...
Rawkode
<p>In Kubernetes is it possible to add <code>hostPath</code> storage in Statefulset. If so, can someone help me with some example?</p>
Dinesh
<p>Yes but it is definitely for testing purposes.</p> <p>First you need to create as many Persistent Volume as you need</p> <pre><code>kind: PersistentVolume apiVersion: v1 metadata: name: hp-pv-001 labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWri...
Jcs
<p>I have one config file for kube-apiserver.</p> <pre><code>KUBE_APISERVER_OPTS=" --logtostderr=true --v=4 --etcd-servers=https://172.16.0.2:2379,https://172.16.0.3:2379 --bind-address=172.16.0.2 --secure-port=6443 --advertise-address=172.16.0.2 --allow-privileged=true --service-cluster-ip-range=10.0.0.0/24 --enable-...
jiang li
<p><code>systemd</code> environment files must be formatted correctly, which includes escaping the end of your lines if you wish to do multi line values:</p> <pre><code>APISERVER=" \ --arg-1=2 \ --arg-2=3 \ --arg-3=4 \ " </code></pre>
Rawkode
<p>I have tomcat as docker image. I have 3 xmls/property files to bring up the war in my tomcat I need to write init container which will </p> <ol> <li>have a script [shell or python]</li> <li>create a volume and mount it to the main container</li> <li>copy the property files from my local system to the mounted volume...
Tuhin Subhra Mandal
<p>You have to create a volume and mount on both containers. On Init container you run the script to copy the files to the mounted volume.</p> <p>Instead of using a local file, I would suggest you use a blob storage to copy you files over, will make it much more simple.</p> <p><a href="https://kubernetes.io/docs/task...
Diego Mendes
<p>I am fairly new to networkpolicies on Calico. I have created the following NetworkPolicy on my cluster:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: nginxnp-po namespace: default spec: podSelector: matchLabels: run: nginxnp policyTypes: - Ingress ingres...
stiller_leser
<p>There is a typo in the NetworkPolicy template <code>acces: frontend</code> should be <code>access: frontend</code></p> <pre><code> ingress: - from: - podSelector: matchLabels: acces: frontend </code></pre>
Diego Mendes
<p>I have 3 Linux VM on my MBP, and all 3 VM can share the same disk on MBP's disk (I have no NFS). K8S can dispatch the docker images to K8S nodes. When I kill the process, it seems restarted on the <em>same</em> node. I am pretty the other node has the same docker image installed, and I guess it is limited by the .ya...
Derek Ma
<p>I don't believe this is possible. When the PV is bound to a node, as that's where it exists; so if your pod has a PVC bound to that PV it will always be scheduled on that node.</p> <p>You'd need to use a different provider, such as Ceph/RBD, in-order to maintain freedom of movement and PV/PVC's.</p> <p>Maybe Rook....
Rawkode
<p>In my K8 cluster, I have two Deployments in the same namespace. One Deployment is for Database-Postgres and the other Deployment is for Tomcat. The Tomcat should be accessible from outside hence I have configured &quot;NodePort&quot; Service and for internal communication I have created a &quot;ClusterIP&quot; Servi...
Dusty
<p>You have overridden the default <code>ENTRYPOINT</code> in the postgresql image by specifying <code>deployment.spec.template.containers[0].command</code>. So now the only process that runs inside the pod of the deployment <code>nginx-statefulset</code> is <code>sleep infinity</code> and postgres is not running. Remo...
livinston
<p>I have a application consisting of frontend, backend and a database. At the moment the application is running on a kubernetes cluster. Front-, backend and database is inside its own Pod communicating via services.</p> <p>My consideration is to put all these application parts (Front-, Backend and DB) in one Pod, so...
Raphael G.
<p>No, it is a bad idea, this is why:</p> <ul> <li>First, the DB is a stateful container, when you update any of the components, you have to put down all containers in the POD, let's say this is a small front end update, it will put down everything and the application will be unavailable.</li> <li>Let's say you have m...
Diego Mendes
<p>I'm trying to set up the LetsEncrypt SSL ceritficate using cert manager. I have successfully deployed Cert Manager by Helm and stuck at configuring <code>ingress.yaml</code>.</p> <pre><code>$ sudo kubectl create --edit -f https://raw.githubusercontent.com/jetstack/cert-manager/master/docs/tutorials/quick-start/exam...
Igniter
<p>No. You cannot use an IP address for the Ingress. To use an IP address, you'd need to configure it to point to your worker nodes and create a NodePort Service, which will allow you to browse to <code>http://IP:NODEPORT</code>.</p>
Rawkode
<p>We use device mapper storage driver. This is probably more of a docker than k8s question.</p> <p>Is there is a way to determine for example where this mount is coming from</p> <blockquote> <p>/opt/dsx/ibm-data-platform/docker/devicemapper/mnt/b1127f21d5fd96b2ac862624d80b928decc1d60b87ec64d98430f69f360d3cee/root...
Tagar
<p>You can ask Docker for a list of containers that have that volume mounted:</p> <p><code>docker container ls --filter=volume=&lt;name of volume&gt;</code></p>
Rawkode
<p>When there's more than one search result from <code>/</code> filter command, how do you navigate to next item? Basically I'm looking for F3 (next search result) equivalent in k9s. Commands listed <a href="https://k9scli.io/topics/commands/" rel="noreferrer">here</a> does not seem to include what I'm looking for...</...
Davita
<p>Narain's answer works when searching in a list of resources but when looking at yaml the interaction is slightly different:</p> <ol> <li>Press <code>/</code></li> <li>Type search term, press enter</li> <li>Press <code>n</code> to go to next, <code>shift-n</code> to go to previous match</li> </ol> <p>Edit: I realize ...
worldsayshi
<p>Just deployed my docker image to Azure AKS and created nginx ingress controller. My image has the SSL certificate and handles SSL itself. So, I need a passthrough route to my container.</p> <p>When I navigate to <em><a href="https://just-poc.live" rel="nofollow noreferrer">https://just-poc.live</a></em> famous ngin...
killjoy
<p><code>nginx.ingress.kubernetes.io/backend-protocol: &quot;HTTPS&quot;</code> annotaion was missing. 502 error is gone!</p>
killjoy
<p>I have couchbase cluster on k8s with operator 1.2 , I see following error today continuously </p> <p>IP address seems to have changed. Unable to listen on 'ns_1@couchbase-cluster-couchbase-cluster-0001.couchbase-cluster-couchbase-cluster.default.svc'. (POSIX error code: 'nxdomain') (repeated 3 times)</p>
Vishnu Gopal Singhal
<p>The “IP address change” message is an alert message generated by Couchbase Server. The server checks for this situation as follows: it tries to listen on a free port on the interface that is the node’s address. </p> <p>It does this every 3 seconds. If the host name of the node can’t be resolved you get an nxdomain ...
deniswsrosa
<p>I have 4 k8s pods by setting the replicas of Deployment to 4 now.</p> <pre><code>apiVersion: v1 kind: Deployment metadata: ... spec: ... replicas: 4 ... </code></pre> <p>The POD will get items in a database and consume it, the items in database has a column <code>class_name</code>.</p> <p>now I want one pod...
hxidkd
<p>I would not recommend this approach, but the closest thing to do what you want is using the stateful-set and use the pod name as the index.</p> <p>When you deploy a stateful set, the pods will be named after their statefulset name, in the following sample:</p> <pre><code>apiVersion: v1 kind: Service metadata: na...
Diego Mendes
<p>I want to create boiler plate for any k8s object. </p> <p>For instance, the <code>deployment</code> object boilerplate can be generated by using <code>kubectl</code>: </p> <p><code>kubectl run --dry-run -o yaml ...</code> </p> <p>This will generate the yaml configuration file of the deployment object. I can redir...
Tran Triet
<p>While <code>kubectl create object-type -o yaml</code> will give you the very basics, it doesn't normally cover much of the spec.</p> <p>Instead, I prefer to fetch existing objects and modify:</p> <p><code>kubectl get configmap configMapName -o yaml &gt; configmap.yaml</code></p> <p>Strip away everything you don't...
Rawkode
<p>So I'm trying to create a bash script to pass the IP array needed to make inventory file for ansible the official docs say that this is achieved through</p> <pre><code>declare -a IPS=(10.10.1.3 10.10.1.4 10.10.1.5) CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]} </...
user3700919
<p>The issue comes from the <code>sudo</code> in your script.</p> <p>You create a virtualenv and activate it for the local session. <br /> But then you change to root context to install the requirements, which are installed at system-level, not virtualenv level. <br /> Then you execute back python in the virtualenv con...
zigarn
<p>Is there a way to tell Kubernetes what pods to kill before or after a downscale? For example, suppose that I have 10 replicas and I want to downscale them to 5, but I want certain replicas to be alive and others to be killed after the downscale. Is that possible?</p>
Matheus Melo
<p>While it's not possible to selectively choose which pod is killed, you can prevent what you're really concerned about, which is the killing of pods that are in the midst of processing tasks. This requires you do two things:</p> <ol> <li>Your application should be able to listen for and handle SIGTERM events, which ...
Grant David Bachman
<p>I have 2 questions as I am currently trying to learn minikube and now wants to install it;</p> <p>1- Which driver is preferable for Minikube (KVM or docker) ? Does one have some sort of advantage over other ?</p> <p>2- Is it possible to install and run the minkube inside a VM managed by KVM ?</p>
usmangt87
<p>1 - There is no &quot;better&quot; or &quot;worse&quot;. Using Docker is the default and with that the most supported version. 2 - Yes, it is possible to run Minikube inside a VM.</p>
Stefan Papp
<p>I'm trying a simple microservices app on a cloud Kubernetes cluster. This is the Ingress yaml:</p> <pre><code>apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-nginx-nginx-ingress namespace: default annotations: kubernetes.io/ingress.class: nginx spec: defaultBackend: service: ...
Nav
<p>The solution has three parts:</p> <ol> <li><p>Use <code>kubectl get all</code> to find out the running ingress service:</p> <pre><code>NAME TYPE EXTERNAL-IP PORT(S) service/ingress-nginx-nginx-ingress LoadBalancer 172.xxx.xx.130 80:31840/TCP,443:30550/TCP </code></pr...
Nav
<p>How to get list of pods that are not linked to any service</p> <p>Lets say i have pods:</p> <p><code>Svc1-green-xyz</code> and <code>svc1-blue-lmn</code></p> <p>Service <code>svc1</code> is served by <code>svc1-green-xyz</code>. With <code>svc1-blue-lmn</code> is a prior version of the same service and is not use...
lr-pal
<p>This is possible, but very hacky. Pods and services aren't really <em>linked</em>, so much as services use <em>selectors</em> to determine which pods they should target. What's really happening is that services keep track of a list of endpoints they need to forward traffic to. So, you could theoretically get a list ...
Grant David Bachman
<p>Hi i keep getting this error when using ansible via kubespray and I am wondering how to over come it</p> <pre><code> TASK [bootstrap-os : Assign inventory name to unconfigured hostnames (non-CoreOS, non-Flatcar, Suse and ClearLinux)] ***********************************************************************************...
user3700919
<p>From Kubespray documentation:</p> <pre class="lang-sh prettyprint-override"><code># Deploy Kubespray with Ansible Playbook - run the playbook as root # The option `--become` is required, as for example writing SSL keys in /etc/, # installing packages and interacting with various systemd daemons. # Without --become t...
zigarn
<p>I removing other versions from cert-manager. After that i install the new version with helm using.</p> <p>Installation works fine.</p> <p>but when i use the command:</p> <pre><code>$ kubectl get orders,challenges,clusterissuers Error from server: request to convert CR from an invalid group/version: acme.cert-manag...
Lucas Borges
<p>First of all, suggest to backup all your objects (certs, orders, issuer, clusterissuer, etc. with <a href="https://velero.io/" rel="nofollow noreferrer">velero</a> for example) !</p> <p><a href="https://cert-manager.io/docs/installation/upgrading/remove-deprecated-apis/" rel="nofollow noreferrer">Cert-manger documen...
Zied
<p>I am new to Kubernetes. I am using Kops to deploy my Kubernetes application on AWS. I have already registered my domain on AWS and also created a hosted zone and attached it to my default VPC.</p> <p>Creating my Kubernetes cluster through kops succeeds. However, when I try to validate my cluster using <code>kops va...
Kalpana Sundaram
<p>From what you describe, you created a Private Hosted Zone in Route 53. The validation is probably failing because Kops is trying to access the cluster API from your machine, which is outside the VPC, but private hosted zones only respond to requests coming from within the VPC. Specifically, the hostname <code>api.uc...
Grant David Bachman
<p>I'm kinda new here, so please be gentle with me. </p> <p>I've inherited an old (ish) kops install procedure using Ansible scripts, which has a specific version of the "kope.io" image within the Instance Group creation </p> <pre><code>apiVersion: kops/v1alpha2 kind: InstanceGroup metadata: creationTimestamp: null...
Steve Button
<p>According to <a href="https://github.com/kubernetes/kops/blob/master/docs/images.md" rel="nofollow noreferrer">kops documentation</a> you can specify an image and that will be used to provision the AMI that will build your instance group.</p> <p>You can find out the latest <code>kope.io</code> images and their resp...
ssice
<p>I try to use the master api to update resources.</p> <p>In 1.2 to update a deployment resource I'm doing <code>kubectl apply -f new updateddeployment.yaml</code></p> <p>How to do the same action with the api? </p>
ant31
<p>This API is not really convincingly designed, since it forces us to reimplement such basic stuff at the client side...</p> <p>Anyway, here is my attempt to reinvent the hexagonal wheel in Python...</p> <h2>Python module kube_apply</h2> <p>Usage is like <code>kube_apply.fromYaml(myStuff)</code></p> <ul> <li>can read ...
Ichthyo
<p>I have a service running in Kubernetes and currently, there are two ways of making GET requests to the REST API.</p> <p>The first is</p> <pre><code>kubectl port-forward --namespace test service/test-svc 9090 </code></pre> <p>and then running</p> <pre><code>curl http://localhost:9090/sub/path \ -d param1=abcd \ -d pa...
tobias
<p>This should be something which uses:</p> <pre><code>from kubernetes.stream import portforward </code></pre> <p>To find which command maps to an API call in Python, you can used</p> <pre><code>kubectl -v 10 ... </code></pre> <p>For example:</p> <pre><code>k -v 10 port-forward --namespace znc service/znc 1666 </code><...
oz123
<p>I have written few c++ services which have the MQTT Client. Based on the message received on the MQTT topic the c++ service will take some actions like sending an MQTT message to another topic or saving the message to the database etc. </p> <p>I have set up a few MQTT Brokers on Dockers and attached those MQTT Brok...
Kishore Chilakala
<p>This is not possible under MQTT 3.x. The reason being that prior to MQTT 5, every message is sent to every subscriber to that topic making it very difficult to load balance correctly. <em>Subscribers would need receive everything then discard decide for themselves to discard some messages, leaving them for other s...
Philip Couling
<p>I'm trying to setup kubernetes on AWS. For this I created an EKS cluster with 3 nodes (t2.small) according to official AWS tutorial. Then I want to run a pod with some app which communicates with Postgres (RDS in different VPC). </p> <p>But unfortunately the app doesn't connect to the database.</p> <p>What I have:...
Alex Fruzenshtein
<p>Have you tried to enable "dns propagation" in the peering connection? It looks like you are not getting the internally routable dns. You can enable it by going into the setting for the peering connection and checking the box for dns propagation. I generally do this will all of the peering connections that I control....
donkeyx
<p>In Helm Chart, one can define a postStart hook with parameters from the values.yaml file.</p> <p>WIf the container dies and replaced, or upgraded, will postStart always be called with the same values in each start of a container?</p>
user1015767
<p>postStart and preStop are container lifecycle events so as long as your deployment configuration is not changed, those hooks will be called in each restart.</p>
Mesut
<p>I trying to setup kubernetes on my local environment using docker. I've built the necessary docker image with this Dockerfile:</p> <pre><code>FROM node:9.11.1 WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app/ EXPOSE 3002 CMD [ "npm", "start" ] </code></pre> <p>I then push...
Christofer Johnson
<p>You are mounting something else over <code>/usr/src/app</code> where <code>package.json</code> is supposed to be located. That hides all the files in there. Remove the <code>volumes</code> and <code>volumeMounts</code> sections.</p>
kichik
<p>We are running a single NodeJS instance in a Pod with a request of 1 CPU, and no limit. Upon load testing, we observed the following:</p> <pre><code>NAME CPU(cores) MEMORY(bytes) backend-deployment-5d6d4c978-5qvsh 3346m 103Mi backend-deployment...
danthegoodman
<p>Although Node.js runs the main application code in a single thread, the Node.js runtime is multi-threaded. Node.js has an internal <a href="https://nodejs.org/en/docs/guides/dont-block-the-event-loop/" rel="nofollow noreferrer">worker pool</a> that is used to run background tasks, including I/O and certain CPU-inte...
pvillela
<p>We are running hazelcast in embedded mode and the application is running in kubernetes cluster. We are using Kubernetes API for discovery. </p> <p>It was all working fine and now we just started using <code>envoy</code> as sidecar for SSL. Now for both <code>inbound</code> and <code>outbound</code> on TCP at <code>...
user762421
<p>You can find an example config below for how to deploy Hazelcast with Envoy sidecar and use it with mTLS. </p> <p><a href="https://github.com/hazelcast/hazelcast-kubernetes/issues/118#issuecomment-553588983" rel="nofollow noreferrer">https://github.com/hazelcast/hazelcast-kubernetes/issues/118#issuecomment-55358898...
Mesut
<p>Having:</p> <pre><code>kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: namespace: default name: example-role rules: - apiGroups: [&quot;&quot;] resources: [&quot;pods&quot;] verbs: [&quot;get&quot;, &quot;watch&quot;, &quot;list&quot;] </code></pre> <p>And rolebinding:</p> <pre><code>kind: Role...
Chris G.
<p>All Kubernetes clusters have two categories of users: service accounts managed by Kubernetes, and normal users, and a third subject: Groups. Kubernetes does not have objects (kinds) which represent normal user accounts. Normal users cannot be added to a cluster through an API call. Normal users are typically managed...
Highway of Life
<p>Various Kubernetes security recommendations tell you to avoid SSH into containers and ask to use kubectl instead. The prime reason quoted is the possibility of escaping to the underlying host resources via SSH into containers. So, I have following specific queries:</p> <ol> <li><p>Which features of kubectl prevent ...
Anuj
<p>If the reason is "you can escape via one and not the other", then I think it comes from somebody who don't understand the security mechanisms involved. There are other reasons to prefer <code>kubectl exec</code> over SSH, such as audit logging integrated with everything else Kubernetes, and easy access revocation, ...
Tollef Fog Heen
<p>I was trying to get an alert in slack from Datadog when kubernet crojob fail. I have a query to get pod failure notification when its crashloop but not sure how to update the query for the cronjob failure</p> <pre><code>max(last_10m) :avg:kubernets_state.contaier.status_report.count.waiting{reason:crashloopbackoff ...
Rajesh174u
<p>Can you use the <code>kubernetes_state.job.completion.failed</code> metric?</p> <p>For example:</p> <pre><code>max(last_5m):max:kubernetes_state.job.completion.failed{*} by {kube_cluster_name,kube_namespace,kube_cronjob} &gt;= 1 </code></pre> <p>Note that there are two different tags, <code>kube_cronjob</code>, whic...
Björn Marschollek
<p>I'm using Docker For Desktop with the built-in Kubernetes cluster. I have installed a <code>Pod</code> that serves resources over HTTP, but I'm not sure how to access it using my browser. I have the following <code>ServiceSpec</code> that correctly routes traffic to the <code>Pod</code>:</p> <pre><code>spec: clus...
Cory Klein
<p>That service will be available in your browser at <a href="http://localhost:8037" rel="noreferrer">http://localhost:8037</a></p> <p>Note that the port <code>8037</code> corresponds to the <code>port</code> property on the <code>ServiceSpec</code> object.</p> <p>If you are unable to reach the service at that URL, t...
Cory Klein
<p>I have a service running in namespace istio-system , I want to connect it with pod in different namespace say default . My cluster is running on minikube . How to do the same ? I tried myService.istio-system.svc.cluster.local , but it didnot worked and from where its picking this i.e from which configuration file . ...
Anurag Gupta
<p>Realized the user is asking <a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem">XY Problem</a></p> <p>I put the answer here:</p> <pre><code>kubectl -n istio-system port-forward --address 0.0.0.0 svc/kiali 31000 31000 </code></pre> <p>with <code>-n istio-system</code>, you can nominiate t...
BMW
<p>I have created the kubernetes cluster with the version 1.19.11. Here, the metric-server installed by default. Now, I had hit the below queries,</p> <p>kubectl get --raw &quot;/apis/metrics.k8s.io/v1beta1/nodes&quot;</p> <p>it return &quot;Error from server (NotFound): the server could not find the requested resource...
bala n
<p>If you are using <code>minikube</code>, try starting with the addon enabled <code>--addons=&quot;metrics-server&quot;</code>. For example:</p> <pre><code>minikube start \ --kubernetes-version=v1.25.2 \ --addons=&quot;dashboard&quot; \ --addons=&quot;metrics-server&quot; \ --addons=&quot;ingress&quot;...
yucer
<p>I have setup a private docker registry inside my Kubernetes Cluster. The deployment is as follows</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1 kind: Deployment metadata: name: registry labels: app: registry spec: replicas: 1 selector: matchLabels: app: registry t...
echappy
<p>I figured this out. Before I was using <code>kubectl expose deployment/registry</code> to automatically create the service. I figured out that if I create a NodePort service, this will expose it on a fixed port on all nodes</p> <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1 kind: Service metadata...
echappy
<p>I'm troubleshooting liveness probe failures. I'm able to extract specific entries from k8s event using this approach</p> <pre><code>k get events --sort-by=.metadata.creationTimestamp | grep Liveness </code></pre> <p>I'd like to get only the pod(s) that causing the issue.<br> I'm considering to pipe a cut, but I'm ...
Crixo
<p>there is a feature in kubernetes called <a href="https://kubernetes.io/docs/reference/kubectl/jsonpath/" rel="nofollow noreferrer">jsonpath</a></p> <p>validate if your jsonpath is correct with this online tool: <a href="https://jsonpath.com/" rel="nofollow noreferrer">https://jsonpath.com/</a></p> <p>easily go thr...
BMW
<p>I setup a standard GKE cluster including istio. In the logs I find errors among which e.g.:</p> <pre><code>{ insertId: "xuxoovg5olythg" logName: "projects/projectname/logs/stderr" metadata: {…} receiveTimestamp: "2019-01-03T11:39:10.996283280Z" resource: { labels: { cluster_name: "standard-clu...
musicformellons
<p>Currently it is said to be working as intended, as a short-term solution. Possibly will be fixed in the future.</p> <p>Source: <a href="https://github.com/Stackdriver/metadata-agent/issues/183#issuecomment-426406327" rel="nofollow noreferrer">https://github.com/Stackdriver/metadata-agent/issues/183#issuecomment-426...
Jakub Gocławski
<p><a href="https://i.stack.imgur.com/4MX4U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4MX4U.png" alt="enter image description here" /></a><a href="https://stackoverflow.com/questions/64481963/unknown-flag-export-while-copying-secret-from-one-namespace-to-another-kubect">unknown flag: --export w...
rmznbyk 1
<p>As of Kubernetes 1.14, --export is deprecated and this feature is removed in 1.18. You can use get -o yaml without --export. For example, the following command export secrets config:</p> <pre><code>kubectl get secret &lt;your secrets&gt; --namespace &lt;your namespace&gt; -o yaml &gt; output.yaml </code></pre>
Caner
<p>I want to mount an Azure Shared Disk to the multiple deployments/nodes based on this: <a href="https://learn.microsoft.com/en-us/azure/virtual-machines/disks-shared" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/virtual-machines/disks-shared</a></p> <p>So, I created a shared disk in Azure Portal ...
RemoPar
<p><strong><a href="https://azure.microsoft.com/en-us/blog/announcing-the-general-availability-of-azure-shared-disks-and-new-azure-disk-storage-enhancements/" rel="noreferrer">Yes, you can</a></strong>, and the capability is GA.</p> <p>An Azure Shared Disk can be mounted as ReadWriteMany, which means you can mount it t...
Highway of Life
<p>I'm new, and exploring ArgoCD, Helm, Grafana, and Prometheus. I found a cool repo (<a href="https://github.com/naturalett/continuous-delivery" rel="nofollow noreferrer">https://github.com/naturalett/continuous-delivery</a>) on how to deploy all the services using Argo, it's working great, but I'm unable to reach Gra...
zoe08
<p><em>(Posted the solution on behalf of the question author in order to move it to the answer space).</em></p> <p>I was able to solve it by creating a yaml with the NodePort configuration and passing the yaml to the kustomization!</p> <pre><code>apiVersion: v1 kind: Service metadata: name: grafana-nodeport namespa...
halfer
<p>I have a working docker image which I am trying to now use on Kubernetes but as I try to run the deployment it never runs. It gets stuck in a crash loop error and I have no way of working out what the logs say because it exits so quickly. I've included my deployment yaml file to see if there is something obviously w...
Rutnet
<p>You can view the previous logs by adding <code>-p</code></p> <p><code>kubectl logs -p pod-name</code></p> <p>I'd delete the Deployments Pod and try this with a new Pod, which will run 5 times before entering CrashLoopBackoff.</p> <p>If the error isn't happening during container runtime, then you can describe the ...
Rawkode
<p>I have a resource yaml file in a folder structure given below</p> <blockquote> <p>base</p> <p>---- first.yaml</p> <p>main</p> <p>---- kustomization.yaml</p> </blockquote> <p>In kustomization.yaml I am referring the first.yaml as</p> <blockquote> <p>resources:</p> <ul> <li>../base/first.yaml</li> </ul> </blockquote> ...
Kabilan R
<p>Kustomize cannot refer to individual resources in parent directories, it can only refer to resources in current or child directories, but it can refer to other Kustomize directories.</p> <p>The following would be a valid configuration for what you have:</p> <pre><code>. ├── base │   ├── main │   │   ├── kustomizatio...
Highway of Life
<p>I'm running <code>kubectl create -f notRelevantToThisQuestion.yml</code></p> <p>The response I get is:</p> <blockquote> <p>Error from server (NotFound): the server could not find the requested resource</p> </blockquote> <p>Is there any way to determine which resource was requested that was not found?</p> <p>...
Glen Pierce
<p>To solve this, downgrade the client or upgrade the server. In my case I've upgraded server (new minikube) but forget to upgrade client (kubectl) and end up with those versions.</p> <pre><code>$ kubectl version --short Client Version: v1.9.0 Server Version: v1.14.1 </code></pre> <p>When I'd upgraded client version (i...
sobi3ch
<p>I am trying to deploy my Jhipster (v5.5.0) project onto Kubernetes (v1.16.3), but the pod keeps failing with the below logs. Anyone have any ideas?</p> <p>Here is my YAML that will create the deployment / pod. I have another YAML that creates the PV and PVC.</p> <pre><code>kind: Deployment metadata: name: portal...
Mike K.
<p>Since the container <code>portal</code> in pod run as non-root <code>950</code></p> <pre><code> securityContext: runAsNonRoot: true runAsUser: 950 </code></pre> <p>Please confirm if this user has permission to create a file/folder in root <code>/</code>. Normally only root has this...
BMW
<p>I see that normally a new image is created, that is, a dockerfile, but is it a good practice to pass the cert through environment variables? with a batch that picks it up and places it inside the container</p> <p>Another approach I see is to mount the certificate on a volume.</p> <p>What would be the best approximat...
Julio
<p>Definitely do <strong>not</strong> bake certificates into the image.</p> <p>Because you tagged your question with <code>azure-aks</code>, I recommend using the Secrets Store CSI Driver to mount your certificates from Key Vault.</p> <ul> <li>See the <a href="https://github.com/Azure/secrets-store-csi-driver-provider-...
julie-ng
<p>Should I use URL's at the root of my application like so:</p> <pre><code>/ready /live </code></pre> <p>Should they both be grouped together like so:</p> <pre><code>/status/ready /status/live </code></pre> <p>Should I use <a href="https://www.rfc-editor.org/rfc/rfc5785" rel="nofollow noreferrer">RFC5785</a> and put t...
Muhammad Rehan Saeed
<p>The Kubernetes docs use <code>/healthz</code>, which I'd say is advisable to follow; but you really can use whatever you want.</p> <p>I believe <code>healthz</code> is used to keep it inline with <code>zpages</code>, which are described by OpenCensus:</p> <p><a href="https://opencensus.io/zpages/" rel="nofollow no...
Rawkode
<p>I want to set <code>scrape_interval</code> for the Prometheus to 15 seconds. My config below doesn't work, there is an error in the last line. I am wondering how should I config the 15 seconds <code>scrape_interval</code>?</p> <pre><code>apiVersion: monitoring.coreos.com/v1 kind: Prometheus metadata: n...
kevin
<p><code>scrape_interval</code> is probably a parameter name in the prometheus config and not for the <code>Prometheus</code> object in k8s (which is read by prometheus-operator and used to generate actual config).</p> <p>You can see in the <a href="https://github.com/prometheus-operator/prometheus-operator/blob/master...
bjakubski
<p>My core dns corefile got corrupted somehow and now I need to regenerate it or reset it to it's default installed value. How do I do that? I've tried copying and pasting a locally-saved version of the file via <code>kubectl edit cm coredns -n kube-system</code> but I get validation errors </p> <pre><code>error: conf...
user_78361084
<p>When you directly edit the setting, it used to give the error. </p> <p>What can you do?</p> <blockquote> <p>before you run anything, please take a backup:</p> </blockquote> <pre><code>kubectl -n kube-system get configmap coredns -o yaml &gt; coredns.yaml </code></pre> <h3>Ways #1, forcely apply it.</h3> <pre...
BMW
<p>I'm working on a project that uses the <code>klog library</code> for logging, and I want to be able to write the <code>logs to a **terminal** while being able to write to a **file**</code> for viewing on reboot or downtime.</p> <p>I tested through the following code, but it can only write to the file and not output ...
moluzhui
<p>If you read the <a href="https://pkg.go.dev/k8s.io/klog/v2#section-documentation" rel="nofollow noreferrer">Klog documentation</a> says that it supports a flag, <code>-alsologtostderr</code>:</p> <blockquote> <p><code>-alsologtostderr=false</code><br/> Logs are written to standard error as well as to files.</p> </bl...
Nicholas Carey
<p>I'd like to prepare multiple yaml files customizing arguments of flannel (DaemonSet) and run the flannel pod of the node with yaml matching the condition expressed by the label. Can I label a worker node before joining Kubernetes master ?</p>
shigeru ishida
<p>You can specify <code>--node-labels</code> when you're <code>kubelet</code> is starting, which will apply the labels to the nodes; but <strong>ONLY</strong> during registration.</p> <p>This will not work if your <code>kubelet</code> is starting up and the node is already a member of the cluster.</p> <p><a href="ht...
Rawkode
<p>I have an init container and am running a command in it which takes a ton of parameters so I have something like </p> <pre><code>command: ['sh', '-c', 'tool input1 input2 output -action param1 -action param2 -action param3 -action param4 -action param5 -action param6 -action param7 -action param7 -action param8 -ac...
The_Lost_Avatar
<p>Another tip is to do it via command, so save your time that you needn't manually do that.</p> <pre><code>kubectl run nginx --image=nginx --generator=run-pod/v1 --dry-run -o yaml -- tool input1 input2 output -action param1 -action param2 -action param3 -action param4 -action param5 -action param6 -action param7 -ac...
BMW
<p>In some project there are scaling and orchestration implemented using technologies of a local cloud provider, with no Docker &amp; Kubernetes. But the project has poor logging and monitoring, I'd like to instal Prometheus, Loki, and Grafana for metrics, logs, and visualisation respectively. Unfortunately, I've found...
AivanF.
<p>Can't comment about Loki, but Prometheus is definitely doable. Prometheus supports a number of service discovery mechanisms, k8s being just on of them. If you look at the <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/" rel="nofollow noreferrer">list of options</a> (the ones ending...
bjakubski
<p>My metrics are scraping every 30seconds, even though I've specified a 10s interval when defining my servicemonitor.</p> <p>I've created a servicemonitor for my exporter that seems to be working well. I can see my exporter as a target, and view metrics on the /graph endpoint. However, when on the &quot;targets&quot; ...
Trevor Jordy
<p>First: Double check if you've changed the ServiceMonitor you need changed and if you are looking at scrapes from your ServiceMonitor.</p> <p>Go to the web UI of your prometheus and select Status -&gt; Configuration. Now try to find part of the config that prometheus operator created (based on ServiceMonitor config)....
bjakubski
<p>I have one question about Grafana. How I can use exiting Prometheus deamonset on GKE for Grafana. I do not want to spin up one more Prometheus deployment for just Grafana. I come up with this question after I spin up the GKE cluster. I have checked <code>kube-system</code> namespace and it turns out there is Prometh...
Farkhod Sadykov
<p>prometheus-to-sd is not a Prometheus instance, but a component that allows getting data from Prometheus to GCP's stackdriver. More info here: <a href="https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/prometheus-to-sd" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/k8s-stackdriver/...
bjakubski
<p>On <code>CentOS 7.4</code>, I have set up a Kubernetes master node, pulled down jenkins image and deployed it to the cluster defining the jenkins service on a NodePort as below.</p> <p>I can curl the jenkins app from the worker or master nodes using the IP defined by the service. But, I can not access the Jenkins a...
Robin
<p>Your Jenkins Service is of type <code>NodePort</code>. That means that a specific port number, on any node within your cluster, will deliver your Jenkins UI.</p> <p>When you described your Service, you can see that the port assigned was <code>31587</code>.</p> <p>You should be able to browse to <code>http://SOME_I...
Rawkode
<p>I'm using the latest prometheus 2.21.0 and latest node-exporter</p> <p>Trying to run the query and getting <strong>no datapoints found</strong> however both metrics <code>kube_pod_container_resource_limits_memory_bytes</code> and <code>node_memory_MemTotal_bytes</code> are working independently and return data</p> <...
DmitrySemenov
<ol> <li>This is a convention widely used in prometheus land. It means this metric is not one directly scraped from some target(s), but instead a result of recording rule. This convention is described <a href="https://prometheus.io/docs/practices/rules/#naming-and-aggregation" rel="nofollow noreferrer">here</a>.</li> <...
bjakubski