Question stringlengths 65 39.6k | QuestionAuthor stringlengths 3 30 ⌀ | Answer stringlengths 38 29.1k | AnswerAuthor stringlengths 3 30 ⌀ |
|---|---|---|---|
<p>I wanted to know exactly what is the difference between '>-' and '|-' especially in kubernetes yaml manifests</p>
| Bguess | <p>Newlines in folded block scalars (<code>></code>) are subject to line folding, newlines in literal block scalars (<code>|</code>) are not.</p>
<p>Line folding replaces a single newline between non-empty lines with a space, and in the case of empty lines, reduces the number of newline characters between the surrou... | flyx |
<p>I have a running GKE cluster with an HPA using a target CPU utilisation metric. This is OK but CPU utilisation is not the best scaling metric for us. Analysis suggests that active connection count is a good indicator of general platform load and thus, we'd like to look into this as our primary scaling metric.</p>
<... | benjimix | <p>Ok I managed to figure this out by looking up the schema for the HPA (<a href="https://docs.okd.io/latest/rest_api/apis-autoscaling/v2beta1.HorizontalPodAutoscaler.html" rel="noreferrer">https://docs.okd.io/latest/rest_api/apis-autoscaling/v2beta1.HorizontalPodAutoscaler.html</a>).</p>
<p>In short, I was using the ... | benjimix |
<p>I am learning k8s. My question is that how to let k8s get service url as minikube command "minikube get service xxx --url" do?
Why I ask is because that when pod is down and up/created/initiated again, there is no need to change url by visiting service url. While
I deploy pod as NodePort, I could access pod with hos... | user84592 | <p>NodePort, as the name suggests, opens a port directly on the node (actually on all nodes in the cluster) so that you can access your service. By default it's random - that's why when a pod dies, it generates a new one for you. However, you can specify a port as well (3rd paragraph <a href="https://kubernetes.io/docs... | Amrit |
<p>A container running behind a K8s service fails to make network requests with the error <code>x509: certificate signed by unknown authority</code>.</p>
<p>The container is an API that serves incoming requests and makes external network requests before responding, it's running in a local K8s cluster managed by Docker ... | some_id | <p>I hope this helps someone else as there are many different discussions about this topic online.</p>
<p>The fix seems to be that when doing a multi stage docker build and using e.g. <code>FROM golang:alpine3.14 AS build</code> along with <code>FROM scratch</code>, the root certificates are not copied into the image.... | some_id |
<p>I am trying to apply kubernetes to my minikube cluster for the first time. I have limited experience with cluster management and have never worked with prometheus before so I apologize for noob errors. </p>
<p>I run the following commands:</p>
<pre><code>docker build -t my-prometheus .
docker run -p 9090:9090 my-p... | beanwa | <p><code>kubernetes_sd_configs</code> is a list of configs, styled as block sequence in YAML terms.</p>
<p>Now, your list of configs looks like this:</p>
<pre><code>- role: endpoints
- api_server: localhost:3000
</code></pre>
<p>So you're defining two configs, and only the first one of them has a role. This is why y... | flyx |
<p>I have a Kubernetes cluster running on my local machine(via docker-for-desktop) and a metrics-server has been deployed to monitor CPU Usage. I want to make some changes in the <code>metrics-server-deployment.yaml</code> file which resides in <code>/metrics-server/deploy/1.8+</code> </p>
<p>I am done with the change... | Gauraang Khurana | <p>From the directory where you have <code>metrics-server-deployment.yaml</code>, just run:</p>
<pre><code>kubectl apply -f metrics-server-deployment.yaml
</code></pre>
<p>If it complains, you can also manually delete it and run:</p>
<pre><code>kubectl create -f metrics-server-deployment.yaml
</code></pre>
| Amrit |
<p>I'm trying to inject an HTTP status 500 fault in the bookinfo example.</p>
<p>I managed to inject a 500 error status when the traffic is coming from the Gateway with:</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo
namespace: default
spec:
gateways:
- b... | Igor Šarčević | <p>The root cause of my issues were an improperly set up includeIPRanges in my minicloud cluster. I set up the 10.0.0.1/24 CIDR, but some services were listening on 10.35.x.x.</p>
| Igor Šarčević |
<p>I'm new to kubernetes and trying to explore the new things in it. So, my question is </p>
<p>Suppose I have existing kubernetes cluster with 1 master node and 1 worker node. Consider this setup is on AWS, now I have 1 more VM instance available on Oracle Cloud Platform and I want to configure that VM as worker no... | Shubham Naphade | <p>I would instead divide your clusters up based on region (unless you have a good VPN between your oracle and AWS infrastructure)</p>
<p>You can then run applications across clusters. If you absolutely must have one cluster that is geographically separated, I would create a master (etcd host) in each region that you ... | Ryan |
<p>I have a security requirement to include in my event logs the machine name / hostname on which an instance of my application is running. Presumably this is so that a security auditor who is trying to trace through a breach can determine, e.g., if the breach is related to one specific compromised machine. This also a... | JackLThornton | <p>Perhaps the easiest way to do this is to use <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/" rel="nofollow noreferrer">Kubernetes Downward API</a>. You can expose node name via environment variable defined in Pod spec:</p>
<pre><code> env:
... | Oleg |
<p>I was trying to showcase binary authorization to my client as POC. During the deployment, it is failing with the following error message:</p>
<blockquote>
<p>pods "hello-app-6589454ddd-wlkbg" is forbidden: image policy webhook backend denied one or more images: Denied by cluster admission rule for us-central1.sta... | ARINDAM BANERJEE | <p>Thank you for trying Binary Authorization. I just updated the <a href="https://cloud.google.com/solutions/binary-auth-with-cloud-build-and-gke" rel="nofollow noreferrer">Binary Authorization Solution</a>, which you might find helpful.</p>
<p>A few things I noticed along the way:</p>
<blockquote>
<p>... denied by... | sethvargo |
<p>We're using Kubernetes on-premise and it's currently running on VMWare. So far, we have been successfull in being able to provision volumes for the apps that we deploy. The problem comes if the pods - for whatever reason - switch to a different worker node. When that happens, the disk fails to mount to the second wo... | automation1002 | <p>First, I'll assume your running in tree vsphere disks.</p>
<p>Second, in this case (and more so, with CSI) kubernetes doesn't have control over all volume operations. The VMWare functionality for managing attachment and detachment of a disk is implemented in the volume plugin which you are using. Kubernetes doesn... | jayunit100 |
<p>I have defined Kafka and Kafka schema registry configuration using Kubernetes deployments and services. I used <a href="https://docs.confluent.io/current/installation/docker/docs/config-reference.html" rel="nofollow noreferrer">this link</a> as a reference for the environment variables set up. However, when I try to... | Cassie | <p>You've configured Schema Registry to look for the Kafka broker at <code>kafka:9092</code>, but you've also configured the Kafka broker to advertise its address as <code>localhost:9092</code>. </p>
<p>I'm not familiar with Kubernetes specifically, but <a href="https://rmoff.net/2018/08/02/kafka-listeners-explained/"... | Robin Moffatt |
<p><strong><em>Update</em></strong>
The issue is resolved. </p>
<ol>
<li>I shutdown docker desktop.</li>
<li>Deleted C:\ProgramData\DockerDesktop and .kube folder</li>
<li>Restarted docker desktop</li>
<li>reset docker desktop to factory defaults</li>
<li>and restarted it again and it worked.</li>
</ol>
<p>I have sta... | Talal Abbas | <h2>Just follow these steps</h2>
<ol>
<li>stop docker for desktop</li>
<li>remove the folder <code>~/Library/Group\ Containers/group.com.docker/pki</code></li>
</ol>
<pre><code> rm -rf ~/Library/Group\ Containers/group.com.docker/pki
</code></pre>
<ol start="3">
<li>start docker for destkop</li>
</ol>
<p>Found <a hre... | freedev |
<h2>Background</h2>
<p>I'm running a Kubernetes cluster on Google Cloud Platform. I have 2 Node-Pools in my cluster: <code>A</code> and <code>B</code>. <code>B</code> is cheaper (depends on hardware). I prefer that my deployment will run on <code>B</code>. Unless no free resources in <code>B</code>. In that case, new ... | No1Lives4Ever | <p>You can taint pool A. Then configure <em>all</em> your pods to tolerate the taint, but with a tolerationSeconds for the duration you want. This is in addition to the config you already did for pool B.</p>
<p>The effect will be that the pod is scheduled to A if it won't fit on B, but then after a while will be evict... | Hitobat |
<p>I have a specific version of postgres with postgis that I need to use for my database. This is what I usually do to provision it:</p>
<ol>
<li>Create a kubernetes secret that holds value of admin password</li>
<li>Create a PV (persistent volume) - I have .yaml for this</li>
<li>Create a PVC(pv claim) to use it for t... | Remember_me | <p>Ever looked into <a href="https://www.terraform.io/" rel="nofollow noreferrer">Terraform</a> or <a href="https://helm.sh/" rel="nofollow noreferrer">Helm</a>? Both are declarative ways to create reproducible deployments. IMO Terraform is more for the basic Kubernetes infrastructure itself, while I see Helm more used... | Alex_M |
<p>From what I've read about Kubernetes, if the master(s) die, the workers should still be able to function as normal (<a href="https://stackoverflow.com/a/39173007/281469">https://stackoverflow.com/a/39173007/281469</a>), although no new scheduling will occur.</p>
<p>However, I've found this to not be the case when t... | bcoughlan | <blockquote>
<p>Is it expected behaviour that kube-proxy won't stop routing to pods on
master nodes, or is there something "broken"? </p>
<p>Are any workarounds
available for this kind of setup to allow the worker nodes to still
function correctly?</p>
</blockquote>
<p>The cluster master plays the role of... | Karthik Balaguru |
<p>Ok.. so, we have Google Secret Manager on GCP, AWS Secret Manager in AWS, Key Vault in Azure... and so on.</p>
<p>Those services give you libs so you can code the way your software will access the secrets there. They all look straightforward and sort of easy to implement. Right?</p>
<p>For instance, using Google SM ... | JGG | <p>There are many possible motivations why you may want to use an abstraction (such as the CSI driver or sidecar injector) over a native integration:</p>
<ul>
<li><p><strong>Portability</strong> - If you're multi-cloud or multi-target, you may have multiple secret management solutions. Or you might have a different sec... | sethvargo |
<p>Kubernetes assigns an IP address for each container, but how can I acquire the IP address from a container in the Pod? I couldn't find the way from documentations.</p>
<p>Edit: I'm going to run Aerospike cluster in Kubernetes. and the config files need its own IP address. And I'm attempting to use confd to set the ... | yanana | <p>The simplest answer is to ensure that your pod or replication controller yaml/json files add the pod IP as an environment variable by adding the config block defined below. (the block below additionally makes the name and namespace available to the pod)</p>
<pre><code>env:
- name: MY_POD_NAME
valueFrom:
fieldR... | PiersyP |
<p>All of a sudden, I cannot deploy some images which could be deployed before. I got the following pod status:</p>
<pre><code>[root@webdev2 origin]# oc get pods
NAME READY STATUS RESTARTS AGE
arix-3-yjq9w 0/1 ImagePullBackOff 0 10m
docker-registry... | Devs love ZenUML | <p>You can use the '<em><strong>describe pod</strong></em>' syntax</p>
<p><strong>For OpenShift use:</strong></p>
<pre><code>oc describe pod <pod-id>
</code></pre>
<p><strong>For vanilla Kubernetes:</strong></p>
<pre><code>kubectl describe pod <pod-id>
</code></pre>
<p>Examine the events of the output.
... | rjdkolb |
<p>On Google Kubernetes Engine (GKE) you can use the <code>cloud.google.com/app-protocols</code> annotation on a Service to specify what protocol is used on that port (HTTP or HTTPS) <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress-xlb#https_tls_between_load_balancer_and_your_application" rel="... | Arnout Engelen | <p>Turns out when the "GKE Ingress for HTTP(S) Load Balancing" uses HTTPS to connect to the service, it accepts <em>any</em> certificate valid (even a self-signed one), without further configuration.</p>
<p>Apparently it does not use TLS to protect against MITM attacks here (which I guess might be reasonable)... | Arnout Engelen |
<p>I am trying to deploy an app to kubernetes cluster and I want to store data in <strong>Persistent Volume</strong>. However, I am very confused about two parameters in the setup. Can someone explains what is the different between <strong>volumes.hostPath</strong> and <strong>volumeMounts.mountPath</strong>? I read so... | jiashenC | <p>The mount path is always the destination inside the Pod a volume gets mounted to.</p>
<p>I think the documentation is pretty clear on what hostPath does:</p>
<blockquote>
<p>A hostPath volume mounts a file or directory from the host node’s
filesystem into your Pod. This is not something that most Pods will
n... | matthias krull |
<p>I've got a persistent disk (GCP), that I'm hoping to be able to allow read write access to multiple pods.</p>
<p>Is this possible? Here are my two configs:</p>
<p><strong>pVolume.yaml</strong></p>
<pre><code>apiVersion: "v1"
kind: "PersistentVolume"
metadata:
name: "pv0001"
spec:
storageClassName: manual
c... | Chris Stryczynski | <p>For a GCP persistent disk in ReadWrite mode on different nodes this is not possible :(</p>
<p>It is possible however:</p>
<ul>
<li>Have both replicas scheduled on the <strong>same node</strong>. In that case both of them can mount the same persistent disk ReadWrite</li>
<li>Use it in <strong>ReadOnly mode</strong>... | Janos Lenart |
<p>I'm trying to upgrade some GKE cluster from 1.21 to 1.22 and I'm getting some warnings about deprecated APIs. Am running Istio 1.12.1 version as well in my cluster</p>
<p>One of them is causing me some concerns:</p>
<p><code>/apis/extensions/v1beta1/ingresses</code></p>
<p>I was surprised to see this warning because... | Sunil | <p>In our case, use of old version of <a href="https://github.com/kubernetes/kube-state-metrics" rel="nofollow noreferrer">kube-state-metrics</a> seems to cause the beta version of API calls. Some days after updating kube-state-metrics, the deprecated API calls was stopped so far.</p>
| hiroshi |
<p>I am following the <code>Installation Instructions</code> from <a href="https://argoproj.github.io/argo-cd/getting_started/#3-access-the-argo-cd-api-server" rel="nofollow noreferrer">https://argoproj.github.io/argo-cd/getting_started/#3-access-the-argo-cd-api-server</a>
and even though the service type has been chan... | Hector Esteban | <p>I managed to successfully login argocd-server by the following</p>
<pre><code>kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
argoPass=$(kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -d... | j3ffyang |
<p>I'm using github actions for creating new images and pushing them to a registry.</p>
<pre><code> - name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{secrets.DOCKER_USER}}/book:$GITHUB_SHA
</code></pre>
<p>This works perfectly. Now, I need to replace the value of the image. So I th... | Diego | <p>Use the correct json path expression to the <code>image</code> property and quote the replacement value.</p>
<p>Example:</p>
<pre><code>$ yq '.spec.template.spec.containers.[0].image = "STRING"' argo/deployment.yaml
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
... | hakre |
<p>In kubernetes I can currently limit the CPU and Memory of the containers, but what about the hard disk size of the containers.</p>
<p>For example, how could I avoid that someone runs a container in my k8s worker node that stores internally .jpg files making this container grow and grow with the time.</p>
<p>Not ta... | Jxadro | <p>There is some support for this; the tracking issues are <a href="https://github.com/kubernetes/features/issues/361" rel="nofollow noreferrer">#361</a>, <a href="https://github.com/kubernetes/features/issues/362" rel="nofollow noreferrer">#362</a> and <a href="https://github.com/kubernetes/features/issues/363" rel="n... | Janos Lenart |
<p>I have Kubernets 1.20.1 cluster with single master and single worker configured with <code>ipvs</code> mode. Using calico CNI <code>calico/cni:v3.16.1</code>. Cluster running on OS RHEL 8 kernel <code>4.18.0-240.10</code> with firewalld and selinux disabled.</p>
<p>Running one <code>netshoot</code> pod (<code>10.1.3... | sfgroups | <p>I was able to resolve this issue by running below command on <code>ens192</code> interface on VMware VM on.</p>
<pre><code># cat /etc/sysconfig/network-scripts/ifcfg-ens192 | grep ETHTOOL
ETHTOOL_OPTS="-K ens192 tx-udp_tnl-csum-segmentation off; -K ens192 tx-udp_tnl-segmentation off"
</code></pre>
<p>got t... | sfgroups |
<p>I want to send data from a sensor written in Python to a Go http Server which are deployed with Kubernetes (k3s) on two Raspberry Pi's. The sensor will read every minute the temperatur and luminosity and send the data as a json with a timestamp to the server. At first when I run the setup it works, but after a while... | TheQuestioner | <p>I think the problem is the weather server (k8s service) is broken.</p>
<p>This is because the selector is checking for pods with label <code>app=weather</code> which includes both server pods and sensor pods.</p>
<p>If a sensor tries to send data (through the k8s service) to another sensor pod, then it will result i... | Hitobat |
<p>I was using NodePort to host a webapp on Google Container Engine (GKE). It allows you to directly point your domains to the node IP address, instead of an expensive Google load balancer. Unfortunately, instances are created with HTTP ports blocked by default, and an update locked down manually changing the nodes, as... | Ray Foss | <p>Update 2023-06-23</p>
<p>At some point Google added the ability to add network tags to your node pool... So now you can directly add http-server, https-server and it will work as expected.</p>
<hr />
<p>Update: A deamonset with a nodeport can handle the port opening for you. nginx/k8s-ingress has a nodeport on 443 w... | Ray Foss |
<p>In my kubernetes Ingress controller logging lots of handshake message like this. how to stop this error message? it appers request coming from with-in the pod 127.0.0.1</p>
<pre><code>2018/09/15 13:28:28 [crit] 21472#21472: *323765 SSL_do_handshake() failed (SSL: error:1417D18C:SSL routines:tls_process_client_hello... | sfgroups | <p>My issue is with HAPROXY health check configuration I set to <code>ssl-hello-chk</code> now I changed it to <code>tcp-check</code> error message stopped.</p>
<p>change this:</p>
<pre><code>mode tcp
balance leastconn
option ssl-hello-chk
</code></pre>
<p>to</p>
<pre><code> mode tcp
bal... | sfgroups |
<p>I am running some internal services and also some customer facing services in one K8s cluster. The internal ones should only be accessible from some specific ips and the customer facing services should be accessible worldwide.</p>
<p>So I created my Ingresses and an nginx Ingress Controller and some K8s LoadBalance... | Hubert Ströbitzer | <p>As surprising as it is, the L7 (http/https) load balancer in GCP created by a Kubernetes Ingress object <strong>has no IP whitelisting capabilities</strong> by default, so what you described is working as intended. You can filter on your end using the <code>X-Forwarded-For</code> header (see Target Proxies under <a ... | Janos Lenart |
<p>I have Kubernets 1.18 cluster with Calico CNI (v3.13.2). I was able to schedule to workload. but in the events I see <code>CIDRNotAvailable</code> message, coming from all nodes in the default name space.</p>
<p>my CIDR range is <code>-cluster-cidr=10.236.0.0/16</code> in <code>/etc/kubernetes/manifests/kube-contro... | sfgroups | <p>I have to remove <code>serviceSubnet</code> from kubeadm configure and use the default one and use this subnet for POD IP <code>podSubnet: 10.201.0.0/16</code>. created cluster with this configurtion, Now this error stop coming, I can see all the node has CIDR subnet assigned.</p>
<pre><code>kubectl get nodes -o js... | sfgroups |
<p>I have applied the <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="nofollow noreferrer">kube-prometheus-stack</a> to my k8s cluster, and notice there are no scrape configs for my services or pods.</p>
<p>I'd like all services etc in my cluster to be scraped, ... | Jon Bates | <p>Looks like there was already a <a href="https://stackoverflow.com/questions/64452966/add-custom-scrape-endpoints-in-helm-chart-kube-prometheus-stack-deployment">solution</a></p>
<p>Just add your additional jobs to the values file at this location:</p>
<pre class="lang-yaml prettyprint-override"><code>prometheus:
p... | Jon Bates |
<p>I have successfully set up NGINX as an ingress for my Kubernetes cluster on GKE. I have enabled and configured external metrics (and I am using an external metric in my HPA for auto-scaling). All good there and it's working well.</p>
<p>However, I have a deprecation warning in StackDriver around these external metr... | benjimix | <p>Ok this has nothing to do with NGINX and everything to do with Prometheus (and specifically the Prometheus sidecar <code>prometheus-to-sd</code>).</p>
<p>For future readers if your Prometheus start-up looks like this:</p>
<pre><code> - name: prometheus-to-sd
image: gcr.io/google-containers/prometh... | benjimix |
<p>I setup my cluster with one master and two nodes. I can create pods on nodes. If my master node fails (reboot) when I use kubeadm reset and then kubeadm init I lost all my pods, deployments, services.</p>
<p>Am I losting my pods because reset? What should I do?</p>
<p>Some similar questions:</p>
<p><a href="https... | gustavomr | <p><code>kubeadm reset</code> on the master deletes all configuration (files and a database too). There is no way back.</p>
<p>You should not run <code>kubeadm init</code> when you reboot the master. <code>kubeadm init</code> is a one off action to bootstrap the cluster. When the master is rebooted your OS's init syst... | Janos Lenart |
<p>I am using <code>kubectl port-forward</code> in a shell script but I find it is not reliable, or doesn't come up in time:</p>
<pre><code>kubectl port-forward ${VOLT_NODE} ${VOLT_CLUSTER_ADMIN_PORT}:${VOLT_CLUSTER_ADMIN_PORT} -n ${NAMESPACE} &
if [ $? -ne 0 ]; then
echo "Unable to start port forwarding t... | eeijlar | <p>I took @AkinOzer's comment and turned it into this example where I port-forward a postgresql database's port so I can make a <code>pg_dump</code> of the database:</p>
<pre><code>#!/bin/bash
set -e
localport=54320
typename=service/pvm-devel-kcpostgresql
remoteport=5432
# This would show that the port is closed
# n... | Peter V. Mørch |
<p>When we use kubeadm to set up a k8s cluster, there are two options to config:</p>
<p><code>--pod-network-cidr</code></p>
<p><code>--service-cidr</code> (default ‘10.96.0.0/12’)</p>
<p>Question is:</p>
<ol>
<li><p>If I use <code>10.244.0.0./12</code> for <code>pod-network-cidr</code>, do I need to save that IP ra... | xren | <p>To reply briefly:</p>
<ul>
<li><ol>
<li>You do have to reserve <strong>both</strong> the pod-network range and the service network range. You can't use those on your LAN (and you can't have routes to it). Both ranges are configurable so you can pick something that is not used. Use ipcalc if you are unsure.</li>
</o... | Janos Lenart |
<p>I'm using EKS (Kubernetes) in AWS and I have problems with posting a payload at around 400 Kilobytes to any web server that runs in a container in that Kubernetes. I hit some kind of limit but it's not a limit in size, it seems at around 400 Kilobytes many times works but sometimes I get (testing with Python request... | StefanH | <p>Thanks for your answers and comments, helped me get closer to the source of the problem. I did upgrade the AWS cluster from 1.11 to 1.12 and that cleared this error when accessing from service to service within Kubernetes. However, the error still persisted when accessing from outside the Kubernetes cluster using a ... | StefanH |
<p><strong>What I have</strong></p>
<p>I have used Kube secrets for private Docker registry authentication in the <code>default</code> namespace. That works as expected. For example:</p>
<pre><code>$ kubectl get secret regsecret
NAME TYPE DATA AGE
regsecret kubernetes.io/dock... | Kartik Pandya | <p>By design, there is no way to accomplish this. You will need to create the <code>regsecret</code> in the same namespace where your Deployment is.</p>
<blockquote>
<p><code>ImagePullSecrets</code> is an optional list of references to secrets <strong>in the same
namespace</strong> to use for pulling any of t... | Janos Lenart |
<p>I have a task. I need to write python code to generate a yaml file for kubernetes. So far I have been using pyyaml and it works fine. Here is my generated yaml file:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
data:
info:
name: hostname.com
aio-max-nr: 262144
cpu:
cpuLogicalCores: 4
memory... | Livid Font | <p>The pipe makes the contained values a string. That string is not processed by YAML, even if it contains data with YAML syntax. Consequently, you will need to give a string as value.</p>
<p>Since the string contains data in YAML syntax, you can create the string by processing the contained data with YAML in a previou... | flyx |
<p>kube-controller-manager has the following property</p>
<pre><code>-deployment-controller-sync-period duration Default: 30s
Period for syncing the deployments.
</code></pre>
<p>What does this actually control and what does <code>period for syncing the deployments</code> mean?</p>
| Mark | <p>Haha most curious thing. You'd expect it does something like controlling how often the controller checks whether the status of Deployment objects are compatible with spec or if there is a change needed.</p>
<p>However currently the controller-manager is notified on changes by the apiserver so it always inherently k... | Janos Lenart |
<p>I want to reserve static IP address for my k8s exposed service.
If I am not mistaken when I expose the k8s service it gets the random public IP address. I redeploy my app often and the IP changes.
But I want to get permanent public IP address.
My task is to get my application via permanent IP address (or DNS-name).<... | malcolm | <p>This is cloud provider specific, but from the tag on your question it appears you are using Google Cloud Platform's Kubernetes Engine (GKE). My answer is specific for this situation.</p>
<p>From the <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer#step_5_optional_configuring_a_static... | Janos Lenart |
<p>My kubernetes version is 1.10.4.</p>
<p>I am trying to create a ConfigMap for java keystore files:</p>
<pre><code>kubectl create configmap key-config --from-file=server-keystore=/home/ubuntu/ssl/server.keystore.jks --from-file=server-truststore=/home/ubuntu/ssl/server.truststore.jks --from-file=client--truststore=... | user1068861 | <p><code>kubectl describe</code> does not show binary data in ConfigMaps at the moment (kubectl version v1.10.4); also the <code>DATA</code> column of the <code>kubectl get configmap</code> output does not include the binary elements:</p>
<pre><code>$ kubectl get cm
NAME DATA AGE
key-config 0 ... | Janos Lenart |
<p>I want to debug the pod in a simple way, therefore I want to start the pod without deployment.</p>
<p>But it will automatically create a deployment</p>
<pre><code>$ kubectl run nginx --image=nginx --port=80
deployment "nginx" created
</code></pre>
<p>So I have to create the <code>nginx.yaml</code> file</p>... | Larry Cai | <pre><code>kubectl run nginx --image=nginx --port=80 --restart=Never
</code></pre>
<blockquote>
<p><code>--restart=Always</code>: The restart policy for this Pod. Legal values [<code>Always</code>, <code>OnFailure</code>, <code>Never</code>]. If set to <code>Always</code>
a deployment is created, if set to <code... | Janos Lenart |
<p>one of my keys in a Kubernetes deployment is really big and I want to break it into a multi line key:</p>
<pre class="lang-yaml prettyprint-override"><code>annotations:
container.apparmor.security.beta.kubernetes.io/9c2591b6-bd95-442a-9d35-fb600143a873: runtime/default
</code></pre>
<p>I tried this:</p>
<pre class... | cmdjulian | <p>Use double quotes and escape the newlines:</p>
<pre class="lang-yaml prettyprint-override"><code>annotations:
? "container.apparmor.security.beta.kubernetes.io/\
9c2591b6-bd95-442a-9d35-fb600143a873"
: runtime/default
</code></pre>
<p>Double quotes are the only YAML scalar that can be broken anywhe... | flyx |
<p>So I've got a Kubernetes cluster up and running using the <a href="https://coreos.com/kubernetes/docs/latest/getting-started.html" rel="nofollow noreferrer">Kubernetes on CoreOS Manual Installation Guide</a>.</p>
<pre><code>$ kubectl get no
NAME STATUS AGE
coreos-master-1 Ready,Sch... | grasbueschel | <p>The Sevice network provides fixed IPs for Services. It is not a routeable network (so don't expect <code>ip ro</code> to show anything nor will ping work) but a collection iptables rules managed by kube-proxy on each node (see <code>iptables -L; iptables -t nat -L</code> on the nodes, not Pods). These <a href="https... | Janos Lenart |
<p>Team, my yaml syntax is correct as I validated it online. However, I am not able to run it and every time it throws a different error.</p>
<pre><code>└─ $ ▶ kubectl create -f ~/waste/wf.yaml
Error: failed to parse yaml file: error unmarshaling JSON: while decoding JSON: unknown field "\u00a0\u00a0\u00a0\u00a0comple... | AhmFM | <p>0xA0 (decimal 160) is a white space looking character but is not actually space (0x20 or decimal 32). You have probably copy pasted that from a web page. Fix your yaml to use spaces instead.</p>
<p>"Spaces" in your file: " ”</p>
<p>Actual space: " "</p>
| Janos Lenart |
<p>I am trying to pass given part of values.yaml into helm template:</p>
<pre><code> receivers:
test1:
test2:
test3:
test4:
</code></pre>
<p>using function:</p>
<p><code>{{ .Values.receivers | toYaml | nindent 2}}</code></p>
<p>Code is placed in correct format, however empty fields get filled wi... | nlesniak | <p>There are no fields inserted. The processor only replaces values that already exist with a different serialization that has the same semantics.</p>
<p><code>test3:</code> in YAML without a value is parsed as having an empty scalar value. The <a href="https://yaml.org/spec/1.2.2/#103-core-schema" rel="nofollow norefe... | flyx |
<p>Is there a way to get a trigger to shutdown, so we can close all connections gracefully before shutdown and don't proceed any actions after that probe and keeping the probe ready to kill.</p>
<p>This including flushing logs, keeping any state of the application saved before handing over to the new pod and many more... | Kannaiyan | <p>You have 2 options:</p>
<ol>
<li><p>Containers (PID 1) receive SIGTERM before the container (and the pod) is removed. You can trap SIGTERM and act on it.</p></li>
<li><p>You can use the <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-details" rel="nofollow noreferrer">preStop... | Janos Lenart |
<p>When I run exec command</p>
<pre><code> kubectl exec kubia-zgxn9 -- curl -s http://10.47.252.17
Error from server (BadRequest): pod kubia-zgxn9 does not have a host assigned
</code></pre>
<p>Describe pod shows host</p>
<pre><code>IP:
Controlled By: ReplicationController/kubia
Containers:
kubia:
... | Richard Rublev | <p>The Pod is probably not yet scheduled to a Node.</p>
<p>Maybe it just took a little longer than expected or perhaps it's asking for resources that no node can satisfy at the moment.</p>
<p>Check the output of <code>kubectl get pod kubia-zgxn9</code> and see if the state is <code>Running</code>. If so, retry now. I... | Janos Lenart |
<p>In the first yaml below, the second <code>podSelector</code> clause (under <code>to</code>) seems correctly formatted, with two spaces indent for <code>matchLabels</code>, consistent with standards and the rest of the yaml.</p>
<p>The second yaml is identical, but <code>matchLabels</code> has four spaces. This for... | Joshua Fox | <p>Well apparently <code>matchLabels</code> should be a key in the mapping value of <code>podSelector</code>, hence it must be more indented. This:</p>
<pre><code>- podSelector:
matchLabels:
</code></pre>
<p>Places <code>matchLabels</code> on the same indentation level as <code>podSelector</code>, since the initial... | flyx |
<p>Using Kubernetes, exactly the <code>kubectl apply -f ./auth.yaml</code> statement, i'm trying to run a Authorization Server in a pod, but when I check out the logs, this show me the following error:</p>
<pre><code> . ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | ... | Alejandro Villamizar | <p>I was using Spring Boot 3 but was missing:</p>
<pre><code> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</code></pre>
| Chris |
<p>I want to edit a configmap from <code>aws-auth</code> during a vagrant deployment to give my vagrant user access to the EKS cluster. I need to add a snippet into the existing <code>aws-auth</code> configmap. How do i do this programmatically?</p>
<p>If you do a <code>kubectl edit -n kube-system configmap/aws-auth</... | Eli | <p>First, note that the <code>mapRoles</code> and <code>mapUsers</code> are actually treated as a string, even though it is structured data (yaml).</p>
<p>While this problem is solvable by jsonpatch, it is much easier using <a href="https://stedolan.github.io/jq/" rel="nofollow noreferrer"><code>jq</code></a> and <cod... | Janos Lenart |
<p>I am unable to get the TLS termination at nginx ingress controller working on my kubernetes cluster.</p>
<p>my ingress rule looks as the following : </p>
<pre><code>Christophers-MacBook-Pro-2:acme-microservice cjaime$ kubectl describe ing myapp-ingress-1
Name: myapp-ingress-1
Namespace: default
... | hackmabrain | <p>Your tests with openssl are executed correctly and they show that nginx does offer the valid certificate for <strong>myapp-default.acme.io</strong> when that hostname is provided in the request via <a href="https://en.m.wikipedia.org/wiki/Server_Name_Indication" rel="nofollow noreferrer">SNI</a>. This is in harmony ... | Janos Lenart |
<p>I installed istio using these commands:</p>
<pre><code>VERSION = 1.0.5
GCP = gcloud
K8S = kubectl
@$(K8S) apply -f istio-$(VERSION)/install/kubernetes/helm/istio/templates/crds.yaml
@$(K8S) apply -f istio-$(VERSION)/install/kubernetes/istio-demo-auth.yaml
@$(K8S) get pods -n istio-system
@$(K8S) label namespace de... | user674669 | <p>If you used <code>istioctl</code>, it's pretty easy:</p>
<pre><code>istioctl x uninstall --purge
</code></pre>
<p>Of course, it would be easier if that command were listed in <code>istioctl --help</code>...</p>
<p>Reference: <a href="https://istio.io/latest/docs/setup/install/istioctl/#uninstall-istio" rel="noreferr... | Tin Can |
<p>I have created a new GCP Kubernetes cluster. The cluster is private with NAT - not have connection to the internet. I also deploy <code>bastion</code> machine which allow my to connect into my private network (vpc) from the internet. This is the <a href="https://cloud.google.com/nat/docs/using-nat" rel="nofollow nor... | No1Lives4Ever | <p><code>kubectl proxy</code> acts exactly as an apiserver, exactly like the target apiserver - but the queries trough it are already authenticated. From your description, 'works with curl', it sounds like you've set it up correctly, you just need to target the client kubectl to it:</p>
<pre><code>kubectl --server=htt... | Janos Lenart |
<p>Trying to run Elastic Search 6.2.4 on Openshift but it is not running and the container exits with the code 137. </p>
<pre><code>[2018-06-01T14:24:58,148][INFO ][o.e.p.PluginsService ] [jge060C]
loaded module [ingest-common]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [... | Jayabalan Bala | <p>Kernel <em>command line</em> parameters can't be changed per pod, but <code>vm.max_map_count</code> is parameter you can change via sysctl.</p>
<p>See these two similar SO question for a solution:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/44439372/how-to-pass-sysctl-flags-to-docker-from-k8s">How to... | Janos Lenart |
<p>Adding the annotation:</p>
<pre><code> annotations:
nginx.ingress.kubernetes.io/auth-url: http://my-auth-service.my-api.svc.cluster.local:8080
</code></pre>
<p>...to my ingress rule causes a 500 response from the ingress controller (the ingress works without it).</p>
<p>The service exists and I can ssh into ... | Neilos | <p>FWIW, for future readers - I ran into the same problem, and after looking at my auth service logs, noticed nginx ingress' requests were appending a /_external-auth-xxxxxx path to the request url.</p>
<p>Here's where the ingress controller does it, in the source:</p>
<p><a href="https://github.com/kubernetes/ingres... | oliverbarnes |
<p>I have multiple pods running as below. I want to delete them all except the one having minimum age. How to do it?</p>
<p><a href="https://i.stack.imgur.com/ejLRE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ejLRE.png" alt="enter image description here"></a></p>
| Vatan Soni | <p>Something like this? Perhaps also add <code>-l app=value</code> to filter for a specific app</p>
<pre><code>kubectl get pods --sort-by=.metadata.creationTimestamp -o name | head -n -1 | xargs echo kubectl delete
</code></pre>
<p>(Remove <code>echo</code> to do it for realz)</p>
| Janos Lenart |
<p>I have a Kubernetes environment with a rabbitmq servirve who deploys 2 pods of rabbitmq.</p>
<p>I need to install a plugin on rabbitmq, (Delayed Message Plugin) but I don't like the "manual" way, so if the pod is deleted, I have to install the plugin again.</p>
<p>I want to know which is the recommended way of ach... | dragonalvaro | <p>You should mount the configuration for RabbitMQ from a config map.</p>
<p>For example:</p>
<p>The ConfigMap:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: rabbitmq-config
namespace: rabbitmq
data:
enabled_plugins: |
[rabbitmq_management,rabbitmq_peer_discovery_k8s].
rabbitmq.conf: |
... | matthias krull |
<p>I am trying to run apache ignite cluster using Google Kubernetes Engine.</p>
<p>After following the tutorial here are some <strong>yaml</strong> files.</p>
<p>First I create a service -
<strong>ignite-service.yaml</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
# Name of Ignite Service used by Ku... | wadhwasahil | <p>Step 1: <code>kubectl apply -f ignite-service.yaml</code> (with the file in your question)</p>
<p>Step 2: <code>kubectl apply -f ignite-rbac.yaml</code></p>
<p>ignite-rbac.yaml is like this:</p>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
name: ignite
namespace: default
---
apiVersion: rbac.autho... | Janos Lenart |
<p>In the documentation about affinity and anti-affinity rules for kubernetes there is a pratical use case arround a <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#more-practical-use-cases" rel="nofollow noreferrer">web application and a local redis cache</a>. </p>
<ol>
<li>The redis deplo... | Geoffrey Samper | <p>This can be configured in the (redis) Service, but in general it is not recommended:</p>
<blockquote>
<p>Setting <code>spec.externalTrafficPolicy</code> to the value <code>Local</code> will only proxy requests to local endpoints, never forwarding traffic to other nodes</p>
</blockquote>
<p>This is a complex topi... | Janos Lenart |
<p>Is there a way to get the actual resource (CPU and memory) constraints inside a container?</p>
<p>Say the node has 4 cores, but my container is only configured with 1 core through resource requests/limits, so it actually uses 1 core, but it still sees 4 cores from /proc/cpuinfo. I want to determine the number of th... | Dagang | <h2>Short answer</h2>
<p>You can use the <a href="https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-container-fields-as-values-for-environment-variables" rel="noreferrer">Downward API</a> to access the resource requests and limits. There is no need for service ac... | Janos Lenart |
<p>What's the best way to store a persistent file in Kubernetes? I have a cert (.pfx) and I want to be passing to the application its path. From the looks of it it can't be stored in secrets. Was thinking about a volume but the question is how do I upload the file to it? And which type of volume to choose? Or is there ... | FRC | <p>It's unclear from your question why you came to the conclusion that it can't be stored as a Secret. This is one of the main <a href="https://kubernetes.io/docs/concepts/configuration/secret/#use-cases" rel="noreferrer">use cases</a> for Secrets.</p>
<p>Step 1. Create a Secret from your file:</p>
<pre><code>kubectl... | Janos Lenart |
<p>when i run this command mentioned below <code>kubectl get po -n kube-system</code>
I get this error ::
<strong>The connection to the server localhost:8080 was refused - did you specify the right host or port?</strong></p>
| Adarsha Jha | <p><code>localhost:8080</code> is the default server to connect to if there is no <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl" rel="nofollow noreferrer"><code>kubeconfig</code></a> present on your system (for the current user).</p>
<p>Follow the instructions on the page l... | Janos Lenart |
<p>I have the following Ingress resource:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: main-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.... | Kostas Demiris | <p>Your patch has a number of problems; for example <code>"- path"</code> instead of <code>"path"</code> but also incorrect referencing of object levels. However, even if you fixed the mistakes this would not work as intended. Let's see why.</p>
<p><code>kubectl patch</code> is a request for a <strong><em>strategic me... | Janos Lenart |
<p>A secret went missing in one of my Kubernetes namespaces. Either some process or somebody deleted this accidentally.
Is there a way to find out how this got deleted.</p>
| Frqa | <p>If <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/audit/" rel="nofollow noreferrer">audit logging</a> was enabled on the cluster at the time, then yes. Some hosted Kubernetes clusters (GKR, AKS, ...) can be enabled for this too, but you haven't specified the kind of cluster/provider. Otherwise t... | Janos Lenart |
<p>I am following this tutorial at <a href="https://gettech1.wordpress.com/2016/05/26/setting-up-kubernetes-cluster-on-ubuntu-14-04-lts/" rel="nofollow noreferrer">https://gettech1.wordpress.com/2016/05/26/setting-up-kubernetes-cluster-on-ubuntu-14-04-lts/</a> to setup kubernet multi node with 2 minions and 1 master no... | A l w a y s S u n n y | <p>The command you should be executing is <code>KUBERNETES_PROVIDER=ubuntu ./kube-up.sh</code></p>
<p>Without setting that environment variable kube-up.sh tries to deploy VMs on Google Compute Engine and to do so it needs the gcloud binary that you don't have installed.</p>
| Janos Lenart |
<p>How can I pass the <code>nginx.conf</code> configuration file to an nginx instance running inside a Kubernetes cluster?</p>
| xechelonx | <p>You can create a ConfigMap object and then mount the values as files where you need them:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx.conf: |
your config
comes here
like this
other.conf: |
second file
contents
</code></pre>
<p>And in you pod spec:<... | Janos Lenart |
<p>I am trying to get heapster eventer to work on a cluster with RBAC enabled. Using the same roles that work for /heapster command does not seem to be sufficient.</p>
<p>On running the pod logs fill up with entries like this:</p>
<pre><code>Failed to load events: events is forbidden: User "system:serviceaccount:kube... | Gudlaugur Egilsson | <p>All of the above objects seem to be correct to me.</p>
<p>It's just a hunch but perhaps you created the Deployment first and then the ClusterRole and/or ClusterBindingRole and/or the ServiceAccount itself. Make sure you have these 3 first, then delete the current heapster Pods (or the Deployment, and wait for the P... | Janos Lenart |
<p>Is it possible to map, the device port(USB port) of a worker node, to a POD?
Similar to <code>docker create --device=/dev/ttyACM0:/dev/ttyACM0</code></p>
<p>Is it possible? I checked the refence doc, but could not find anything.</p>
<p>In Docker service, is it possible to map <code>--device port</code> to service ... | jisan | <p>You can actually get this to work. You need to run the container privileged and use a hostPath like this:</p>
<pre><code> containers:
- name: acm
securityContext:
privileged: true
volumeMounts:
- mountPath: /dev/ttyACM0
name: ttyacm
volumes:
- name: ttyacm
hostPath:
path: /d... | Janos Lenart |
<p>I tried to create k8s cluster on aws using kops. </p>
<p>After create the cluster with default definition, I saw a LoadBalance has been created. </p>
<pre><code>apiVersion: kops/v1alpha2
kind: Cluster
metadata:
name: bungee.staging.k8s.local
spec:
api:
loadBalancer:
type: Public
....
</code></pre>
<... | pham cuong | <p>In the type of cluster that kops creates the apiserver (referred to as api above, a component of the Kubernetes master, aka control plane) <em>may</em> not have a static IP address. Also, kops can create a HA (replicated) control plane, which means there <strong>will</strong> be multiple IPs where the apiserver is a... | Janos Lenart |
<p>I have the following services and would like to call those outside from kubernetes: </p>
<pre><code>k get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
greeter-service ClusterIP 10.233.35.214 <none> 3000/TCP 4d9h
helloweb ... | softshipper | <p>Your query didn't match the host. Try</p>
<pre><code>curl -v -H 'Host: greeter-service.default.svc.cluster.local' 172.17.8.180:80/greeting
</code></pre>
| Janos Lenart |
<p>How can I get the image ID (the docker sha256 hash) of a image / container within a Kubernetes deployment? </p>
| Chris Stryczynski | <p>Something like this will do the trick (you must have <code>jq</code> installed):</p>
<pre><code>$ kubectl get pod --namespace=xx yyyy -o json | jq '.status.containerStatuses[] | { "image": .image, "imageID": .imageID }'
{
"image": "nginx:latest",
"imageID": "docker://sha256:b8efb18f159bd948486f18bd8940b56fd2298... | Janos Lenart |
<p>I have a simple meteor app deployed on kubernetes. I associated an external IP address with the server, so that it's accessible from within the cluster. Now, I am up to exposing it to the internet and securing it (using HTTPS protocol). Can anyone give simple instructions for this section?</p>
| fay | <p>In my opinion <a href="https://github.com/jetstack/kube-lego" rel="noreferrer">kube-lego</a> is the best solution for GKE. See why:</p>
<ul>
<li>Uses <a href="https://letsencrypt.org/" rel="noreferrer">Let's Encrypt</a> as a CA</li>
<li>Fully automated enrollment and renewals</li>
<li>Minimal configuration in a sin... | Janos Lenart |
<p>I've created a secret using</p>
<pre class="lang-shell prettyprint-override"><code>kubectl create secret generic production-tls \
--from-file=./tls.key \
--from-file=./tls.crt
</code></pre>
<p>If I'd like to update the values - how can I do this?</p>
| Chris Stryczynski | <p>This should work:</p>
<pre class="lang-shell prettyprint-override"><code>kubectl create secret generic production-tls \
--save-config \
--dry-run=client \
--from-file=./tls.key --from-file=./tls.crt \
-o yaml | \
kubectl apply -f -
</code></pre>
| Janos Lenart |
<p>When trying to use the helm function: lookup, I do not get any result at all as expected.</p>
<p>My Secret that I try to read looks like this</p>
<pre><code>apiVersion: v1
data:
adminPassword: VG9wU2VjcmV0UGFzc3dvcmQxIQ==
adminUser: YWRtaW4=
kind: Secret
metadata:
annotations:
sealedsecrets.bitnami.com/clu... | Mikael Nyborg | <p>This error is the result of two parts <em>working</em> together:</p>
<p>First, helm's <code>lookup</code> only works in a running cluster, not when running <code>helm template</code> (without <code>--validate</code>). If run in that manner it returns nil. (It is usually used as <code>lookup ... | default dict {}</co... | Janos Lenart |
<p>Just curious about the intent for this default namespace.</p>
| Steven Barragán | <p>That namespace exists in clusters created with kubeadm for now. It contains a single ConfigMap object, cluster-info, that aids discovery and security bootstrap (basically, contains the CA for the cluster and such). This object is readable without authentication.</p>
<p>If you are courious:</p>
<pre><code>$ kubectl... | Janos Lenart |
<p>I read a bout metalLB in <a href="http://blog.cowger.us/2018/07/25/using-kubernetes-externaldns-with-a-home-bare-metal-k8s.html" rel="nofollow noreferrer">http://blog.cowger.us/2018/07/25/using-kubernetes-externaldns-with-a-home-bare-metal-k8s.html</a>
the writers said</p>
<blockquote>
<p>Bare metal cluster opera... | yasin lachini | <p>A Service with <code>type: NodePort</code> would open the same port on all of the nodes enabling clients to direct their traffic to any of the nodes and kube-proxy can balance the traffic between Pods from that point on. You face 3 problems here:</p>
<ol>
<li>Unless you are happy with depending on a single node you... | Janos Lenart |
<p>Can I run both docker swarm and kubernetes on same nodes , can overlay network and kubernetes internal cluster network work together ?</p>
| Rajib Mitra | <p>Technically yes, but it's not as good an idea as it sounds at first. Unfortunately it confuses Kubernetes about the amount of resources available on the nodes.</p>
| Janos Lenart |
<p>When a client sends a request to the Kubernetes apiserver, authentication plugins attempt to <a href="https://kubernetes.io/docs/admin/authentication/#webhook-token-authentication#authentication-strategies" rel="nofollow noreferrer">associate a number of attributes to the request</a>. These attributes can be used by... | dippynark | <p>The UID field is intentionally not used for authentication purposes, but it is to allow logging for audit purposes.</p>
<p>For many organizations this might not be important, but for example Google allows employees to change their usernames (but of course not the numeric UID). Logging the UID would allow lookups of... | Janos Lenart |
<p>I am using PostgreSQL helm chart and facing an issue while adding an init.sql script in the <code>/charts/postgresql/files/docker-entrypoint-initdb.d</code> and running <code>helm install</code>
and I am getting the following issue - </p>
<pre class="lang-none prettyprint-override"><code>Error: YAML parse error on... | Pranav Bhatia | <p>Your error doesn't seem to have much to do with Mac. While it's not informative, it looks like the problem is that Helm can't find the chart version 8.1.16: it doesn't exist in Bitnami repo and the version is not updated in your local <code>Chart.yaml</code>. Here's what I did to replicate it:</p>
<ol>
<li>Cloned t... | unclenorton |
<p>I am trying to install Minikube on a GCP VM. I am running into an issue where the OS is complaining that VT-X/AMD-v needs to be enabled. Are there any specific instructions for setting this up on GCP?</p>
| cyberbeast | <p><a href="https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances" rel="nofollow noreferrer">Nested Virtualization</a> is supported on GCP and I can confirm the documentation I've linked is up to date and workable.</p>
<p>Quoting the 3 basic points here that you need:</p>
<ul>
<li>... | Janos Lenart |
<p>Given I have created a ConfigMap with a file like that :</p>
<pre><code>VARIABLE1=foo
VARIABLE2=bar
</code></pre>
<p>Is there a way to access those values in Kubernetes or does it have to be in the YAML format?</p>
| ZedTuX | <p>Let's say you have a file called <code>z</code> with the contents above. You have two options to make that into a ConfigMap.</p>
<h2>Option 1 (--from-file)</h2>
<pre><code>$ kubectl create cm cm1 --from-file=z
</code></pre>
<p>This will result in an object like this:</p>
<pre><code>apiVersion: v1
kind: ConfigMap... | Janos Lenart |
<p>I am setting up a Kubernetes cluster on Google using the Google Kubernetes Engine. I have created the cluster with auto-scaling enabled on my nodepool.
<a href="https://i.stack.imgur.com/g2Tu9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g2Tu9.png" alt="nodepool_setup"></a></p>
<p>As far as I understan... | darkownage | <p>You really have debugged it yourself already. You need to edit the <a href="https://console.cloud.google.com/iam-admin/quotas?usage=USED" rel="noreferrer">Quotas on the GCP Console</a>. Make sure you select the correct project. Increase all that are low: probably addresses and CPUs in the zone. This process is semi ... | Janos Lenart |
<p>I'm trying to install minikube according to <a href="https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/" rel="nofollow noreferrer">this</a> manual.
First I had <a href="https://github.com/kubernetes/minikube/issues/2755" rel="nofollow noreferrer">this</a> bug so I downgraded minikube to versi... | deez | <p>The default disk size for minikube is 2000MB.</p>
<p>Set a new default size for minikube with</p>
<pre><code>minikube config set disk-size
</code></pre>
<p>eg</p>
<pre><code>minikube config set disk-size 8000
</code></pre>
<p>for 8GB (8000 mb)</p>
<p>Then delete your minikube with</p>
<pre><code>minikube del... | Ganesh Krishnan |
<p>I use <strong>kubeadm</strong> to launch cluster on <strong>AWS</strong>. I can successfully create a load balancer on <strong>AWS</strong> by using <strong>kubectl</strong>, but the load balancer is not registered with any EC2 instances. That causes problem that the service cannot be accessed from public. </p>
<p>... | jiashenC | <p>In My case the issue was with the worker nodes not getting the providerId assigned properly.</p>
<p>I managed to patch the node like - kubectl patch node ip-xxxxx.ap-southeast-2.compute.internal -p '{"spec":{"providerID":"aws:///ap-southeast-2a/i-0xxxxx"}}'</p>
<p>to add the ProviderID. And then when i deployed th... | user373480 |
<p>Our users are allowed to access Kubernetes clusters only from the management station, there is no possibility to access the API directly from their laptops/workstations.</p>
<p>Every user posses kubeconfig with relevant secrets belonging to this particular user. As the kubeconfig also contains the token used to aut... | Sl4dy | <p>You could use bash process substitution to pass the entire <code>kubeconfig</code> to <code>kubectl</code> without saving it to a filesystem.</p>
<p>Something like this works for CI systems:</p>
<ol>
<li>Base64-encode your <code>kubeconfig</code> and store it securely</li>
</ol>
<pre><code>export KUBECONFIG_DATA=$(c... | czak |
<p>I have a cluster and set up kubelet on a node (name is <code>myNode</code>) with the <code>static</code> CPU Manager Policy. So I've started kubelet with <code>--cpu-manager-policy=static</code> (to set the static policy) and <code>--reserved-cpus=1</code> (to make sure kubelet has one core to run on exclusively) as... | Wolfson | <p>You also need to provide memory request and limit in order to qualify for the <em>Guaranteed</em> tier and exclusive cores:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: wl
labels:
app: wl
spec:
containers:
- name: wl
image: docker.io/polinux/stress:latest
imagePullPolicy: IfNotPresent
... | Janos Lenart |
<p>I would like to implement functionality (or even better reuse existing libraries/APIs!) that would intercept a kubectl command to create an object and perform some pre-creation validation tasks on it before allowing kubectl command to proceed.</p>
<p>e.g.
check various values in the yaml against external DB for ex... | user1843591 | <p>The way to do this is by creating a <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook" rel="nofollow noreferrer">ValidatingAdmissionWebhook</a>. It's not for the faint of heart and even a brief example would be an overkill as a SO answer. A few pointer... | Janos Lenart |
<p>I'm running the theia code-editor on my EKS cluster and the image's default user is theia on which I grant read and write permissions on /home/project. However, when I mount that volume /home/project on my EFS and try to read or write on /home/project it returns permission denied I tried using initContainer but stil... | touati ahmed | <p>You can instead set the <code>securityContext</code> in your pod spec to run the Pods as uid/gid 1001.</p>
<p>For example</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
name: atouati
spec:
replicas: 1
selector:
matchLabels:
app: atouati
templat... | OregonTrail |
<p>Pretty basic question. We have an existing swarm and I want to start migrating to Kubernetes. Can I run both using the same docker hosts?</p>
| Wjdavis5 | <p>See the official documentation for <em>Docker for Mac</em> at <a href="https://docs.docker.com/docker-for-mac/kubernetes/" rel="nofollow noreferrer">https://docs.docker.com/docker-for-mac/kubernetes/</a> stating:</p>
<blockquote>
<p>When Kubernetes support is enabled, you can deploy your workloads, in parallel, o... | gesellix |
<p>I have a small company network with the following services/servers:</p>
<ul>
<li>Jenkins</li>
<li>Stash (Atlassian)</li>
<li>Confluence (Atlassian)</li>
<li>LDAP</li>
<li>Owncloud</li>
<li>zabbix (monitoring)</li>
<li>puppet</li>
<li>and some Java web apps</li>
</ul>
<p>all running in separate kvm(libvirt)-vms in ... | stefa ng | <p>Regarding the multi-host networking: you're right that Docker links won't work across hosts. With Docker 1.9+ you can use "Docker Networking" like described in their blog post <a href="http://blog.docker.com/2015/11/docker-multi-host-networking-ga/" rel="nofollow">http://blog.docker.com/2015/11/docker-multi-host-net... | gesellix |
<p>We have configured to use 2 metrics for HPA</p>
<ol>
<li>CPU Utilization</li>
<li>App specific custom metrics</li>
</ol>
<p>When testing, we observed the scaling happening, but calculation of no.of replicas is not very clear. I am not able to locate any documentation on this.</p>
<p><strong>Questions:</strong></p... | arunk2 | <p>From <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#how-does-the-horizontal-pod-autoscaler-work" rel="noreferrer">https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#how-does-the-horizontal-pod-autoscaler-work</a></p>
<blockquote>
<p>If multiple metrics ... | Janos Lenart |
<p>If I have under volumes</p>
<pre><code>name: nfslocation
nfs:
server: 10.1.1.3
path: /vol/vol104/ostntfs0/folder/folder2
</code></pre>
<p>And I want to move it to a patch file,
how do I do that?</p>
<pre><code>-op: replace
...
</code></pre>
<p>I am not clear on the format.</p>
<p>Somethin... | archcutbank | <pre><code>- op: replace
path: /spec/template/spec/volumes/4/nfs/server
value: 10.1.1.3
- op: replace
path: /spec/template/spec/volumes/4/nfs/path
value: /vol/vol104/ostntfs0/folder/folder2
</code></pre>
<p>This worked out for me...</p>
| archcutbank |
<p>How can I pull <code>docker.pkg.github.com</code> Docker images from within Kubernetes cluster?</p>
<p>Currently, the Github Docker registry requires authentication even for packages from public Github repositories.</p>
| Vojtech Vitek - golang.cz | <ol>
<li>Create new Github Personal Access Token with <code>read:packages</code> scope at <a href="https://github.com/settings/tokens/new" rel="noreferrer">https://github.com/settings/tokens/new</a>.</li>
<li><p>Base-64 encode <code><your-github-username>:<TOKEN></code>, ie.:</p>
<pre><code>$ echo -n Vojte... | Vojtech Vitek - golang.cz |
<p>The timezone did not meet my expectations When i use <code>kubectl logs <mypod> --timestamps</code> to get the pod log.</p>
<p>current output:</p>
<pre class="lang-bash prettyprint-override"><code>2022-06-15T07:31:41.826543867Z 2022/06/15 15:31:41 [info] Start grpc server listen 58212 port.
2022-06-15T07:31:41... | Notscientific Farmer | <p><code>kubectl</code> does not support this directly at the time of writing this and it tricky to do this in a portable way. On Linux something like this would work:</p>
<pre><code>kubectl logs --timestamps mypod | while read timestamp line; do \
echo "$(env TZ="EST" date -d "$timestamp" '+... | Janos Lenart |
<p>I'm new to k8s, but I know that, as a k8s requirement, every Pod should be reachable from any other Pod. However, this is not happening in my setup: I can't ping from within a Pod another Pod in another Node. </p>
<p><strong>Here is my setup:</strong></p>
<p>I have one master node (<code>sauron</code>), and three ... | Daniel | <p>Solved the issue by entering <em>each</em> worker node and doing the following:</p>
<pre><code>rm /var/lib/weave/weave-netdata.db
reboot
</code></pre>
<p><strong>Explanation:</strong></p>
<p>My weave log files showed the excerpt:</p>
<pre><code>INFO: 2020/04/08 21:52:31.042120->[192.168.202.235:6783|fe:da:ea:... | Daniel |
<p>I have a Kubernetes cluster running Calico as the overlay and NetworkPolicy implementation configured for IP-in-IP encapsulation and I am trying to expose a simple nginx application using the following Service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: default
spec:
type: Lo... | dippynark | <p>I’m afraid we don’t have a simple way to match the tunnel IPs dynamically right now. If possible, the best solution would be to move away from IPIP; once you remove that overlay, everything gets a lot simpler.</p>
<p>In case you’re wondering, we need to force the nodes to use the tunnel IP because, if you’re suing... | Fasaxc |
<p>I have a kubernetes cluster and a nginx ingress. I have deployed an ingress to route traffic from a domain example.org to a specific container. Now, I am trying to block all requests which are not coming from a whitelisted ip range. Therefore I annotated the created ingress with <code>nginx.ingress.kubernetes.io/whi... | mkn | <p>Okay, so this documentation fixed the issue <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-s... | mkn |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.