prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I'm using an Ingress to expose my services from outside the Kubernetes cluster, so I don't need Kubernetes to provision a loadbalancer. Therefore, I created a ClusterIP service:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: myapp namespace: default spec: ports: - port: 80 targetPort: 8080 ...
<p>It is not trying to create one. You are receiving the error message from <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/service/service_controller.go#L287" rel="nofollow noreferrer">service_controller.go:287</a>:</p> <pre><code>func (s *ServiceController) createLoadBalancerIfNeeded(key...
<p>I'm running into an issue where I seem to max out my Container Engine (Kubernetes Engine) cluster at 9 nodes (or 9 vCPUs). For context, I'm trying to run around 50 or so web scrapers as Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">Cron Jobs</a>. Here is t...
<p>I received some help on this issue from the <a href="https://gcp-slack.appspot.com/" rel="noreferrer">Google Cloud Platform Community Slack</a>. It turns out I was hitting the <em>In-use IP addresses</em> quota; however, I didn't realize you could request increased quotas.</p> <p>I was able to increase quotas by:</...
<p>Apologies for not keeping this short, as any such attempt would make me miss-out on some important details of my problem.</p> <p>I have a legacy Java application which works in a active/standby mode in a clustered environment to expose certain RESTful WebServices via a predefined port. </p> <p>If there are two nod...
<p>You can use a readiness probe in conjunction with election container. Election will always elect one master from the election pool, and if you make sure only that pod is marked as ready... only that pod will recieve traffic.</p>
<p>Usually we expose our Kubenretes services through an managed K8s/GCP Ingress with auto-assigned NodePorts, but for some <a href="https://github.com/GoogleCloudPlatform/k8s-multicluster-ingress" rel="nofollow noreferrer">use</a> <a href="https://kubernetes.io/docs/tasks/administer-federation/ingress/" rel="nofollow n...
<p>It is more about not assigning the same port manually to multiple services then anything else. If you have a manualy defined NodePort it will not get assigned to dynamic service, so yes, you should use port from this range.</p>
<p>I'm trying to configure the spinnaker to deploy applications in kubernetes environment. </p> <p>I followed a <a href="http://www.spinnaker.io/docs/kubernetes-source-to-prod" rel="nofollow">documentation</a>, at <a href="http://www.spinnaker.io/docs/kubernetes-source-to-prod#section-3-create-a-demo-server-group" re...
<p>The recommended way to configure the docker registry address, or any other configs, is using <a href="https://www.spinnaker.io/setup/install/halyard/" rel="nofollow noreferrer">Halyard</a>. Modifying the config files directly could result in them getting overwritten. </p> <p>You can add an account, or edit an exist...
<p>I have RBAC enabled kubernetes cluster created using kops version <strong>1.8.0-beta.1</strong>, I am trying to run a nginx pod which should attach pre-created EBS volume and pod should start. But getting issue as not authorized even though i am a <strong>admin</strong> user. Any help would be highly appreciated. <...
<p>In kops 1.8.0-beta.1, master node requires you to tag the AWS volume with:</p> <p><code>KubernetesCluster: &lt;clustername-here&gt;</code></p> <p>If you have created the k8s cluster using kops like so:</p> <p><code>kops create cluster --name=k8s.yourdomain.com [other-args-here]</code></p> <p>your tag on the EBS ...
<p>Trying to run a local registry. I have the following configuration:</p> <p>Deployment:</p> <pre><code>apiVersion: apps/v1beta2 kind: Deployment metadata: name: registry labels: app: registry role: registry spec: replicas: 1 selector: matchLabels: app: registry template: metadata: ...
<p>You need to specify the correct <code>spec.selector</code> in <code>registry</code> service manifest:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: registry namespace: default labels: app: registry spec: selector: app: registry type: NodePort ports: - name: registry nodeP...
<p>I am brand new to suiteCRM and I am trying to deploy into Minikube. I am using the helm charts in the K8s repo:</p> <p><a href="https://github.com/kubernetes/charts/tree/master/stable/suitecrm" rel="nofollow noreferrer">https://github.com/kubernetes/charts/tree/master/stable/suitecrm</a></p> <p>I am using the co...
<p>I think the issue has to do with not setting the suitecrm host correctly. It is configured to use LoadBalancer but as you are using minikube you need to manually set the APP_HOST variable with a different command than that displayed by helm. This is what I did to make it work:</p> <pre><code>helm install --name red...
<p>Can I use the same storage class for different services - e.g. I am using persistent volumes for Redis, RabbitMQ , Elastic Search on Kubernetes. </p> <p>Should I create only only storage class if they all require the same provisioner (GCEPersistentDisk) or what is the best practice for creating and managing storage...
<p>Let's look at the definition of <code>StorageClass</code> from the documentation:</p> <p><code>kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: standard provisioner: kubernetes.io/aws-ebs parameters: type: gp2 reclaimPolicy: Retain mountOptions: - debug</code></p> <p>So at a basic level, it d...
<p>See the connected question - <a href="https://stackoverflow.com/q/46968582/2790937">Kubernetes pod exec API exception: Response must not include &#39;Sec-WebSocket-Protocol&#39; header if not present in request</a>.</p> <p>I have been able to successfully make a WebSocket connection using Pod <code>exec</code> API....
<p>For future wanderers....</p> <p>Although the <code>exec</code> API supports <code>Authorization</code> header, the browser WebSocket API doesn't support it yet. So the solution for us was to reverse-proxy it from our server APIs. </p> <p>It went like this...</p> <p>client browser -wss-> GKE LB (SSL Termination) -...
<p>We are building a grpc service in python which has a bidirectional streaming endpoint and also a unary endpoint.</p> <p>we want the stream to live forever so we have no timeouts and streams are working as expected, we are using kubernates and docker for deployment.</p> <p>But we are facing issues with scaling the ...
<p>Right now we don't have a good answer: the thread-per-RPC assumption was baked into gRPC Python fairly early and deeply, well before we were aware of "just keep an open connection in case either side has anything to say" long-lived RPCs being a use case.</p> <p>We're working on better solutions but they'll likely b...
<p>Running a baremetal master. Trying to set it up. Looked at the other answers - the hostname is in place - everything. And still...</p> <pre><code>[root@kube-future kubernetes]# kubectl get The connection to the server localhost:8080 was refused - did you specify the right host or port? </code></pre> <p>UPDATE</p>...
<p>I had the same. </p> <p>Running the following command as suggested <a href="https://groups.google.com/forum/#!topic/kubernetes-users/2EJ-i7vLVNw" rel="nofollow noreferrer">here</a> solved my problem. </p> <pre><code>sudo cp /etc/kubernetes/admin.conf $HOME/ sudo chown $(id -u):$(id -g) $HOME/admin.conf export KUBE...
<p>I am running a NodeJS image in my Kubernetes Pod, while exposing a specific port (9080), and running Traefik as a side-car container as reverse proxy. How do I specify Traefik route from the Deployment template.</p> <p><strong>Deployment</strong></p> <pre><code>apiVersion: apps/v1beta1 kind: Deployment metadata: ...
<p>If I understand correctly, you want to forward requests hitting the Traefik container to the Node.js application living in the same pod. Given that the application is configured statically from Traefik's perspective, you can simply mount a proper file provider configuration into the Traefik pod (presumably via a Con...
<p>We have a cluster with a master node (foo-1), and two worker nodes (foo-2 and foo-3). We have a pod that was running on foo-3 (as decided by Kubernetes). We purposely shut down foo-3 as an experiment.</p> <p>My expectation was that Kubernetes would "see" the shutdown, and automatically restart the pod in foo-2. But...
<p>There is a <code>--pod-eviction-timeout</code> parameter in <a href="https://kubernetes.io/docs/admin/kube-controller-manager/" rel="noreferrer">kube-controller-manager</a> which is 5m by default:</p> <pre><code> --pod-eviction-timeout duration The grace period for deleting pods on failed nodes. (default 5m0s) <...
<p>I am following the instructions as given <a href="https://kubernetes.io/docs/getting-started-guides/gce/" rel="nofollow noreferrer">here</a>.</p> <p>I used the following command to get a running cluster, in gcloud console I typed: <code>curl -sS https://get.k8s.io | bash</code> as described in the link, after that,...
<p>Is there a reason why you did not use GKE (Google Kubernetes Engine) which provides the dashboard add-on installed out of the box?</p> <p>In your case, simply:</p> <ul> <li>the kubernetes-dashboard addon might not be installed (but logs say so, so I think this is not the problem)</li> <li>network configuration tha...
<p>I am setting up a kubernetes lab using one node only and learning to setup kubernetes nfs. I am following kubernetes nfs example step by step from the following link: <a href="https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs" rel="nofollow noreferrer">https://github.com/kubernetes/examples/tree...
<p>Each <em>Persistent Volume Claim</em> (PVC) needs a <em>Persistent Volume</em> (PV) that it can bind to. In your example, you have only created a PVC, but not the volume itself.</p> <p>A PV can either be created manually, or automatically by using a <em>Volume class</em> with a provisioner. Have a look at <a href="h...
<p>I have a Kubernetes pod that is already running on a Minikube (v0.23.0) node. </p> <p>Some context: it's the coredns pod that is created from enabling the plugin. I'm working through this blog post, in an attempt to set up custom DNS entries for my Kubernetes cluster: <a href="https://coredns.io/2017/05/08/custom-d...
<p>Looking at the Pod name <code>coredns-6b4fd7784-xhb5s</code>, it looks like your CoreDNS Pod is actually being managed by a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment controller</a>.</p> <p>Do not modify Pods managed by a deployment controlle...
<p>I created an headless service:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: myapp-service-headless spec: ports: - port: 80 selector: app: myapp clusterIP: None </code></pre> <p>From Kubernetes dashboard I can see its <code>Internal endpoints</code>:</p> <pre><code>myapp-service-headles...
<p>There is two option to expose the service outside, you can use the ingress controller to connect to the server. </p> <p>The simple method is change your service type to NodePort, then you should be able access server using NodeIP and service external port number.</p> <p>here is the more info.</p> <p><a href="http...
<p>I'm quite new to the Spinnaker and have to ask for some help I guess. Does anyone knows why it could be that I can't create any Application and just keep seeing this screen. My installation is through Halyard 1.5.0 and Ubuntu 14.04. We don't use any cloud provider but I did configure Docker and Kubernetes part</p> ...
<p>I suspect you may be using <code>redis</code> as the persistent storage type(I ran into the same issue). </p> <p>If this is the case, persistent storage using redis doesn't seem to be working properly out-of-the-box, and it is not supported. I would try using an S3 target, if available.</p> <p><a href="https://w...
<p>How do you <strong>hard</strong> force a pod to terminate? </p> <p>We have tried every documented form of kubectl delete pod and they remain. kubectl reports that they've been deleted, but kubectl get pods tells a different story. All pods that they could've been using have been deleted as well as any pods that co...
<p>Taken from <code>kubectl delete --help</code>:</p> <pre><code>kubectl delete pod foo --grace-period=0 --force </code></pre> <p>Note that if your pods are controlled via e.g. a deployment, then a new one will be recreated every time you delete one. So do make sure that's not the symptom you're observing!</p>
<p>I want to implement graceful shutdown in a Kubernetes Pod. I know I need to listen for SIGTERM, which indicates the start of the shutdown procedure. But what exactly do I do when I receive it?</p> <p>At the very least I must wait for all running request to finish before exiting. But can the pod still receive new re...
<p>I recently faced similar problem, I used simple preStop hook, which introduces some delay(sleep) between start of termination and receiving SIGTERM to underlying process</p> <pre><code>lifecycle: preStop: exec: command: - "sleep" - "60" </code></pre> <p>Thi...
<p>Failed to create clusterroles. &lt;> already assigned as the roles of "container engine admin" &amp; "container engine cluster admin"</p> <pre><code>Error from server (Forbidden): error when creating "prometheus- operator/prometheus-operator-cluster-role.yaml": clusterroles.rbac.authorization.k8s.io "prometheus-ope...
<p>I've got the same problem on Google Kubernetes Engine.</p> <p>According to the answer of <em>enj</em> and the comment of <em>ccyang2005</em> please find the following snipet who solve my problem :)</p> <h1>Step 1 : Get your identity</h1> <pre><code>gcloud info | grep Account </code></pre> <p>Will output you some...
<p>For improved performance and availability we'd like to distribute certain services from out stack across different Kubernetes clusters in different parts of the world (GCP regions).</p> <p>The majority of our stack will continue to run in one cluster / region but some user facing services will be deployed all over ...
<p>VPC networks are <a href="https://cloud.google.com/vpc/docs/vpc" rel="nofollow noreferrer">global</a> resources, not restricted by regional boundaries, and so with the correct <a href="https://cloud.google.com/vpc/docs/using-firewalls" rel="nofollow noreferrer">firewall rules</a> set up, you should be able to access...
<p>After months of using Helm (version 2.6.2) to deploy services in kubernetes, we've started experiencing random errors while performing the <code>--upgrade</code> command.</p> <p>Most of the time the upgrade times out, in other situations instead it looks like a network issue occurs, with errors like <code>getsockop...
<p>Upgrading to Helm 2.7.0 and using <code>--history-max</code> solved the issue for me, so the problem must have been related to the fact that old config maps were not cleared up by tiller, and over time they piled up until tiller started to struggle to make sense of them. </p> <p>More information about it <a href="h...
<p>I am trying to follow this tutorial on configuring nginx-ingress-controller for a Kubernetes cluster I deployed to AWS using kops.</p> <p><a href="https://daemonza.github.io/2017/02/13/kubernetes-nginx-ingress-controller/" rel="nofollow noreferrer">https://daemonza.github.io/2017/02/13/kubernetes-nginx-ingress-cont...
<p>To copy the nginx template file from the ingress controller pod to your local machine, you can first grab the name of the pod with <code>kubectl get pods</code> then run <code>kubectl exec [POD_NAME] -it -- cat /etc/nginx/template/nginx.tmpl &gt; nginx.tmpl</code>.</p> <p>This will leave you with the <code>nginx.tm...
<p>I'm quite new to the Spinnaker and have to ask for some help I guess. Does anyone knows why it could be that I can't create any Application and just keep seeing this screen. My installation is through Halyard 1.5.0 and Ubuntu 14.04. We don't use any cloud provider but I did configure Docker and Kubernetes part</p> ...
<p>@grizzthedj</p> <p>thanks again for recommendations. It doesn't seem, however, solved the issue. I wonder if it has something to do with my Docker Registry or Kubernetes. Here is what I have in my .hal/config:</p> <pre><code>dockerRegistry: enabled: true accounts: - name: &lt;hidden-name&gt; requiredGrou...
<p>I am trying to configure gitlab ci to deploy app to google compute engine. I have succesfully pushed image to gitlab repository but after applying kubernetes deployment config i see following error in kubectl describe pods:</p> <pre><code>Failed to pull image "registry.gitlab.com/proj/subproj/api:v1": rpc error: co...
<p>There is workaround, image could be pushed to google container registry, and then pulled from gcr without security. We can push image to gcr without gcloud cli using <a href="https://cloud.google.com/container-registry/docs/advanced-authentication" rel="nofollow noreferrer">json token file</a>. So <code>.gitlab-ci.y...
<p>Created a headless service:</p> <p>myapp-service-headless.yaml</p> <pre><code>apiVersion: v1 kind: Service metadata: name: myapp-service-headless spec: ports: - port: 8000 selector: app: myapp clusterIP: None </code></pre> <p>After create it to Kubernetes cluster, check its service status:</p> <p...
<p>Did you expose your container port inside your Endpoint (Pod)? </p> <p>From what i knew, the headless service can be used to generate entries in kube-dns based on how you configure the Service, as discussed <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-records-and-hostname-base...
<p>I would like to bound PersistentVolumeClaim with a gcePersistentDisk PersistentVolume. Below the steps I did for getting that:</p> <h1>1. Creation of the gcePersistentDisk:</h1> <p><code>gcloud compute disks create --size=2GB --zone=us-east1-b gce-nfs-disk</code></p> <h1>2. Definition the PersistentVolume and the...
<p>I found the solution.</p> <p>Below the new definitions of the PV and PVC:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: nfs-pv labels: app: test # the label has been added to make sure the bounding is working as expected spec: capacity: storage: 2Gi accessModes: - ReadWr...
<p>What I understood by the documentation is that:</p> <ul> <li> <pre class="lang-sh prettyprint-override"><code>kubectl create </code></pre> Creates a new k8s resource in the cluster</li> <li> <pre class="lang-sh prettyprint-override"><code>kubectl replace </code></pre> Updates a resource in the live cluster</li> <li>...
<p>Those are two different approaches:</p> <h3>Imperative Management</h3> <p><code>kubectl create</code> is what we call <a href="https://kubernetes.io/docs/tutorials/object-management-kubectl/imperative-object-management-configuration/" rel="noreferrer">Imperative Management</a>. On this approach you tell the Kubernet...
<p>I have an asp.net core 2.0 application whose docker image runs fine locally, but when that same image is deployed to an AKS cluster, the pods have a status of <em>CrashLoopBackOff</em> and the pod log shows:</p> <blockquote> <p>Did you mean to run dotnet SDK commands? Please install dotnet SDK from: <a href="h...
<p>Turned out that our build system wasn't putting the app code into the container as we thought. Since the container wasn't runnable, I didn't know how to inspect its contents until I found this command which is a lifesaver for these kinds of situations:</p> <p><code>docker run --rm -it --entrypoint=/bin/bash [image_...
<p>I'm pulling my hair out for a week but I am close to giving up. Please share your wisdom. </p> <p>This is my Docker file: </p> <pre><code>FROM node RUN apt-get update RUN mkdir -p /var/www/stationconnect RUN mkdir -p /var/log/node WORKDIR /var/www/stationconnect COPY stationconnect /var/www/stationconnect RUN c...
<p>When create a container, you should have a foreground process to keep the container alive.</p> <p>What i’ve done is add a shell script line <code>while true; do sleep 1000; done</code> at the end of my <strong>docker-entrypoint.sh</strong>, and refer to it in <code>ENTRYPOINT [/docker-entrypoint.sh]</code></p> <p...
<p>I'm trying to follow <a href="https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/azure.md" rel="nofollow noreferrer">this guide</a> to setting up a K8s cluster with external-dns' Azure DNS provider. The guide states that:</p> <blockquote> <p>When your Kubernetes cluster is created by...
<p>From what I can see when using AKS the <code>/etc/kubernetes/azure.json</code> doesn't get created. As an alternative I followed the instructions for use with non Azure hosted sites and created a service principal (<a href="https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/azure.md#opti...
<p>The last(3rd) container is continuously being delete and recreated by kubernetes. It goes from Running to Terminating state. The Kubernetes UI shows status as : 'Terminated: ExitCode:${state.terminated.exitCode}' </p> <p>My deployment YAML:</p> <pre><code>apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler me...
<p>Check the pod logs using the commands below: <code>kubectl get events -w -n namespace</code> and <code>kubectl describe pod -n namespace pod_name</code></p>
<p>Requests that our app needs to serve exhibit great variance (unknown in advance) of processing latencies (from few seconds to hours). </p> <p>We'd like to use kubernetes autoscaling capabilities but it is not clear how to deal with random pod termination policy during downscaling (as it comes at odds with our desir...
<p>One of the things you can do, is to build into your app support for termination handling and set a rather long termination grace period. You can find a nice explanation of this topic in <a href="https://pracucci.com/graceful-shutdown-of-kubernetes-pods.html" rel="nofollow noreferrer">https://pracucci.com/graceful-sh...
<p>I have a setup a config map called kube-dns in the kube-system NS, with some custom upstream DNS entries (3 x of them), but my containers/pods are not inheriting these custom DNS entries in their resolv.conf files when I schedule them through a simple deployment.</p> <p>My logs in the kube-dns pods don't seem to be...
<p>I also read those blogs/tutorials and they seem to fail to mention that you need to run <code>kubectl apply -f your-dns-configmap.yaml</code> on your config map.</p> <p>I'd run the following: <code>kubectl get cm --namespace="kube-system"</code> to see if your config map is actually there or not. It should turn up ...
<p>I've been trying to conceptualise a website that allows users to play short audio samples (about 10 in total on the entire site). </p> <p>I've become quite interested in containers but don't have a great deal of experience in using them (hence the reason i'm considering this idea- to learn more).</p> <p>I want to ...
<p>That really depends on what you see fit for your use case. If you have small amount of rather small samples, that does not change as time passes (without image rebuild) it makes perfect sense to bake them into the image. On the other side, if you want to ie. manage uploads via your website, or even just upload/manag...
<p>I just deployed a managed Kubernetes cluster with Azure Container Service. My deployment includes a single agent machine over the managed cluster and an Azure disk attached to it for persistent storage.</p> <p>The problem I am facing is that I don't know how to ssh this agent server. I read that you should be able ...
<blockquote> <p>The problem I am facing is that I don't know how to ssh this agent server.</p> </blockquote> <p>Do you mean you create AKS and can't find master VM?</p> <p>If I understand it correctly, that is a by design behavior, AKS does <strong>not</strong> provide direct access (Such as with SSH) to the clu...
<p>I was just wondering, why it is useful to run etcd cluster <a href="https://github.com/kubernetes/charts/tree/master/incubator/etcd" rel="nofollow noreferrer">inside Kubernetes</a>, when Kubernetes itself <a href="https://kubernetes.io/docs/concepts/overview/components/#etcd" rel="nofollow noreferrer">depends on etc...
<p>I have an external ETCD that manages my k8s HA cluster and im not letting any developer apps near it. I would be too concerned about something going wrong and breaking the k8s cluster. It is also a fixed size at 3 which works well for the cluster size with its requirements. If the developers need a key/value store...
<p>Im writing custom controller for kubernetes. Im creating shared informer</p> <pre><code>cache.NewSharedIndexInformer( &amp;cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (k8sruntime.Object, error) { return client.CoreV1().ConfigMaps(nameSpace).List(opti...
<p>Its not possible to filter objects by regular expression. It is possible to filer object by lable</p> <p>This is the code that will filter by label</p> <pre><code>labelSelector := labels.Set(map[string]string{"mylabel": "ourdaomain1"}).AsSelector() informer := cache.NewSharedIndexInformer( &amp;cache.ListWatc...
<p>When I create a deployment and a service in a Kubernetes Engine in GCP I get connection refused for no apparent reason.</p> <p>The service creates a Load Balancer in GCP and all corresponding firewall rules are in place (allows traffic to port 80 from <code>0.0.0.0/0</code>). The underlying service is running fine, ...
<p>This turned out to be a dumb mistake on my part. The gunicorn server was using a bind to <code>127.0.0.1</code> instead of <code>0.0.0.0</code>, so it wasn't accessible from outside of the pod, but worked when I <code>exec</code>-ed into the pod.</p> <p>The fix in my case was changing the entrypoint of the Dockerfil...
<p>It seems there is 2 ways to logically group pods, which are:</p> <ul> <li>using labels to identifies organizational units in a loosely coupled fashion</li> <li>creating namespaces</li> </ul> <p>What are exactly the differences and use cases?</p>
<p>Let's begin with a cluster which consists a number of nodes(Virtual Machines or Physical Machines ). Now We will divide our cluster in a logical way </p> <p><strong>Namespaces</strong> is a virtual cluster or a logical cluster. It helps us to organise projects or environments (development, testing, staging, and pr...
<p>Action:</p> <p>Tried updating the kubernetes-dashboard in k8s hosted in azure acs with image <code>gcrio.azureedge.net/google_containers/kubernetes-dashboard-amd64</code> from version <code>v1.6.3</code> to <code>v1.7.1</code> (latest).</p> <p>Problem:</p> <p>The image version, when edited either with kubectl or ...
<p>It will be getting updated but then reverted by the k8s addon manager. If you ssh into a master the templates for the addon services live in <code>etc/kubernetes/addons</code>.</p> <p>To upgrade the image you can edit <code>/etc/kubernetes/addons/kubernetes-dashboard-deployment.yaml</code> and change <code>image</c...
<p>I have an azure container service (aks) cluster. It is migrated to version 1.8.1. I am trying to deploy postgres database and use <code>AzureFileVolume</code> to persist postgres data on.</p> <p>By default, if I deploy the postgres database without mounting volume, everything is working as excepted, i.e. pod is cre...
<p>We came across the same problems and figured out the following solution:</p> <p>Instead of using an <em>AzureFileVolume</em>, we used an <strong>AzureDisk</strong>. So what we needed in Kubernetes is the following...</p> <p><strong>Storage Class</strong></p> <p><a href="https://i.stack.imgur.com/uvMBA.jpg" rel="n...
<p>I am running kubernetes(v1.7) and flannel(v0.9.0) which was installed using kubeadm.</p> <p>I want to know that-</p> <ol> <li>How does a node get a subnet?</li> <li>Where are all allocated subnets stored and how I can see them?</li> <li>How does flannel interact with kubernetes?</li> </ol> <p>Thanks,</p>
<ol> <li>flannel gives the POD IP address. network range is defined in <code>subnet.env</code> file</li> </ol> <blockquote> <pre><code># cat /var/run/flannel/subnet.env FLANNEL_NETWORK=10.244.0.0/16 FLANNEL_SUBNET=10.244.0.1/24 FLANNEL_MTU=1450 FLANNEL_IPMASQ=true </code></pre> </blockquote> <ol start="2"> <li><p>All...
<ol> <li>Is this even possible with helm? </li> <li>What options for security are possible (BasicAuth? Client Certs? OAuth2?)</li> <li>Is there any example / documentation about this (both server and client side)?</li> </ol>
<p><strong>Helm Private Repository using private GitHub repositories</strong>.<br/></p> <p><strong>Steps:</strong></p> <ol> <li>Create a private GitHub repository named <code>private-helm-registry</code> or any.</li> <li>Place your Raw Helm Charts.</li> <li><p>Create a <code>charts</code> folder and place <code>index...
<p>I'm using the hosted version of gitlab and gitlab-ci and following the kubernetes integration setup <a href="https://docs.gitlab.com/ce/user/project/integrations/kubernetes.html" rel="noreferrer">https://docs.gitlab.com/ce/user/project/integrations/kubernetes.html</a>.</p> <p>I'm struggling to find what to enter as...
<pre><code>kubectl cluster-info </code></pre> <p>or</p> <pre><code>cat ~/.kube/config | grep server </code></pre>
<p>I'm trying to access the Kubernetes API in order to discover pods from within a deployed container. Although I'll do this programatically, right now, I'm just using cURL to check for issues.</p> <p>I run this from a pod terminal:</p> <pre><code>curl -vvv -H "Authorization: Bearer $(&lt;/var/run/secrets/kubernetes....
<p>It looks like you're on fully RBAC enabled cluster, and your default service account <code>system:serviceaccount:myproject:default</code>, as expected, is unauthorised. You should create and use dedicated service account for this pod and explicitly grant it access to what it needs to read.</p> <p><a href="https://k...
<p>I have an Image which i should add a dependency to it. Therefore I have tried to change the image when is running on the container and create new Image. I have follow <a href="https://www.techrepublic.com/article/how-to-commit-changes-to-a-docker-image/" rel="nofollow noreferrer">this article</a> with the following ...
<p>As with K8s Version 1.8. There is no way to do Hot Fix changes directly to the images.For example, Committing new image from running container. If you still change or add something by using <code>exec</code> it will stay until the container is running. It's <strong>not best practice</strong> in K8s eco-system. </p>...
<p>Can someone example to me how CSRF works in the cluster setup?</p> <p>I have a kubernetes cluster hosting a django website, and I'm having some occasional issues with 403 errors. I have multiple instances of the site load balanced in kubernetes.</p> <p>How does CSRF work when a POST is sent from 1 instance and han...
<blockquote> <p>Can someone example to me how CSRF works in the cluster setup?</p> </blockquote> <p>Exactly the same way it usually ought not to (CSRF is Cross Site Request Forgery, i.e. the attack). To protect against it, you hand out secret tokens to your clients which they must include with subsequent requests. Y...
<p>For development purposes I try to use Minikube. I want to test how my application will catch an event of exposing a service and assigning an External-IP. When I exposed a service in Google Container Engine quick start tutorial I could see an event of External IP assignment with: <code>kubectl get services --watch</c...
<p>On GKE or AWS installs, the external IP comes from the cloud support that reports back to kube API the address that the created LB was assigned.</p> <p>To have the same on minikube you'd have to run some kind of an LB controller, ie. <a href="https://github.com/kubernetes/contrib/tree/master/service-loadbalancer" r...
<p>I have a kubernetes cluster with running pods. In order to monitor and troubleshoot the infrastructure, I want to implement a centralized logging solution so all incoming and outgoing HTTP requests will be logged within one place.</p> <p>For the incoming requests this is not a problem at all, I can use nginx log fr...
<p>Take a look at a service mesh solution like <a href="https://istio.io" rel="nofollow noreferrer">Istio</a> or <a href="https://linkerd.io" rel="nofollow noreferrer">Linkerd</a> as well as tracing solutions like <a href="https://uber.github.io/jaeger/" rel="nofollow noreferrer">Jaeger</a> or <a href="https://zipkin.i...
<p>I would like to know which steps I have to follow in order to send the logs created in my custom apache container (deployed in a pod with Kubernetes) to the Stackdriver collector.</p> <p>I have noticed that if I create a pod with a standard apache (or nginx) container, access.log and error.log are sent automaticall...
<p>After some researches I have resolved the problem of log forwarder from my custom apache container.</p> <p>I don't know why the "standard redirection" (using /dev/stdout or /proc/self/fd/1) is not working anyway the solution that I followed is called "sidecar container with the logging agent"</p> <p>1) create a co...
<p>Using AWS EC2 to install Rancher cluster. Then setup Kubernetes cluster from Rancher server.</p> <p>About auto scaling, there are some ways to do:</p> <h2>Use Rancher cattle webhook service</h2> <blockquote> <p><a href="https://rancher.com/docs/rancher/v1.6/en/cattle/webhook-service/" rel="nofollow noreferrer">...
<p>Since you deployed Kubernetes with Rancher, you should use Rancher webhooks for this operation. Use Prometheus/Grafana to set up webhook when CPU utilization is over some %.</p>
<p>I checked the kubernetes docs, find that pods/exec resources has no verb, and do not know how to only control access for it? Since I create a pod, someone else need to access it use 'exec' but cannot create anything in my cluster.</p> <p>How to implement this?</p>
<p>Since pods/exec is a subresource of pods, If you want to exec a pod, you first need to get the pod, so here is my role definition.</p> <pre><code>kind: Role apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: namespace: default name: pod-reader rules: - apiGroups: [""] resources: ["pods", "pods/log"] ve...
<p>We have a full cluster running in production and suddenly it stopped working with the following error:</p> <blockquote> <pre><code>The Deployment "authapi" is invalid: metadata.finalizers[0]: Invalid value: "foregroundDeletion": name is neither a standard </code></pre> <p>finalizer name nor is it fully qualifi...
<p>This is a bug, fixed in 1.6.7+</p> <p><a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.6.md/#v167" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.6.md/#v167</a></p> <blockquote> <p>Fix Invalid value: "foregroundDeletion" error when attempting t...
<p>My current Kafka deployment file with 3 Kafka brokers looks like this:</p> <pre><code>apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: kafka spec: selector: matchLabels: app: kafka serviceName: kafka-headless replicas: 3 updateStrategy: type: RollingUpdate podManagementPolicy: Pa...
<p>I managed to solve the problem with a command field inside the pod definition:</p> <pre><code> command: - sh - -c - "export KAFKA_ADVERTISED_HOST_NAME=$(hostname).kafka-headless.default.svc.cluster.local &amp;&amp; start-kafka.sh" </code></pre> <p>This runs a shell command which exports the a...
<p>I'm having a problem going through the step in the <a href="https://learn.microsoft.com/en-us/azure/aks/kubernetes-walkthrough" rel="nofollow noreferrer">Quickstart for Azure Kubernetes cluster for Linux</a>. </p> <p>The following command creates a resource group successfully: $> az group create --name myResour...
<p>yes you cannot create kubernete cluster in azure without app registration in AD, for that u need to create role,serviceprincipal,application in AD tenant and it should be on same region. follow these 2 links to create serviceprincipal either from cli or portal. <a href="https://learn.microsoft.com/en-us/azure/azure-...
<p>When you run: <code>kubectl get svc -n default</code>, you will have a kubernetes service with Type as ClusterIP already there.</p> <p>What is the purpose of this service? Any references appreciated.</p> <p>I'm running in Minikube</p> <pre><code>xyz:Kubernetes _$ kubectl describe svc/kubernetes Name: ...
<p>AFAIK the kubernetes service in the default namespace is a service which forwards requests to the Kubernetes master ( Typically kubernetes API server).</p> <p>So all the requests to the kubernetes.default service from the cluster will be routed to the configured Endpoint IP. In this scenario its the kubernetes mast...
<p>I know that I can <a href="https://kubernetes.io/docs/tasks/administer-cluster/memory-default-namespace/#create-a-limitrange-and-a-pod" rel="nofollow noreferrer">create a LimitRange</a> in a namespace. Then all pods created in <em>that</em> namespace will have Resource (CPU/Memory) Limits/Requests set.</p> <p>So my...
<p>It is currently not possible to enforce <code>LimitRange</code> and <code>ResourceQuota</code> cluster-wide, that is, providing defaults for every namespace. I'm aware of at least <a href="https://github.com/kubernetes/kubernetes/issues/17097" rel="nofollow noreferrer">one discussion</a> to potentially change this.<...
<p>I created an EBS volume with 30 GiB size. Made two manifest files:</p> <ul> <li>pv-ebs.yml</li> <li>pvc-ebs.yml</li> </ul> <p>In pv-ebs.yml:</p> <pre><code>apiVersion: v1 kind: PersistentVolume metadata: name: ebs spec: capacity: storage: 30Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPo...
<p>When EBS is created, it is provisioned in a particular AZ and it can not be cross-zone mounted. If you do not have nodes available in the same zone for scheduling the pod, it will not start.</p> <p>Another thing is that with a properly configured kube cluster, you should not need to create PV on your own at all, ju...
<p>In this stackoverflow question: <a href="https://stackoverflow.com/questions/38261107/kubernetes-deployment-how-to-change-container-envi">kubernetes Deployment. how to change container environment variables for rolling updates?</a></p> <p>The asker mentions mentions he edited the deployment to change the version t...
<p>Assuming <code>v1</code> is already running and you try to deploy <code>v1</code> again with the same environment variable values etc., then k8s will not see any difference between your current and updated deployment resource. Without diff, the k8s scheduler assumes that the desired state is already reached and won...
<p>While diving into Docker, Google Cloud and Kubernetes, and without clearly understanding all three of them yet, it seems to me these products are overlapping, yet they're not compatible.</p> <p>For example, a <code>docker-compose.yml</code> file needs to be re-written so an app can be deployed to Kubernetes.</p> <...
<p><strong><a href="https://www.docker.com/resources/what-container" rel="noreferrer">Containers</a></strong>:</p> <ul> <li>Containers are at the core of the other technologies listed here</li> </ul> <p><strong><a href="https://www.docker.com/" rel="noreferrer">Docker</a></strong>:</p> <ul> <li>Docker is a popular impl...
<p>In this stackoverflow question: <a href="https://stackoverflow.com/questions/38261107/kubernetes-deployment-how-to-change-container-envi">kubernetes Deployment. how to change container environment variables for rolling updates?</a></p> <p>The asker mentions mentions he edited the deployment to change the version t...
<p>If you don't want to:</p> <ul> <li>Checking in the new YAML version</li> <li>Manually updating the config</li> </ul> <p>You can update the deployment either through:</p> <ul> <li>A REST call to the deployment in question by patching/putting your new image as a resource modification. i.e. <code>PUT /apis/extension...
<p>I have a Kubernetes deployment containing a very simple Spring Boot web application. I am experiencing random timeouts trying to connect to this application externally.</p> <p>Some requests return instantly whereas others hang for minutes.</p> <p>I am unable to see any issues in the logs.</p> <p>When connecting t...
<p>As you have narrow down the issue to networking which means components of the cluster are healthy such as <strong>Kubelet, Kube-proxy</strong> and etc. </p> <p>You can check their status by using systemctl utility. For example </p> <pre><code>systemctl status kubelet systemctl status kube-proxy </code></pre> <p>Y...
<p>I'm having a problem going through the step in the <a href="https://learn.microsoft.com/en-us/azure/aks/kubernetes-walkthrough" rel="nofollow noreferrer">Quickstart for Azure Kubernetes cluster for Linux</a>. </p> <p>The following command creates a resource group successfully: $> az group create --name myResour...
<p>Thanks for the feedback. I managed to resolve the issue by deleting my .azure folder and retrying.</p>
<p>I'm looking to create a statefulset using affinity. I have added a label to my 3 nodes. Two of them have area=area1 and one node has area=area2. I'm looking to run my statefulset pods only on the nodes with area=area1. It's not working. I'm getting an error from the scheduler that no nodes were matched. I'm running ...
<p>You should be using <code>nodeAffinity</code> not <code>podAffinity</code>, <code>podAffinity</code> is "based on labels on pods that are already running on the node rather than based on labels on nodes" (<a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/" rel="nofollow noreferrer">https://k...
<p>I have horizontal pod autoscaler running on GKE. It works but its slow to respond to increases in workload, so I would like to try modifying a couple of the kube-controller-manager parameters, specifically:</p> <p>--horizontal-pod-autoscaler-upscale-delay --horizontal-pod-autoscaler-downscale-delay</p> <p>But the...
<p>These flags must be configured in the kube-controller-manager and since you cannot pass flags to the GKE cluster it is impossible to modify the autoscaler settings on GKE.</p>
<p>Can embedded tomcat or any such embedded server be used for microservices in production environment? How, embedded server is different wrt the normal standalone full fledged server (performance . reliability wise)? Is the embedded server light weight compared to standalone? What are the features that embeded servers...
<p>Well, it's a matter of choice. I've seen some services which use embedded tomcat in production and some services which rely on standalone tomcat container which is directly provided by the platform. Some platforms might not have a java runtime, in such scenarios you're bound to use embedded containers for tomcat or ...
<p>I'm trying to write Helm Charts for our product. The images are stored on GCR private repo. The charts for all components are ready, but I'm trying to write a YAML file in a chart for imagePullSecrets. I've read chart tips from <a href="https://github.com/kubernetes/helm/blob/master/docs/charts_tips_and_tricks.md#cr...
<p>It can be created and deployed using the following steps:</p> <p><strong>Steps:</strong></p> <ol> <li><p>Create base64 encoded string using your docker_username and docker_password</p> <pre><code>$ echo -n "docker_username:docker_password" | base64 ZG9rY2VyX3VzZXI6ZG9ja2VyX3Bhc3N3b3Jk </code></pre></li> <li><p>Pl...
<p>Now we're using <code>Kubernetes</code> to implement the PaaS service and users can ssh into the containers. Because container runs inside the network of Kubernetes, users can access the services like <code>kube-apiserver</code>.</p> <p>We want to restrict the outbound of the user's pods. It seems that <code>Kubern...
<p>Outbound traffic is now supported by Network Policies since v1.8, you should check again and see if your use case is fully supported.</p> <p><a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#default-deny-all-egress-traffic" rel="nofollow noreferrer">https://kubernetes.io/docs/concep...
<p>Kops created a cluster as well as terraform scripts.</p> <p>How to restart kubelet and provide new flags for garbage collection(manual approach) and how to apply them to terraform?</p> <p>Problem occurs when I manually kill the kubelet process on master and it keeps getting restarted immediately. </p>
<p>You could change the /etc/sysconfig/kubelet file. In the config, append / change the flags you need. Then restart the kubelet service using <code>$ systemctl restart kubelet</code></p>
<p>In a kubernetes I have a container X. I'd like to run a cronjob, that executes a command within a container X.</p> <p>I have the following idea in mind:</p> <ol> <li>run a cronjob using busybox container,</li> <li><p>from within busybox container execute a script that will:</p> <ol> <li>determine the pod name whe...
<p>Your general approach (calling the <code>{pod}/exec</code> endpoint on the Kubernetes API from within your container) seems totally valid to me. In general, I see two aspects to consider, here: 1) how to use <code>curl</code> to communicate with the Kubernetes API, and 2) how to authenticate against the API from wit...
<p>I want to expose 2 ports on one service:</p> <pre><code>apiVersion: apps/v1beta1 kind: Deployment metadata: name: etools spec: replicas: 1 template: metadata: labels: app: etools spec: containers: - name: etools image: eregistry.azurecr.io/etools:latest ports:...
<p>Your <code>Service</code> is very close, but in the <a href="https://kubernetes.io/docs/api-reference/v1.8/#serviceport-v1-core" rel="nofollow noreferrer">ports:</a> array, the ports need to be named if there is more than one (they ideally would always have names), and the <code>selector:</code> is just once per <co...
<p>I have been using kops to build the kubernetes cluster which is really easy-to-go tool, however i am unable to find a way-out on how to change the admin password which is auto-generated while the cluster is being created.</p>
<blockquote> <p>As it is currently not possible to modify or delete + create secrets of type &quot;Secret&quot; with the CLI you have to modify them directly in the kops s3 bucket.</p> <p>They are stored /clustername/secrets/ and contain the secret as a base64 encoded string. To change the secret base64 encode it with:...
<p>I have a helm chart template, and I would like to use the result of <code>whoami</code> as a template variable. How do I do this?</p> <p>So if my values.yaml file has: </p> <pre><code>env: uniqueId: {{ whoami? }} </code></pre> <p>how might I do this?</p> <p>note: I am on os x, so whoami I believe assumes a lin...
<p>The Helm Chart's "values.yaml" file is typically for default values. Anything that you'd like to override should be done at time of install/upgrade of the chart.</p> <p>The Helm docs show a lot of different ways in which values can be used: <a href="https://github.com/kubernetes/helm/blob/master/docs/charts.md" rel...
<p>Just curious, with mesos I'm used to being able to do <code>systemctl stop mesos-master</code> and <code>systemctl start mesos-master</code> (if I need to bounce it for some reason). With k8s, there are multiple components to 'stop' in the control plane, such as apiserver, controller-manager, etc.</p> <p>When creat...
<p>The Kubernetes control plane pods are often deployed as <a href="https://kubernetes.io/docs/tasks/administer-cluster/static-pod/" rel="noreferrer">Static Pods</a>. These are not managed by any kind of Deployment controller, but are defined in static (hence the name) configuration files that are placed in a configura...
<p>I'm just getting started with kuberneted on Windows 10. I downloaded the bits from <a href="https://github.com/kubernetes/minikube/releases" rel="noreferrer">here</a>.</p> <p>While attempting to start minikube from powershell:</p> <pre><code>PS C:\WINDOWS\system32&gt; minikube start --vm-driver=hyperv </code></pre...
<p>While I do not completely understand what happend, I chanced upon <a href="https://github.com/kubernetes/minikube/issues/1400" rel="noreferrer">this article</a>. </p> <hr> <p>I got minikube running using the following steps: </p> <pre><code> PS C:\WINDOWS\system32&gt; minikube delete PS C:\WINDOWS\system32...
<p>Tiller is not working properly in my kubernetes cluster. I want to delete everything Tiller. Tiller (2.5.1) has 1 Deployment, 1 ReplicaSet and 1 Pod.</p> <p><strong>I tried: kubectl delete deployment tiller-deploy -n kube-system</strong></p> <ul> <li>results in "deployment "tiller-deploy" deleted"</li> <li>howe...
<p>To uninstall tiller from a kubernetes cluster:</p> <pre><code>helm reset </code></pre> <p>To delete failed tiller from a kubernetes cluster:</p> <pre><code>helm reset --force </code></pre>
<p>We are running Prometheus on our cloud under Kubernetes, and are able to get stats back for the memory, CPU usage etc of the nodes. Now we want to be able to scrape our own custom time series from pods running on the cloud. As I understand it, this requires a job with a kubernetes_sd_config of role 'pod' (and a rela...
<blockquote> <p>and a relabel that will select only pods with a given name</p> </blockquote> <p>I suppose that's possible, but in our config, we just omit the scrape annotation (discussed below) and Prom doesn't contact those Pods; we haven't touched the Prom config itself in months, but change the Pod annotations m...
<p>I'm trying to build a docker image from my <code>go</code> app. The github repo is private. I'm a bit new to go (and docker), but I thought that the <code>/vendor</code> file managed through <code>glide</code> should circumvent the problem? Also why does docker have to get everything from github? Everything is avail...
<p>Only use <code>golang:1.8-onbuild</code> if you need to compile your go code image INSIDE a container. That's typically useful for CI builds. Otherwise avoid since it's a massive image.</p> <p>A much much faster solution is to build your Go application locally (dev env for instance) and copy the final Go applicatio...
<p>I am trying to install kubernetes. There was a problem when checking the container executed on kubernetes. I set the type of service to Nodeport, but I could not access from a node other than the one on which the container is running. Want to make it accessible from other computers, please tell me where it is differ...
<p>It's caused by default DROP on FORWARD chain (which in turn is caused by docker).</p> <p>You can see it working again if you add <code>iptables -A FORWARD -j ACCEPT</code> rule to your node.</p> <p>The k8s issue is here: <a href="https://github.com/kubernetes/kubernetes/issues/39823" rel="noreferrer">https://githu...
<p>I have a simple application that Gets and Puts information from a Datastore.</p> <p>It works everywhere, but when I run it from inside the Kubernetes Engine cluster, I get this output:</p> <pre><code>Error from Get() rpc error: code = PermissionDenied desc = Request had insufficient authentication scopes. Error fr...
<p>So what I learnt in the process of debugging this issue was that:</p> <ul> <li><p>During the creation of a Kubernetes Cluster you can specify permissions for the GCE nodes that will be created.</p></li> <li><p>If you for example enable Datastore access on the cluster nodes during creation, you will be able to acces...
<p>I am using </p> <p><code>kubectl scale --replicas=0 -f deployment.yaml</code> </p> <p>to stop all my running pods. Please let me know if there are better ways to bring down all running pods to Zero keeping configuration, deployments etc.. intact, so that I can scale up later as required.</p>
<p>You are doing the correct action; <em>traditionally</em> the <code>scale</code> verb is applied just to the resource name, as in <code>kubectl scale deploy my-awesome-deployment --replicas=0</code>, which removes the need to always point at the <em>specific file</em> that describes that deployment, but there's nothi...
<p>I have a <code>express</code> web server with static files. Let's call this my <code>express-deployment</code>. </p> <p>I'd like to use my <code>ingress-nginx</code> to serve static files from my <code>express-deployment</code> without ever actually hitting my express server. </p> <p>In <code>nginx</code> this is ...
<p>In theory, you could have a PV in in RWX mode mounted to both express and ingress and provide custom config to the nginx-ingress pods, but that should be avoided. Ingress Controller has one responsibility - implement Ingress rules defined in your cluster. To serve static content you should have a pod that does that,...
<h1>Question</h1> <p>What is the purpose of the K8S_HOST_URL configuration parameter in EFK? In EFK, K8S_HOST_URL exists as an environment variable and it looks being used to communicate to the Kubernetes API server by fluentd as being specified in the <a href="https://github.com/openshift/origin-aggregated-logging/bl...
<p>First "<code>K8S_HOST_URL</code>" does not show up in <a href="https://github.com/elastic/elasticsearch/search?utf8=%E2%9C%93&amp;q=K8S_HOST_URL&amp;type=" rel="nofollow noreferrer"><code>elastic/elasticsearch</code></a>, <a href="https://github.com/fluent/fluentd/search?utf8=%E2%9C%93&amp;q=K8S_HOST_URL&amp;type=" ...
<p>I have several apps deployed into a kubernetes cluster. I have the receipts and etc as yaml files and I deploy and apply everything with <code>kubectl</code>.</p> <p>I decided to migrate to helm because of its features and to avoid replicating code between dev and prod (I could use variables and etc).</p> <p>The p...
<p>A properly designed chart should namespace deployed resources by <code>.Release.Name</code>. That way you can deploy chart side by side with existing software you have. It's likely that you will be able create large part of your stack in parallel and then update your off-chart services to point to on-chart pods, tha...
<p>anyone knows how to find the name of a kubernetes cluster in azure portal? I did not create the cluster but I'm trying to connect to it and I don't know and can't find what to put in the --name tag</p>
<p>Well, the name of the kubernetes cluster is the name of the resource you see in the portal. As simple as that.</p> <p>Just find the cluster in question and look how its called.</p>
<p>I am new to helm charts. So please correct me if I am going wrong in understanding. I have a service which I am trying to deploy using helm charts. I want to change the config map name and its key values to read depending on deployment environment. Hence I want to add conditional logic in values.yaml.</p> <p>Can so...
<p>A chart's <code>values.yaml</code> is primarily used to set default values, regardless of the environment. It exists to fill chart templates with values. It is not designed to be a template itself, so there is no logic you can apply inside a <code>values.yaml</code> file.</p> <p>Each environment should have its own...
<p>I have a Kubernetes cluster running on Google Kubernetes Engine (GKE) with network policy support enabled. I created an nginx deployment and load balancer for it:</p> <pre><code>kubectl run nginx --image=nginx kubectl expose deployment nginx --port=80 --type=LoadBalancer </code></pre> <p>Then I created this networ...
<p>I talked about this in my <a href="https://github.com/ahmetb/kubernetes-networkpolicy-tutorial/blob/a18f9e6e/08-allow-external-traffic.md" rel="nofollow noreferrer">Network Policy recipes repository</a>.</p> <p>&quot;<em>Allowing EXTERNAL load balancers while DENYING local traffic</em>&quot; is not a use case that m...
<p>I get a weird new line when my chart is rendered that templates from another file using <code>{{ include }}</code>. For instance, my manifest looks like this </p> <pre><code> containers: - name: {{ .Release.Name }} image: {{ .Values.global.image}}:{{ .Values.global.imageTag }} imagePullPo...
<p>You can use a hyphen to suppress the newline on template commands. You're already using it for <code>define</code> and <code>end</code>.</p> <p>Similarly, you should use <code>{{- include ... -}}</code>.</p>
<p>I would like to know if there is a way to force Kubernetes, during a deploy, to use every node in the cluster. The question is due some attempts that I have done where I noticed a situation like this:</p> <ul> <li><p>a cluster of 3 nodes</p></li> <li><p>I update a deployment with a command like: <code>kubectl set ...
<p>The scheduler will try to figure out the most reasonable way of scheduling at given point in time, which can change later on and results in situations like you described. Two simple ways to manage this in one way or another are :</p> <ul> <li>use DaemonSet instead of Deployment : will make sure you have one and onl...
<p>Problem: the code we're running on Kubernetes Pods have a very high variance across it's runtime; specifically, it has occasional CPU &amp; Memory <em>spikes</em> when certain conditions are triggered. These triggers involve user queries with hard realtime requirements (system has to respond within &lt;5 seconds). <...
<p>High availability of pods with load can be achieved in two ways:</p> <blockquote> <p><strong>Configuring More CPU/Memory</strong></p> </blockquote> <p>As the applications requires more CPU/memory during the peak times configure in such a way that allocated resources for the POD will take care of extra load. Conf...
<p>I have seen many questions on the same regard but somehow I still can't successfully connect to MongoDB Slave.</p> <p>I am running my cluster on Kubernetes using <a href="https://github.com/cvallance/mongo-k8s-sidecar" rel="nofollow noreferrer">mongo-k8s-sidecar</a>, connecting my application directly to the master...
<p>You can't run <code>createIndex()</code> on a Secondary member, even if you're using slaveOk/ReadPreference.SECONDARY.</p> <p>If you test the code without the <code>createIndex()</code> call, you'll probably see that it's working as you expect.</p> <p>See <a href="https://docs.mongodb.com/manual/tutorial/build-ind...
<p>The issue: I have a Prometheus outside of Kubernetes cluster. So, I want to export metrics from remote cluster.</p> <p>I took the config sample from <a href="https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml" rel="noreferrer">Prometheus Github repo</a> and modifie...
<p>If you want to monitor a Kubernetes cluster from an external Prometheus server, I would suggest to set up a <a href="https://prometheus.io/docs/prometheus/latest/federation/#use-cases" rel="noreferrer">Prometheus federation</a> topology:</p> <ul> <li>Inside the K8s, install node-exporter pods and a Prometheus insta...
<p>I have a subchart in <code>charts/</code> directory. I would like to disable it for some deployments.</p> <p>Is it possible somehow? Currently i see the only way to add condition to all templates like below:</p> <p>deployment.yaml</p> <pre><code>{{- if .Values.isDev }} deployment code {{- end }} </code></pre> <p...
<p>As a general rule of thumb I always have</p> <pre><code>{{- if .Values.enabled }} ... {{- end }} </code></pre> <p>in every file in every subchart. Depending on situation the default value will be either <code>true</code> for regular components or <code>false</code> for dev related, or simply <code>false</code> for...
<p>Kubernetes uses Docker, and <a href="https://kubernetes.io/docs/getting-started-guides/scratch/#docker" rel="noreferrer">kubelet dictates</a> the compatible Docker versions for any given cluster.</p> <p>My question is, given a Kubernetes cluster that is already configured and running, how would I find out what vers...
<p>You can find container runtime and its version using the following:</p> <pre><code>kubectl get node &lt;node&gt; -o jsonpath="{.status.nodeInfo.containerRuntimeVersion}" </code></pre>
<p>I was looking for ways to get details on disk utilization (mainly writes and Delete's) on a per POD level. I did get google advice such as cAdvisor/heapster etc but none of them talk about disk usage profiling from POD perspective.</p> <p>Any help on this is greatly appreciated.</p> <p>TIA!</p>
<p>Assuming the pods are running a linux variant you can do:</p> <pre><code>kubectl exec -it &lt;pod&gt; cat /proc/1/io </code></pre> <p>Returns info on the main process' IO defined <a href="https://stackoverflow.com/questions/3633286/understanding-the-counters-in-proc-pid-io">here</a></p> <p>You could then write a ...
<p>I am trying to consume Python Rest API call from a container running inside the Kubernetes. I am able to consume the service inside the pod</p> <pre><code>*curl http://localhost:5002/analyst_rating -v * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 5002 (#0) &gt; GET /analyst_rating HTTP/1.1 &gt; ...
<p>You can't get any GET request because it seems that you use POST method </p> <pre><code>*curl -I -X POST http://184.173.44.62:30484/analyst_rating -v </code></pre> <p>Also, why do you use -I parameter? Try to execute:</p> <pre><code>curl http://184.173.44.62:30484/analyst_rating -v </code></pre> <p>If this does...
<p>I'm using Search Guard plugin to secure an elasticsearch cluster composed of multiple nodes. Here is my Dockerfile:</p> <pre><code>#!/bin/sh FROM docker.elastic.co/elasticsearch/elasticsearch:5.6.3 USER root # Install search guard RUN bin/elasticsearch-plugin install --batch com.floragunn:search-guard-5:5.6.3-16 ...
<p>The image itself has an entrypoint <code>ENTRYPOINT ["/run/entrypoint.sh"]</code> specified in the Dockerfile. You can replace it by your own script. So for example create a new script, mount it and first call <code>/run/entrypoint.sh</code> and then wait for start of elasticsearch before running your <code>init_sg....