prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I have an app with several containers running just fine using kubernetes on AWS however now I need to port this to a AWS Dedicated Host VPC where the cluster has previously been created NOT using Kubernetes so I am not able to execute kube-up.sh or its kops equivalent</p>
<p>Is it possible to orchestrate my containe... | <p>Yes, definitely. kubectl is just a client application and it can connect to any kubernetes cluster and orchestrate it. </p>
<p>If you get i/o timeout, you most likely have connectivity issues and some firewall/proxy in place. Did you try to just access the kubernetes API through curl or telnet? </p>
|
<p>I'm relatively new to K8S and hit a road block. I've created a ConfigMap to create a central location so that all Deployments can pull in and mount the same vars - something like so:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: site
namespace: staging
spec:
revisionHist... | <p>If you want to set values from your configMap directly as env vars inside your pod, then you do not need to mount them as files. Instead use:</p>
<pre><code>env:
- name: MY_ENV_VAR
valueFrom:
configMapKeyRef:
name: <your-configmap-name>
key: <key-of-your-value>
</code></pre>
... |
<p>I am trying to attach to a running container in Kubernetes, however I get the error message below. </p>
<pre><code>>kubectl attach -it es-client-2756725635-4rk43 -c es-node
Unable to use a TTY - container es-node did not allocate one
If you don't see a command prompt, try pressing enter.
</code></pre>
<p>How do... | <p>In order to have proper TTY and stdin when doing attach:</p>
<pre><code>kubectl attach -it POD -c CONTAINER
</code></pre>
<p>The container must be configured with <code>tty: true</code> and <code>stdin: true</code>.
By default both of those values are <code>false</code>: <a href="https://kubernetes.io/docs/reference... |
<p>I would like to run a Cassandra cluster under Kubernetes on Google Container Engine using the examples given here: <a href="https://github.com/kubernetes/kubernetes/tree/master/examples/storage/cassandra" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/tree/master/examples/storage/cassandra</a></p... | <p>The short answer is that there is no way to do this in kubernetes. Kubernetes does very little in terms of storage management.</p>
<p>If you have the flexibility of choosing other solutions, <a href="https://robinsystems.com/product-and-solutions/robin-for-databases/" rel="nofollow noreferrer">check this out</a>.</... |
<p>I am using kubernetes on google cloud container, and I still don't understand how the load-balancers are "magically" getting configured when I create / update any of my ingresses.</p>
<p>My understanding was that I needed to deploy a <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/gce... | <p>Google Container Engine runs the glbc "glue" on your behalf unless you explicitly request it to be disabled as a cluster add-on (see <a href="https://cloud.google.com/container-engine/reference/rest/v1/projects.zones.clusters#HttpLoadBalancing" rel="nofollow noreferrer">https://cloud.google.com/container-engine/refe... |
<p>How can I expose service of type <code>NodePort</code> to internet <strong>without</strong> using type <code>LoadBalancer</code>? Every resource I have found was doing it by using load balancer. But I don't want load balancing its expensive and unnecessary for my use case because I am running one instance of <code>p... | <p>using <code>NodePort</code> as Service type works straight away e.g. like this:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
type: NodePort
ports:
- port: 80
nodePort: 30080
name: http
- port: 443
nodePort: 30443
name: https
selector:
name: ngin... |
<p>Hoping someone can help.
I have a 3x node CoreOS cluster running Kubernetes. The nodes are as follows:
192.168.1.201 - Controller
192.168.1.202 - Worker Node
192.168.1.203 - Worker Node</p>
<p>The cluster is up and running, and I can run the following commands:</p>
<pre><code>> kubectl get nodes
NAME ... | <p>If you installed your cluster with kubeadm you should add a pod network after installing.</p>
<p>If you choose flannel as your pod network, you should have this argument in your init command <code>kubeadm init --pod-network-cidr 10.244.0.0/16</code>.</p>
<p>The flannel YAML file can be found in the <a href="https:... |
<p>I'm new in kubernetes and I have some doubts about the installation of kubernetes on centos 7, I have read some documentation on some links:</p>
<p><a href="https://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/docs/getting-started-guides/kubeadm/</a></p>
<p><a... | <p><code>kubeadm</code>.</p>
<p><code>kubeadm</code> now can support for multi masters, which is considerable for production.</p>
<p>The <code>kubeadm</code> also supplies a secure deployment. It automatically configs <a href="https://kubernetes.io/docs/admin/kubelet-tls-bootstrapping/" rel="nofollow noreferrer">TLS ... |
<p>A new Kubernetes Deployment with 2+ replicas for high availability.</p>
<p>I want to be able to execute a command on the first pod only, let's say create a DB, and let the other replicas wait for the first one to complete.<br>
To implement this, I just want to know in the pod if this is replica #1 or not.</p>
<p>S... | <p>in Kubernetes a <code>Deployment</code> is considered stateless and therefore doesn't provide the feature you're looking for. You should rather look into <code>StatefulSet</code> and their features.</p>
<p>A <code>StatefulSet</code>e.g. supports <a href="https://kubernetes.io/docs/tutorials/stateful-application/bas... |
<p>I want to set up gcsFUSE on my cluster. It's easier to do this in Debian jessie according to the <a href="https://github.com/GoogleCloudPlatform/gcsfuse" rel="nofollow noreferrer">gcsFUSE page</a>.</p>
<p>The <code>config-default.sh</code> that <code>kube-up.sh</code> uses contains the following:</p>
<pre><code>NO... | <p>from reading the <a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/util.sh" rel="nofollow noreferrer">cluster/gce/util.sh</a> you can use <code>KUBE_GCE_MASTER_IMAGE</code> / <code>KUBE_GCE_MASTER_PROJECT</code> and <code>KUBE_GCE_NODE_IMAGE</code> / <code>KUBE_GCE_NODE_PROJECT</code> for tha... |
<p>I am using <code>Azure CLI 2.0</code> and I am trying to create <code>Azure Container Service type Kurbenetes</code>, with this command (I already created resource group)</p>
<pre><code>az acs create --orchestrator-type=kubernetes --resource-group=mi-shared-docker-test --dns-prefix=kube --name=mishareddocker
</code... | <p>Well, the error states it pretty clearly, you don't have the right permissions, you should read on the ACS\Kubernetes guide.</p>
<p>I understand you are using AZ, not azure, but the idea is the same, you should have <a href="https://learn.microsoft.com/en-us/azure/container-service/container-service-deployment#kube... |
<p>How can I pass the <code>nginx.conf</code> configuration file to an nginx instance running inside a Kubernetes cluster?</p>
| <p>You can create a ConfigMap object and then mount the values as files where you need them:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
nginx.conf: |
your config
comes here
like this
other.conf: |
second file
contents
</code></pre>
<p>And in you pod spec:<... |
<p>I have a question about kubernetes and network firewall rules. I want to secure my kubernetes cluster with firewall rules, and was wondering if workers/masters need internet access? I'm planning on using a private registry located on my network, but I'm having problems getting it to work when the workers don't have ... | <p>you need to pass an argument <code>--pod-infra-container-image</code> to a <strong>kubelet</strong> as documented here: <a href="https://kubernetes.io/docs/admin/kubelet/" rel="nofollow noreferrer">https://kubernetes.io/docs/admin/kubelet/</a>.
It defaults to <code>gcr.io/google_containers/pause-amd64:3.0</code>, wh... |
<p>right now i'm accessing my pods (postgres port 5432) trough a service that is exposed, but since <strong>gcloud</strong> charge for every forwarding rule created, the amount of pods i need to monitor or to execute stuff in it, is costing me more and more, is there a way to create a single expose service for all of ... | <p>If you are looking for a managed solution then Google is offering VPN for that:
<a href="https://console.cloud.google.com/networking/vpn/" rel="nofollow noreferrer">https://console.cloud.google.com/networking/vpn/</a></p>
<p>If you are happy to roll your own then you can create a new Compute instance on the same ne... |
<p>I have Kubernetes running on a VM on my dev box. I want to view the Kubernetes dashboard from the VM host. When I run the following command:</p>
<pre><code>kubectl proxy --address 0.0.0.0 --accept-hosts ^/.*
</code></pre>
<p>When I try to access the dashboard I get an unauthorized error. </p>
<p>What am I miss... | <p>The --accept-hosts access control is for checking of the <em>hostname</em>, so it won't start with a / (slash). You need to do:</p>
<pre><code>kubectl proxy --address 0.0.0.0 --accept-hosts '.*'
</code></pre>
<p>(Make sure you shell escape the .* as it may match files in the current directory!)</p>
<p>More inform... |
<p>I'm trying to use <code>Consul</code> with <code>Registrator</code> in GCE & K8s. Everything launches fine except `Registrator'. </p>
<p>Here is my deployment:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: consul
spec:
replicas: 1
strategy: {}
... | <p>I have switched to Linkerd which works very well together with k8s. </p>
|
<p>I followed this guide <a href="https://coreos.com/kubernetes/docs/latest/kubernetes-on-aws-launch.html" rel="nofollow noreferrer">https://coreos.com/kubernetes/docs/latest/kubernetes-on-aws-launch.html</a> to create a kubernetes cluster on AWS with <a href="https://github.com/coreos/kube-aws" rel="nofollow noreferre... | <p>It seems like the problem was because my credentials were not all generated correctly. So perhaps the apiserver cert was signed with a wrong ca cert? Not sure how that might've happened.</p>
<p>Anyway, deleting the <code>credentials</code> directory, then destroy the cluster and bring it up again solved the problem... |
<p>i followed this guide <a href="https://kubernetes.io/docs/getting-started-guides/centos/centos_manual_config/" rel="noreferrer">link</a> to install a kubernetes cluster and i have no error, but i can't access kubernetes-Dashboard</p>
<p>I did
<code>kubectl create -f https://rawgit.com/kubernetes/dashboard/master/sr... | <p>192.168.0.0/16 is a private IP range, meaning you need to be within the cluster's network to access it.</p>
<p>The easiest way to access your service outside the cluster is to run <code>kubectl proxy</code>, which will proxy requests to your localhost port 8001 to the Kubernetes API server. From there, the apiserve... |
<p>I've setup a Kubernetes 1.5 cluster with the three master nodes tainted <em>dedicated=master:NoSchedule</em>. Now I want to deploy the Nginx Ingress Controller on the Master nodes only so I've added tolerations:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-ingress-controlle... | <p>A toleration does <em>not</em> mean that the pod must be scheduled on a node with such taints. It means that the pod <em>tolerates</em> such a taint. If you want your pod to be <em>"attracted"</em> to specific nodes you will need to attach a <strong>label</strong> to your dedicated=master tainted nodes and set nodeS... |
<p>I'm trying to use the kubernetes ingress resource on bare metal with no cloud provider. </p>
<p>I created an ingress resource:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx
spec:
rules:
- host: foobar.com
http:
paths:
- path: /foo
backend:
... | <p>The issue here was the kubelet configuration. By default, the kubelet will listen on <code>0.0.0.0</code> and because <code>docker0</code> is the first available address, it grabbed <code>docker0</code>'s IP.</p>
<p>I added the following to the kubelet config:</p>
<pre><code>--address=<actualip> --node-ip=&l... |
<p>Does anyone know if it is possible to specify the Kubernetes version when deploying ACS Kubernetes flavour?</p>
<p>If so how?</p>
| <p>Using the supported resource provider in ARM you cannot specify the version. However, if you use <a href="http://github.com/Azure/acs-engine" rel="nofollow noreferrer">http://github.com/Azure/acs-engine</a> you can do so. ACS Engine is the open source code we (I work for MS) use to drive Azure Container Service. Usi... |
<p>I get the go get k8s.io/client-go/1.5/...
An error occurred while trying to go run:</p>
<pre><code>> # k8s.io/client-go/pkg/api/v1
> ../k8s.io/client-go/pkg/api/v1/helpers.go:86: undefined: v1.FinalizerOrphan
</code></pre>
<p>Want to how to deal with, please?</p>
<p>../k8s.io/client-go/pkg/api/v1/helpers.go... | <p>I encountered a similar issue when I tried to go get kubernetes v1.5.2.<br/>
Just solved it with:<br/>
<i>cd ../k8s.io/kubernetes</i><br/>
<i>git checkout v1.5.2</i><br/></p>
|
<p>I have a simple meteor app deployed on kubernetes. I associated an external IP address with the server, so that it's accessible from within the cluster. Now, I am up to exposing it to the internet and securing it (using HTTPS protocol). Can anyone give simple instructions for this section?</p>
| <p>In my opinion <a href="https://github.com/jetstack/kube-lego" rel="noreferrer">kube-lego</a> is the best solution for GKE. See why:</p>
<ul>
<li>Uses <a href="https://letsencrypt.org/" rel="noreferrer">Let's Encrypt</a> as a CA</li>
<li>Fully automated enrollment and renewals</li>
<li>Minimal configuration in a sin... |
<p>I'm trying to secure my k8s cluster, and I'm looking at client-authentication authorization support for k8s. My requirement is that I want to be able to uniquely identify myself (e.g. client) to the k8s apiserver, but everything I read so far about client authentication is not the solution. </p>
<p>My understandin... | <p>It is not only verified that the certificate is authorized by the CA. The client certificate also contains the <a href="https://kubernetes.io/docs/admin/authentication/#x509-client-certs" rel="nofollow noreferrer">Common Name (CN)</a> which can be used with a simple <a href="https://kubernetes.io/docs/admin/authoriz... |
<p>If I run through the <a href="https://cloud.google.com/container-engine/docs/tutorials/http-balancer" rel="noreferrer">http load balancer example</a> it works fine in my google container engine project. When I run "kubectl describe ing" the backend is "HEALTHY". If I then change the svc out to one that points to m... | <p>After a lot of digging I found the answer:
According to the requirements here: <a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/cluster-loadbalancing/glbc#prerequisites" rel="noreferrer">https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/cluster-loadbalancing/glbc#prerequ... |
<p>I've created an YAML file with three images in one pod (they need to communicate with eachother over 127.0.0.1) It seems that it's all working. I've defined a nodeport in the yaml file.</p>
<p>There is one deployment defined <code>applications</code> it contains three images:</p>
<ul>
<li>contacts-db (A MySQL data... | <p>The selector of a service is matching the labels of your pod. In your case the defined selectors point to the containers which leads into nothing when choosing pods.</p>
<p>You'd have to redefine your services to use one selector or split up your containers to different Deployments / Pods.</p>
<p>To see whether a ... |
<p>Hi I am following this doc <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api-conventions.md#strategic-merge-patch" rel="noreferrer">https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api-conventions.md#strategic-merge-patch</a> for strategic-merge-patch to partially update the... | <p>As documented it depends on annotations of the types. AFAIS the strategic merge only works if <code>patchStrategy</code> and <code>patchMergeKey</code> are given. For example, this is the case in <a href="https://github.com/kubernetes/client-go/blob/7ac1236/pkg/api/v1/types.go#L2119" rel="nofollow noreferrer"><code>... |
<p><strong>Go env:</strong></p>
<blockquote>
<p>GOARCH="amd64"</p>
<p>GOBIN="/root/"</p>
<p>GOEXE=""</p>
<p>GOHOSTARCH="amd64"</p>
<p>GOHOSTOS="linux"</p>
<p>GOOS="linux"</p>
<p>GOPATH="/data/workspace/kubernetes"</p>
<p>GORACE=""</p>
<p>GO... | <p>My guess is that you've stepped on the fact that the global timeout handler can't actually stop the goroutines working on the request. So when the connection times out (1m unless you've changed it), it returns an error. If the goroutine actually completes at the same time, it could also attempt to write to the conne... |
<p>Performed update to Kubernetes 1.5.2 on Google Container Engine.
Then started getting the following errors:</p>
<pre><code>Failed to count the # of live instances on Kubernetes
</code></pre>
<p>To resolve this I then upgraded Jenkins (to 2.32.2) and the Kubernetes plugin (to 0.10) to the latest versions.</p>
<p>A... | <p>The last error was resolved by changing the slave container name to jnlp instead of default (see image). The google documentation shows the name is supposed to be default but it seems with these updates this is not the right approach to get this system working. </p>
<p>It looks like the updated kubernetes-plugin cr... |
<p>I have reached moment when I need to split my prometheus into smaller ones.
I have been reading about it <a href="https://www.robustperception.io/scaling-and-federating-prometheus/" rel="nofollow noreferrer">here</a> but it does not say anything about scaling in kubernetes. Below is my setup:</p>
<ul>
<li>one node ... | <p>Another option would be going for a horizontally scalable, distributed Prometheus implementation: <a href="https://github.com/weaveworks/cortex" rel="nofollow noreferrer">https://github.com/weaveworks/cortex</a> (NB I wrote this.)</p>
<p>Its not ready for prime time yet, but we're using it internally and getting pr... |
<p>At present, there are lots of containers running in kubernetes cluster, is there any good solution to monitor each container and could sent alert when container is in bad status ?</p>
| <p>This is broad subject and a lot depends on what you actually want to monitor, the size of your deployment and the technical expertise available.</p>
<p>The most comprehensive solution is <a href="https://prometheus.io" rel="nofollow noreferrer">Prometheus</a>. It comes with extensive documentation, getting start gu... |
<p>I'm using Kubernetes 1.5.2 in CoreOS 1235.6.0 on bare metal, with calico v1.0.2 for the overlay network. Containers are getting correct IP addresses, but their routes don't match:</p>
<pre><code>/ # ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
link/loopback 00:00:00:00:00:00 b... | <p>The addressing and routes inside the container look fine. The routes outside the container on the host would be more interesting. Given what you've seen (veth created, which implies the CNI plugin is working), I'd check that the policy controller and calico-node are running properly (e.g. no error logs / restart l... |
<p>I am trying to use Docker + Kubernetes for my application management.</p>
<p>I have installed kubectl, kubeadm, kubelet (got the steps from google docs) for Kubernetes cluster.</p>
<p>Now cluster is having 2 node(1 Master, 1 Child)</p>
<p>I have a customize Dockerfile , how can it use it as a Kubernetes pods ?</p... | <p>You could use a private Docker registriy outside or inside the cluster or work with local (pre-pulled) images.</p>
<ol>
<li><p>Outside the cluster you might want to look at these:</p>
<ul>
<li><a href="https://docs.docker.com/registry/" rel="noreferrer">Docker registry image</a></li>
<li><a href="https://www.jfrog... |
<p>I get the go get k8s.io/client-go/1.5/...
An error occurred while trying to go run:</p>
<pre><code>> # k8s.io/client-go/pkg/api/v1
> ../k8s.io/client-go/pkg/api/v1/helpers.go:86: undefined: v1.FinalizerOrphan
</code></pre>
<p>Want to how to deal with, please?</p>
<p>../k8s.io/client-go/pkg/api/v1/helpers.go... | <p>Sorry, this should be temporary--we are working on a fix (and on a system so our publishing bot stops breaking the client). In the meantime, go back a commit or two, as the other answer suggests.</p>
|
<p>Create a deployment as below:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
owt: hello
pdl: com
app: world
idc: xg
add: parameters-48
name: parameters-48
spec:
replicas: 2
template:
metadata:
labels:
name: parameters-48
spec:
... | <p>Following the <a href="https://github.com/kubernetes/kubernetes/issues/40990" rel="nofollow noreferrer">issue</a>, it's maybe worth to summarize how to find the correct container pid / proc for a pod:</p>
<p>Run some application:</p>
<pre><code>$ kubectl run bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp... |
<p>How to configure kubernetes cluster with corporate ldap, for authentication?</p>
<p>I'd not found anything official.</p>
| <p><a href="https://github.com/apprenda-kismatic/kubernetes-ldap" rel="nofollow noreferrer">Kismatic</a> is one of the projects that provides a Lightweight Directory Access Protocol (LDAP) authentication webhook for Kubernetes. For Kismatic Enterprise Toolkit (KET) source code check out <a href="https://github.com/appr... |
<p>I want to allow only my team to access(https) our staging environments(Web application) through ingress in GKE cluster.</p>
<p>I found the article below. but GKE doesn't support basic authentication and setting nginx is only way . </p>
<p><a href="https://stackoverflow.com/questions/39862340/gke-ingress-basic-auth... | <p>We're having very similar problems, however our services themselves require authentication, so public accessibility is not too much of a concern for us.</p>
<p>It might not apply to your scenario, but you can firewall the ingress' external IP to be accessible only from certain IPs, e.g. the one of your office. It's... |
<p>I'm currently trying to figure out the best way, as a Kubernetes admin, to make users and give them access to <code>kubectl</code>. Originally, I was going to use serviceAccounts, but it seems that that should not be used as authentication for users. I have been reading over this: <a href="https://kubernetes.io/docs... | <p>i would go the cert route. I believe that what most people use for production and its what we currently use. I included a link to the hard way which has a better description on making certs. </p>
<p><a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/02-certificate-authority.md" r... |
<p>I was looking at the kubernetes API endpoints listed <a href="http://kubernetes.io/docs/api-reference/v1/operations/" rel="noreferrer">here</a>. Im trying to create a deployment which can be run from the terminal using <code>kubectl ru CLUSTER-NAME IMAGE-NAME PORT</code>. However I cant seem to find any endpoint for... | <p>To make it easier to eliminate fields or restructure resource representations, Kubernetes supports multiple API versions, each at a different API path, such as <code>/api/v1</code> or <code>/apis/extensions/v1beta1</code> and to extend the Kubernetes API, API groups is implemented.</p>
<p>Currently there are sever... |
<p>I tried this <a href="https://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="noreferrer">doc</a> to install and setup Kubernetes in Ubuntu VM. I have finished upto 3/4 and now kube-dns pod is in pending status.
How can i figure out this?
here is the result for <code>kubectl get pods --namespace=kube-system... | <h3>Cause</h3>
<p>Most likely a lack of available computing resources in your cluster.</p>
<p>If you're using the example in <a href="https://github.com/kubernetes/kubernetes/blob/release-1.10/cluster/addons/dns/kube-dns.yaml.base#L104-L108" rel="noreferrer">cluster/addons/dns</a> you're certainly using a <code>Deplo... |
<p>I followed the <a href="https://www.mongodb.com/blog/post/running-mongodb-as-a-microservice-with-docker-and-kubernetes" rel="nofollow noreferrer">https://www.mongodb.com/blog/post/running-mongodb-as-a-microservice-with-docker-and-kubernetes</a> and tried to run a single mongodb instance with a LoadBalancer Service a... | <p>Tried a different approach and nailed it. </p>
<p>Followed the following tutorial: <a href="https://kubernetes.io/docs/tutorials/stateful-application/run-stateful-application/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateful-application/run-stateful-application/</a></p>
<p>Exposed the headl... |
<p>EDIT: I'm just going to blame this on platform inconsistencies. I have given up on pushing to the Google Cloud Container Registry for now, and have created an Ubuntu VM where I'm doing it instead. I have voted to close this question as well, for the reasons stated previously, and also as this should probably have be... | <p>The <a href="https://cloud.google.com/container-registry/docs/access-control#permissions_and_roles" rel="nofollow noreferrer">first image push requires admin rights</a> for the project. I had the same problem trying to push a new container to GCR for a team project, which I could resolve by updating my permissions.<... |
<p>I've created a Kubernetes cluster on AWS with <a href="https://github.com/kubernetes/kops" rel="noreferrer">kops</a> and can successfully administer it via <code>kubectl</code> from my local machine.</p>
<p>I can view the current config with <code>kubectl config view</code> as well as directly access the stored sta... | <p>For a full overview on Authentication, refer to the official Kubernetes docs on <a href="https://kubernetes.io/docs/admin/authentication/#openid-connect-tokens" rel="noreferrer">Authentication</a> and <a href="http://kubernetes.io/docs/admin/authorization/" rel="noreferrer">Authorization</a></p>
<p>For users, ideall... |
<p>I am creating a Replication controller with one init-container. however the init container fails to start and the status of the pod is:</p>
<pre><code>NAME READY STATUS RESTARTS AGE
testcontainer 0/1 CrashLoopBackOff 12 37m
</code></pre>
<p>I am not sure wh... | <p>I think the problem here isn't the init container. The <code>hello-world</code> image print a text and exits immediately. Since <a href="https://kubernetes.io/docs/api-reference/v1/definitions/#_v1_podspec" rel="nofollow noreferrer"><code>.spec.restartPolicy</code></a> of the pod defaults to <code>Always</code>, it ... |
<p>I'm running this command:</p>
<pre><code>kubectl set image deployment/www-deployment VERSION_www=newImage
</code></pre>
<p>Works fine. But there's a 10 second window where the website is 503, and I'm a perfectionist. </p>
<p><strong>How can I configure kubernetes to wait for the image to be available before swi... | <p>within the <a href="https://kubernetes.io/docs/user-guide/pod-states/" rel="nofollow noreferrer">Pod lifecycle</a> it's defined that:</p>
<blockquote>
<p>The default state of Liveness before the initial delay is Success.</p>
</blockquote>
<p>To make sure you don't run into issues better configure the <code>Readi... |
<p>I am new to the kubernetes environment. While deploying an application, I could figure out how to do auto scaling but did not quite understand how high availability is ensured? If its not, how can I configure it?</p>
<p>Edit : By HA, I mean how to ensure that pod is scheduled across multiple nodes to ensure HA on p... | <blockquote>
<p>By HA, I mean how to ensure that pod is scheduled across multiple
nodes to ensure HA on pod/service level.</p>
</blockquote>
<p>I'm guessing your app is cloud compatible and can be scaled, In this situation there are multiple feature your can take advantage of:</p>
<ul>
<li><code>DaemonSets</code>... |
<p>I'm running Kubernetes myself on Google Compute Engine (not Google Container Engine). Google Container Engine has <a href="https://cloudplatform.googleblog.com/2015/12/monitoring-Container-Engine-with-Google-Cloud-Monitoring.html" rel="nofollow noreferrer">built-in integration</a> with Stackdriver Monitoring and I'm... | <p>It is not possible to configure Stackdriver exactly the same way that it is done in GKE. </p>
<p>However, you can set <code>ENABLE_CLUSTER_MONITORING</code> to <code>google</code> in <a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/config-default.sh#L107" rel="nofollow noreferrer">config-de... |
<p>I have GKE to create a Kubernetes cluster, which is having 2 nodes and i have created a deployment to download nginx image with 2 replicas. Now that i have nginx images running on the same node ( NODE 1 ) , i am able to login to NODE 2 and curl the PODIP of NODE1 .</p>
<p>I would like to understand , how communicat... | <p>You should start by reading an overview on <a href="https://kubernetes.io/docs/admin/networking/" rel="nofollow noreferrer">Networking in Kubernetes</a>. The question you are asking is about the <em>overlay network</em>. The exact workings of the overlay network is viewed as an implementation detail and there are ma... |
<p>I am running kubeadm alpha version to set up my kubernates cluster.
From kubernates , I am trying to pull docker images which is hosted in nexus repository.
When ever I am trying to create a pods , It is giving "ImagePullBackOff" every time. Can anybody help me on this ?</p>
<p>Detail for this are present in <a ... | <p>You need to <a href="https://kubernetes.io/docs/user-guide/images/#referring-to-an-imagepullsecrets-on-a-pod" rel="noreferrer">refer to the secret</a> you have just created from the Pod definition.</p>
<p>When you create the secret with <code>kubectl create secret docker-registry my-secret --docker-server=123.456.7... |
<p>I am trying to create a pod with 2 containers each having different images! Am not sure how to expose the two different containers to the client. Following is my yaml file for deployment.</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: checkdifimage
spec:
replicas: 1
template:
... | <p>You have multiple Options:</p>
<ol>
<li><p>Create multiple services exposing one port each, on the same deployment.</p></li>
<li><p>Create single service exposing multiple ports:</p>
<pre><code>---
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- name: http
... |
<p>How can I to source the Kubernetes deployment/job name that spawned the current pod from within the pod?</p>
| <p>In many cases the hostname of the Pod equals to the name of the Pod (you can access that by the HOSTNAME environment variable). However that's not a reliable method of determining the Pod's identity.</p>
<p>You will want to you use the <a href="https://kubernetes.io/docs/user-guide/downward-api/" rel="noreferrer">D... |
<p>When I try to create an alerting policy in Stackdriver Monitoring, my custom metrics do not show up in the dropdown list. When I try to add a chart in the Stackdriver Monitoring dashboard, they show up. Is there something more I need to do to make these custom metrics alertable?</p>
<p>These custom metrics were cre... | <p>you should have access to alert on the same custom metrics in the dropdown, and be able to choose "Custom Metrics" as the RESOURCE TYPE. Maybe check your permissions / logged in account, it could be different between the two cases. If it isn't, hit the "Send Feedback" button at the bottom right of the screen and add... |
<p>I've read the <a href="https://cloud.google.com/container-engine/docs/quickstart" rel="nofollow noreferrer">quick start guide</a> and I've got as far as</p>
<ul>
<li>I have a cluster</li>
<li>I can see that I need to type a <code>kubectl run</code> command to start my container.</li>
</ul>
<p>I want to start a pub... | <p>you're right, creating volumes using the <a href="https://kubernetes.io/docs/user-guide/kubectl/kubectl_create/" rel="nofollow noreferrer">imperative commands</a> to create volumes without config files isn't available in Kubernetes.</p>
<p>But it's easy to write some configuration. Based on this <a href="https://gc... |
<p>I have installed Deis Workflow v.2.11 in a GKE cluster, and some of our applications share values in common, like a proxy URL e credentials. I can use these values putting them into environment variables, or even in a .env file.
However, every new application, I need to create a .env file, with shared values and the... | <p>I believe what you're looking for is a way to set environment variables globally across all applications. That is currently not implemented. However, please feel free to hack up a PR and we'd likely accept it!</p>
<p><a href="https://github.com/deis/controller/issues/383" rel="nofollow noreferrer">https://github.co... |
<p>I have 5 machines running Ubuntu 16.04.1 LTS. I want to set them up as a Kubernetes Cluster. Iḿ trying to follow this <a href="http://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="nofollow noreferrer">getting started guide</a> where they're using <code>kubeadm</code>. </p>
<p>It all worked fine until ste... | <p>It is very likely that you missed this critical piece of information from the guide:</p>
<blockquote>
<p>If you want to use flannel as the pod network, specify
--pod-network-cidr 10.244.0.0/16 if you’re using the daemonset manifest below.</p>
</blockquote>
<p>If you omit this <code>kube-dns</code> will never l... |
<p>I run a k8s cluster in google cloud (GKE) and a MySQL server in aws (RDS). Pods need to connect to RDS which only allows connections from certain IP. How can I configure outgoing traffic to have a static IP?</p>
| <p>I had the same problem to connect to a sftp server from a Pod.
To solve this, first you need to create an external IP address:</p>
<pre><code>gcloud compute addresses create {{ EXT_ADDRESS_NAME }} --region {{ REGION }}
</code></pre>
<p>Then, I suppose that your pod is assigned to your default-pool node cluster.
Ex... |
<p>I have setup my kubernetes cluster from scratch following this doc: <a href="https://kubernetes.io/docs/getting-started-guides/scratch/" rel="noreferrer">https://kubernetes.io/docs/getting-started-guides/scratch/</a></p>
<p>My kubernetes master and worker are working correctly, but I didn't find the instruction to ... | <p>Addons can be deployed through yaml files as well as using the <code>addon manager</code>. I have already installed <code>dashboard</code>, <code>monitoring</code>, <code>DNS</code> manually using the <code>yaml</code> files provided (with small modifications) in this <a href="https://github.com/kubernetes/kubernete... |
<p>Occasionally, I see an issue where a pod will start up without network connectivity. Because of this, the pod goes into a CrashLoopBackOff and is unable to recover. The only way I am able to get the pod running again is by running a <code>kubectl delete pod</code> and waiting for it to reschedule. Here's an example ... | <p>Looks like your network driver is not working properly. Without more information about your setup, I could only suggest you the following:</p>
<ol>
<li>Find out what network driver was used? You can tell by checking kubelet <code>--network-plugin</code> flag. If no network plugin is specified, then it is using nati... |
<p>Coming from numerous years of running node/rails apps on bare metal; i was used to be able to run as many apps as i wanted on a single machine (let's say, a 2Go at digital ocean could easily handle 10 apps without worrying, based on correct optimizations or fairly low amount of traffic)</p>
<p>Thing is, using kuber... | <p>According to the <a href="https://kubernetes.io/docs/user-guide/compute-resources/" rel="noreferrer">docs</a>, CPU requests (and limits) are always fractions of available CPU cores on the node that the pod is scheduled on (with a <code>resources.requests.cpu</code> of <code>"1"</code> meaning reserving one CPU core ... |
<p>I'm reading some document about k8s resource model, but I'm puzzled with "Opaque Integer Resources" in <a href="https://kubernetes.io/docs/user-guide/compute-resources/" rel="nofollow noreferrer">here</a>, what's the exactly "opaque" mean?</p>
<p>thanks for your help~</p>
| <p>Kubernetes <em>understands</em> what CPU and memory are and can discover these resources by various means. So a node might have 4 CPUs and 32GB memory. Pods can request these resources and the scheduler will make sure that a Pod is scheduled on a node that have enough of these resources still available.</p>
<p>But ... |
<p>I found a few people that tried to tackle this, only slightly relevant posts <a href="https://stackoverflow.com/questions/37786244/what-username-does-the-kubernetes-kubelet-use-when-contacting-the-kubernetes-api">here</a> and <a href="https://stackoverflow.com/questions/33790438/using-kubectl-with-kubernetes-authori... | <p>the <code>system:authenticated</code> group was added in 1.5</p>
<p>prior to 1.5, you can use <code>"user":"*"</code></p>
|
<p>I am trying to understand on how we can start a interactive shell on a desired container using Kubernetes <a href="https://github.com/kubernetes-incubator/client-python" rel="nofollow noreferrer">client-python</a> API. </p>
<p>I found that we can use <a href="https://github.com/kubernetes-incubator/client-python/bl... | <p>from reading the tests I'd guess that the linked documentation already holds your answer. Use <code>/bin/bash</code> as command and send any further commands through the stdin stream.</p>
<p>Invokation should be done with:</p>
<pre><code>api.connect_get_namespaced_pod_exec('pod',
... |
<p>I have a sort of ELK stack, with fluentd instead of logstash, running as a DaemonSet on a Kubernetes cluster and sending all logs from all containers, in logstash format, to an Elasticsearch server.</p>
<p>Out of the many containers running on the Kubernetes cluster some are nginx containers which output logs of th... | <p>After a few days of research and getting accustomed to the <a href="https://github.com/so0k/docker-efk" rel="noreferrer">EFK stack</a>, I arrived to an EFK specific solution, as opposed to that in Darth_Vader's answer, which is only possible on the ELK stack.</p>
<p>So to summarize, I am using Fluentd instead of Lo... |
<p>I am having issues getting the visitors real IP in my PHP app. I have Kubernetes running in Google Container Engine (master: 1.4.8, node: 1.4.7). </p>
<p>Service definition:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: app-service
spec:
type: LoadBalancer # spawning google loadbalancer
s... | <p>A new feature was <a href="https://kubernetes.io/docs/user-guide/load-balancer/#loss-of-client-source-ip-for-external-traffic" rel="nofollow noreferrer">added to Kubernetes 1.5</a>:</p>
<blockquote>
<p>Due to the implementation of this feature, the source IP for sessions as seen in the target container will not b... |
<p>I built a Kubernete cluster in local data center. There are 4 nodes and 1 master.
Looking for a L4 loadbalance solution for internal service.</p>
<pre><code>root@niubi01:/home/mesos# kubectl get nodes
NAME STATUS AGE
niubi01 Ready,master 7d
niubi02 Ready 7d
niubi03 Ready 7d
ni... | <p>independent from where your <code>LoadBalancer</code> is located you could just have a virtual IP address load balanced between your nodes and include it in your service definition as shown <a href="https://kubernetes.io/docs/user-guide/services/#external-ips" rel="nofollow noreferrer">in the documentation</a>:</p>
... |
<p>We have an application with 4 pods running with a load balancer! We want to try the rolling update, but we are not sure what happens when a pod goes down! The documentation is unclear! Particularly this quote from <a href="https://kubernetes.io/docs/user-guide/pods/#termination-of-pods" rel="noreferrer">Termination ... | <p>1) when a Pod is shutting down it's state is changed to <code>Terminating</code> and it is not considered by the LoadBalancer - as described in the <a href="https://kubernetes.io/docs/concepts/abstractions/pod-termination/" rel="noreferrer">Pod termination</a> docs</p>
<p>2) Yes - you might want to look at the <cod... |
<p>Stupid question, but right now I'm deploying my Kubernetes cluster inside a VM. Is there a way to deploy it directly onto my machine?</p>
<p>I'm sure there has to be a easy fix but many of the docs I've read have been focused on deploying it inside VM.</p>
| <p>I am assuming you are using some flavor of Linux; otherwise the information below won't be useful to you.</p>
<p>The easiest way of <em>bare metal</em> deployment ("onto your machine") is by using <a href="https://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="nofollow noreferrer">kubeadm</a>. The documen... |
<p>I followed the guide in the following link:
<a href="http://blog.kubernetes.io/2017/01/running-mongodb-on-kubernetes-with-statefulsets.html" rel="noreferrer">http://blog.kubernetes.io/2017/01/running-mongodb-on-kubernetes-with-statefulsets.html</a></p>
<p>and set up a mongo DB replica set on Kubernetes with Statef... | <p>It looks like the answer is present in the StatefulSet Basics documentation section <a href="https://kubernetes.io/docs/concepts/abstractions/controllers/statefulsets/%20https://kubernetes.io/docs/user-guide/services/#headless-services" rel="nofollow noreferrer">Using Stable Network Identities</a>:</p>
<blockquote>... |
<p>I am trying to create a new service for one of my deployments named <code>node-js-deployment</code> in GCE hostes Kubernetes Cluster</p>
<p>I followed the Documentation to <a href="https://github.com/kubernetes-incubator/client-python/blob/master/kubernetes/docs/CoreV1Api.md#create_namespaced_service" rel="nofollow... | <p>From reading your code, it seems that you miss assigning the metadata to <code>body.metadata</code>. And you missed that the <code>ports</code> field of the <code>V1ServiceSpec</code> is supposed to be a list, but you used a single <code>V1ServicePort</code> so without testing I assume this should works:</p>
<pre><... |
<p>I daily find myself doing...</p>
<pre><code>$ kubectl --context=foo get pods
< copy text manually >
$ kubectl --context=foo logs dep1-12345678-10101
</code></pre>
<p>I would like to cycle through matching resources with</p>
<pre><code>$ kubectl --context=foo logs dep1<TAB>
</code></pre>
<p>but this... | <p>Both <code>bash</code> and <code>zsh</code> supports scripts that completes printed command when you press <code><TAB></code>. The feature is called <em>Programmable completion</em>, and you can find more details about that here: <a href="https://www-s.acm.illinois.edu/workshops/zsh/completion/completion.html"... |
<p>I have two kubernetes clusters on google container engine but on seperate google accounts (one using my company's email and another using my personal email). I attempted to switch from one cluster to another. I did this by:</p>
<ol>
<li><p>Logging in with my other email address</p>
<p><code>$ gcloud init</code></p... | <p>This occurs because although I logged in with the new credentials... kubectl isn't using the new credentials. In order to change the login/access credentials that kubectl will use to access your cluster you need to run the following command:</p>
<pre><code>gcloud auth application-default login
</code></pre>
<p>You... |
<p>I am trying to finally choose between Spring Cloud Netflix, Kubernetes and Swarm for building our microservices environment. They are all very cool and do some choice is very hard.
I'll describe a little which kind of problems I want to solve.
I couldn't find any best way to design Api Gateway (not a simple load ba... | <p>Kubernetes and Docker Swarm are container orchestration tools.
Spring Cloud is a collection of tools to build microservices/streaming architectures.
There is a bit of overlap, like service discovery, gateway or configuration services. But you could use Spring Cloud without containers and deploy the jars yourself wit... |
<p>has anyone tried having the image for an init container in a private repo when using the imagePullSecret to access the registry? Below is a sample for a private registry with image pull secrets. </p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:
- name: private-reg-co... | <p>You can add it via annotations:</p>
<pre><code>annotations:
pod.beta.kubernetes.io/init-containers: '[
{
"name": "install",
"image": "my-init-container",
"imagePullSecrets": "something"
}
]'
</code></pre>
|
<p>I would like to access to OpenShift and Kubernetes API from inside a pod to query and modify objects in the application the pod belongs to.</p>
<p>In the documentation (<a href="https://docs.openshift.org/latest/dev_guide/service_accounts.html" rel="noreferrer">https://docs.openshift.org/latest/dev_guide/service_ac... | <p>At least in kubernetes 1.5.3 I can also see the namespace in <code>/var/run/secrets/kubernetes.io/serviceaccount/namespace</code>. </p>
|
<p>I am running minikube/Kubernetes and am having difficulty accessing a volume from a volumeMount in a deployment. </p>
<p>I can confirm that when the microservice starts up, it is not able to access the /config directory (ie. the "mountPath" in the "volumeMounts"). I have verified that the hostPath/path is valid.<... | <p>In the interest of completeness, below is the solution that I found... I got the hostPath and mounts working on minikube (on Mac) which took a few steps but required several "minikube delete" commands to get the most current version and reset the environment. Below are some additional notes about how to get this fu... |
<p>I've been trying to start kubernetes-dashboard (and eventualy other services) on a NodePort outside the default port range with little success,
here is my setup:
Cloud provider: Azure (Not azure container service)
OS: CentOS 7</p>
<p>here is what I have tried:</p>
<h1>Update the host</h1>
<pre><code>$ yum update... | <p>You are specifying <code>--service-node-port-range=8880-8880</code> wrong. You set it to one port only, Set it to a range.</p>
<p>Second problem: You are setting the service to use 9090 and it's not in the range.</p>
<pre><code> ports:
- port: 80
targetPort: 9090
nodePort: 9090
</code></pre>
<p>API Serv... |
<p>This question pertains to the Kubernetes tutorial on Google's CodeLabs found here: <a href="https://codelabs.developers.google.com/codelabs/cloud-compute-kubernetes/index.html?index=..%2F..%2Fgcp-next#15" rel="nofollow noreferrer">https://codelabs.developers.google.com/codelabs/cloud-compute-kubernetes/index.html?in... | <p>As mentioned above pod can run more than one container, but in fact to make it simple running more than one container in a pod is an exception and definitely not the common use. you may look at a pod as a container++ that's the easy way to look at it. </p>
<p>If you starting with kubernetes I have wrote the blog be... |
<p>I set up a single-node Kubernetes cluster, using kubeadm, on Ubuntu 16.04 LTS with flannel.</p>
<p>Most of the time everything works well, but every couple of days, the cluster gets into a state where it can't schedule new pods - the pods are stuck in "Pending" state and When I <code>kubectl describe pod</code> of ... | <p>For now, this is the best workaround I've found:</p>
<p><a href="https://github.com/kubernetes/kubernetes/issues/34278#issuecomment-254686727" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/34278#issuecomment-254686727</a></p>
<p>I've set up a cron job to run this script on @reboot.</p>
... |
<p>Minikube is supposed to make it simple to run Kubernetes locally, not only for "getting started" but also for "day-to-day development workflows".</p>
<p>source : <a href="https://github.com/kubernetes/minikube/blob/master/ROADMAP.md#goals" rel="noreferrer">https://github.com/kubernetes/minikube/blob/master/ROADMAP... | <p>This is covered in <a href="https://kubernetes.io/docs/getting-started-guides/minikube/#persistent-volumes" rel="noreferrer">the documentation</a>. The relevant section starts right after the sentence that you've already quoted:</p>
<blockquote>
<p>However, Minikube is configured to persist files stored under the... |
<p>Lets say I have 3 containers X,Y and Z. I want container Y to start only after container X is running, and container Z to start only after Y is running.</p>
<p>How do I do this?</p>
| <p>You can use <a href="https://docs.docker.com/compose/overview" rel="nofollow noreferrer"><code>docker-compose</code></a> file with the <a href="https://docs.docker.com/compose/compose-file/#dependson" rel="nofollow noreferrer"><code>depends_on</code></a> option to control container start order</p>
<p>Here is how th... |
<p>I have a Kubernetes 1.5.3 cluster brought up on two nodes using kubeadm (details below). I've been trying to start up <a href="https://coreos.com/blog/the-prometheus-operator.html" rel="nofollow noreferrer">prometheus-operator</a> tonight. After I deleted a resource of kind=Prometheus, my cluster got in to a very st... | <p><code>
E0226 16:20:47.861762 1 pet_set.go:272] Error syncing StatefulSet default/prometheus-prometheus-k8s, requeuing: Failed to create prometheus-prometheus-k8s-db-prometheus-prometheus-k8s-0: PersistentVolumeClaim "prometheus-prometheus-k8s-db-prometheus-prometheus-k8s-0" is invalid: spec.resources[storage]:... |
<p>Is there anyway to filter on source-ip on the kubernetes ingress in GCE? I have tried the ingress.kubernetes.io/whitelist-source-range: but doesnt seems to be working in GCE.</p>
| <p>I guess You are trying to use this feature with GCE native controller instead NGINX? This works with NGINX only at the moment.</p>
<p>NGINX Controller configuration: <a href="https://github.com/kubernetes/ingress/blob/master/controllers/nginx/configuration.md" rel="nofollow noreferrer">https://github.com/kubernetes... |
<p>My Kubernetes cluster setup has n-tier web application running in dev and test environments on AWS. For the production environment, postgres RDS was chosen, to ensure periodic backup. While creating a postgres RDS instance, kubernetes-vpc was selected for db-subnet to keep networking stuff simple during pilot run.
A... | <p>This has to do with DNS resolving. When you use the RDS dns name INSIDE the same VPC it will be resolved to a private ip. When you use the same dns name on the internet or another VPC you will get the public ip of the RDS instance.</p>
<p>This is a problem because from another VPC you can not make use of the load b... |
<p>Lets say I have 3 containers X,Y and Z. I want container Y to start only after container X is running, and container Z to start only after Y is running.</p>
<p>How do I do this?</p>
| <p>You should consider to redesign your application parts if they have such heavy dependencies, then they should maybe not be split to different containers or you should use some decoupeling to avoid</p>
<p>What you could do is to:</p>
<ol>
<li>Have one ore more <a href="https://kubernetes.io/docs/concepts/abstractio... |
<p>I'm trying to configure kubernetes and in my project I've separeted UI and API.
I created one Pod and I exposed both as services.</p>
<p>How can I set API_URL inside pod.yaml configuration in order to send requests from user's browser?</p>
<p>I can't use localhost because the communication isn't between containers... | <p>The service IP is already available in a environment variable inside the pod, because Kubernetes initializes a set of environment variables for each service that exists at that moment.</p>
<p>To list all the environment variables of a pod</p>
<pre><code>kubectl exec <pod-name> env
</code></pre>
<p>If the po... |
<p>I've been trying to run a deployment using a private init container image with little success, I always get this error:</p>
<pre><code>Failed to pull image "private/app": Error: image private/app:latest not found
Error syncing pod, skipping: failed to "StartContainer" for "app" with ErrImagePull: "Error: image priv... | <p>You should using <code>secret</code> object.</p>
<p>something like this:</p>
<pre><code> kubectl create secret docker-registry myregistry \
--docker-server=https://example.io \
--docker-username=foo \
--docker-password=boosecret \
--docker-email=example@boo.com
</code></pre>
<p>And use it , in another ob... |
<p>Im trying to create a replication Controller based on an image that I created locally. But when I try to create the rc it gives error <code>ImagePullBackOff</code>. I have created a cluster locally using <code>minikube</code></p>
<p>Here is my <code>.yaml</code> file:</p>
<pre><code>apiVersion: v1
kind: Replicatio... | <p>So thanks to @BMW for helping me with the issue. The problem was that I was thinking since I created the cluster using <code>minikube</code> (locally) every image that I create in my local machine will be visible to minikube cluster. But an image is visible only when its present inside the node. Thats why every time... |
<p>my web application is running as a Kubernetes pod behind an nginx reverse proxy for SSL. Both the proxy and my application use Kubernetes services for load balancing (as described <a href="http://blog.kubernetes.io/2015/07/strong-simple-ssl-for-kubernetes.html">here</a>).</p>
<p>The problem is that all of my HTTP r... | <p>As of 1.5, if you are running in GCE (by extension GKE) or AWS, you simply need to add an annotation to your Service to make HTTP source preservation work.</p>
<pre><code>...
kind: Service
metadata:
annotations:
service.beta.kubernetes.io/external-traffic: OnlyLocal
...
</code></pre>
<p>It basically exposes ... |
<p>I want to store files in Kubernetes Secrets but I haven't found how to do it using a <code>yaml</code> file.</p>
<p>I've been able to make it using the cli with <code>kubectl</code>:</p>
<pre><code>kubectl create secret generic some-secret --from-file=secret1.txt=secrets/secret1.txt
</code></pre>
<p>But when I tr... | <p>As answered on previous post, we need to provide the certificate/key encoded as based64 to the file. </p>
<p>Here is generic example for a certiticate (in this case SSL):</p>
<p>The <code>secret.yml.tmpl</code>:</p>
<pre><code> apiVersion: v1
kind: Secret
metadata:
name: test-secret
... |
<p>I'm running a number of python apps as Replica Sets inside of kubernetes on Google Container Engine (gke). Along side them I've created the Datadog DaemonSet which launches a dd-agent on each node in my cluster.</p>
<p>Now I would like to use that agents dogstatsd for metrics logging from python apps as well as try... | <p>So, while trying to debug this I deleted the deployment + dameonset and service and recreated it. Afterwards it worked....</p>
|
<p>I am following the Kubernetes guide here: <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-ram-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-ram-container/</a></p>
<p>When I run this command:</p>
<p><code>kubectl create -f http... | <p>You're trying to schedule a <a href="https://kubernetes.io/docs/user-guide/pods/" rel="nofollow noreferrer"><code>Pod</code></a> in a cluster which does not exist. Prior to creating resources you need to provision the underlying cluster.</p>
<p>I kindly suggest you read the documentation at <a href="https://k8s.io"... |
<p>I have a service exposed of type=LoadBalancer and when I do a</p>
<p><code>kubectl describe services servicename</code>,</p>
<p>I get this output :</p>
<pre><code>Name: ser1
Namespace: default
Labels: app=online1
Selector: app=online1
Type: LoadBalancer
IP: 10.0.0.32
Ex... | <p><strong>Port unset</strong> means: You didn't specify a name in service creation.</p>
<p>Service Yaml excerpt (note <code>name: grpc</code>):</p>
<pre><code>spec:
ports:
- port: 26257
targetPort: 26257
name: grpc
type: NodePort
</code></pre>
<p><code>kubectl describe services servicename</code> outp... |
<p>I'm defining this autoscaler with kubernetes and GCE and I'm wondering what exactly should I specify for <code>targetCPUUtilizationPercentage</code>. That target points to what exactly? Is it the total CPU in my cluster? When the pods referenced in this autoscaler consume more than <code>targetCPUUtilizationPercenta... | <p>The CPU utilization is the average CPU usage of a all pods in a deployment across the last minute divided by the requested CPU of this deployment. If the mean of the pods' CPU utilization is higher than the target you defined, then your replicas will be adjusted accordingly.</p>
<p>You can read more about this topic... |
<p>I'm running multiple web pods for the same application and I have this folder in my application where clients can upload their files.
the folder is sitting in this directory(if my war file name is sample.war) /usr/local/tomcat/webapps/sample/uploadfiles and I want it to be shared between all the web pods,
in case t... | <p>Sharing the same writeable volume between different pods is not something that is supported by all volume types. Have a read of the <a href="https://kubernetes.io/docs/user-guide/persistent-volumes/" rel="nofollow noreferrer">Persistent Volumes manual</a> and look for volume types that support <code>ReadWriteMany</c... |
<p>I deploy a kubernetes cluster following the guide: <a href="https://blog.hypriot.com/post/setup-kubernetes-raspberry-pi-cluster/" rel="nofollow noreferrer">https://blog.hypriot.com/post/setup-kubernetes-raspberry-pi-cluster/</a>. It basically uses hypriotOS and kubernetes from the debian repository.</p>
<p>After th... | <p>It turn out that the answer was in one of the <a href="https://blog.hypriot.com/post/setup-kubernetes-raspberry-pi-cluster/#comment-3142210207" rel="nofollow noreferrer">comments</a> from , but it was not clear that this was my issue.</p>
<p>As the author of the comment stated is due to the iptables policies from D... |
<p>I'm wondering how people are deploying a production-caliber Kubernetes cluster in AWS and, more importantly, how they chose their approach.</p>
<p>The <a href="https://kubernetes.io/docs/getting-started-guides/aws/#supported-production-grade-tools-with-high-availability-options" rel="nofollow noreferrer">k8s docume... | <p>I'd say pick anything which fit's your needs (see also <a href="https://kubernetes.io/docs/getting-started-guides/#table-of-solutions" rel="nofollow noreferrer">Picking the right solution</a>)...</p>
<p>Which could be:</p>
<ul>
<li>Speed of the cluster setup</li>
<li>Integration in your existing toolchain
<ul>
<l... |
<p>After deploying the kubernetes cluster using kargo, I found out that kubedns pod is not working properly:</p>
<pre><code>$ kcsys get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
dnsmasq-alv8k 1/1 Running 2 1d 10.233.86.2 kubemaster
dnsmasq-c9y52 1/1 Runni... | <p>According to the error you posted, <code>kubedns</code> can not communicate with the API server:</p>
<pre><code>dial tcp 10.233.0.1:443: i/o timeout
</code></pre>
<p>This can mean three things:</p>
<hr>
<p><strong>Your network fabric for containers is not configured properly</strong></p>
<ul>
<li>Look for error... |
<p>I have several docker images that I want to use with <code>minikube</code>. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?</p>
<p>Stuff I tried:
<br>1. I tried running these commands (separately, deleting the instances of miniku... | <p>As the <a href="https://minikube.sigs.k8s.io/docs/handbook/pushing/#1-pushing-directly-to-the-in-cluster-docker-daemon-docker-env" rel="noreferrer">handbook</a> describes, you can reuse the Docker daemon from Minikube with <code>eval $(minikube docker-env)</code>.</p>
<p>So to use an image without uploading it, you ... |
<p>I have a YAML file that I use to create a Deployment in Kubernetes which includes:</p>
<pre><code> volumeMounts:
- name: git-volume
mountPath: /code
volumes:
- name: git-volume
gitRepo:
repository: "git@bitbucket.org:organization/bot.git"
revision: "b686122a44aa271117b602e4eba4cc02f... | <p>Solution is to switch to HTTPS instead of SSH (available in the dropdown in the top-right section of Bitbucket).</p>
<p>Ie: </p>
<p><a href="https://organization@bitbucket.org/organization/bot.git" rel="nofollow noreferrer">https://organization@bitbucket.org/organization/bot.git</a></p>
|
<p>We have a docker image. And am trying to deploy it using kubernetes. My doubt is can I deploy a pod with a single container but not run any process in the container while the container comes up? But run it after it starts. That is, after the container starts, go into the bash of the container, and run the process(le... | <p>What you're trying to do sounds like an antipattern anyways you can do with with the sleep process e.g. like this:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
name: app
spec:
containers:
- name: app-container
image: app-image:version
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.