prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I have php application with <code>public</code> folder, that contains as <code>index.php</code> that handles php requests as static files.</p> <p>I would like to deliver static files via nginx container directly, and use php-fpm only for delivering dynamic requests.</p> <p>How that can be achieved? As i understand...
<p>Let's begin by saying that there are 2 pods which are Nginx Pod and Php pod. Now There are two things need to be associated with these pods.</p> <ul> <li>Static files (Public folder)</li> <li>Configuration file (nginx.conf)</li> </ul> <p>I would prefer to use Persistent Volume claim for static files and ConfigMap...
<p>I have a service named <code>foo</code> with a selector to <code>foo</code> pod:</p> <pre><code>apiVersion: v1 kind: Service metadata: labels: name: foo name: foo namespace: bar spec: clusterIP: 172.20.166.230 ports: - port: 8080 protocol: TCP targetPort: 8080 selector: name: foo ses...
<p>It looks like this is a default behavior when using iptables as a proxy mode.</p>
<p>Is it possible to update an external loadbalancer service in kubernetes with a new spec from an yaml file. </p> <p>I can do rolling updates of the deployments but how can I update services, primarily not changing the external IP address. </p> <p>Thanks, Rajesh</p>
<p>If you do not want to edit on the living or already deployed manifest file. you can edit the service manifest file on your computer and use <strong>apply</strong> action instead of create. For instance, </p> <pre><code>kubectl apply -f service-manifest.yaml </code></pre> <p><strong>It will work without changing a...
<p>I am using <strong>Helm</strong> to manage services in a <strong>Kubernetes</strong> cluster and use a <strong>chartmuseum</strong> to manage charts of my services.</p> <p>After I've added the repo with the command <code>helm repo add URL</code>, helm can interact with my repo, e.g. install available charts with <c...
<p>The state of a repository is cached on your disk. When you update the remote repository you need to run <code>helm repo update</code> to retrieve the update before you can access it. </p>
<p>OpenStack uses messaging (RabbitMQ by default I think ?) for the communication between the nodes. On the other hand Kubernetes (lineage of Google's internal Borg) uses RPC. Docker's swarm uses RPC as well. Both are gRPC/protofbuf based which seems to be used heavily inside Google as well.</p> <p>I understand that m...
<blockquote> <p>Does messaging offer any advantage over RPC in scaled distributed systems ?</p> </blockquote> <p>Mostly persistence is a big advantage for messaging system. Another point is broadcasting. You need to implement this into <a href="https://grpc.io/" rel="noreferrer">gRPC</a> by yourself. Service Discovery ...
<p>I want to scale an application with workers.<br> There could be 1 worker or 100, and I want to scale them seamlessly.<br> The idea is using replica set. However due to domain-specific reasons, the appropriate way to scale them is for each worker to know its: ID and the total number of workers.</p> <p>For example, i...
<p>Before giving the kubernetes-specific answer, I wanted to point out that it seems like the problem is trying to push cluster-coordination down into the app, which is almost by definition harder than using a distributed system primitive designed for that task. For example, if every new worker identifies themselves in...
<p>I am trying to install the azure-cli in the <code>dind:latest</code> image based on alpine.</p> <p>For context, I want to use it to connect to AKS and deploy an app to Kubernetes via Gitlab.</p> <p>In my <code>gitlab-ci.yml</code> file I start with this</p> <pre><code>image: docker:latest services: - docker:din...
<p>This helped me in one of my alpine based image</p> <pre><code>apk update apk add bash py-pip apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python- dev pip install azure-cli apk del --purge build </code></pre>
<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...
<h2>From RHEL</h2> <p>The environment variable K8S_HOST_URL in fluend is an internal url for reaching the master API. Not documented yet.</p>
<pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: helloworld-rules spec: rules: - host: helloworld-v1.example.com http: paths: - path: / backend: serviceName: helloworld-v1 servicePort: 80 - host: helloworld-v2.example.com http: paths: - path: / backend: ...
<p>It depends on how you configure your nginx controller.</p> <p>You should have a Service configured which is the entry point when accessing from outside see the docs <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress" rel="noreferrer">https://kubernetes.io/docs/concepts/service...
<p>I'd like to check that my kubernetes helm chart does not define unused values in <code>values.yaml</code>. This should include any subcharts such that if you've defined <code>subchart.foo.bar: ???</code> in the top-level <code>values.yaml</code> that key is definitely used in the subchart, or possibly as a short-cut...
<p>AFAIK, there isn't a tool for that. However, it shouldn't be that hard to make one, even using bash. For example, you need to export all key/value pairs like this <code>test.test1.test2</code> and grep for that string recursively in the templates folder. If you want to read yaml using bash, you can install <code>shy...
<p>I am trying to ship my K8s pod logs to Elasticsearch using Filebeat.</p> <p>I am following the guide online here: <a href="https://www.elastic.co/guide/en/beats/filebeat/6.0/running-on-kubernetes.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/beats/filebeat/6.0/running-on-kubernetes.html</a></p> <...
<p>The conditions need to be a list:</p> <pre><code>- drop_event.when.regexp: or: - kubernetes.pod.name: "weave-net.*" - kubernetes.pod.name: "external-dns.*" - kubernetes.pod.name: "nginx-ingress-controller.*" - kubernetes.pod.name: "filebeat.*" </code></pre> <p>I'm not sure if your order...
<p>I'm trying to create a kubernetes cluster following the document at: <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="noreferrer">https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/</a></p> <p>First I have installed kubeadm with docker image on Coreos (1520.9.0) i...
<p>Just tonight I used <a href="https://github.com/kubernetes-incubator/kubespray#readme" rel="noreferrer">kubespray</a> to provision a vagrant cluster, on CoreOS, using flannel (vxlan), and I was also mystified about how flannel could be a Pod inside Kubernetes</p> <p>It turns out, <a href="https://github.com/kuberne...
<p>It is known that some applications aren't aware of Linux kernel isolation and virtualization features such as cgroups. This includes system utils like <code>top</code>, <code>free</code> and <code>ps</code>, but also platforms like Java.</p> <p>I've recently read <a href="https://very-serio.us/2017/12/05/running-jv...
<p>A NodeJS process will try an allocate memory regardless of the container limits, just like Java. </p> <p>Setting a limit on the process will help stop the OS from killing the process, particularly in constrained environments where Node might try allocate past the memory limit even though Node could probably run ins...
<p>I have been creating pods with <code>type:deployment</code> but I see that some documentation uses <code>type:pod</code>, more specifically <a href="http://kubernetes.io/docs/user-guide/pods/multi-container/" rel="noreferrer">the documentation for multi-container pods</a>:</p> <pre><code>apiVersion: v1 kind: Pod me...
<p>Radek's answer is very good, but I would like to pitch in from my experience, you will almost never use an <strong>object</strong> with the <strong>kind</strong> <strong>pod</strong>, because that doesn't make any sense in practice. </p> <p>Because you need a <strong>deployment</strong> object - or other Kubernetes...
<p>We are currently rolling out Pimcore 5 in our Docker Kubernetes environment but we didn't find an appropriate answer for the following question yet:</p> <p>Which folders need to be persistent?</p> <p>The documentation points out that the folders <strong>/var</strong> and <strong>/web/var</strong> are used to safe ...
<p>Yes, <code>/var</code> and <code>/web/var</code> need to be on a persistent and shared filesystem.</p> <p>Further hints regarding this setup are in the documentation: </p> <ul> <li><p><a href="https://pimcore.com/docs/master/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Cluster_Setup....
<p> Hi there, I have a docker container that is a php backend. I have created a kubernetes pod of this container. This is what my yml file looks like:</p> <pre><code> apiVersion: v1 kind: Pod metadata: name: backend spec: containers: - name: backend image: 000.dkr.ecr.eu-west-1.amazonaws.com/fullstackapp ...
<p>Well,</p> <p>Since you have dockerized your app (you made an docker image), you also must use a docker image for your MySql database.</p> <p>But here is the kicker, you need also to create <strong>services</strong> for your app pod and your MySql pod.</p> <p>You can find all the details in the k8 <a href="https:/...
<p>While initializing <code>kubeadm</code> I am getting following errors. I have also tried command <code>kubeadm reset</code> before doing <code>kubadm init</code>. Kubelet is also running and command I have used for same is <code>systemctl enable kubelet &amp;&amp; systemctl start kubelet</code>. Following is log aft...
<p>just disable the swap in the machine. <strong>sudo swapoff -a</strong> </p>
<p>How does one deploy a node app from Gitlab-ci to GKE? I already have cluster integration enabled and functional. But the documentation on what that means is almost non existent. I don't know what variables having a GKE cluster connected gives me or how to use it in my CI.</p> <p><a href="https://i.stack.imgur.com/E...
<p>I haven't used Auto DevOps integration, but I can try and generalize a working approach.</p> <p>If you have tiller installed on the k8s cluster, it's best if you create a helm chart for your application. If you haven't done that already, there is a a tutorial on how to do that here: <a href="https://github.com/kube...
<p>I'm using a vanilla minikube environment.</p> <p>I'm not specifying any service account-related instructions in my bare-bones simple Pod <code>.yaml</code> file.</p> <p>Inside a deployed Pod, <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code> is empty. What are the possible causes for this?</p>
<p>As mentioned <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server" rel="noreferrer">in the docs</a></p> <blockquote> <p>In version 1.6+, you can opt out of automounting API credentials for a service account by setting...
<p>I am trying to deploy a Spring Boot application using configuration data from Kubernetes cluster. I have a simple RestController that prints a message by reading from a Kubernetes cluster. </p> <pre><code> private String message = "Message not coming from Kubernetes config map"; @RequestMapping(value="/echo", m...
<p>Let me try and provide an answer which I think gives you what you need, without using any tools beyond what you'll have installed on most boxes. Maybe try this first, and if you find the approach becomes difficult to manage and scale, move onto something more sophisticated.</p> <h2>Step 1: Version control configmap...
<p>I am new to Kubernetes and have a basic question. I installed the Canonical Distribution of Kubernetes on a bare metal Ubuntu "Localhost" setup with LXD. </p> <p>I am able to run a simple deployment/service for a NGINX cluster. However, I am confused as to how I can actually expose it externally using my server ...
<p>From what you describe, it looks like, in your local environment, configured a "containerized cluster". Therefore, you can access the NodePort accessing these containerized worker nodes, but the host IP itself (as there is nothing configured in that local host, right?). </p> <p>So, what you would need to do is to e...
<p>Can someone guide the configuration for auto discover for K8s. The Prometheus server is outside of the cluster. I tried <a href="https://movio.co/en/blog/prometheus-service-discovery-kubernetes/" rel="noreferrer">Service Discovery With Kubernetes</a> and someone mentioned in this <a href="https://groups.google.com/f...
<p>By digging though the source code I figured out, that Prometheus always uses the in cluster config, if no <code>api_server</code> is provided in the config (<a href="https://github.com/prometheus/prometheus/blob/099df0c/discovery/kubernetes/kubernetes.go#L90-L96" rel="noreferrer"><code>discovery/kubernetes/kubernet...
<p>I've a kubernetes 1.8. I've deploy a lots of services but I've problem remove some pods, it's never delete.</p> <p>This is the pod describe:</p> <pre><code>Name: project-settlement-api-798c8b6688-ldclr Namespace: project Node: 10.93.96.208/10.93.96.208 Star...
<p>It looks to me that you are using a Deployment API Object. Therefore, if you remove the pod it will be recreated. Try the following:</p> <pre><code>kubectl get deployments </code></pre> <p>Get the deployment id and execute</p> <pre><code>kubectl delete deployment DEP_ID </code></pre> <p>Then it will be removed....
<p>If I execute "free" command in the pod (openshift/kubernetes), what output I will get.</p> <p>Will I get the memory utilisation of pod or memory utilisation of node where pod exist.</p>
<p>I believe it is the node. Some things like that don't relate to the pod but fall back to the node. Another example is uptime. That is also for the node.</p>
<p>I saw there is no <code>sink configuration</code> for Prometheus in this <a href="https://github.com/kubernetes/heapster/blob/master/docs/sink-configuration.md" rel="nofollow noreferrer">heapster document</a>. Is there any simple way to combine these two and monitor.</p>
<p>Prometheus uses a <a href="https://prometheus.io/docs/introduction/faq/#why-do-you-pull-rather-than-push?" rel="nofollow noreferrer">pull model</a> to retrieve the data, while Heapster is tool, which pushes their metrics to a certain endpoint (pull model).</p> <p>I assume you want to get Kubernetes metrics into Pro...
<p>minikube version ⏎ minikube version: v0.22.3</p> <p>I'm trying to setup various pods within a minikube instance. I'm running behind a...
<p>we can't ping the service IP address, you can telnet to the port <code>5432</code> defined in the service with service IP.</p>
<p>I've set up an insecure k8s master node using <code>hyperkube</code>, with an insecure API:</p> <pre class="lang-sh prettyprint-override"><code>docker run -d --name=k8s-apiserver --net=container:etcd gcr.io/google_containers/hyperkube:v1.8.5 /apiserver --etcd-servers=http://127.0.0.1:2378 --service-cluster-ip-range...
<p>Starting from kubernetes version 1.8 you should use <code>--kubeconfig</code> key to specify a path to a <code>kubeconfig</code> file where is described how to connect to API server: </p> <pre><code>--kubeconfig string Path to a kubeconfig file, specifying how to connect to the API server. (default "/var/lib/k...
<p>minikube version ⏎ minikube version: v0.22.3</p> <p>I'm trying to setup various pods within a minikube instance. I'm running behind a...
<p>@sfgroups answer is correct! ping was the wrong tool to use. Telnet or actually using psql worked. The actual problem was that my services weren't pointing to anything. </p> <p>I updated my app pods to have the unique names and then updated the selector for the service.</p>
<p>I currently load testing my service using Gatling in AWS. I did several load tests using HTTP and my service works perfectly. No TLS handshake errors. When we moved to the HTTPS, the load test result showed <strong>TLS handshake timeout</strong> exception all over the place and finally thrown OOM because unprocessed...
<p>So it seems the problem was because the time it took for Gatling to handshake longer than the creation users per second. By decreasing the number of users created and increasing the number RPS solved that.</p>
<p>I'm using <code>kube-aws</code> to run a Kubernetes cluster on AWS, and everything works as expected.</p> <p>Now, I realize that cron jobs aren't turned on in the version I'm using (<code>v1.7.10_coreos.0</code>), while the documentation for Kubernetes only states the following:</p> <blockquote> <p>For previous ...
<p><code>batch/v2alpha1=true</code> is set by default in <code>kube-aws</code>. You can find it <a href="https://github.com/kubernetes-incubator/kube-aws/blob/22673054e2e2de1f096980050a5f52060974929a/core/controlplane/config/templates/cloud-config-controller#L2040" rel="nofollow noreferrer">here</a></p>
<p>I cannot seem to figure out how to get certain metrics from GCP into Stackdriver (google monitoring) in a usable way. They can be viewed using Stackdriver's "Metrics Explorer" tool, but not saved into a graph or alerting policy. As a specific example, only a handful of the metrics outlined in this table are availabl...
<p>Metrics Explorer includes access to more metrics than are currently available for alerting. We're working on addressing this both for UIs and APIs. Please stay tuned to release notes. Thanks for using Stackdriver!</p>
<p>I am trying to loop for a count in a kubernetes helm chart like this:</p> <pre><code>reaction.mongo_url_big: mongodb://{{ for $mongocount := 0; $mongocount &lt; {{ .Values.mongodbReplicantCount }}; $mongocount++ }}{{ .Values.mongodbReleaseName }}-mongodb-replicaset-{{ $mongocount }}:{{ .Values.mongodbPort }}{{ if $...
<p>Use range:</p> <pre><code>{{ range .Values }} {{ .MongodbReleaseName }} {{ end }} </code></pre> <p>This will output the .MongodbReleaseName (assuming that's a field) of every item in .Values. The value is assigned to . while within the range so you can simply refer to fields/functions of the individual Values. ...
<p>What does Apache Mesos do that Kubernetes can't do or vice-versa? </p> <p>Mesos is a Two level scheduler. Sure it grabs resource information from every machine and gives it to the top level scheduler such that frameworks like kubernetes can use to schedule containers across machines but Kubernetes can itself schedu...
<p>Both Mesos and Kubernetes are n-th level containers orchestrators. This means <strong>you can achieve the same features but some kind of tasks could be done easier</strong> (read. better) on one of them. In fact, you can run Kubernetes on Mesos and vice verse.</p> <p>Let's go through main differences that give some ...
<h1>Questions</h1> <p>Where are the configuration files of etcd which kubeadm init installs?</p> <h2>Background</h2> <p>Followed <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="nofollow noreferrer">Using kubeadm to Create a Cluster</a> and noticed there was no step to manually ins...
<p>Kubeadm initialises as well as provide adequate files in the <code>/etc/kubernetes</code> directory to kubelet.</p> <pre><code>[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki" [kubeconfig] Wrote KubeConfig file to disk: "admin.conf" [kubeconfig] Wrote KubeConfig file to disk: "kubelet.c...
<p>I have a kubernetes cluster on Azure and I created 2 namespaces and 2 service accounts because I have two teams deploying on the cluster. I want to give each team their own kubeconfig file for the serviceaccount I created. </p> <p>I am pretty new to Kubernetes and haven't been able to find a clear instruction on th...
<pre><code># your server name goes here server=https://localhost:8443 # the name of the secret containing the service account token goes here name=default-token-sg96k ca=$(kubectl get secret/$name -o jsonpath='{.data.ca\.crt}') token=$(kubectl get secret/$name -o jsonpath='{.data.token}' | base64 --decode) namespace=$...
<p>On kubernetes 1.8.4 I'm trying to give kubernetes users access to our dashboard.</p> <p>When using the admin context to proxy, all the tokens work when logging into the dashboard. But my users don't have the admin context, only I do, so they use their own context to proxy. And in those situations, they get an error...
<p>I couldn't find a different way other than providing some access to kube-system, so I did using the following role and binding:</p> <pre><code>kind: Role apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: namespace: kube-system name: user-role-dashboard rules: - apiGroups: [""] resources: - ser...
<p>After having changed the IP configuration of the cluster (all <em>external</em> IPs changed, the internal private IPs remained the same), some <code>kubectl</code> commands do not work anymore for any container. The pods are all up and running, and seem to find themselves without problems. Here is the output:</p> ...
<p>Based on the symptom new ip missing from the certificate. use the below command to validate.</p> <pre><code> openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text |grep DNS </code></pre>
<p>For Openshift Health checks (Liveness and readiness probes), does the liveness check run after the container is ready. So should the Readiness initial delay be less than the Liveness initial delay.</p> <p>Please advise.</p> <p>Thanks B.</p>
<p>The delay specified for both readiness and liveness check is from the start of the deployment. The start of the delay for the liveness check is not dependent on the pod first being ready. Once they start, both run for the life of the pod.</p> <p>You need to evaluate what you set the delays to based on the role of e...
<p>I'm in desperate need of help. I'm noticing that my Kubernetes minions/nodes are rebooting at what appear to be random intervals a few times a day and I can't figure out why. This is a big problem for me because every reboot causes about 10 minutes of downtime for every app on the node. </p> <p>When they reboot, I ...
<p>Troubleshooting can be done by looking at the logs so that you can have more information to see what is making the node to reboot. When rebooting happens the kublet process restarts and it’s trying to get metrics before the first metrics have been collected. That is why you see the warning error after the restart of...
<p>I'm trying to copy files to/from a Windows container in a pod running on an ACS k8s cluster.</p> <p>I'm using this kubectl command from my Windows 10 laptop:</p> <pre><code>kubectl cp dev-acs-conn-testdn-1981314364-rjc0l:\app\nettrace.etl c:\ </code></pre> <p>And I'm getting this error in response:</p> <blockquo...
<p>So it turns out that the &quot;kubectl cp&quot; command requires that tar be in the container, not on the local system as I expected. And since Windows doesn't ship with tar.exe the problem lies there.</p> <p>I deployed a new pod that included a Windows version of tar.exe and it's dependencies. This got me further i...
<h1>Question</h1> <p>How to get the Kubernetes related keys from etcd? Tried to list keys in etcd but could not see related keys. Also where is etcdctl installed?</p> <pre><code>$ etcdctl bash: etcdctl: command not found.. $ sudo netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Addr...
<p>Usually you need to get <code>etcdctl</code> by yourself. Just download the latest <code>etcdctl</code> archive from <a href="https://github.com/coreos/etcd/releases" rel="noreferrer">etcd releases page</a>.</p> <p>Also, starting from Kubernetes version 1.6 it uses etcd version 3, so to get a list of all keys is:</...
<p>What are the Advantages and Disadvantages of Two Level Scheduler (like in Apache Mesos) vs Single Level Scheduler (like in Kubernetes) ? And how they would perform on small and large clusters for variety of work loads that normally take place in build, test, deploying stateless, stateful &amp; Big data applications?...
<p>Full disclosure: I work for Mesosphere :) </p> <p>One advantage of two-level schedulers is that they can manage different workloads in different ways. </p> <p>Some workloads require access to special resources only available on certain nodes (external storage for example). Some workloads might run best on special ...
<p>when I create the Kubernetes Job by a job yaml file, and I have this error message:</p> <p>Job in version \"v1\" cannot be handled as a Job: [pos 196]: json: expect char '\"' but got char '{'</p> <p><strong>Anyone know why? Thanks!</strong></p> <p>File job.yml:</p> <p><code> apiVersion: batch/v1 kind: Job metada...
<p>The above file perfectly creates a job for me. I am using minikube version <code>minikube version: v0.23.0</code> and kubectl version <code>1.8</code></p> <p>When I run the command <code>kubectl create -f job.yaml</code> , output is as follows.</p> <pre><code>[pgarg@localhost]$ kubectl create -f job.yaml job "pi"...
<p>I am configuring a master Jenkins to start slaves with kubernetes. When a slave starts its pipeline I need him to have a maven <code>settings.xml</code> read (or copied) from the master. With kubernetes plugin I haven't found a way for that.</p> <p>Any suggestions, please?</p>
<p>Maybe Jenkins <a href="https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#pipeline-basic-steps" rel="nofollow noreferrer">Pipeline: Basic Steps</a> can help you out. They offer a <a href="https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-stash-code-stash-some-files-to-be-used-later-in-the-bui...
<h1>Question</h1> <p>What are the commands to start/stop the K8S cluster? After installation is done following <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#24-initializing-your-master" rel="nofollow noreferrer">Using kubeadm to Create a Cluster</a>, restarted the CentOS server and the ...
<p>As you are using <strong>kubeadm</strong> to initiate and administrate the k8s cluster.As I understand kubeadm use following approach</p> <p>Systemd manage only kubelet service on the node.</p> <p>Kubelet create and manage k8s control plane componenets (kube-api server, kube-controller-manager , etcd and scheduler...
<p>I guess that minikube needs VirtualBox because of dockers' dependencies, but my current docker version doesn't need it.</p> <p>So do I still need VirtualBox or another VM to start minikube?</p>
<p>this is only case on window or osx, do need virtualbox, vmware to create minikube vm using boot2docker, in Linux even Linux VM minikube can directly run kubernetes in host docker when choice --vm-driver none, which uses localkube.</p>
<p>I am trying to access the Kubernetes API directly without running <code>kubectl -proxy</code>. But when I use the token of the serviceaccount default, I get a 403. Even after creating a ClusterRole and ClusterRoleBinding for this serviceaccount, the request is rejected with 403.</p> <p>The configuration I applied l...
<p>I think you have a little issue in your curl path, it should be <code>/api/v1/namespaces/...</code> and not <code>/v1/api/namespaces/...</code>. See e.g. <a href="https://kubernetes.io/docs/api-reference/v1.8/#list-62" rel="nofollow noreferrer">https://kubernetes.io/docs/api-reference/v1.8/#list-62</a></p>
<p>Through the REST API I am able to GET Node's details through:</p> <pre><code>http://127.0.0.1:8001/api/v1/nodes/{Node Name} </code></pre> <p>However, I want to add a new label and delete an old one. Say add label <code>app=service</code>, and remove <code>backend=database</code>, What type of request am I supposed...
<p>You can set a new label with the only one request.</p> <p>JSON is:</p> <pre><code>{ "metadata": { "labels": { "app": "service" } } } </code></pre> <p>You should send <code>PATCH</code> request to: </p> <pre><code>http://127.0.0.1:8001/api/v1/nodes/&lt;node_name&gt; </code></pr...
<p>I would like to generate dynamic configuration files (redis, database) based on values (<code>ex.redis_host</code>) collected from env variables which will differ from service to service and put it on a specific location (<code>config/redis.yml</code>).</p> <p>How will i be able to achieve it? </p>
<p>Dynamic Config file generation can include creation of</p> <ol> <li><p><strong>Config file structure</strong>:</p> <p>The config files for e.g redis.yaml might varry for development, staging, production environments. eg: </p> <p>staging</p> <pre><code>${ENVIRONMENT}: host: ${REDIS_HOST} namespace: ${REDI...
<p>I'm a complete loss. I have a kubernetes cluster running on ec2. I set it up using kops (versions 1.7.3/1.7.0 client/server). It's been working just fine for 4 months and all of the sudden I begin receiving this when creating new pods. </p> <pre><code>Failed to pull image "123456789.dkr.ecr.us-west-2.amazonaws.com/...
<p>I can now confirm that nothing was wrong with my configuration. The IAM permissions listed in <a href="https://kubernetes.io/docs/concepts/containers/images/#using-aws-ec2-container-registry" rel="nofollow noreferrer">here</a> work. It does appear that either AWS was encountering an outage or perhaps I exceeded some...
<p>I am using Promethues to monitor my Kubernetes cluster. All my microservices can be accessed using my HA Proxy.</p> <p>My base Promethues config is :</p> <pre><code>- job_name: 'kubernetes_pods' tls_config: insecure_skip_verify: true kubernetes_sd_configs: - api_server: http://172.29.219.102:8080 rol...
<blockquote> <p>{"status":"UP"}</p> </blockquote> <p>Prometheus requires data to be in its format, and cannot handle other arbitrary data. The error you are getting is a parse error due to this.</p> <p>You should instrument your code using a <a href="https://prometheus.io/docs/instrumenting/clientlibs/" rel="nofoll...
<p>We have got into an issue with our AWS deployment with kubernetes/helm where we are seeing "Pod sandbox changed, it will be killed and re-created". This was not happening before but got started with our latest deployment where we deleted previous deployment with helm delete and created new one with helm install. Not...
<p>The fix turned out to be increasing the limits for memory. We changed values.yaml file (following section) used by helm and bumped up the limits...</p> <p>resources:</p> <pre><code>limits: cpu: 100m memory: 128Mi &lt;--- increased this value... requests: cpu: 100m memory: 128Mi </code></pre> <p>Wish the e...
<p>Running in Minikube, I have the following ingress, with the necessary backend:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: my-ingress annotations: kubernetes.io/ingress.class: "nginx" nginx.ingress.kubernetes.io/rewrite-target: / spec: rules: - http: paths: ...
<p>You are misunderstanding the example. With your configuration requests to the rewrite target <code>/</code> will be rewritten to <code>/config/</code>, not the other way around. So you need to switch paths: use <code>/config</code> as rewrite target, and set the <code>/</code> path in the rule.</p> <p>So the rewrit...
<p>Assume I have a deployment/Pod with lets say a name "xyz" . I would like to check if this Pod has a specific image. If this image is different from what I have recently pulled from the docker registry only then deploy. Otherwise don't deploy. This is assuming that the tags are not updated. any ideas appreciated. </p...
<p>Check this out this thread <a href="https://stackoverflow.com/questions/46266006/how-do-i-redeploy-everything-in-kubernetes-after-updating-a-dockerfile/46266696#46266696">here</a> is based on rolling update mechanism. Or directly set using the command line tool as kubectl,</p> <pre><code>$ kubectl set image deploym...
<p>I installed minikube as instructed here <a href="https://github.com/kubernetes/minikube/releases" rel="nofollow">https://github.com/kubernetes/minikube/releases</a> and started with with a simple <code>minikube start</code> command. </p> <p>But the next step, which is as simple as <code>kubectl get pods --all-names...
<p>I faced a similar issue on win7 when changed work environment, as you said it is working fine at home but not working at office, high chance it caused by firewall policy, cannot pass TLS verification.</p> <p>Instead of waste time on troubleshoot(sometimes nothing to do if you cannot turn off firewall), if you just ...
<p>I am trying to run my app using Kubernetes I have created a deployment from file called <code>deployment.yaml</code> a service from the file called <code>service.yaml</code></p> <p>Here is the content of <code>deployment.yaml</code>:</p> <pre><code>apiVersion: v1 kind: Pod metadata: name: kubectl-test ...
<p>Your service specification target all pods with label "app=kubectl-test-189010" which your pod's specification doesn't have. </p> <p>You need to update pod's metadata so it will match selector from service spec:</p> <pre><code> metadata: name: kubectl-test app: kubectl-test-189010 </code></pre> <...
<p>I'm trying to figure out how the docker command <code>docker run -p 8080:80 webapp</code> to kubernetes yaml. I have a nginx dockerized and the image works fine when I start it with the command mentioned above. When I push it to kubernetes, nothing happens. </p> <p>Dockerfile:</p> <pre><code>FROM nginx:1.13.3-alpi...
<p>You are targeting the wrong port here. From what I see this app starts nginx on port 80, yet your service definition targets port 8080 on endpoint pods. As there is no traffic reaching nginx, nothing will get logged on stdout access log. Change your service definition to direct traffic on correct port (80) and that ...
<p>I have a <strong>console</strong> app in .net core. How to implement Kubernetes readiness/liveness probe?</p> <p>My app process rabbitmq messages in loop, and don`t listen any http ports. </p>
<p>Readiness probe makes zero sense for this scenario as you will not direct any traffic via means of Service. As your app reads rabbitmq on it's own, it will do so regardless of kube probes. There is logic though in using liveness probe where you might want to restart container if the process inside has failed in some...
<p>As I understand the purpose of the <em>Kubernetes Controller</em> is to make sure that current state is equal to the desired state. Nevertheless, <em>Kubernetes Operator</em> does the same job.</p> <p>The list of controller in the <em>Control-Plane</em>:</p> <ul> <li>Deployment</li> <li>ReplicaSet</li> <li>StatefulS...
<p>I believe the term &quot;kubernetes operator&quot; was introduced by <a href="https://coreos.com/operators/" rel="noreferrer">the CoreOS people here</a></p> <blockquote> <p>An Operator is an application-specific controller that extends the Kubernetes API to create, configure and manage instances of complex stateful ...
<p>I am trying to setup Jenkins Dynamic slaves creation using jenkins-kubernetes plugin.</p> <p><strong>My jenkins is running outside K8s Cluster.</strong></p> <p>Link: <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="noreferrer">https://github.com/jenkinsci/kubernetes-plugin</a> </p> <p>My jenkins vers...
<p>Instead of using certificates, I suggest you to use credentials in kubernetes, by creating a serviceAccount:</p> <pre><code>--- apiVersion: v1 kind: ServiceAccount metadata: name: jenkins --- kind: Role apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: jenkins rules: - apiGroups: [""] resources: [...
<p>A node of my k8s cluster has GC trying to remove images used by a container. </p> <p>This behaviour seems strange to me.</p> <p>Here the logs:</p> <pre><code>kubelet: I1218 12:44:19.925831 11177 image_gc_manager.go:334] [imageGCManager]: Removing image "sha256:99e59f495ffaa222bfeb67580213e8c28c1e885f1d245ab2bbe...
<p>What you've encountered is not the regular Kubernetes garbage collection that deleted orphaned API resource objects, but the <a href="https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/#image-collection" rel="nofollow noreferrer">kubelet's <em>Image collection</em></a>.</p> <p>Whe...
<p>I'm trying to understand why one of my containers in a pod is slower to start when started by the kubelet, than it is when started via the docker cli directly on the GKE node itself.</p> <p>Here's the kubelet log. The container is started, and but stays in an unready state for 23 seconds:</p> <pre><code>18:49:55.0...
<p>Turns out that the problem with the slow start up of these containers was constrained CPU for the Python interpreter during start up. I added a bash script that would print the datetime before starting the Python process and when varying the CPU resources available to the container, the problem becomes painfully cle...
<p>I'm running a gke 1.8.4 cluster, and seeing an issue with requests to access resources being permitted, even though RBAC is denying them</p> <p>from logs/kube-apiserver.log (I've replaced my username and the username I'm impersonating, in &lt;<em>italics</em>>):</p> <blockquote> <p>I1218 13:30:38.644205 5 ...
<p>GKE enables both the RBAC authorizer and a webhook authorizer that consults GKE IAM. Does the specified username have permissions via GKE?</p>
<p>I'm basically trying to run <code>crond -f</code> as root, while having the default user be something different.</p> <p>Since the crontabs it runs use sensitive information from other files on the image, I want to give root access to these files, start the crond process, then switch the user to a newly created one....
<p>While building the Docker image, create a user which belongs to sudo group and is allowed to run all sudo commands without a password.</p> <p>Consider the below example which creates a docker image called test with user named myuser with sudo pass: </p> <pre><code>$ cat Dockerfile FROM debian:latest ENV user_name...
<p>I need to </p> <ul> <li>expose some pods directly on nodes, for TCP &amp; UDP </li> <li>be able to access them externally, individually</li> </ul> <p>I would like to avoid creating a loadbancer service for each pod as there is no need of loadbalancing, just the exposure to outside world.</p> <p>I don see any solu...
<p>If your nodes are accessible from the outside world you can get away with just <code>hostNetwork: true</code>, there are some potential issues with it though (ie. just one pod per host or potential port conflicts with other stuff on node). You don't need any service defined for it, as it will just listen on your nod...
<p>I've registered custom resource definition in K8S:</p> <pre><code>apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: resources.example.com labels: service: "my-resource" spec: group: example.com version: v1alpha1 scope: Namespaced names: plural: resources ...
<p>explain works using openapi schema information published by the server. Prior to v1.15, CRDs did not have the ability to publish that info.</p> <p>In 1.15+, CRDs that specify <a href="https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#specifying-a-structural-schema"...
<p>I want to configure elasticsearch with the elasticsearch.yml, located in /usr/share/elasticsearch/config. I am doing this via a ConfigMap which I mount into the container.</p> <p>That does not work due to k8s takes over the control of this directory and the other files of that directory does not exist anymore (eg j...
<p>So found a proper solution I want to share with you. The magic happens with the subPath in the volumeMount</p> <pre><code>apiVersion: v1 kind: ConfigMap ... data: elasticsearch.yml: | xpack.license.self_generated.type: basic --- apiVersion: extensions/v1beta1 kind: Deployment ... spec: ... template: c...
<p>I came up with the use case where I need to give specific name of secret token when it gets generated during creation of namespace. </p> <p>So when we create a namespace in K8S we will get one secret token like below.</p> <pre><code>NAMESPACE NAME TYPE ...
<p>To the best of my knowledge, there is no such option. However, if you're creating your namespaces via software and not manually through kubectl, you can always clone the secret token to a copy with a name of your liking upon namespace creation. Do you automatically create namespaces or is that for a manual use-case?...
<p><img src="https://i.stack.imgur.com/hI11N.png" alt="docker ps screenshot"></p> <p><code>docker ps</code> </p> <pre><code>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7523fd2c20c7 gcr.io/...
<p>What containers do you want to delete and why? The containers printed in your <code>docker ps</code> output are Kubernetes containers. You basically would destroy minikube by deleting these containers.</p> <p>In general Kubernetes manages these containers for you. Kubernetes interprets a deleted container as a fail...
<p>In kubernetes we can easily expose certain params and values through environment variables. Examples of these can be the node IP, the container uid, etc.</p> <p>Example</p> <pre><code> - name: POD_ID valueFrom: fieldRef: fieldPath: metadata.uid </code></pre> <p>However, I was wondering if ...
<p>Figured it out myself, you can only reference the variables that are also exposed if you <code>kubectl edit pod &lt;podname&gt;</code> a pod.</p>
<p>Recently we have created a cluster on Kubernetes Engine (GCP) and we started to notice a strange behavior on it. Every day the nodes are getting stopped and recreated automatically in a certain time of day, making applications unavailable for a few minutes.</p> <p><strong>How the incidents are displayed in Stackdri...
<p>The described behavior is very similar to how the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/preemptible-vm" rel="nofollow noreferrer">preemptible nodes in GKE</a> behave (they live a maximum of 24 hours).</p> <p>If you're unsure if your nodes are preemptible, check the GCP WebUI (my sample<a...
<p>I have set up a Rancher k8s environment on AWS. </p> <p>Rancher server lies behind a classic ELB with ssl termination and is accessible via e.g <code>https://my.rancher.server</code>.</p> <p>I have deployed a simple pod via the command line by running</p> <pre><code>kubectl create -f &lt;podfilename.yml&gt; </cod...
<p>ELB's HTTP does not support websockets; you need to use a SSL listener -> TCP backend and configure proxy protocol support. <a href="http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/basic-ssl-config/#elb" rel="nofollow noreferrer">http://rancher.com/docs/rancher/v1.6/en/installing-rancher...
<p>I am running kubernetes (k8s) on top of Google Cloud Patform's Container Engine (GKE) and Load Balancers (GLB). I'd like to limit the access at a k8s ingress to an IP whitelist.</p> <p>Is this something I can do in k8s or GLB directly, or will I need to run things via a proxy which does it for me?</p>
<p>The way to whitelist source IP's in nginx-ingress is using below annotation.</p> <p><code>ingress.kubernetes.io/whitelist-source-range</code></p> <p><strong>But unfortunately, Google Cloud Load Balancer does not have support for it, AFAIK.</strong></p> <p>If you're using nginx ingress controller you can use it.</p> ...
<p>I have tried to install Docker CE in my system and it ends with some problem.</p> <p>I did the below steps:</p> <ol> <li>sudo yum install -y yum-utils – No error</li> <li>sudo yum-config-manager --add-repo <a href="https://download.docker.com/linux/centos/docker-ce.repo" rel="nofollow noreferrer">https://download....
<p>The <code>container-selinux</code> package is available from the <code>rhel-7-server-extras-rpms</code> channel. You can enable it using:</p> <pre><code>subscription-manager repos --enable=rhel-7-server-extras-rpms </code></pre> <p>But if you do not have any subscription for Enterprise Linux, you can use CentOS Ex...
<p>I have successfully set up a kubernetes cluster on AWS using <code>kops</code> and the following commands:</p> <pre><code>$ kops create cluster --name=&lt;my_cluster_name&gt; --state=s3://&lt;my-state-bucket&gt; --zones=eu-west-1a --node-count=2 --node-size=t2.micro --master-size=t2.small --dns-zone=&lt;my-cluster-...
<p>The problem is that you're provisioning a Kubernetes 1.7 cluster with kops and using a <a href="https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml" rel="nofollow noreferrer">dashboard manifest</a> file for Kubernetes 1.8 so try the following (nuke the curre...
<p>I have deployed prometheus 2.0 on my multi node kubernetes cluster made from kubeadm. While accessing the prometheus dashboard i am not able to view pods and service job even after configuring it in prometheus configuration yaml file. prometheus target are as follow <a href="https://i.stack.imgur.com/jiQPG.png" rel=...
<p>I assume you are doing the query you posted in the comments:</p> <pre><code>container_memory_usage_bytes{job="kubernetes-pods"} </code></pre> <p>This doesn't work, because you are filtering by the job name <code>kubernetes-pods</code>, but <code>container_memory_usage_bytes</code> comes from cAdvisor. So according...
<p>I've been trying to shut down kubernetes cluster , but I couldn't managed to do it.</p> <p>When I type </p> <pre><code>kubectl cluster-info </code></pre> <p>I can see that my cluster is still running.</p> <p>I tried commands like running script</p> <pre><code>kube-down.sh </code></pre> <p>but it didn't work.</...
<p>The tear down section of the <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#tear-down" rel="noreferrer">official documentation</a> says:</p> <blockquote> <p>To undo what kubeadm did, you should first drain the node and make sure that the node is empty before shutting it down.</p> <p>Ta...
<p>I have a use case to gracefully terminate the container where i have a script to kill the process gracefully from within the container by using the command "kill PID".( Which will send the TERM signal ) But I have liveness probe configured as well. Currently liveness probe is configured to probe at 60 second interva...
<p>In Kubernetes, Liveness Probe checks for the health state of a container.</p> <p>To answer your question on whether it uses SIGKILL or SIGTERM, the answer is both are used but in order. So here is what happens under the hood.</p> <ol> <li>Liveness probe check fails</li> <li>Kubernetes stops routing of traffic to t...
<p>I'm traying to create a Pod from a docker private image. For this i have created a secret like this: </p> <pre><code>kubectl create secret docker-registry $SECRETNAME --docker-server=$DOCKER_REGISTRY_SERVER --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL </code></pre> ...
<p>Since the fail is at the initial stage, this is probably an issue with authentication or repository-(image/tags access). Please verify that the repository name is valid and that the image version specified is available in the repository.</p> <p>If all has been verified and the issue still persists, try do the follo...
<p>Kubernetes has the ability to set (in a deployment definition) environment variables from a config file. According to the <a href="https://12factor.net/config" rel="nofollow noreferrer">Twelve Factor App guide</a>, one should only store secrets/config vars in the environment variables, not in a file.</p> <p>What ar...
<p>The Twelve Factor App guide <a href="https://12factor.net/config" rel="nofollow noreferrer">advocates the use of environment variables because when using configuration files</a></p> <blockquote> <p>it’s easy to mistakenly check in a config file to the repo; there is a tendency for config files to be scattered abo...
<p>I ran into the below error when trying to deploy an application in a kubernetes cluster. It looks like kubernetes doesn't allow to mount a file to containers, do you know the possible reason?</p> <p>deployment config file</p> <pre> apiVersion: extensions/v1beta1 kind: Deployment metadata: name: model-loader-serv...
<p><code>caused "not a directory"</code> is kind of self explanatory. What is the exact volume and volumeMount definition you use ? do you use <a href="https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath" rel="nofollow noreferrer">subPath</a> in your declaration ?</p> <p>EDIT: change </p> <pre><code>- ...
<p>I am trying to setup horizontal pod autoscaling using custom-metrics. For <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics" rel="nofollow noreferrer">support of custom metrics</a> in kuberenetes 1.8.1, I need to <a href="https://kubernetes.io/docs/tasks/a...
<p>Support for the aggregation layer has been added a couple weeks ago, so no configuration should be necessary for a new cluster. Please see details here: <a href="https://github.com/Azure/AKS/issues/54" rel="nofollow noreferrer">https://github.com/Azure/AKS/issues/54</a></p>
<p>I am trying to create a deployment declaratively, using <code>kubectl apply</code>. The below configuration is created just fine when I do</p> <pre><code>kubectl create -f postgres-deployment.yaml </code></pre> <p>but if I go</p> <pre><code>kubectl apply -f postgres-deployment.yaml </code></pre> <p>I am presente...
<p>Old Kubernetes versions supported the Deployment object on the <code>extensions/v1beta1</code> API group. <a href="https://v1-9.docs.kubernetes.io/docs/api-reference/v1.9/#deployment-v1beta1-extensions" rel="nofollow noreferrer">That is no longer the case</a>.</p> <p>For Kubernetes versions before 1.9.0 you should ...
<p>I am setting up kubernetes cluster on a Centos 7 machine, and the <code>kubeadm init</code> command gives me the below warning message.</p> <pre><code>[init] Using Kubernetes version: v1.9.0 [init] Using Authorization modes: [Node RBAC] [preflight] Running pre-flight checks. [WARNING SystemVerification]: do...
<p>Yes, you need additional software. crictl is part of the <a href="https://github.com/kubernetes-incubator/cri-tools/releases" rel="noreferrer">cri-tools</a> repo on github.</p> <p>At least when I encountered this problem (Dec 20, 2017), cri-tools isn't available on kubernete's package repo, so I had to download sou...
<p>While joining the centos 7 node to cluster 1.9.0, <code>kubeadm join</code> command gives this error message.</p> <p><code>Failed to request cluster info, will try again: [Get https://10.10.10.10:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate has expired or is not yet valid]</code></p>...
<p>The root cause of the issue is my node didn't have the correct time. after configuring NTP service node was able to join the master.</p>
<p>For a multi zoned, multi cluster setup. Is it possible to dynamically expose or retrieve the zone in which the master node is running, from a pod? Since this is needed to correctly push our metrics to stackdriver, in order to run a <a href="https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-me...
<p>There is an unofficial way to determine what zone (or region) the master is running in by parsing the <code>kube-env</code> metadata entry on a node. <code>kube-env</code> is a key-value store where keys are all uppercase, followed by a colon, which is followed by the value. If you look for the key <code>ZONE</code>...
<p>I've an gce ingress controller pointing to a service type <code>NodePort</code>.</p> <p>Is there a way to preserve the client's ip? I've tried this from <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="nofollow noreferrer">here...
<p>The original ip comes in the <code>X-Forwarded-For</code> header. If you're using rails it may come as <code>HTTP_X_FORWARDED_FOR</code></p> <p><a href="https://cloud.google.com/compute/docs/load-balancing/http/" rel="nofollow noreferrer">https://cloud.google.com/compute/docs/load-balancing/http/</a></p>
<p>By default docker uses a shm size of 64m if not specified, but that can be increased in docker using --shm-size=256m</p> <p>How should I increase shm size of a kuberenetes container or use --shm-size of docker in kuberenetes.</p>
<p>I originally bumped into this post coming from google and went through the whole kubernetes issue and openshift workaround. Only to find the much simpler solution listed <a href="https://stackoverflow.com/a/46434614/1165797">on another stackoverflow answer</a> later.</p>
<p>I am trying to setup horizontal pod autoscaling using custom-metrics. For <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics" rel="nofollow noreferrer">support of custom metrics</a> in kuberenetes 1.8.1, I need to <a href="https://kubernetes.io/docs/tasks/a...
<p>AKS now supports aggregated API - you can find specific scaling details in the following GitHub comment @ <a href="https://github.com/Azure/AKS/issues/77#issuecomment-352926551" rel="nofollow noreferrer">https://github.com/Azure/AKS/issues/77#issuecomment-352926551</a>. Run "az aks upgrade" even to the same Kubernet...
<p>I am trying to deploy a simple nginx in kubernetes using hostvolumes. I use the next <strong>yaml</strong>:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: webserver spec: replicas: 1 template: metadata: labels: app: webserver spec: containers: ...
<p>I believe you have the wrong indentation. The <code>volumes</code> key should be at the same level as <code>containers</code>.</p> <pre><code>apiVersion: extensions/v1beta1 kind: Deployment metadata: name: webserver spec: replicas: 1 template: metadata: labels: app: webserver spec: ...
<p>Please before you comment or answer, this question is about a CLI program, not a service. Apparently 90% of Kubernetes has to do with running services, so there is sparse documentation for CLI programs meant to be part of a pipeline workflow.</p> <p>I have a command line program that uses stdout for JSON results.</...
<blockquote> <p>Is there a way to just have the pod running without an entrypoint [...]?</p> </blockquote> <p>A pod consists of one or more containers, each of which has an individual entrypoint. It is certainly possible to run a <em>container</em> with a dummy command, for example, you can build an image with:</p>...
<p>Here is a transcript:</p> <pre><code>LANELSON$ kubectl --kubeconfig foo get -a jobs No resources found. </code></pre> <p>OK, fine; even with the <code>-a</code> option, no jobs exist. Cool! Oh, let's just be paranoid and check for one that we know was created. Who knows? Maybe we'll learn something:</p> <pre>...
<p>The answer is that Istio <a href="https://istio.io/docs/setup/kubernetes/sidecar-injection.html#automatic-sidecar-injection" rel="nofollow noreferrer">automatic sidecar injection</a> happened to be "on" in the environment (I had no idea, nor should I have). When this happens, you can <a href="https://istio.io/docs/...
<p>I building a Kubernetes cluster on Google Kubernetes Engine (GKE). It is basically a <code>Service</code> with an associated <code>ReplicaSet</code> with a number of pods. </p> <p>Those pods need to talk to each other for keeping consensus. For this end, a <code>ClusterIP</code> seems a good fit, allowing intra clu...
<p>Indeed <code>NodePort</code> is a superset of <code>ClusterIP</code>, but to be clear, you do not need the service to be of <code>NodePort</code> type for it to be exposed by IngressController. IC has access to endpoints (pods) directly, so there is no need to use anything but <code>ClusterIP</code>.</p> <p>Another...
<h1>Question</h1> <p>What is the cause of the <strong>http: proxy error: x509: certificate signed by unknown authority</strong> when starting <strong>kubectl proxy</strong> with a specific IP of the node?</p> <pre><code>kubectl proxy --port=8001 --address=172.31.0.16 --accept-hosts='172.31.0.16' I1222 09:00:03.47183...
<p>Found the cause. Has not executed below.</p> <pre><code>export KUBECONFIG=/etc/kubernetes/admin.conf </code></pre>
<p>I am learning Kubernetes and currently deep diving into high availability and while I understand that I can set up a highly available control plane (API-server, controllers, scheduler) with local (or with remote) etcds as well as a highly available set of minions (through Kubernetes itself), I am still not sure wher...
<p>Kubernetes Service is another REST Object in the k8s Cluster. There are following types are services. Each one of them serves a different purpose in the cluster.</p> <ul> <li>ClusterIP</li> <li>NodePort </li> <li>LoadBalancer</li> <li>Headless</li> </ul> <p>fundamental Purpose of Services </p> <ul> <li>Providing ...
<p>We have an existing website, lets say <code>example.com</code>, which is a CNAME for <code>where.my.server.really.is.com</code>.</p> <p>We're now developing new services using Kubernetes. Our first service <code>/login</code> is ready to be deployed. Using a mock HTML server I've been able to deploy two pods with s...
<p>Following <a href="https://github.com/containous/traefik/blob/master/docs/user-guide/kubernetes.md#forwarding-to-externalnames" rel="nofollow noreferrer">traefik documentation on using <code>ExternalName</code></a></p> <blockquote> <p>When specifying an ExternalName, Træfik will forward requests to the given host ac...
<p>For a large online application, use k8s to run it. The scale maybe daily activity user 500,000.</p> <p>The application inside k8s need messaging feature - Pub/Sub, there are these options:</p> <ul> <li>Kafka</li> <li>RabbitMQ</li> <li>Redis</li> </ul> <h1>Kafka</h1> <p>It needs zookeeper and good to run on os de...
<p>Yes, running Kafka on Kubernetes is great. Check out this example: <a href="https://github.com/Yolean/kubernetes-kafka" rel="noreferrer">https://github.com/Yolean/kubernetes-kafka</a>. It includes ZooKeeper and Kafka as <code>StatefulSet</code>s.</p> <hr> <p>PS. Running any of the services in your question on Kube...
<p>What can be the reason for not being able to curl/use a rest API with some slugs i.e example.com/application/v2/xxxx.The docker image i use is the app from <a href="http://vespa.ai/" rel="nofollow noreferrer">http://vespa.ai/</a> <a href="https://github.com/vespa-engine/docker-image/blob/master/Dockerfile" rel="nof...
<p>HostSuspensionResource should not be involved here I think. The restapi entry point is the ApplicationHandler class for the call you are making.</p> <p>What happens when you curl inside the container with the default port (i.e not the 'internal' 19071 port)?</p>
<p>I create deployment and service from *.yaml. Into container I find ns record via <code>nslookup</code> or <code>dig</code>, but can't connect to db via service name or service IP. </p> <p>Anybody can tell me, what I do wrong?</p> <p><strong>Environment</strong>:</p> <p><strong>Minikube version</strong>: </p> <pr...
<p>Short answer: they technically don't exist. </p> <p>Long answer: they're iptables rules <a href="http://leebriggs.co.uk/blog/2017/02/15/kubernetes-networking-part1.html" rel="nofollow noreferrer">http://leebriggs.co.uk/blog/2017/02/15/kubernetes-networking-part1.html</a></p>
<p>I am learning Kubernetes, and and faced a conceptual question, what is the benefit of new taint model over the simple node selector.</p> <p>Documentation talks about a usecase where a group of devs might have exclusive right for a set of pods by a taint like <code>dedicated=groupA:NoSchedule</code>. But I thought w...
<p>A node selector affects a single pod template, asking the scheduler to place it on a set of nodes. A NoSchedule taint affects all pods asking the scheduler to block all pods from being scheduled there.</p> <p>A node selector is useful when the pod needs something from the node. For example, requesting a node that h...