prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I am trying to use kubelet to start kubernetes api server as a staic pod, but failed with following errors:</p>
<pre><code>I0523 11:13:41.192680 9248 remote_runtime.go:41] Connecting to runtime service /var/run/dockershim.sock
I0523 11:13:41.196764 9248 kuberuntime_manager.go:171] Container runtime docker ini... | <p>after some research, i found the solution here: <a href="https://github.com/kubernetes/kubernetes/issues/43704" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/43704</a></p>
<p>by adding these two parameters to kubelet:</p>
<pre><code> --cgroups-per-qos=false
--enforce-node-allocat... |
<p>I init k8s cluster master with kubeadm, but I felt very confused. The version of kubeadm:</p>
<pre><code># ./kubeadm version
kubeadm version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1", GitCommit:"82450d03cb057bab0950214ef122b67c83fb11df", GitTreeState:"clean", BuildDate:"2016-12-14T00:52:01Z", GoVersio... | <p>The reason that it mentions the port is in use is because you already ran <code>kubeadm init</code> once and it has already changed a number of things. </p>
<p>run <code>kubeadm reset</code> first to undo all of the changes from the first time you ran it.</p>
<p>Then run <code>systemctl restart kubelet</code></p>
... |
<p>I'm trying to make use of init container to prepare some files before the main container starts up. In the init container I'd like to mount a <code>hostPath</code> volume so that I can share prepare some file for the main container.</p>
<p>My cluster is using pre 1.6 version of kubernetes so I'm using the <code>met... | <p>You don't need to do <code>hostPath</code> volume to share data generated by init-container with the containers of Pod. You can use <code>emptyDir</code> to achieve same result. The benefit of using <code>emptyDir</code> is that you don't need to do anything on host and this will work on any kind of cluster even if ... |
<p>I am using rookio on Kubernetes with CoreOS for dynamically creating Persistent Volume. </p>
<p>So I create a PersistentVolumeClaim (<code>kubectl create -f postgres-pvc.yaml</code>) and apply a patch for persistentVolumeReclaimPolicy to Retain. I do a <code>"kubectl get pv"</code>and I can see a dynamically crea... | <p>If you have precious data that you want to use in another PostgreSQL pod, maybe StatefulSets is which you are looking for, as it allows:</p>
<blockquote>
<p>Stable, persistent storage [...] across Pod (re)schedulings.</p>
</blockquote>
<p>Therefore, I would advise you to deploy your PostgreSQL database as a Stat... |
<p>All of a sudden, I cannot deploy some images which could be deployed before. I got the following pod status:</p>
<pre><code>[root@webdev2 origin]# oc get pods
NAME READY STATUS RESTARTS AGE
arix-3-yjq9w 0/1 ImagePullBackOff 0 10m
docker-registry... | <p>You can use the '<em><strong>describe pod</strong></em>' syntax</p>
<p><strong>For OpenShift use:</strong></p>
<pre><code>oc describe pod <pod-id>
</code></pre>
<p><strong>For vanilla Kubernetes:</strong></p>
<pre><code>kubectl describe pod <pod-id>
</code></pre>
<p>Examine the events of the output.
... |
<p>I'm following a kubernetes tutorial. I got halfway through but now I want to start over. </p>
<p>I tried <code>kubectl delete pods --all --force</code> but when I do <code>kubectl get pods</code> it still shows my deployments, and the age is reset. How do I get back to a pristine state to restart the tutorial?</p>
| <p>Firt, delete the deployments, so that the <code>ReplicaSet</code> won't recreate pods:</p>
<pre><code>kubectl delete deployments --all --force --grace-period=0
</code></pre>
<p>Then, use the <code>--grace-period</code> flag:</p>
<pre><code>kubectl delete pods <pod> --grace-period=0 --force
</code></pre>
<p... |
<p>My Kubernetes version is :</p>
<pre><code># kubectl --version
Kubernetes v1.4.0
</code></pre>
<p>I am planning to use Prometheus to monitor my Kube cluster. For this, I need to annotate the metrics URL.</p>
<p>My current metrics URL is like :</p>
<pre><code>http://172.16.33.7:8080/metrics
</code></pre>
<p>But I... | <p>If you annotate the service, it doesn't take any effect on the possibly matched pods. Your pods are managed either by a ReplicationController, or over a ReplicaSet / Deployment. In that case, annotate these resources to make the annotations reach the pods. In example of deployments, you must use the template section... |
<p>I have configured the Kubernetes plugin to spin up slaves.
However I am having problems with access-control.
Getting an error when the master tries to spin up new pods (slaves) </p>
<blockquote>
<p>Unexpected exception encountered while provisioning agent Kubernetes Pod Template
io.fabric8.kubernetes.client.Ku... | <p>It is odd that the service account worked for you normally but didn't work in Jenkins. In my setup, I had to add a <code>RoleBinding</code> to give the service account the <code>edit</code> role (my namespace is actually <code>jenkins</code> but I changed it here to match your namespace).</p>
<pre><code>apiVersion:... |
<p>I have the following Deployment... </p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: socket-server-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: socket-server
spec:
containers:
- name: socket-server
image: gcr.io/pro... | <p>The problem is with the number <code>80</code>. Here it's within an <code>EnvVar</code> context, so it has to be of type <code>string</code> and not <code>int</code></p>
|
<p>I'm following a kubernetes tutorial. I got halfway through but now I want to start over. </p>
<p>I tried <code>kubectl delete pods --all --force</code> but when I do <code>kubectl get pods</code> it still shows my deployments, and the age is reset. How do I get back to a pristine state to restart the tutorial?</p>
| <p>You need to delete the deployments, not the pods. Otherwise the ReplicaSet from the Deployment will just recreate the PODs (self healing capability).</p>
|
<p>Trying to understand how sticky session should be configured when working with service type=loadbalancer in AWS
My backend are 2 pods running tomcat app
I see that the service create the AWS LB as well and I set the right cookie value in the AWS LB configuration ,but when accessing the system I see that I keep switc... | <p>It's not supported. Please see <a href="https://github.com/kubernetes/kubernetes/issues/2867" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/2867</a> which has the gory details.</p>
|
<p>I'm trying to develop a sample application using spring cloud and minikube which consist of 3 spring boot applications.</p>
<p>The first two are two different application (servers) which have the same endpoint but different functionality, and the third one is a client used to integrates the two other applications i... | <p>You can use:</p>
<p>CLI: <code>kubectl get services --selector=YOUR-LABEL-NAME</code>.</p>
<p>API: <code>GET /api/v1/namespaces/{namespace}/services</code> with <code>labelSelector</code> parameter see <a href="https://kubernetes.io/docs/api-reference/v1.6/#list-161" rel="nofollow noreferrer">API docs</a>.</p>
<p... |
<p>I need a way to get service cluster ip range (as CIDR) that works accross all Kubernetes clusters.</p>
<p>I tried the following, which works fine for clusters created with kubeadm as it greps arguments of apiserver pod:</p>
<pre><code>$ kubectl cluster-info dump | grep service-cluster-ip-range
... | <p>I don't think there is a way to access such information through K8s Api, there is an open issue to address lack of this functionality: <a href="https://github.com/kubernetes/kubernetes/issues/25533" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/25533</a> . If you have access to the etcd o... |
<p>I have kubernetes cluster with weave CNI plugin consisting of 3 nodes: </p>
<ul>
<li>1 master node (virtual machine)</li>
<li>2 worker baremetall nodes (4 cores xeon with hyperthreading - 8 logical nodes)</li>
</ul>
<p>The trouble is that <code>top</code> shows that kubelet has 60-100% CPU usage on first worker.
... | <p>Finally I found the solution.<br>
Kubelet stores information about all pods, running on it in</p>
<pre><code>/var/lib/dockershim/sandbox
</code></pre>
<p>So when I <code>ls</code> in that folder I found files for all missing pods. Then I deleted these files and log messages disappeared and CPU usage returns to nor... |
<p>Our scenarios:</p>
<p>We use ceph rbd to store some machine learning training dataset, the workflow as below:</p>
<p>Create a ceph-rbd pvc pvc-tranining-data with AccessMode: ReadWriteOnce.<br>
Create a write job with 1 pod to mount pvc-training-data and write training data in to pvc-training-data.<br>
After writi... | <p>Regarding your first question:</p>
<blockquote>
<ol>
<li>How to understand AccessModes: ReadOnlyMany, ReadWriteOnce,
ReadWriteMany? I think the usage scope is ReadOnlyMany < ReadWriteOnce
< ReadWriteMay, so if I apply a PVC with AccessMode: ReadWriteOnce, it
is ok I use it as AccessMode: ReadOnlyMan... |
<p>If I run Kubernetes on a cluster of Ubuntu machines, how does NFS work inside Kubernetes when it is mounted on each of the ubuntu nodes?</p>
<p>My use case is for databases and RabbitMQ to utilize that storage available on the nodes the pods are running.</p>
<p>Do I mount that NFS as a regular volume when deployin... | <p>For you to use <code>NFS</code> with Kubernetes you have to create a <code>PV</code> and then utilize it via <code>PVC</code>.</p>
<p>Your <code>PV</code>s will decide which <code>NFS</code> node they are backed with. Since that is where you will mention the server address. Look at the sample example below.</p>
<p... |
<p>I'm trying to develop a sample application using spring cloud and minikube which consist of 3 spring boot applications.</p>
<p>The first two are two different application (servers) which have the same endpoint but different functionality, and the third one is a client used to integrates the two other applications i... | <p>I found fabric8 library that helped me to achieve this.
Still don't know if this is the correct answer, but it works :D</p>
<p><a href="https://github.com/fabric8io/kubernetes-client/tree/master/kubernetes-client" rel="nofollow noreferrer">https://github.com/fabric8io/kubernetes-client/tree/master/kubernetes-clien... |
<p>After migrating the image type from container-vm to cos for the nodes of a GKE cluster, it seems no longer possible to mount a NFS volume for a pod.</p>
<p>The problem seems to be missing NFS client libraries, as a mount command from command line fails on all COS versions I tried (cos-stable-58-9334-62-0, cos-beta-... | <p>Martin, are you setting up the mounts manually (executing mount yourself), or are you letting kubernetes do it on your behalf via a pod referencing an NFS volume?</p>
<p>The former will not work. The later will. As you've discovered COS does not ship with NFS client libraries, so GKE gets around this by setting up ... |
<p>I am running kubernetes on minikube, I am behind a proxy, so I had set the env variables(HTTP_PROXY & NO_PROXY) for docker in /etc/systemd/system/docker.service.d/http-proxy.conf.
I was able to do docker pull but when I run the below example</p>
<pre><code>kubectl run hello-minikube --image=gcr.io/google_contai... | <p>I ran into the same problem and am sharing what I learned after making a couple of wrong turns. This is with minikube v0.19.0. If you have an older version you might want to update.</p>
<p>Remember, there are two things we need to accomplish:</p>
<ol>
<li>Make sure kubctl does not go through the proxy when connect... |
<p>I am incrementing a Datadog counter in python:</p>
<pre><code>from datadog import initialize
from datadog import ThreadStats
stats.increment('api.request_count', tags=['environment:' + environment])
</code></pre>
<p>And have set the metric type to "count" and the unit to "requests per none" in the metadata for the... | <p>Why not use dogstatsd instead of threadstats? If you're already running the dd-agent on your node in a way that's reachable by your containers, you can use the <code>datadog.statsd.increment()</code> method instead to send the metric over statsd to the agent, and from there it would get forwarded to your datadog acc... |
<p>The following sections are: the errors, the configuration and the kubernetes version and the etcd version.</p>
<pre><code>[root@xt3 kubernetes]# for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do systemctl restart $SERVICES; systemctl enable $SERVICES; systemctl status $SERVICES ; done
... | <p>I had a very similar issue, in my case I fixed it changing the <code>KUBE_API_PORT=</code> to another one avaliable on my system like <code>KUBE_API_PORT=9090</code></p>
<p>Try to <code>curl 127.0.0.1:8080</code> to figure out if that port is being used by another service</p>
|
<p>I have a minikube cluster running locally (v0.17.1), with two deployments: one is a Redis instance and one is a custom app that is trying to connect to the Redis instance. My configuration is more or less copy/pasted from the official docs and the <a href="https://github.com/kubernetes/kubernetes/blob/master/example... | <p>Figured this out in the end, it looks like I misunderstood how the service selectors work in Kubernetes. </p>
<p>I have posted that my service definition is:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: poller-redis
labels:
app: poller-redis
tier: backend
role: database
target: p... |
<p>I am deploying a 5 docker containers topology into Kubernetes, one of the containers is RabbitMQ container X, and every other container has a link to that container. After setting up a link between Y and X(rabbit), Y has a new DNS record in hosts file in order to reach that container by name. Now that I am migrating... | <p>You probably want to create a <code>Service</code> object for your deployment of RabbitMQ. It will be accessible by name in the DNS from within the cluster.</p>
<blockquote>
<p>If you have a Service called "my-service" in Kubernetes Namespace "my-ns" a DNS record for "my-service.my-ns" is created. Pods which exis... |
<p>Is it possible to get a list of pods that have status <code>Running</code> from <code>kubectl</code>?</p>
<p>Using an external command it would be:</p>
<p><code>kubectl get pods | grep Running</code></p>
<p>Can I ask this from <code>kubectl</code> directly instead of string matching with grep or awk?</p>
| <p>You can use a golang template:
<code>kubectl get pods --all-namespaces -o go-template --template '{{range .items}}{{if eq (.status.phase) ("Running")}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}'
</code>
Of course <code>{{.metadata.name}}</code> can be replaced or extended with any informations you need.</p>
|
<p>I want to set up connections from a kubernetes cluster (created via <code>az acs create</code> with mostly default settings) to an Azure Postgresql instance, and I'd like to know what source-IP range to enter in postgres HBA (this is the thing Azure calls a <code>firewall-rule</code> under <code>az postgres server</... | <p>It should be the external IP for the node that the pod is scheduled on, e.g. on container engine:</p>
<pre><code>$ kubectl get no -o wide
NAME STATUS AGE VERSION EXTERNAL-IP OS-IMAGE KERNEL-VERSION
gke-cluster-1-node-1 Ready ... |
<p>I have installed fresh Kubernetes 1.6.2 master on a single host and now trying to start Flannel using <a href="https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml" rel="nofollow noreferrer">https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml</a></p>
<p>The pod does ... | <p>Note that to install Kubernetes with flannel you need to specify the <code>--pod-network-cidr</code> flag. See <a href="https://kubernetes.io/docs/admin/kubeadm#kubeadm-init" rel="noreferrer">kubeadm init section</a></p>
<p>Example</p>
<pre><code>kubeadm init --pod-network-cidr=10.244.0.0/16
</code></pre>
<p>then... |
<p>I'm trying to deploy an application in a GKE 1.6.2 cluster running ContainerOS but the instructions on the website / k8s are not accurate anymore.</p>
<p>The error that I'm getting is:</p>
<pre><code>Error from server (Forbidden): User "circleci@gophers-slack-bot.iam.gserviceaccount.com"
cannot get deployments.ext... | <p>I had a few breaking changes in the past with using the gcloud tool to authenticate kubectl to a cluster, so I ended up figuring out how to auth kubectl to a specific namespace independent of GKE. Here's what works for me:</p>
<p>On CircleCI:</p>
<pre><code>setup_kubectl() {
echo "$KUBE_CA_PEM" | base64 --decode &... |
<p>I have a project running Java in a docker image on Kubernetes. Logs are automatically ingested by the fluentd agent and end up in Stackdriver.</p>
<p>However, the format of the logs is wrong: Multiline logs get put into separate log lines in Stackdriver, and all logs have "INFO" log level, even though they are real... | <p>This answer contained most of the information I needed: <a href="https://stackoverflow.com/a/39779646">https://stackoverflow.com/a/39779646</a></p>
<p>I have adapted the answer to fit my exact question, and to fix some weird imports and code that seems to have been deprecated.</p>
<p>logback.xml:</p>
<pre><code>&... |
<p>I am following the Kubernetes tutorials and am using Minikube as my Kubernetes environment on my MacBook. All of the steps in the tutorial work well, with the exception of getting Ingress working (tutorial for Ingress that I am following is at: <a href="https://cloud.google.com/container-engine/docs/tutorials/http-... | <p>After some experimentation, it appears that the nginx ingress addon incorrectly tries to re-direct to an https protocol (port 443) but if this is not configured (which is my case), then the "301 Moved Permanently" error occurs... so to address this, I set the ssl-redirect flag as follows
(see the new annotation tag ... |
<p>I'm trying to get the name of the container image from within the container.</p>
<p>I tried to look around the Downward APIs, but it seems that it's not possible:<br />
<a href="https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/" rel="nofollow noreferrer">https://kub... | <p>Your solution is probably OK, assuming you build your containers with CI/CD. Please see <a href="https://stackoverflow.com/questions/30690186/how-do-i-access-the-kubernetes-api-from-within-a-pod-container">this answer</a> about how to access the kubernetes API from within a cluster as an alternative. Here's the link... |
<p>We are using kubernetes plugin for Jenkins to construct a special CI system. We want to achieve that:</p>
<ol>
<li><p>For a given build job(named <em>job_A</em>), it will be built more than one time;</p></li>
<li><p>We hope this job <em>job_A</em> to be bound to a specific jenkins-slave(named <em>pod_A</em>), and t... | <p>In the PodTemplate definition there is an option idle time <em>Time in minutes to retain slave when idle</em> (<code>time_T</code>) that you can set to a large value.</p>
<p>Then set the label of the pod template to a unique value and same label in your job. That way that pod will only take builds of that job</p>
|
<p>I <a href="https://stackoverflow.com/questions/44233242/kubernetes-cluster-and-phoenix-automate-mix-ecto-migrate/44233465#44233465">learned recently</a> that Kubernetes has a feature called <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="noreferrer">Init Containers</a>. Awesome, be... | <p>To avoid confusion, ill answer your specific question. i agree with oswin that you may want to consider another method.</p>
<p>Yes, you can use init containers with a deployment. this is an example using the old style (pre 1.6) but it should work </p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
meta... |
<p>I am running grafana as a pod inside my Kubernetes cluster. Once Grafana is initialized, it create a DB on localhost and saves all data there. This means that whenever a pod is destroyed and recreated, the whole DB is reinitialized and I lose all previous Data.</p>
<p>The grafana config inside the Pod for DB is ::<... | <p>In general, you could use <code>ConfigMaps</code> like the comment said.</p>
<p>The Grafana image itself provides the ability to provide all configuration parameters via environment variables. This is only mentioned in the GitHub <a href="https://github.com/grafana/grafana-docker/blob/5a6ae51eb9f15c2448234003eb5857... |
<p>I'm pushing my Phoenix app to a Kubernetes cluster for review. I use GitLab to create a service for the web server and another service for a temporary postgres pod.</p>
<p>What I would like to do is automate <code>mix ecto.create</code> and <code>mix ecto.migrate</code>. However, there is a timing issue - there's a... | <p>Kubernetes has something called <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">init containers</a> which may help you.</p>
<p>From the documentation, here is an example of an app container which waits for a dB container.</p>
<pre><code>apiVersion: v1
kind: ... |
<p>I have read the Load Balancing page at <a href="https://github.com/grpc/grpc/blob/master/doc/load-balancing.md" rel="noreferrer">https://github.com/grpc/grpc/blob/master/doc/load-balancing.md</a> to start of, but still am confused as to the right approach to loadbalancing between back end GRPC instances. We are dep... | <p>I can't talk about kubernetes, but regarding gRPC loadbalancing, there are basically two approaches:</p>
<ol>
<li>For simple usecases, you can enable round robin over the list of addresses returned for a given name (ie, the list of IPs returned for service.foo.com). The way to do this is language-dependent. For C++... |
<p>I have started pods with command</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl run busybox \
--image=busybox \
--restart=Never \
--tty \
-i \
--generator=run-pod/v1
</code></pre>
<p>Something went wrong, and now I can't delete this <code>Pod</code>.</p>
<p>I tried using the methods described below bu... | <p>You need to delete the deployment, which should in turn delete the pods and the replica sets <a href="https://github.com/kubernetes/kubernetes/issues/24137" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/24137</a></p>
<p>To list all deployments:</p>
<pre><code>kubectl get deployments --all-namespac... |
<p>My pod have more than one log file, such as <code>php-fpm</code> + <code>nginx</code> stack. How to collect the log files?</p>
<p>I know nginx doing it with symlink. But this cannot deal with more than 2 log files.</p>
<p>I want to mount volume in host to pods, but how to set different folder for every pod? Is the... | <p>Finally, I find a way to collect the logs. </p>
<ol>
<li>Make sure all apps write all log files to a folder, e.g.
<code>/med/log</code>.</li>
<li>Make sure all apps start the job with a script, e.g.
<code>entrypoint.sh</code>.</li>
<li>Create a folder named by $HOSTNAME in mount volume, e.g.
<code>/log/$HOSTNAME</c... |
<p>I'm trying to create a redis cluster on K8s. I need a sidecar container to create the cluster after the required number of redis containers are online.</p>
<p>I've got 2 containers, <code>redis</code> and a sidecar. I'm running them in a <code>statefulset</code> with 6 replicas. I need the sidecar container to run ... | <p>I advise you to use Kubernetes Jobs: </p>
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/" rel="noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/</a></p>
<p>This kind of Job will keep running until it is completed once. In th... |
<p>I have created some Persistent Volumes myself. Is it possible to make the <code>volumeClaimTemplates</code> in my Stateful Set select those? It seems that it will always provision new persistent volumes, rather than use the existing ones.</p>
<p><em>Kubernetes: 1.5</em></p>
| <p>You need to use the <code>selector</code> option. If you label your pv's accordingly, the pods would use the volumes you previously created. </p>
<p>Example From: <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims" rel="nofollow noreferrer">https://kubernetes.io/docs/con... |
<p>K8 Version:</p>
<pre><code>Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:44:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"... | <p>You error message shows flanel subnet.evn file is missing. you need to fix flannel configuration first. What version of kubernetes your using?</p>
<blockquote>
<p>network: open /run/flannel/subnet.env: no such file or directory"</p>
</blockquote>
<p>if your using kubernetes 1.6 and above, we can use below yaml... |
<p>Use case:</p>
<p>I want to be able to re-run a job from where the first job left off. I am using Helm to deploy into Kubernetes.</p>
<p>I have the idea of saving the state of the first job in a ConfigMap. The ConfigMap yaml defining the ConfigMap is packaged up with the job and both are deployed at the same time... | <p>Have you tried using volumes? In this case it should not be overwritten when using helm upgrade.</p>
<p>Could an example like this work? (From
<a href="https://groups.google.com/forum/#!msg/kubernetes-users/v2806ezEdPk/1geJCO8-AQAJ" rel="nofollow noreferrer">https://groups.google.com/forum/#!msg/kubernetes-users/v... |
<p>I'm running Kubernetes 1.6.2 with RBAC enabled. I've created a user <code>kube-admin</code> that has the following Cluster Role binding</p>
<pre class="lang-yaml prettyprint-override"><code>kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: k8s-admin
subjects:
- kind: User
nam... | <p>The connection between kubectl and the api is fine, and is being authorized correctly.</p>
<p>To satisfy an exec request, the apiserver contacts the kubelet running the pod, and that connection is what is being forbidden.</p>
<p>Your kubelet is configured to authenticate/authorize requests, and the apiserver is no... |
<p><a href="https://traefik.io/" rel="noreferrer">Traefik</a> is a reverse HTTP proxy with several supported backends, Kubernetes included. How does Istio compare?</p>
| <p>It's something of an apples-to-oranges comparison. </p>
<p>Edge proxies like Traefik or Nginx are best compared to <a href="https://lyft.github.io/envoy/" rel="noreferrer">Envoy</a> - the proxy that Istio leverages. An Envoy proxy is installed automatically by Istio adjacent to every pod.</p>
<p>Istio provides sev... |
<p>How can I deserialize a Kubernetes YAML file into an Go struct? I took a look into the <code>kubectl</code> code, but somehow I get an error for every YAML file:</p>
<pre><code>no kind "Deployment" is registered for version "apps/v1beta1"
</code></pre>
<p>This is an MWE:</p>
<pre><code>package main
import (
... | <p>You need to import <code>_ "k8s.io/client-go/pkg/apis/extensions/install"</code> otherwise the schema is empty, see also <a href="https://godoc.org/k8s.io/client-go/pkg/apis/extensions/install" rel="noreferrer">docs</a>.</p>
<p>The complete working example is:</p>
<pre><code>$ go get -u github.com/golang/dep/cmd/d... |
<p>I have been trying to find a way to define a service in one namespace that links to a Pod running in another namespace. I know that containers in a Pod running in <code>namespaceA</code> can access <code>serviceX</code> defined in <code>namespaceB</code> by referencing it in the cluster DNS as <code>serviceX.namesp... | <p>I stumbled over the same issue and found a nice solution which does not need any static ip configuration:</p>
<p>You can access a service via it's <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="noreferrer">DNS name</a> (as mentioned by you): <em>servicename.namespace.svc.clus... |
<p>Is it possible to change an existing PVC to ReadWriteMany from ReadWriteOnce without recreating it? I have an existing database pod and the file system has become read only for some reason. I wanted to connect another pod to the PVC to look at it.</p>
| <p>You can do so without changing the PVC. The <em>Once</em> in <code>ReadWriteOnce</code> is not about the number of Pods accessing the PVC but about the number of Nodes accessing it.</p>
<p>Create another Pod mounting the same PVC and set <code>nodeSelector</code> (use <a href="https://kubernetes.io/docs/concepts/co... |
<p>In Kubernetes, let’s say we have three pods, which are physically hosted on Node X, Y and Z. When I expose them as a service using ‘kubectl expose’, are all nodes in the cluster (in addition to X, Y and Z) configured the same way? Specifically, kube-proxy in each node within the cluster watches the apiserver, builds... | <p>You are correct. The portal network (aka service network, cluster network) has no network interface but is a collection of iptables rules managed by kube-proxy. Each node needs to have these rules as a pod on any of them could connect any portal IP (aka service IP, cluster IP).</p>
<p>Read more here:
<a href="https... |
<p>I am trying to execute this rolling update example in v1.6.2 cluster. my kubectl command giving this error message.</p>
<pre><code>Error from server: json: cannot unmarshal string into Go value of type map[string]interface {}
</code></pre>
<p>Here is the YMAL file from this page: <a href="https://www.mirantis.com/... | <p>The <code>updateStrategy</code> appears to be incorrect:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: frontend
spec:
updateStrategy:
type: RollingUpdate
maxUnavailable: 1
template:
metadata:
labels:
app: frontend-webserver
spec:
nodeSelector... |
<p>GKE seems to create a cluster using one availability zone for the master although it provides an option to deploy nodes to multiple availability zones. I am concerned that if master AZ goes down, I cannot manage my cluster anymore. I understand my apps will continue to run but it is a big concern that I cannot scale... | <p>The GKE master today is not highly available and if a zone goes down, your cluster's Kubernetes API will go down with it. However you should note that GKE master is managed service with a 99.5% SLA. <a href="https://cloud.google.com/container-engine/sla" rel="nofollow noreferrer">https://cloud.google.com/container-e... |
<p>Does Kubernetes support connection draining?</p>
<p>For example, my deployment rolls out a new version of my web app container.
In connection draining mode Kubernetes should spin up a new container from the new image and route all new traffic coming to my service to this new instance. The old instance should remai... | <p>Kubernetes <strong>does</strong> support connection draining, but how it happens is controlled by the Pods, and is called <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods" rel="noreferrer">graceful termination</a>.</p>
<h2>Graceful Termination</h2>
<p>Let's take an example of a ... |
<p>My app consists of two containers: the app itself and a database. I'm planning to wrap the app into a chart, thus paving a way for easy reproducible deployment.</p>
<p>Apart from setting/reading environment envs (which helm+kubernetes seems to handle really well), part of app's configuration is:</p>
<blockquote>
... | <p>You are right, Kubernetes or Helm cannot help with preparing your pre-filled database records/schema.</p>
<p>You should probably have your application initialize those pre-filled data. If you don't want to put this logic into your application, you can ship an initialization script and configure an <a href="https://... |
<p>I have a <code>configMap</code> created from file:</p>
<pre><code>kubectl create configmap ssportal-apache-conf --from-file=ssportal.conf=ssportal.conf
</code></pre>
<p>and then I need to mount this file into the deployment:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ssportal... | <p>Okay, it's a bit tricky. The final working YAML spec is</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ssportal
spec:
replicas: 2
template:
metadata:
labels:
app: ssportal
spec:
containers:
- name: ssportal
image: eu.gcr.io/my-proje... |
<p>Is there a way to prevent readiness probe from execution once container has successfully started? I suppose that liveness probe should be enough to monitor container health.</p>
| <p>The readiness and liveness probes serve slightly different purposes.</p>
<p>The readiness probe controls whether the pod IP is included in the list of endpoints for a service, and so also whether a target for a route when it is exposed via an external URL.</p>
<p>The liveness probe determines whether a pod is stil... |
<p>Using the latest Kubernetes version in GCP (<code>1.6.4</code>), I have the following <code>Ingress</code> definition:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myproject
namespace: default
annotations:
ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.cla... | <p>It does take 5-10 minutes for an Ingress to actually become usable in GKE. In the meanwhile, you can see responses with status codes 404, 502 and 500.</p>
<p>There is an ingress tutorial here: <a href="https://cloud.google.com/container-engine/docs/tutorials/http-balancer" rel="noreferrer">https://cloud.google.com/... |
<p>Is it possible to use configMap values for port values like containerPort or targetPort?</p>
<p>Here's the possible example how it could work:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: auth
spec:
template:
metadata:
labels:
app: auth
spec:
co... | <p>No, it is not possible for the <code>ports</code> section.</p>
<p>You can use <code>env</code> keys in container's commands and args. Find more here: <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/expansion.md" rel="noreferrer">https://github.com/kubernetes/community/blob... |
<p>I am trying to build an HTTPs proxy server in front of another service in Kubernetes, using either an NginX proxy LoadBalancer server, or Ingress. Either way, I need a certificate and key so that my external requests get authenticated.</p>
<p>I'm looking at <a href="https://kubernetes.io/docs/tasks/tls/managing-tl... | <p>If you want an external request to get into your K8s cluster then this is the job of an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress" rel="noreferrer">ingress controller</a>, or configuring the service with a loadbalancer, if your cloud provider supports it.</p>
<p>The certificate discus... |
<p>We have an HTTP <code>livenessProbe</code> setup which returns a 500 if service is unhealthy, and prints out what the problem is.<br />
Is there any way to view the output that was returned by <code>livenessProbe</code>?</p>
<p>I could log it in the application, but maybe it's possible to view from Kubernetes?</p>
<... | <p>Unfortunately, there does not seem to be a way to access the HTTP response body of a failed HTTP probe.</p>
<p>To confirm this suspicion, let's have a look at the <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/probe/http/http.go#L65" rel="noreferrer">HTTP Prober's source code</a>, which is run wi... |
<p>The CentOS Atomic Host is shipped without the kubernetes-master package built into the image. Instead, you need to run the master kubernetes components (apiserver, scheduler, and controller-manager) in containers, managed via systemd, using the service files. Do you have any good tutorials on how to form a kubernete... | <p>You can try Kubernetes the Hard Way on Github:</p>
<p><a href="https://github.com/kelseyhightower/kubernetes-the-hard-way" rel="nofollow noreferrer">https://github.com/kelseyhightower/kubernetes-the-hard-way</a></p>
|
<p>I am trying to setup an Ingress on Kubernetes on Google Container Engine and am getting quota exceeded errors (see abbrieviated output below).</p>
<pre><code>Name: my-ingress
Address:
Default backend: default-http-backend:80 (10.0.2.2:8080)
Rules:
Host Path Backends
---- ---- --... | <p>According to <a href="https://cloud.google.com/compute/docs/load-balancing/http/backend-service" rel="nofollow noreferrer">this page</a>:</p>
<pre><code>gcloud compute backend-services list
</code></pre>
<p>will list all your backend services in all clusters.
For my case, it lists 6 and match my usage reported by:... |
<p>I'm trying to create a service account with either no secrets or just secret I specify and the kubelet always seems to be attaching the default secret no matter what.</p>
<h3>Service Account definition</h3>
<pre><code>apiVersion: v1
automountServiceAccountToken: false
kind: ServiceAccount
metadata:
name: test
se... | <p>Your understanding of <code>automountServiceAccountToken</code> is right it is for pod that will be launched.</p>
<p>The automatic token addition is done by Token controller. Even if you edit the config to delete the token it will be added again.</p>
<blockquote>
<p>You must pass a service account private key fi... |
<p>I have more than one Kubernetes context. When I change contexts, I have been using <code>kill -9</code> to kill the port-forward in order to redo the <code>pachtctl port-forward &</code> command. I wonder if this is the right way of doing it.</p>
<p>In more detail:</p>
<p>I start off being in a Kubernetes con... | <p>You can specify the port if you want, as a different one using <code>-p</code> flag as mentioned in <a href="http://docs.pachyderm.io/en/latest/pachctl/pachctl_port-forward.html" rel="nofollow noreferrer">docs</a> Is there a reason of not doing it?</p>
<p>Also starting processes in background and then sending it a ... |
<p>In my kubernetes cluster, each node is a virtualbox vm with two NICs, eth0 for NAT and eth1 for Host-Local communicating. </p>
<p><code>kubectl get pod --all-namespaces -o wide</code> shows</p>
<p><a href="https://i.stack.imgur.com/GIa22.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GIa22.png... | <p><a href="https://github.com/kubernetes/kubernetes/issues/44702" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/44702</a></p>
<p>Problem solved by passing <code>--node-ip=</code> to kubelet.</p>
|
<p>I've used this command to deploy a Kubernetes cluster in Azure:</p>
<pre><code>az acs create -n acs-cluster -g acsrg1 -d applink789 --generate-ssh-keys
</code></pre>
<p>Everything is working- I can connect to the cluster with <code>kubectl</code>. Now I want to define an SSH step in a Continuous Delivery pipeline... | <p>Figured it out- the documentation says the keys will be generated <em>if they are missing.</em> If the id_rsa keypair is present in the <code>.ssh</code> hidden directory, it is used. Connected with Putty using the <code>azureuser</code> default account.</p>
|
<p>I am trying to follow docs to setup a one node Kubernetes cluster with Centos 7.</p>
<p>kubeadm init will return no error but kubectl get nodes will return:</p>
<pre><code>NAME STATUS AGE VERSION
[MY_IP] NotReady 22s v1.6.4
</code></pre>
<p>system log repeats:</p>
<pre><code>Jun 6 16:21... | <p>you can run this command</p>
<pre><code>kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml
kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
</code></pre>
|
<p>I've set up and deployed a Kubernetes stateful set containing three CockroachDB pods, <a href="https://www.cockroachlabs.com/docs/orchestrate-cockroachdb-with-kubernetes.html" rel="noreferrer">as per docs</a>. My ultimate objective is to query the database without requiring use of kubectl. My intermediate objective ... | <p>From inside the Kubernetes cluster, you can talk to the database by connecting the <code>cockroachdb-public</code> DNS name. In <a href="https://www.cockroachlabs.com/docs/orchestrate-cockroachdb-with-kubernetes.html#step-4-use-the-built-in-sql-client" rel="noreferrer">the docs</a>, that corresponds to the example c... |
<p>I'm planning to wrap our application (which consists of multiple microservices) into a chart.</p>
<p>Right now, for each microservice, we store secrets and configuration values hardcoded directly in our <code>deployment.yaml</code> files, in <code>...containers[].env</code>. All of our <code>yaml</code> files are s... | <p>Configmaps are very generic configuration files. They can consist of a list of key value pairs but they can also be generic files. For example you can store a nginx configuration file <code>nginx.conf</code> in a configmap and load it in the proper location for the nginx daemon to read it.</p>
<p>Secrets are suppos... |
<p>I have a Backend service which is deployed to Kubernetes.
Whenever I want to deploy I build my docker image, push it to the google docker registry with a tag (e.g. <code>1.1.0</code>) and update my deployment yaml.</p>
<p>However, updating this file and creating another commit is a PITA. Especially because I have a... | <p>A straightforward solution is to trigger a rolling update of your deployment by using <code>kubectl set image</code>:</p>
<pre><code>kubectl set image deployment/foobar <container_name>=<new_image:new_tag>
</code></pre>
<p>and you can use your git commit id as image tag.</p>
|
<p>How would we create a directory inside the kubernetes persistent volume to mount to use in the container as subPath ? eg: mysql directory should be created while claiming the persistent volume </p>
| <p>I would probably put an init container into my podspec that simply mounts the volume and runs a <code>mkdir -p</code> to create the directory and then exit. You could also do this in the target container itself with some kind of script.</p>
<p><a href="https://kubernetes.io/docs/concepts/workloads/pods/init-contain... |
<p>I'm trying HPA: <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/</a></p>
<p>PV:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: api-orientdb-pv
labels:
... | <p>It's working as intended. The <em>Once</em> in <code>ReadWriteOnce</code> refers to the number of Nodes that can use the PVC and not the number of Pods (HPA or no HPA).</p>
<p>If you want only one Pod to be able to write then create two Deployments. One with <code>replicas: 1</code> and the other one that has the a... |
<p>I set up a kubernetes cluster in AWS using KOPS; now I want to set up an NGINX ingress controller and terminate TLS with AWS managed certificate. The topology in my understanding is AWS ELB is facing the internet and terminates TLS, forwards unencrypted to ingress service which then does dispatches.</p>
<p>I've dep... | <p>I managed to get this done largely using the ingress here: <a href="https://github.com/kubernetes/kops/tree/master/addons/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/kops/tree/master/addons/ingress-nginx</a> except for the ingress service I added <code>service.beta.kubernetes.io/aws-load-b... |
<p>I have a golang service that implements a WebSocket client using gorilla that is exposed to a Google Container Engine (GKE)/k8s cluster via a NodePort (30002 in this case).</p>
<p>I've got a manually created load balancer (i.e. NOT at k8s ingress/load balancer) with HTTP/HTTPS frontends (i.e. 80/443) that forward t... | <p>I think this may be Working as Intended. Google just updated the documentation today (about an hour ago).</p>
<p><a href="https://cloud.google.com/compute/docs/load-balancing/http/#websocket_proxy_support" rel="nofollow noreferrer">LB Proxy Support docs</a></p>
<p><a href="https://cloud.google.com/compute/docs/loa... |
<p>I'm trying to connect on a container throw the Kubernetes WebSocket API, from a container running within Kubernetes, without any success. </p>
<p>Install <code>wscat</code>:</p>
<pre><code>apt-get update
apt-get install -y npm
ln -s /usr/bin/nodejs /usr/bin/node
npm install -g n
n stable
npm install -g wscat
</co... | <p>I just found out that the container name was wrong:<br>
<code>?container=aws</code> Aws was not on this pod.</p>
|
<p>I have a pod/service running an application that consumes etcd as a synchronization system and datastore. I want to run etcd within the pod, such that all of the replicas form a coherent cluster. In other words, so the application in replica #1 can write "foo" to <code>localhost:4001/v2/keys/my_key</code> and then r... | <p>You can deploy etcd on kubernetes using an Operator (from the <code>extensions/v1beta1</code>) and the <a href="https://quay.io/repository/coreos/etcd-operator" rel="nofollow noreferrer"><code>quay.io/coreos/etcd-operator</code></a> image.</p>
<p>An example deployment with a cluster size of 3 looks like this:</p>
... |
<p>Running <code>kubectl logs</code> shows me the stderr/stdout of one Kubernetes container. </p>
<p>How can I get the aggregated stderr/stdout of a set of pods, preferably those created by a certain replication controller?</p>
| <p>You can use labels</p>
<pre><code>kubectl logs -l app=elasticsearch
</code></pre>
<p>And you'd probably want to specify <code>--all-containers --ignore-errors</code> in order to:</p>
<ul>
<li>Include logs from pods with multiple containers</li>
<li>Continue to next pod on fatal error (e.g. logs could not be retrieve... |
<p>Among Kubernetes, OpenShift, Docker Swarm and Docker DataCenter deployment tools which all are having automatic rollback in case of any failure happens?</p>
| <p>All of them have a sort of rollback mechanism built-in with commands available for you to control. However, these are not fully automated and you might have to do it manually. For Kubernetes, here is the related github <a href="https://github.com/kubernetes/kubernetes/issues/23211" rel="nofollow noreferrer">issue</a... |
<p>Scanario: I have a container image that needs to run with <code>net.core.somaxconn</code> > default_value. I am using Kubernetes to deploy and run in GCE.</p>
<p>The nodes (vms) in my cluster are configured with correct <code>net.core.somaxconn</code> value. Now the challenge is to start the docker container with f... | <p><strong>Solution 1</strong>: use <a href="https://stackoverflow.com/questions/43032406/gke-cant-disable-transparent-huge-pages-permission-denied/43081893#43081893">this answer</a> as a template to see how to configure the whole node to that sysctl value; you can use something like <code>echo 4096 >/proc/sys/net/c... |
<p>I am running web site with Kubernetes on Google Cloud. At the moment, everything is working well - through http. But I need https. I have several services and one of them is exposed to the outside world, let's call it web. As far as I know, this is the only service that needs to be modified. I tried to creating a st... | <p>Since you have not mentioned this already, I'm just assuming you're using Google Container Engine (GKE) for your Kubernetes setup.</p>
<p>In the service resource manifest, if you set the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer" rel="noreferrer"><code>Type</code> t... |
<p>I have created a pod with two containers. I know that different containers in a pod share same network namespace (i.e.,same IP and port space) and can also share a storage volume between them via configmaps. My question is do the pods also share same filesystem. For instance, in my case I have one container 'C1' tha... | <p>You can use an <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir" rel="nofollow noreferrer">emptyDir</a> for this:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: test-pd
spec:
containers:
- image: gcr.io/google_containers/test-webserver
name: generating-container
volumeMo... |
<p>I have been working on a simple Node.js application that SETs and GETs a key from etcd using Istio to connect the two services together. I have tried a few variations but keep seeing the same error returned.</p>
<blockquote>
<p>nodeAppTesting failed(etcd-operator) ->{"errors":[{"server":"<a href="http://etcd-ope... | <p>I was able to resolve this issues reported here. I will be publishing a recipe demonstrating the flow sometime this week. For now, we can consider this closed. In the future, I will move to the forums or post on issues. Be on the look out for the article (I will update this post with the link when available).
T... |
<p>I am getting the following error when trying to access the Kubernetes dashboard found in the cluster info:</p>
<pre><code>kubectl cluster-info
</code></pre>
<p>Also pops up in incognito mode in Chrome:</p>
<blockquote>
<p>User "system:anonymous" cannot proxy services in the namespace "kube-system".: "No policy ... | <p>I was able to access it with a local proxy by running:</p>
<pre><code>kubectl proxy
</code></pre>
<p>And then navigating to <a href="http://127.0.0.1:8001/ui" rel="nofollow noreferrer">http://127.0.0.1:8001/ui</a> (<a href="http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/... |
<p>I defined my deployment resources</p>
<pre><code> resources:
limits:
cpu: 900m
memory: 2500Mi
</code></pre>
<p>now on <a href="http://localhost:8001/api" rel="nofollow noreferrer">http://localhost:8001/api</a> <a href="https://i.stack.imgur.com/riZLA.png" rel="nofollow noreferrer"><img src... | <p>Usually, you will need to implement some monitoring solution for your K8s cluster to store historical metrics. </p>
<p>If your Kubernetes deployment runs on GKE, you can use <a href="https://cloudplatform.googleblog.com/2015/12/monitoring-Container-Engine-with-Google-Cloud-Monitoring.html" rel="nofollow noreferrer"... |
<p>Is it possible to run "kubeadm init" without Internet access?</p>
<p>When executing kubeadm init on isolated networks where the host is not allowed to make external connections, it fails on download of a stable version check of some sort, as it tries to retrieve <a href="https://storage.googleapis.com/kubernetes-re... | <p>Resolved by using the following command:</p>
<pre><code>kubeadm init --kubernetes-version=v1.6.4
</code></pre>
<p>(Note the "v" in the version number.)</p>
|
<p>I'm using Rancher over Kubernetes to create our test/dev environment. First of all, it's a great tool and I'm amazed of how it simplify the management of such environments.</p>
<p>That said, I have an issue (which is probably more a knowledge lack of Rancher). I try to automate the deployment via Jenkins, and as we... | <p>Ok, just for the information, I found that this is possible via the Rest API of Rancher.</p>
<p>Check the following link : <a href="http://docs.rancher.com/rancher/v1.2/en/api/v2-beta/api-resources/service/" rel="nofollow noreferrer">http://docs.rancher.com/rancher/v1.2/en/api/v2-beta/api-resources/service/</a></p>... |
<p><strong>1.</strong> Followed -> <a href="https://kubernetes.io/docs/getting-started-guides/ubuntu/manual/" rel="noreferrer">https://kubernetes.io/docs/getting-started-guides/ubuntu/manual/</a></p>
<p>After I clone as they mentioned in doc. <code>git clone --depth 1 https://github.com/kubernetes/kubernetes.git</code... | <p>I have had some fun with this :-)</p>
<p>So, Kubernetes 1.6.4 on Ubuntu 14.04 (Trusty):</p>
<ul>
<li>have <code>nsenter</code> built & installed (<code>nsenter</code> is a hard <code>kubelet</code> dependency and is not present in 14.04)</li>
<li>patch up the <code>kubelet</code> and <code>kubeadm</code> packa... |
<p>I currently have a service that looks like this:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: httpd
spec:
ports:
- port: 80
targetPort: 80
name: http
protocol: TCP
- port: 443
targetPort: 443
name: https
protocol: TCP
selector:
app: httpd
extern... | <p>This is not simple to achieve -- because of the way kube-proxy works, your traffic can get forwarded between nodes before it reaches the pod that's backing your Service.</p>
<p>There are some beta annotations that you can use to get around this, specifically <code>service.beta.kubernetes.io/external-traffic: OnlyLo... |
<p>My Understanding of this <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="noreferrer">doc page</a> is, that I can configure service accounts with Pods and hopefully also deployments, so I can access the k8s API in Kubernetes 1.6+. In order not to alter or use the def... | <p>As you will need to specify 'podSpec' in Deployment as well, you should be able to configure the service account in the same way. Something like:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-deployment
spec:
template:
# Below is the podSpec.
metadata:
name: ...... |
<p>I intend to use Kubernetes and Ingress for load balancing. I'm trying to learn how to set up Flask, uWSGI and Nginx.
I see this tutorial that has all three installed in the same container, and I'm wondering whether I should use it or not.
<a href="https://ianlondon.github.io/blog/deploy-flask-docker-nginx/" rel="nor... | <p>Flask is a web framework, any application written with it needs a WSGI server to host it. Although you could use the Flask builtin developer server, you shouldn't as that isn't suitable for production systems. You therefore need to use a WSGI server such as uWSGI, gunicorn or mod_wsgi (mod_wsgi-express). Since the w... |
<p>The CentOS Atomic Host is shipped without the kubernetes-master package built into the image. Instead, you need to run the master kubernetes components (apiserver, scheduler, and controller-manager) in containers, managed via systemd, using the service files. Do you have any good tutorials on how to form a kubernete... | <p>You should be able to get a Kubernetes cluster working using the <a href="https://github.com/kubernetes/contrib/tree/master/ansible" rel="nofollow noreferrer">old contrib/ansible playbooks</a>. While somewhat outdated, they've been tested to work. At this point the Atomic team is working towards <a href="http://ww... |
<p>I am trying to run microservice applications with kubernetes. I have rabbitmq, elasticsearch and eureka discovery service running on kubernetes. Other than that, I have three microservice applications. When I run two of them, it is fine; however when I run the third one they all began restarting over and over again ... | <p>See kubectl get logs for any obvious errors. In this case, as suspected, it looks like it is insufficient resources problem (or a service that has resource leaks).
If possible, try increasing resources to see if it helps. </p>
|
<p>I tried <code>kubectl exec</code> on a k8s 1.6.4 RBAC-enabled cluster and the error returned was: <code>error: unable to upgrade connection: Unauthorized</code>. <code>docker exec</code> on the same container succeeds. Otherwise, <code>kubectl</code> is working. <code>kubectl</code> tunnels through an SSH connection... | <p>This is an RTFM moment... The solution was basically to follow all the steps on <a href="https://kubernetes.io/docs/admin/kubelet-authentication-authorization/#kubelet-authorization" rel="noreferrer">this page</a> for authn, authz, or both.</p>
<p>I had omitted <code>--kubelet-client-certificate</code> and <code>--... |
<p>Currently, under kubernetes1.5.3, kube-apiserver.log and kube-controller-manager.log is generated by adding '1>>/var/log/kube-apiserver.log 2>&1' in /etc/kubernetes/kube-apiserver.yaml file.
When I upgrade the kubernetes version to 1.6.3, it not work. There is no log file created under /var/log. How to get th... | <p>For kubernetes1.6+, try the following options</p>
<h3><code>kube-apiserver</code></h3>
<pre><code>--audit-log-path=/var/log/kubernetes/kube-apiserver.log --logtostderr=false
</code></pre>
<p>and restart <code>kube-apiserver</code>, you can find all logs for <code>kube-apiserver</code> in file <code>/var/log/kuber... |
<p>I am looking to list all the containers in a pod in a script that gather's logs after running a test. <code>kubectl describe pods -l k8s-app=kube-dns</code> returns a lot of info, but I am just looking for a return like:</p>
<pre><code>etcd
kube2sky
skydns
</code></pre>
<p>I don't see a simple way to format the d... | <h1>Answer</h1>
<pre><code>kubectl get pods POD_NAME_HERE -o jsonpath='{.spec.containers[*].name}'
</code></pre>
<h1>Explanation</h1>
<p>This gets the JSON object representing the pod. It then uses kubectl's <a href="https://kubernetes.io/docs/user-guide/jsonpath/" rel="noreferrer">JSONpath</a> to extract the name o... |
<p>I've been running a Kubernetes cluster for a while now, but I haven't been able to keep it stable.
My cluster consists of four nodes, two masters and two workers. All nodes run on the same physical server, which in turn runs VMware vSphere 6.5. Each node runs CoreOS stable (1353.7.0), and I'm running Kubernetes/Hyp... | <p>Seen this as well. problem seems to go away if you downgrade CoreOS to a older version with docker 1.12.3.</p>
<p>Docker is a nightmare with regressions in every single version they release :(</p>
|
<p>In some hosting environments/configurations, the network traffic between pods (applications) may traverse the public Internet. As a result, I'd like to secure the communication between the pods.</p>
<p>For example, I have the following structure:</p>
<p>Service_A - edge service in my product and provides access to... | <p>A simple, generic solution that I like is to run a reverse-proxy (such as nginx) in each pod. All of your app containers will listen on localhost or unix sockets, and the ssl proxy will terminate external HTTPS connections. This makes it easy to audit your SSL config across all your apps, since every connection is t... |
<p>I'm trying to simulate Daemon-set in kubernetes with using Deployment/RC/Replica-set.</p>
<p><strong>What I want to achieve :</strong></p>
<p>As daemon-set kind deploy PODs on each nodes like wise I want to deploy pod on each node, but without kind daemonset.</p>
<p>Is there any way to do it ? Can't find proper w... | <p>You can do that by using Deployment/ReplicaSet in Kubernetes with <strong>hostPort</strong>.<br/><br/>
Assuming you have 4 nodes in Kubernetes cluster, you can create a deployment or replicaset with hostPort and replicas equal to number of nodes in cluster. <br/><br/>
For example you want to run nginx pod on every n... |
<p>What are installed for minikube:</p>
<pre><code>$ ls -al /usr/local/bin/
-rwxr-xr-x 1 root root 26406912 Jun 14 12:05 docker-machine
-rwxrwxr-x 1 me libvirtd 11889064 Jun 14 12:07 docker-machine-driver-kvm
-rwxrwxr-x 1 me me 70232912 Jun 14 11:58 kubectl
-rwxrwxr-x 1 me me 82512696 Jun 14 11:57 mini... | <p>My update is close to the solution. The solution is to enable virtualization in the BIOS.</p>
<p>1, Power on your PC and open the BIOS.</p>
<p>2, Go to the <code>security</code> section and enable virtualization.</p>
|
<p>I am trying to configure my Kubernetes cluster to use a local NFS server for persistent volumes.</p>
<p>I set up the PersistentVolume as follows:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: hq-storage-u4
namespace: my-ns
spec:
capacity:
storage: 10Ti
accessModes:
- ReadWrit... | <p>It turned out that I needed to put the IP (I also put the path) in quotes. After fixing that, the pvc goes to status Bound, and the pod can mount correctly.</p>
|
<p>I am reading <a href="http://blog.madhukaraphatak.com/scaling-spark-with-kubernetes-part-6/" rel="nofollow noreferrer">this blog</a> and tried to run the <a href="https://github.com/phatak-dev/kubernetes-spark" rel="nofollow noreferrer">code</a>. If <code>sleep infinity</code> is removed, the pod will be stuck in Cr... | <p>The reason the pod goes into the <code>CrashLoopBackOff</code> state is that Kubernetes expects to process manage the command executed by the container. Presumably the <code>start-master.sh</code> script executes, then exits, which Kubernetes interprets as the process dying. You need to execute a command which will ... |
<p>I need to access a service from my cluster on GKE outside of it. This service restricts access IP allowing just one IP. So, I have to set a NAT or something like that, but I don't really sure that is the right solution to set an external gateway/NAT on my GKE cluster. Can you help me, please?</p>
| <p>You can achieve this by configuring a <a href="https://cloud.google.com/solutions/connecting-securely#natgateway" rel="nofollow noreferrer">NAT Gateway</a>.</p>
<p>Here's a guide: <a href="https://github.com/johnlabarge/gke-nat-example" rel="nofollow noreferrer">https://github.com/johnlabarge/gke-nat-example</a></p... |
<p>I have a etcd cluster running on coreOS. The leader was set to the first member I've started (as expected), but I started the wrong one first, so the leader isn't who it's supposed to be.</p>
<p>How do I change the role of a leader to a different member?</p>
| <p>I misunderstood the role of the etcd cluster leader. I was setting up a Kubernetes cluster and I thought the master node should be the etcd cluster leader. But as @heimbert mentioned the point of leader election is that you don't have to worry who the leader is.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.