prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I've got <code>Deployment</code> which has <code>n</code> nodes and I have service that exposes <code>4369</code>. I want to connect to one of those nodes via IEX. I am using <code>MiniKube</code> for my local development <code>Kubernetes</code> cluster which binds to some IP and I <code>can</code> access it's dashb...
<p><code>type: ClusterIP</code> with <code>clusterIP: None</code> looks fishy to me. I do not think that minikube provides support for that service type.</p> <p>I would try using <code>type: NodePort</code>, which should expose the service on the minikube IP. </p>
<p>I've got <code>Deployment</code> which has <code>n</code> nodes and I have service that exposes <code>4369</code>. I want to connect to one of those nodes via IEX. I am using <code>MiniKube</code> for my local development <code>Kubernetes</code> cluster which binds to some IP and I <code>can</code> access it's dashb...
<p>You can connect to the pod directly:</p> <pre><code>kubectl exec -it your-pod-name </code></pre> <p>it defaults to bash, which I didn't had so I have to do:</p> <pre><code>kubectl exec -it your-pod-name -- /bin/sh </code></pre> <p>I hope that helps.</p>
<p>Is it possible to turn off/remove/disable the basic auth in GKE that was added by default?</p> <p>It's possible to authenticate towards the GKE master using a number of ways, <a href="http://kubernetes.io/docs/admin/authentication/" rel="nofollow noreferrer">as listed in the documentation</a>.</p> <p>When you crea...
<p>Yes, you can disable Basic Authentication on cluster creation:</p> <p><a href="https://i.stack.imgur.com/j88bg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j88bg.png" alt="enter image description here"></a></p>
<p>I am trying to make an HTTPS call in a Docker container running a Go binary. This gives me the following error:</p> <blockquote> <p>x509: failed to load system roots and no roots provided</p> </blockquote> <p>Having looked this up, it seems the problem is that the BusyBox docker image does not have a root CA cer...
<p>There are multiple options you can have</p> <p><strong>Share certificates from host</strong></p> <p>As you pointed out you can share <code>/etc/ssl/certs</code> from the host.</p> <p><strong>Use busybox with certificates</strong></p> <p>You can use a image like <code>odise/busybox-curl</code> which already has t...
<p>I am running 1.6.2, and am hitting the <code>/apis/batch/v2alpha1/namespaces/&lt;namespace&gt;/cronjobs</code> endpoint, with a valid namespace and a request body of </p> <pre><code>{ "body": { "apiVersion": "batch/v2alpha1", "kind": "CronJob", "metadata": { "name": "hello" }, ...
<p>The v2alpha1 features are not enabled by default. Make sure you are starting your kube-apiserver with this switch to enable the CronJob resource: <code>--runtime-config=batch/v2alpha1=true</code>.</p>
<p>I have a Kubernetes Pod created by a Stateful Set (not sure if that matters). There are two containers in this pod. When one of the two containers fails and use the <code>get pods</code> command, 1/2 containers are Ready and the Status is "Error." The second container never attempts a restart and I am unable to dest...
<p>I encounter a similar problem on a node in my k8s 1.6 cluster esp. when the node has been running for a couple of weeks. It can happen to any node. When this happens, I restart kubelet on the node and the errors go away.</p> <p>It's not the best thing to do, but it always solves the problem. It's also not detriment...
<p>Assume currently I have 2 <code>PVC</code>s with <code>ReadWriteOnce</code>, claimed by <code>Pod #1</code> and <code>Pod #2</code> respectively. Both are running on <code>Node #1</code>.</p> <p>Next, <code>Pod #2</code> is updated with the newer Docker image. However, at the same time <code>Pod #3</code> is run an...
<p>Yes, that is the downside of pv/pvc with the current storage deliveries of AWS and GCE.</p> <p>To avoid this, you would have to use a different storage infrastructure which does not have this limitation. Possibilities are CEPH, Gluster, scaleIO (and others). These solutions abstract the storage away from the disks ...
<p>I am able to set up standalone GRPC ( in Java) server on pods and its communicating with my local GRPC (nodejs) client over http2.</p> <p>Now as a next step - I am trying to set up GRPC server + spring boot on our pods - </p> <ol> <li>Do I have to start spring boot and GRPC as two separate processes on different p...
<ol> <li><p>You can start spring-boot and GRPC in the one process and listening different ports at the same time.</p></li> <li><p>gRPC server communicates over http2 if you start the gRPC server by <code>io.grpc.netty.NettyServerBuilder</code></p></li> </ol> <p>You can see the project in <a href="https://github.com/Lo...
<p>Is it possible to deploy a self-healing and scaling Redis-like key-value store that I can run in Kubernetes (or Swarm or any other automated cloud env)?</p> <p>The challenges I found with Redis:</p> <ol> <li>You need to create a cluster manually with <code>redis-trib</code></li> <li>New nodes need to be added to t...
<p>You can use the Kubernetes Redis Example which work with Redis Sentinel. In case the master fails, sentinel promotes a slave to the new master. The Replication Controller boots a new Slave Pod. Your application connects to sentinel and from that service you will get the ip of the new master. </p> <p>Redis Sentinel ...
<p>I am trying to setup a multi broker kafka on a kubernetes cluster hosted in Azure. I have a single broker setup working. For the multi broker setup, currently I have an ensemble of zookeeper nodes(3) that manage the kafka service. I am deploying the kafka cluster as a replication controller with replication factor o...
<p>Kubernetes has the concept of <code>Statefulsets</code> to solve these issues. Each instance of a statefulset has it's own DNS name so you can reference to each instance by a dns name. </p> <p>This concept is described <a href="http://blog.kubernetes.io/2016/12/statefulset-run-scale-stateful-applications-in-kuberne...
<p>I developed two web apps(we call them A and B) and deployed them to k8s. The web app A refers to the images generated by web app B. In previous environment, B has the fixed IP and port which makes it very easier to reach the images hosted on B.</p> <p>In the K8S environment, I use the service type - NodePort. In th...
<p>There are three answers to your question:</p> <p>The first is that one should not be destroying the <code>Service</code> just because the <code>Pod</code>s behind it are redeployed. The <code>Service</code> is designed to be the long-lived contract that abstracts over the placement (or count) of the servicing <code...
<p>I just want to find out if I understood the documentation right:</p> <p>Suppose I have an nginx server configured with a Deployment, version 1.7.9 with 4 replicas.</p> <pre><code>apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: ...
<p>The answer to "what happens to the request" is that they will be round-robin-ed across all Pods that match the selector within the Service, so yes, they will all receive traffic. I believe kubernetes considers this to be a feature, not a bug.</p> <p>The answer about the traffic going to the old Pods can be answered...
<p>I have created two different namespaces for different environment. one is devops-qa and another is devops-dev. I created two ingress in different namespaces. So while creating ingress of qa env in devops-qa namespace, the rules written inside ingress of qa is working fine. Means I am able to access the webpage of qa...
<p>I actually Solved my problem. I did everything correct. But only thing I did not do is to map the hostname with the same ip in Route53. And instead of accessing the website with hostname, I was accessing it from IP. Now after accessing the website from hostname, I was able to access it :) </p>
<p>While trying to run the next Docker command:</p> <pre><code>docker run \ --net=host \ --pid=host \ --privileged=true \ -d \ gcr.io/google_containers/hyperkube-amd64:v1.7.0 \ /nsenter \ --target=1 \ --mount \ --wd=. \ -- ./hyperkube kubelet \ --hostname-override="127.0.0.1" \ --address="0.0.0.0" \ ...
<p>kubernetes <a href="https://github.com/kubernetes/minikube/pull/1542#issuecomment-315201536" rel="nofollow noreferrer">doesn't support Docker 17.06</a>. Try Docker 1.12.6 instead.</p>
<p>Currently I'm using kubeadm 1.7.2 to install kubernetes.</p> <p>It will download images like <code>gcr.io/google_containers/etc-amd64:3.0.17</code>. But in gcr.io, I only see <code>google-containers</code>.</p> <p>So <code>gcr.io.google_containers</code> is the same <code>gcr.io.google-containers</code> ????</p> ...
<blockquote> <p>So gcr.io.google_containers is the same gcr.io.google-containers</p> </blockquote> <p>Since 2015, yes: see <a href="https://github.com/kubernetes/kubernetes/issues/6229" rel="nofollow noreferrer">kubernetes issue 6229</a></p> <blockquote> <p>It turns out that that is because I am using an older ve...
<p>I am trying to assign a static IP address to a pod on deployment.</p> <pre><code>apiVersion: apps/v1beta1 kind: Deployment metadata: name: aws-test-mysql spec: replicas: 1 template: metadata: labels: app: aws-test-mysql spec: containers: - name: aws-test-mysql image: ...
<p>A static IP cannot be assigned to a Pod because of the dynamic nature of kubernetes' IP layer.</p> <p>Since you don't want to attach a Service (which is the best way imho), a close alternative is to convert the Deployment to a StatefulSet. This will give the Pod a static hostname which more-or-less fulfils your req...
<p>I understand how to set targetPort as integer value when defining service in k8s.</p> <p>However, I'm a little confused about how to set targetPort with string value.</p> <p>Is there any example about this?</p> <p>Thanks,</p>
<p>This Service is for Prometheus. In the following manifest, you first have to define <code>web</code> in the Deployment before you can refer to it as a string in <code>targetPort</code>.</p> <pre><code>apiVersion: v1 kind: Service metadata: labels: prometheus: k8s name: prometheus-k8s namespace: monitoring...
<p>In kubernetes, is there a way to mount <a href="https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes" rel="noreferrer">hostPath volume</a> after pod got started?</p>
<p>There is no way to add a volume to a running Docker container, so Kubernetes has no way to add a volume to a running Pod. Modifying the Pod to include a new <code>hostPath</code> volume will recreate the container(s) in the Pod and mount the volumes as specified.</p>
<p>Jenkins ver. 2.60.1 (running in container on kubernetes)</p> <p>Kubernetes Plugin ver. 0.11 (<a href="https://github.com/jenkinsci/kubernetes-plugin" rel="nofollow noreferrer">https://github.com/jenkinsci/kubernetes-plugin</a>)</p> <p>Pipeline test:</p> <pre><code>podTemplate( label: 'mypod', volumes: [ p...
<p>Upgrading the kubernetes-plugin to 0.12 (29/07/2017) and restarting jenkins has fixed the issue!</p>
<p>I have one own nginx configuration <code>/home/ubuntu/workspace/web.conf</code> generated by script. I prefer to have it under <code>/etc/nginx/conf.d</code> besides <code>default.conf</code></p> <p>Below is the <code>nginx.yaml</code></p> <pre> apiVersion: v1 kind: Pod metadata: name: nginx spec: volumes:...
<p>Try using the <code>subPath</code> key on your <code>volumeMounts</code> like this:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: singlefile spec: containers: - image: ubuntu name: singlefiletest command: - /bin/bash - -c - ls -la /singlefile/ &amp;&amp; cat /singlefile/hos...
<p>How can I prevent kube-dns from forwarding request to Google's name servers (8.8.8.8:53 and 8.8.4.4:53)? I just want to launch pods only for internal use, which means containers in pods are not supposed to connect to the outside at all. When a Zookeeper client connects to a Zookeeper server using hostname (e.g. zkCl...
<p>I don't think there is an option to completely prevent the <code>kube-dns</code> addon from forwarding requests. There certainly isn't an option directly in <code>kubeadm</code> for that.</p> <p>Your best bet is to edit the <code>kube-dns</code> <code>Deployment</code> (e.g. <code>kubectl edit -n kube-system deploy...
<p>I exposed a service with a static IP and an Ingress through an nginx controller as one of the examples of the <a href="https://github.com/kubernetes/ingress/tree/master/examples/static-ip/nginx" rel="noreferrer">kubernetes/ingress</a> repository. I have a second LoadBalancer service, that is not managed by any Ingre...
<p>Using a <code>Service</code> with <code>type: LoadBalancer</code> and using an <code>Ingress</code> are usually mutually exclusive ways to expose your application.</p> <p>When you create a <code>Service</code> with <code>type: LoadBalancer</code>, Kubernetes creates a LoadBalancer in your cloud account that has an ...
<p>In preparation for HIPAA compliance, we are transitioning our Kubernetes cluster to use secure endpoints across the fleet (between all pods). Since the cluster is composed of about 8-10 services currently using HTTP connections, it would be super useful to have this taken care of by Kubernetes.</p> <p>The specific ...
<p>Actually the correct answer is &quot;it depends&quot;. I would split the cluster into 2 separate networks.</p> <ol> <li><p><strong>Control Plane Network</strong></p> <p>This network is that of the physical network or the underlay network in other words.</p> <p>k8s control-plane elements - kube-apiserver, kube-contro...
<p>I am on ubuntu, today I upgraded kubernetes services with apt-get upgrade; apt-get update. Since then kubernetes stops working, none of the services are running, api-server is not starting. I get below error when i run any command</p> <pre><code>root:~# kubectl get pods The connection to the server 172.31.139.86:64...
<p>I see you have upgraded to <code>DockerVersion:17.06.0-ce</code>. I don't think this version is tested with kubernetes based on this page <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#external-dependency-version-information" rel="nofollow noreferrer">https://github.com/kubernetes/kuberne...
<p>I faced with the problem that I cannot send emails from K8s pod using <code>smtp.gmail.com</code> and <code>587</code> port. I tried to use <code>dnsPolicy: ClusterFirstWithHostNet</code> but nothing has changed. With <code>dnsPolicy: Default</code> everything seems OK but I can't use this approach since pods should...
<p>Maybe it just a syntax error in your configmap with quotes (" vs “) If you run <code> kubectl -n kube-system logs kube-dns-xxxx -c dnsmasq </code> you will get a syntax error, instead of <code> upstreamNameservers to [8.8.8.8, 4.4.4.4] </code></p>
<p>I have recently followed the tutorial on how to use Kubernetes with Windows pods ( <a href="https://learn.microsoft.com/en-us/azure/container-service/kubernetes/container-service-kubernetes-windows-walkthrough" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/container-service/kubernetes/container-s...
<blockquote> <p>Can't resolve another service's hostname inside my Kubernetes.</p> </blockquote> <p>This is a by design behavior. Because the cluster IP does not exist.</p> <p>In Kubernetes, all the services in a cluster are handled by <strong>kube-proxy</strong>. kube-proxy runs on every node in the cluster, and w...
<p>While trying to run the next Docker command:</p> <pre><code>docker run \ --net=host \ --pid=host \ --privileged=true \ -d \ gcr.io/google_containers/hyperkube-amd64:v1.7.0 \ /nsenter \ --target=1 \ --mount \ --wd=. \ -- ./hyperkube kubelet \ --hostname-override="127.0.0.1" \ --address="0.0.0.0" \ ...
<p>I found the solution!</p> <p>Hyperkube is not designed to run in macOS so i had to use other kind of kubernetes server for local development and that work perfectly:</p> <p>I am currently using <a href="https://github.com/Mirantis/kubeadm-dind-cluster" rel="nofollow noreferrer">kubeadm-dind-cluster</a></p>
<p>I have a jenkins on my <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a> and I created a project which will run a kubectl command to connect to a kubernetes cluster using (minikube)</p> <p>I'm trying to run a windows command C:\Program Files (x86)\Jenkins\workspace\test2>kubectl ...
<p>Minikube makes use of SSL certificates to connect to the API server. Then you need to use that certificate to properly identify yourself. You can find the information in your <code>.kube/config</code> file. </p>
<p>I switched the project config for <code>gcloud</code> using <code>gcloud config set project abcxyz</code>, however <code>kubectl get pods</code> is returning the pods in the previous gcloud / kubernetes project.</p> <p>How do I update the project config to match gcloud's config?</p>
<p>After you've changed project, run:</p> <pre><code>gcloud container clusters get-credentials &lt;cluster_name&gt; </code></pre> <p>gcloud will then set kubectl to be looking at your new project.</p>
<p>It seems like get.k8s.io is the recommended way to deploy a Kubernetes cluster, but Digital Ocean isn't supported by this script.</p> <p>Is there an alternate way to easily set up a cluster on Digital Ocean that I've missed?</p> <p>Thanks</p>
<p>You can use <code>kubicorn</code> to create a fairly dope kubernetes cluster in Digital Ocean pretty easily. Here are the steps needed to do so:</p> <pre><code>// Install kubicorn go get github.com/kris-nova/kubicorn // Configure your auth export DIGITALOCEAN_ACCESS_TOKEN=***************************************** ...
<p>I have a rails project that using postgres database. I want to build a database server using Kubernetes and rails server will connect to this database.</p> <p>For example here is my defined <code>postgres.yml</code></p> <pre><code>apiVersion: v1 kind: Service metadata: name: postgres spec: selector: app: p...
<p>You can try by exposing your service on NodePort and then accessing the service on that port. </p> <p>Check here <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport</a></p>
<p>Running <code>kubectl get pods</code> with sudo:</p> <pre><code>sudo kubectl get pods The connection to the server localhost:8080 was refused - did you specify the right host or port? </code></pre> <p>Running as a normal user:</p> <pre><code>kubectl get pods No resources found. </code></pre>
<p>By default, kubectl looks in ~/.kube/config (or the file pointed to be $KUBECONFIG) to determine what server to connect to. Your home directory and environment are different when running commands as root. When no connection info is found, kubectl defaults to localhost:8080</p>
<p>I've created a resource with: <code>kubectl create -f example.yaml</code></p> <p>How do I edit this resource with kubectl? Supposedly <code>kubectl edit</code>, but I'm not sure of the resource name, and <code>kubectl edit example</code> returns an error of:</p> <pre><code>the server doesn't have a resource type ...
<p>You can do a <code>kubectl edit -f example.yaml</code> to edit it directly. Nevertheless I would recommend to edit the file locally and do a <code>kubectl apply -f example.yaml</code>, so it gets updated on Kubernetes.</p> <p>Also: Your command fails, because you have to specify a resource type. Example types are <...
<p>I'm trying to expose my api so I can send request to it. However when I used the command <code>minikube service api --url</code> I get nothing. All my pods are running fine according to <code>kubectl get pods</code> so I'm abit stuck about what this could be.</p> <pre><code>api-1007925651-0rt1n 1/1 Runn...
<p>Your configuration is fine, but only missing one thing.</p> <p>There are many types of <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types" rel="noreferrer">Services</a> in Kubernetes, but in this case you should know about two of them:</p> <blockquote> <p><e...
<p>I need to make a decision for container orchestration , and needed help in finding out limitation in real world scenarios that can occur using docker swarm over kubernetes, if anyone ever faced any such limitation please suggest. </p> <p><em>The containers cluster may reach a value of approx 50-100 containers.</em>...
<p>Docker swarm is young and there are a lot of features introduced relatively quickly. This however causes more issues and open "serious" bugs. For a production system that should be up 100% that might be an issue. I personally experienced <a href="https://github.com/moby/moby/issues/31698" rel="nofollow noreferrer">a...
<p>I have recently followed the tutorial on how to use Kubernetes with Windows pods ( <a href="https://learn.microsoft.com/en-us/azure/container-service/kubernetes/container-service-kubernetes-windows-walkthrough" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/container-service/kubernetes/container-s...
<p>So after trying out different scenarios I figured I'd delete the setup and try again, specifying a specific version of microsoft/iis - and it worked:</p> <p><a href="https://gist.github.com/sebug/0f7776668fff4e0e6b3f3d313846afa6" rel="nofollow noreferrer">https://gist.github.com/sebug/0f7776668fff4e0e6b3f3d313846af...
<p>I'm using Helm to upgrade my k8s environment and I'm wondering, if I can change the release name of a deployed release using the upgrade command (or any other way)?</p> <p><strong>example:</strong></p> <pre><code>helm upgrade --set image.tag='12.55.6-2' zk-chart /path/to/helm/files </code></pre> <p>So that <strong>z...
<p>You cannot do this. </p> <p>There is a open <a href="https://github.com/kubernetes/helm/issues/1809" rel="noreferrer">request</a> for this feature.</p>
<p>I am having difficulties accessing a NodePort service on my Kubernetes cluster.</p> <p><strong>Goal</strong></p> <p>set up ALB Ingress controller so that i can use websockets and http/2</p> <p>setup NodePort service as required by that controller</p> <p><strong>Steps taken</strong></p> <p>Previously a Kops (Ver...
<p>By default Kops does not configure the EC2 instances to allows NodePort traffic from outside.</p> <p>In order for traffic outside of the cluster to reach the NodePort you must edit the configuration for your EC2 instances that are your Kubernetes nodes in the EC2 Console on AWS. </p> <p>Once in the EC2 console cli...
<p>I'm creating a ram based emptyDir volume for a pod. </p> <pre><code> volumes: - name: ram-disk emptyDir: medium: "Memory" </code></pre> <p>Because this is a ram disk, I need to set the maximum size which it will take from the ram. Is there a parameter to set maximum size and minimum size?</p>
<p>For kubernetes-1.7.x, it's <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#emptydirvolumesource-v1-core" rel="nofollow noreferrer">possible to set the <code>sizeLimit</code> for an <code>EmptyDir</code></a>.</p>
<p>After trying kubernetes on a few KVMs with kubeadm, I'd like to setup a proper auto-scalable cluster on AWS with <a href="https://github.com/kubernetes/kops/" rel="nofollow noreferrer">kops</a> and serve a few websites with it.</p> <p>The mind-blowing magic of <code>kops create cluster ...</code> gives me a bunch o...
<p>Configuring your service as a LoadBalancer service is not sufficient for your cluster to to setup the actual loadbalancer, you need an ingress controller running like the one above. </p> <p>You should add the kops nginx ingress addon: <a href="https://github.com/kubernetes/kops/tree/master/addons/ingress-nginx" rel...
<p>I'd like to know what each 'config' key represents within the usual yaml config (not even sure what it's called) as well as what options / directives are available.</p> <p>For example what does the following mean:</p> <pre><code> ports: - containerPort: 80 name: example </code></pre> <p>I could google ...
<p>What about reading the <a href="https://kubernetes.io/docs/resources-reference/v1.5/#deployment-v1beta1" rel="nofollow noreferrer">Kubernetes Resources Reference Documentation</a>?</p> <p>All the directives are defined here for the various resources exploited by Kubernetes. Eg: <a href="https://kubernetes.io/docs/r...
<p>When I want to run the demo, I get the error:</p> <blockquote> <p>error: error validating "cronJob_example.yaml": error validating data: couldn't find type: v2alpha1.CronJob; if you choose to ignore these errors, turn validation off with --validate=false</p> </blockquote> <p>Then I found:</p> <blockquote> ...
<p>Here is it documented. <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a> we need to enable this feature in API server.</p> <p>on the master server you need to add the line command section ...
<p>I am running k8s on aws, and I updated the deployment of nginx - which normally, it works fine-, but after this time, the nginx deployment won't show up in "kubectl get deployments".</p> <p>I want to kill all the pods related to nginx, but they keep reproduce themselves. I deleted all deployments "kubectl delete --...
<p>check the deployment, replication controller and replica set and remove them.</p> <pre><code> kubectl get deploy,rc,rs </code></pre>
<p>We're running multiple Kubernetes clusters, which run Cassandra. Our usual procedure when doing a rolling restart of the Cassandra pods is to log into each and submit a <code>nodetool drain</code> and then trigger a recreation of that pod. But often when the pods restart we get errors like </p> <pre><code>ERROR [Hi...
<p>You can try to disable hinted handoff, or try to truncate hints after the drain:</p> <p><strong>nodetool truncatehints</strong></p> <p>If you care about consistency, run repair after the process.</p> <p><strong>Warning:</strong> If you are working with ANY consistency setting or RF=1, this may lead to some data l...
<p>I'm not sure why I'm getting an error <code>No nodes are available that match all of the following predicates:: Insufficient cpu (1)</code>. </p> <p>I don't recall setting any CPU limits. Unless this is some default? </p> <p>The output of <code>kubectl describe pod wordpress</code>: </p> <pre><code>Name: wo...
<p>There are additional containers running besides the ones specified in the config. These are provisioned by default with Kubernetes and run in the <code>kube-system</code> namespace which are not shown in the default namespace.</p> <p>You can view all the pods by <code>kubectl get pods --all-namespaces</code>.</p> ...
<p>I met a couple of problems when installing the Kubernetes with Kubeadm. I am working behind the corporate network. I declared the proxy settings in the session environment.</p> <pre><code>$ export http_proxy=http://proxy-ip:port/ $ export https_proxy=http://proxy-ip:port/ $ export no_proxy=master-ip,node-ip,127.0.0...
<p>I would strongly suspect it is trying to pull down the docker images for <code>gcr.io/google_containers/hyperkube:v1.7.3</code> or whatever, which requires teaching the docker daemon about the proxies, <a href="https://docs.docker.com/engine/admin/systemd/#httphttps-proxy" rel="nofollow noreferrer">in this way using...
<p>For some reason Kubernetes 1.6.2 does not trigger autoscaling on Google Container Engine.</p> <p>I have a <code>someservice</code> definition with the following resources and rolling update:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: someservice labels: layer: backend sp...
<p>Make sure instance group autoscaler either is disabled or has proper minimum/maximum number of instances settings. </p> <p>According to <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#is-cluster-autoscaler-compatible-with-cpu-usage-based-node-autoscalers" rel="nofollow norefe...
<p><a href="https://stackoverflow.com/questions/45573825/pod-will-not-start-due-to-no-nodes-are-available-that-match-all-of-the-followin/45585916#45585916">pod will not start due to &quot;No nodes are available that match all of the following predicates:: Insufficient cpu&quot;</a></p> <p>In the above question, I had ...
<p>1 cpu for a single node cluster is probably too small.</p> <p>From the containers in the original answer, both the dashboard and fluentd can be removed:</p> <ul> <li>the dashboard is just a web UI, which can go away if you use <code>kubectl</code> (which you should, IMO);</li> <li>fluentd should be reading the log...
<p>This is my config:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: wordpress labels: app: wordpress spec: replicas: 1 selector: matchLabels: app: wordpress template: metadata: labels: app: wordpress spec: terminationGracePeriodSecond...
<blockquote> <p>I would have assumed they would be independent and not have any port conflicts. How can I resolve this issue?</p> </blockquote> <p><em>Across</em> Pods that's true, but <em>within</em> a Pod, all containers share the same networking namespace -- that's part of what makes them a Pod. To accomplish wha...
<p>I'm trying to expose a GRPC Java service thought an Ingress to outside world from my GKE cluster.</p> <p>The problem is that GKE's default implementation creates a health check that expect 200 response code on curling "/". It is expected and documented <a href="https://github.com/kubernetes/ingress/blob/master/docs...
<p>Seems at the moment GCP HTTP Load Balancers <a href="https://groups.google.com/forum/#!topic/grpc-io/bfURoNLojHo" rel="nofollow noreferrer">doesn't support HTTP/2</a>. So I ended up simply by exposing my service through LoadBalancer instead of NodePort + Ingress.</p> <p>Note: static IP you provide in <code>loadBala...
<p>By default, image-gc-high-threshold and image-gc-low-threshold values are 90 and 80% respectively.</p> <p>We want to change them to 80 and 70, How we can change the Kubernetes image garbage collection threshold values.</p>
<p>Changing the garbage collection thresholds can be done using switches on the <code>kubelet</code>.</p> <p>From <a href="https://kubernetes.io/docs/admin/kubelet/" rel="nofollow noreferrer">the docs</a></p> <pre><code>--image-gc-high-threshold int32 The percent of disk usage after which image garbage collection ...
<p>Once you deploy a pod, kubernetes monitors the pod health and if something goes wrong, new pod is created . How is this working internally. After deployment, where is kubernetes storing the deployment yaml.</p>
<p>Kubernetes uses the ETCD database as data store. The flow is like this. Kubectl command connect to API server and sends the yaml file to API server. API parses and store the information in ETCD database. Kube controller and schedule looks at the ETCD database and starts the POD. Controller maintain the number of r...
<p>The question is same as the title. I am deploying Kubernetes Cluster on CentOS 7 using Kubeadm and planning to replicate the Master with HA solution. </p> <p>Although there are loads of tools listed in the <a href="https://kubernetes.io/docs/setup/pick-right-solution/#bare-metal" rel="nofollow noreferrer">Kubernet...
<p>A ton of them, and a search before posting would have easily surfaced that very answer</p> <p><a href="https://github.com/ramitsurana/awesome-kubernetes#readme" rel="nofollow noreferrer">https://github.com/ramitsurana/awesome-kubernetes#readme</a></p>
<p>I have configured OIDC with k8s installed using kubeadm. After the configuration, when I run the command <code>kubectl --user=name@gmail.com get nodes</code> I get </p> <blockquote> <p>error: You must be logged in to the server (the server has asked for the client to provide credentials (get nodes))</p> </blockqu...
<p>I use <code>kubectl --username=name@gmail.com get nodes</code> and it works. Earlier I was using the parameter <code>--user</code> instead of <code>--username</code>.</p>
<p>I have a container with some SYS_ADMIN capabilities, and I'm having trouble killing the pod, and am wondering what is the best way to deal with these reluctant containers?</p> <pre><code>- image: headless-chrome securityContext: capabilities: add: - SYS_ADMIN </code></pre>
<p>Sometimes a pod will zombify, even without privileged status. In order to kill a zombified pod, first try the following: <code> kubectl delete pod &lt;&lt;PODNAME&gt;&gt; --grace-period=0 --force </code> ...where <code>&lt;&lt;PODNAME&gt;&gt;</code> is the name of the offending pod. I have to do that from time ...
<p>Before kubeadm I use these steps to take flannel ip &amp; mtu value to docker.</p> <p>Step 1: stop Docker and Flannel<br> Step 2: start Flannel and check its status;<br> step 3: update Docker startup script like this</p> <pre><code>source /run/flannel/subnet.env --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} </cod...
<p>Here are the steps I took to set up flannel in Kubernetes v1.7.3.</p> <p>Install flannel</p> <pre><code>kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.y...
<p>I was trying to deploy Istio in my environment and run across the following error. All the solutions online are regarding clusterrolebinding, I have tried to do that but failed nevertheless. Any inputs to my problem?</p> <p><strong>kubectl api-versions | grep rbac</strong></p> <pre><code>rbac.authorization.k8s.io...
<p>The error Kubernetes gives you basically means that it thinks whatever you're trying to do is a privilege escalation (which is correct) and tries to prevent that.</p> <blockquote> <p>The RBAC API prevents users from escalating privileges by editing roles or role bindings. Because this is enforced at the API level...
<p>I have a cronjob that is completing and outputting several log files.</p> <p>I want to persist these files and be able access them after the pod has succeeded.</p> <p>I've found I can access the stdout with <code>oc logs -f &lt;pod&gt;</code>, but I really need to access the log files.</p> <p>I'm aware Openshift ...
<p>After a <code>Job</code> runs to completion, the <code>Pod</code> terminates, but it is not automatically deleted. Since it has completed, you need to use <code>-a</code> to see it. Once you have the <code>Pod</code> name, <code>kubectl logs</code> works as you would expect.</p> <pre><code>$ kubectl get pods -a NAM...
<p>I am following the sample azure file mentioned at <a href="https://github.com/Azure-Samples/azure-voting-app-redis/blob/master/kubernetes-manifests/azure-vote-all-in-one-redis.yaml" rel="nofollow noreferrer">Azure Voting App</a><br> I have a deployment file like:</p> <pre><code>apiVersion: apps/v1beta1 kind: Deploy...
<p>I'm not sure if it was merely an "example typo", or if that was quite literally your <code>patch</code> command, but the field is <code>imagePullSecrets</code>, plural (as the array contents might hint at), not <code>imagePullSecret</code> singular</p>
<p>I have a Kubernetes deployment which uses a ConfigMap with some configuration which is frequently updated. Currently I have to update this configuration manually, by running a script on my local machine that updates the ConfigMap via <code>kubectl</code>.</p> <p>Is there a way to do this in a more automated fashion...
<p>There are a couple of Kubernetes clients in many languages if you take a look <a href="https://kubernetes.io/docs/reference/using-api/client-libraries" rel="nofollow noreferrer">here</a>. Python and Go are officially supported. You can automate the steps by calling the client.</p> <p>If you know Python, you may refe...
<p>I have project with docker-compose setup ready. Now I want to move to kubernetes. I use <a href="https://github.com/kubernetes/kompose" rel="nofollow noreferrer">Kompose</a> tool for converting from docker-compose to kubernetes.</p> <p>For example, here is my sample <code>docker-compose.yml</code> file</p> <pre><c...
<p>Your docker-compose file contains <code>build</code> key which means you have source code/Dockerfile present for <code>app</code> service, As of now,</p> <pre><code>NAME READY STATUS RESTARTS AGE po/app-2119952459-b4jtb 0/1 ErrImagePull 0 24s </cod...
<p>So here is my problem, I want to set up in Kubernetes ingress resource 3 timeout parameters. Described method in the Kubernetes docs is to use either ingress resource annotations or ConfigMap. In the example below I am trying with annotations but for unknown reason the change is not taking effect.</p> <pre><code>ng...
<p>Are you sure these are the correct annotations? Have a look at <a href="https://github.com/kubernetes/ingress/blob/master/core/pkg/ingress/annotations/proxy/main.go" rel="noreferrer">ingress/annotations/proxy/main.go</a>, where the following constants are defined:</p> <pre><code>connect = "ingress.kubernetes.i...
<p>So in order to update the images running on a pod, I have to modify the deployment config (yaml file), and run something like <code>kubectl apply -f deploy.yaml</code>.</p> <p>This means, if I'm not editing the yaml file manually I'll have to use some template / search and replace functionality. Which isn't really ...
<p>I am using this for changing images in Deployments:</p> <pre><code>kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1 </code></pre> <p>If you view the yaml files as source of truth then use a tag like <code>stable</code> in the yaml and only issue <code>kubectl set image</code> commands when the tag i...
<p>I have a Spring Boot application, deployed on a docker container on Kubernetes. The application works well for some time (hours) but at a certain moment it starts restarting like crazy showing a CrashLoopBackOff error state.</p> <p>This is the info I get from the dead pod:</p> <pre><code>Port: 8080/TCP State...
<p><code>kubectl logs podName containerName</code> will provide you with the container logs which should give you additional information about the cause of the error. </p>
<p>How can I get the image ID (the docker sha256 hash) of a image / container within a Kubernetes deployment? </p>
<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...
<p><strong>Background</strong></p> <p>I have installed Prometheus on my Kubernetes cluster (hosted on Google Container Engineer) using the <a href="https://github.com/kubernetes/charts/tree/master/stable/prometheus" rel="noreferrer">Helm chart for Prometheus</a>.</p> <p><strong>The Problem</strong></p> <p>I cannot f...
<p>You need to add annotations to the service you want to monitor.</p> <pre><code>apiVersion: v1 kind: Service metadata: annotations: prometheus.io/scrape: 'true' </code></pre> <p>From the prometheus.yml in the chart:</p> <ul> <li><code>prometheus.io/scrape</code>: Only scrape services that have a value of <co...
<p>Even after granting cluster roles to user, I get <code>Error from server (Forbidden): User "system:anonymous" cannot list nodes at the cluster scope. (get nodes)</code></p> <p>I have the following set for the user:</p> <pre><code>- context: cluster: kubernetes user: user@gmail.com name: user@kubernetes` ...
<p>Your problem is not with your ClusterRoleBindings but rather with user authentication. Kubernetes tells you that it identified you as <code>system:anonymous</code> (which is similar to *NIX's nobody) and not nsp@example.com (to which you applied your binding).</p> <p>In your specific case the reason for that is tha...
<p>I try to setup nginx ingress (nodeport) on google container with proxy protocol so that the real ip can be forwarded to backend service, but ended up with broken header.</p> <pre><code>2017/02/05 13:48:52 [error] 18#18: *2 broken header: "�����~��]H�k��m[|����I��iv.�{y��Z �嵦v�Ȭq���2Iu4P�z;� o$�s����"���+�/�,�0̨̩...
<p>GKE: With kubernetes v1.6+ source ip is preserved by default and can be found in headers under <code>x-real-ip</code> without setting any extra nginx config. </p> <p>AWS: Source ip can be preserved by adding this to the annotations </p> <pre><code>apiVersion: v1 kind: Service metadata: name: nginx-ingress name...
<p>I would like to roll back the deployment to a certain revision( rollout history) using client-go library of k8s. But so far I havent found a solution. I could onyl fetch resource revision but not 'deployment revision' that I get using kebctl </p> <pre><code>kubectl rollout history deployment/nginx_dep </code></pre>...
<p>Assuming you already had a look at the <a href="https://github.com/kubernetes/client-go/tree/master/examples/create-update-delete-deployment" rel="nofollow noreferrer">update example</a>?</p> <p>In any case, the <code>dp</code> variable here contains all you need:</p> <pre><code>dp, err := clientset.ExtensionsV1be...
<p>I modified the deployment config (production.yaml), changing the container image value.</p> <p>I then ran this: <code>kubectl replace -f production.yaml</code>.</p> <hr> <p>While this occurred, my service did not appear to be responding, in addition:</p> <p><code>kubectl get pods</code>:</p> <p><code>wordpress-...
<p>I believe this behaviour is correct according to the Kubernetes documentation. Assuming you specify <code>n</code> replicas for a deployment, the following steps will be taken by Kubernetes when updating a deployment:</p> <ol> <li>Terminate old pods, while ensuring that at least <code>n - 1</code> total pods are up...
<p>I try to setup a mysql database in Kubernetes. I configured a ConfigMap to store the Database name and a Secret that contains the root password, the user and the password for the user.</p> <p>When I try to connect to the DB afterwards (Inside the container with mysql cli and from outside with IntelliJ Database tool...
<p>Are you sure the data in your secret yaml is base64-encoded correctly? Using <a href="https://www.base64encode.org/" rel="nofollow noreferrer">https://www.base64encode.org/</a>, your <code>data</code> block is supposed to look like:</p> <pre><code>data: mysql-root-password: VGVzdDEyMzQ= # Test1234 mysql-user: d...
<p>I use gitlab for my CI, they host it and i have my own runners. I have a k8s cluster running in gke.</p> <p>I want to use <code>kubectl apply</code> to deploy new versions of my containers.</p> <p>This all works from my local machine because it uses my google account.</p> <p>I tried setting this all up as suggest...
<p>The cause of this problem was an incorrect server url. The server needs to be the one defined on the cluster information page in the google cloud console. You will find an Endpoing ip address.</p>
<p>I see more and more software organizations using gRPC in their service-oriented architectures, but people are also still using REST. In what use cases does it make sense to use gRPC, and when does it make sense to use REST for inter-service communication?</p> <p>Interestingly, I've come across open source projects t...
<p>When done correctly, REST improves long-term evolvability and scalability at the cost of performance and added complexity. REST is ideal for services that must be developed and maintained independently, like the Web itself. Client and server can be loosely coupled and change without breaking each other.</p> <p>RPC ...
<p>I have the following deployment which puts up MySQL instance:</p> <pre><code>kind: Deployment apiVersion: apps/v1beta1 metadata: name: mysql spec: replicas: 1 template: metadata: labels: app: mysql spec: containers: - name: mysql image: mysql:8 ports: ...
<p>The port forwarding is likely there, but you need to tell mysql client to connect using host/port and not unix socket (default)</p> <pre><code>mysql --host=localhost --protocol tcp --port=3306 -u root -p </code></pre> <p>If you don't, mysql by default uses local linux socket to connect to he server: /var/run/mysql...
<p>A livenessProbe (extracted from <a href="https://raw.githubusercontent.com/kubernetes/kubernetes.github.io/master/docs/tasks/configure-pod-container/exec-liveness.yaml" rel="noreferrer">an example</a>) below is working well.</p> <pre><code>livenessProbe: exec: command: - cat - /tmp/healthy </code></pr...
<p>This problem is related to <a href="https://golang.org/pkg/os/exec/#Command" rel="noreferrer">Golang Command API</a>. I changed the livenessProbe as below</p> <pre><code>livenessProbe: exec: command: - /bin/sh - -c - /home/test/check.sh </code></pre>
<p>I have celery running in a docker container on GCP with Kubernetes. Its workers have recently started to get <code>kill -9</code>'d – this looks like it has something to do with OOMKiller. There are no OOM events in <code>kubectl get events</code>, which is something to be expected if these events only appear when a...
<p>Containers can be OOMKilled for two reasons.</p> <ol> <li>If they exceed the memory limits of set for them. Limits are specified on a per container basis and if the container uses more memory than the limit it will be OOMKilled. From the process's point of view this is the same as if the system ran out of memory.</...
<p>The Google Container Engine's (GKE) documentation says: "There’s no vendor lock-in, you’re free to take your workloads out of Container Engine and run them anywhere Kubernetes is supported, including on your own on-premise servers."</p> <p>Still, GKE is a managed environment for Kubernetes and I was wondering how d...
<p>Your workloads will migrate out of GKE without much modification; the only things you would need to change are those tied to the cloud provider (ingress, persistent volumes, etc). Note that this is the same regardless of whether you are running in GKE or on GCE, AWS, Digital Ocean -- as you move environments you wil...
<p>I have installed K8S using minikube on ubuntu 16.04 machine with VirtualBox driver.</p> <hr> <p>I am confused with various documents that are related to this topic. Some say it is not possible with minikube, but minikube documents that it suitable for test purpose. So i believe that maybe there is a way to achieve...
<p>Now that I have spent time on this, I am answering this question so that it can help someone. The answer is YES. Minikube provides a k8s setup which supports the OIDC based authentication. I have been able to configure it. So here is some details on how I configured the kube-apiserver parameters.</p> <p><code>mini...
<p>I got Kubernetes Minikube on my laptop (4cores, 8 GB RAM). I just performed the basic installation steps (got <em>miniKube</em> and <em>kubectl</em>, enabled the BIOS virtualization) and I am able to start the cluster:</p> <pre><code>C:\Users\me&gt;minikube start Starting local Kubernetes cluster... Starting VM... ...
<p>I had same issue as above. I found out that <code>kubectl</code> couldn't connect to the cluster and would throw up the error when i'm on a VPN connection. When I turned off my VPN client, it started working as fine. </p>
<p>I am quite familiar with Docker, but I have zero experience on Kubernetes.</p> <p>I have a <a href="https://docs.docker.com/engine/reference/commandline/stack/" rel="nofollow noreferrer">Docker stack</a> (multi-container) software that I can deploy in a Docker swarm cluster. I was wondering if Kubernetes has someth...
<p>You can copy the content of the generated files into one file and separate them with <code>---</code>.</p> <p>For instance, if you've got 3 Kubernetes files: <code>service.yml</code>, <code>deployment.yml</code> and <code>configmap.yml</code>, your file should look something like:</p> <pre><code># content of servi...
<p>I want to set initial data on MySQL of container. In docker-compose.yml, such code can create initial data when running container.</p> <pre><code>volumes: - db:/var/lib/mysql - "./docker/mysql/conf.d:/etc/mysql/conf.d" - "./docker/mysql/init.d:/docker-entrypoint-initdb.d" </code></pre> <p>However, how can I ...
<p>According to the MySQL Docker image <a href="https://hub.docker.com/_/mysql/" rel="noreferrer">README</a>, the part that is relevant to data initialization on container start-up is to ensure all your initialization files are mount to the container's <code>/docker-entrypoint-initdb.d</code> folder.</p> <p>You can def...
<p>I am new to Kubernetes &amp; Docker. I created a simple nodejs application and deployed on BlueMix Kubernetes. But I am unable to accesses the application on internet. The ip &amp; port mentioned in the kubernetes is not accessible. Can somebody help me.</p> <p>I tried to <a href="http://10.76.193.146:31972" rel="n...
<p>Since your service's <code>port</code> is different from your pod's <code>containerPort</code>, you will have to specify <code>targetPort</code> in your service.</p> <pre><code>spec: type: NodePort selector: name: helloworld-nodejs ports: - port: 8080 targetPort: 8000 </code></pre> <p>According...
<p>I have created a Kubernetes cluster of 2 nodes and one master on CentOS 7. When I use <code>kubectl get nodes</code>, it lists the nodes and everything seems to be working.</p> <p>My question is: Will the cluster automatically balance the resources now between the nodes? I mean, let's say I installed a nginx web se...
<p>Kubernetes won’t balance the node resources. It will schedule the workload based on available resource in the node. In your case if memory is full on master node, if you want to run another pod kubernetes will schedule them in second node.</p>
<p>I'm using uwsgi in a container hosted in a Kubernetes cluster. UWSGI supports a traditional <a href="http://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html" rel="noreferrer">master / slave architecture</a> to provide a better availability for the application but my question is, should I even use this feature?<...
<p>Be conscious of having enough threads/processes/pods to maintain availability if your application blocks while serving each HTTP request (e.g. Django). There is going to be some pod startup time if you're using a horizontal pod autoscaler, and I found with a high traffic application I had much better availability w...
<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...
<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>...
<p>I'm not sure why the persistent volume is not being claimed, or what steps I could take to further diagnose this? </p> <p>Should the claim size match the volume size? Should the volume size match the GCP volume size?</p> <p>This is so difficult to test and figure out... </p> <p>My goal here is just to be able to ...
<p>The <code>spec.accessModes</code> of your persistent volume claim has to match that in the persistent volume. Try change both of them to the same value.</p> <p>If that didn't work, you can add the <code>spec.selector</code> definition to your persistent volume claim definition, by updating it to match your persiste...
<p>I've found that it is hard to use minikube to run local tests that depend on certain containers to be running. For instance using a remote headless-chrome to run some tests:</p> <pre><code> containers: - image: chrome-test imagePullPolicy: Never ports: - containerPort: 80 - image: headless-chrome ...
<p>You can use docker-compose, but using minikube is also very easy to test things.</p> <p>So for my testing I do following steps:</p> <ul> <li>Create new Kubernetes <code>Namespace</code></li> <li>Deploy artifacts(here you deploy the <code>deployment</code>)</li> <li>Expose that <code>deployment</code> with a <code>...
<p>I have created a Kubernetes cluster of 2 nodes and one master on CentOS 7. When I use <code>kubectl get nodes</code>, it lists the nodes and everything seems to be working.</p> <p>My question is: Will the cluster automatically balance the resources now between the nodes? I mean, let's say I installed a nginx web se...
<p>The key point that sfgroups mentioned is that a pod cannot be split between nodes, so there is no "balancing of resources" when resources are exhausted on a node. Your process running in the pod will be OOM killed by the kernel if it hits its memory cgroup limit, and it will be throttled if it hits its CPU cgroup l...
<p>I am currently trying to deploy the following on Minikube. I updated the configuration files to use a hostpath as a persistent storage on minikube node.</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: "pv-volume" spec: capacity: storage: "20Gi" accessModes: - "ReadWriteOnce" ho...
<p>Few questions before I tell you what worked for me:</p> <ul> <li>The directory <code>/data</code> on minikube machine does it have right set of permissions?</li> <li>In minikube you don't need to worry about setting up volumes in other words don't worry about <code>PersistentVolume</code> anymore, just enable the v...
<p>How to set <code>Time in minutes to retain slave when idle</code> and <code>Max number of instances</code> in pipeline when config podTemplate ?</p> <p>I see these two config options in System->Could->kubernetes. But I use pipeline and I didn't figure it out how to set them.</p> <p>Now My pipeline looks like below...
<p>Ok, I figuire it out</p> <p>Add these two. <code> idleMinutes: 10 instanceCap: 10 </code></p> <pre><code>podTemplate(label: 'docker-go', containers: [ containerTemplate( name: 'jnlp', image: 'docker.mydomain.com/library/jnlp-slave:2.62', command: '', args: ...
<p>I am trying to deploy multiple identical docker containers on Google Container Engine. I am using kubectl for that following the instructions here: <a href="https://cloud.google.com/container-engine/docs/tutorials/hello-node" rel="nofollow noreferrer">https://cloud.google.com/container-engine/docs/tutorials/hello-no...
<p>Note that the node port that was allocated is <code>30513</code>. You are using <code>9000</code>, that's the port for the ClusterIP, <code>10.15.253.149</code> that was assigned.</p> <p>You also need to have port <code>30513</code> open on the firewall, as suggested by Eric.</p> <p>If you only need a one-off acce...
<p>Is it possible to take ssh to pod? Eg: <code>ssh pod_ip</code></p> <p>I know we can do this with the <code>kubectl</code> command. But I need to do <code>ssh</code> from my local linux machine which doesn't have <code>kubectl</code>.</p>
<p>Firstly, you have to ensure that the openssh-server has been installed and running in the pod. If not, you can use <code>kubectl exec -it &lt;pod-name&gt; -n &lt;namespace&gt; -- bash</code> to access the pod. If your pod are running Ubuntu, do <code>apt-get install -y openssh-server</code>. </p> <p>Secondly, pods...
<p>We are building our docker-images, and adding a few metadata-labels during docker build, e.g:</p> <pre><code>docker build --label no.company.version=1.2.3 . </code></pre> <p>When we at some point later in time use this image in a kubernetes pod, we would like to retreive that labels from the kubernetes api. This w...
<p>I'm not aware of a way to get docker labels from Kubernetes. The downward api allows you to get k8s labels into a pod however: <a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-applicat...
<p>Currently, I have working K8s API pods in a K8s service that connects to a K8s Redis service, with K8s pods of it's own. The problem is, I am using NodePort meaning BOTH are exposed to the public. I only want the API accessable to the public. The issue is that if I make the Redis service not public, the API can't se...
<p>First, configure the Redis service as a <code>ClusterIP</code> service. It will be private, visible only for other services. This is could be done removing the line with the option <code>type</code>.</p> <pre><code>apiVersion: v1 kind: Service metadata: name: app-api-redis-svc spec: selector: app: app-ap...
<p>I've been using <a href="https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md" rel="nofollow noreferrer">https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md</a> as a guide.</p> <p>I've successfully set the above working. However I'm not able to locate where t...
<p>This deployment is GCE specific NFS. NFS server run as POD in the cluster <code>image: gcr.io/google_containers/volume-nfs:0.8</code></p> <p>looks at this deployment file <a href="https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/nfs-server-rc.yaml" rel="nofollow noreferrer">https://github.com/...
<p>I was able to cluster 2 nodes together in Kubernetes. The master node seems to be running fine but running any command on the worker node results in the error: "The connection to the server localhost:8080 was refused - did you specify the right host or port?"</p> <p>From master (node1), </p> <pre><code>$ kubectl g...
<p><code>kubectl</code> interfaces with <code>kube-apiserver</code> for cluster management. The command works on the master node because that's where <code>kube-apiserver</code> runs. On the worker nodes, only <code>kubelet</code> and <code>kube-proxy</code> is running.</p> <p>In fact, <code>kubectl</code> is supposed...
<p>I've followed a Kubernetes tutorial similar to: <a href="https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy/</a> which created some basic networkpolicies as follows:</p> <pre><code>root@ser...
<p>This should work. A similar command works at my end.</p> <pre><code>kubectl -n policy-demo delete networkpolicy access-nginx </code></pre>
<p>So I'm getting this error when trying to install kubernetes with aws as the cloud provider. I'm installing with kubespray but I narrowed it down to the below command which I tried executing manually inside the hyperkube container. I'm guessing the actual error comes from not having the proper iam role. I'm working o...
<p><a href="https://github.com/kubernetes/kubernetes/issues/11543" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/11543</a></p> <p>I'd be willing to bet that your node iam role doesn't have enough access. I'm not acquainted with kubespray but I think the above issue should help you troublesh...
<p>Numerous forum posts and documentations specify extracting login info for the Kubernetes install from ~/.kube/config.</p> <p>The problem I found: mine doesn't have a proper user account, it specifies a name and a token.</p> <p>How do I get the account name so I can use the kubernetes-cockpit UI? Surprisingly there...
<p>It depends on how you use Cockpit. According to <a href="http://cockpit-project.org/guide/latest/feature-kubernetes.html" rel="nofollow noreferrer">cockpit official page</a>:</p> <p>Used in a standard cockpit session:</p> <blockquote> <p>If a user is able to use kubectl successfully when at their shell terminal,...
<p>I can't find this in the k8s documentation, I'm just wondering what are the default environment variables that are created in every container by k8s. Not user created defaults, but like (and this is just an example) maybe something like <code>{service_name}_PORT</code> or something like that. I just wanna know what ...
<p>From the <a href="https://kubernetes.io/docs/concepts/containers/container-environment/" rel="nofollow noreferrer">K8S Documentation</a>:</p> <p><strong>Container information - ENV's</strong></p> <p>The hostname of a Container is the name of the Pod in which the Container is running. It is available through the host...