prompt stringlengths 65 38.7k | response stringlengths 41 29.1k |
|---|---|
<p>I want to implement a simple Layer 7 Load Balancer in my kubernetes cluster which will allow me to expose kubernetes services to external consumers.</p>
<p>I will create a simple ha-proxy based container which will observe kubernetes services and respective endpoints and reload its backend/frontend configuration (c... | <p>I think a nginx IngressController can work better in this case.
You only have to set the backend service and the hostname inside the ingress definition.</p>
<p>Take a look here:
<a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx" rel="nofollow">https://github.com/kubernetes/contrib... |
<p>When creating a service of type <a href="http://kubernetes.io/docs/user-guide/services/#type-loadbalancer" rel="nofollow">LoadBalancer</a> on AWS, Kubernetes auto-provisions an elastic load balancer. I am wondering how I can automatically associate that load balancer with a Route 53 alias?</p>
<p>Alternatively, can... | <p>There is a project that accomplishes this: <a href="https://github.com/wearemolecule/route53-kubernetes" rel="nofollow">https://github.com/wearemolecule/route53-kubernetes</a></p>
<p>A side note here, there are some issues with being able to select the TLD that this uses, it seems to use the first matching public r... |
<p>I am running a kubernetes cluster on google cloud(version 1.3.5) .
I found a <a href="https://github.com/kubernetes/contrib/tree/master/pets" rel="nofollow">redis.yaml</a>
that uses petset to create a redis cluster but when i run kubectl create -f redis.yaml i get the following error :
error validating "redis.yaml"... | <p>PetSet is currently an alpha feature (which you can tell because the <code>apiVersion</code> in the linked yaml file is <code>apps/v1alpha1</code>). It may not be obvious, but alpha features are not supported in Google Container Engine. </p>
<p>As described in <a href="https://github.com/kubernetes/kubernetes/blob/... |
<p>I'm trying to create two kubernetes services, one which is a loadbalancer with a cluster IP, and another which is a headless (no cluster IP), but instead returns an A record round robin collection of the pod ip addresses (as it should do, according to <a href="http://kubernetes.io/docs/user-guide/services/#headless-... | <p>It seems like there is no pod matching these labels within your cluster, therefore the DNS query doesn't return anything. This is expected.</p>
<p>Start the corresponding pods and you should see a list of A records.</p>
<p>Please be aware that these A records are not shuffled as far as I know, so your clients are ... |
<p>I work in a company where almost all private ipv4 space is already used, so using 10.254.0.0/16 for service address space is a non-starter. I have carved out a /64 of ipv6 space that I can use, but I can't seem to make it work.</p>
<p>Here's my apiserver config:</p>
<pre><code># The address on the local server to... | <p><a href="https://github.com/kubernetes/kubernetes/issues/1443" rel="nofollow noreferrer">I don't think IPv6 is fully supported</a>. I don't think there is a strong motivation among the developers of the project to add IPv6 support, because the largest group of contributors is <a href="http://stackalytics.com/?projec... |
<p>I've been trying to figure out what happens when the Kubernetes master fails in a cluster that only has one master. Do web requests still get routed to pods if this happens, or does the entire system just shut down?</p>
<p>According to the OpenShift 3 documentation, which is built on top of Kubernetes, (<a href="ht... | <p>In typical setups, the master nodes run both the API and etcd and are either largely or fully responsible for managing the underlying cloud infrastructure. When they are offline or degraded, the API will be offline or degraded.</p>
<p>In the event that they, etcd, or the API are fully offline, the cluster ceases to ... |
<p>I am a bit confused on when to a build environment variable vs a runtime environment variable in OpenShift Enterprise. Would someone please help me understand and provide example use cases for each?</p>
| <p>An environment variable that might only be needed at build time is one such as to setup use of a proxy so that when building, external package repositories can be accessed, allowing dependencies to be pulled down. At runtime you probably wouldn't need that and since it may have account/password information in it, yo... |
<p>I've successfully deployed a Kubernetes 1.3.5 cluster on 1 master + 6 nodes (all running CentOS) including the DNS and Kubernetes Dashboard addons. Everything seemed to be working OK at first. However, when I tried to run</p>
<pre><code>kubectl proxy --address=<master-external-ip> --port=9090 --disable-filter... | <p>Yes, it should, otherwise packets going through the API server proxy can not be routed to their final destination: the dashboard pod running on some other machine.</p>
|
<p>I'm building a 3 VM (CentOS 7) cluster of Kubernetes 1.3.2.
According to this kubernetes documentation page <a href="http://kubernetes.io/docs/admin/networking/" rel="nofollow">Networking in Kubernetes</a>: “We give every pod its own IP address” and by that there is no port collision when few pods use the same ports... | <p>The issue occured becuase following <a href="https://docs.docker.com/engine/admin/systemd/" rel="nofollow">docker documentation</a> I had added additional docker config in <em>/etc/systemd/system/docker.service.d/docker.conf</em> that overrides the config in <em>/usr/lib/systemd/system/docker.service</em>. Unfortuna... |
<p>Ok, So I am defiantly not a security expert and battling with this for a few days now, </p>
<p>I am using the Coreos <code>kube-aws</code> cloud-formation template maker, and i want to deploy my cluster to production but because of this little comment:</p>
<blockquote>
<p>PRODUCTION NOTE: the TLS keys and certif... | <p>I was able to get it to work with this <code>worker-openssl.conf</code> using the <strong>the same certificate</strong> for all workers. Probably not the most secure setup.</p>
<pre><code>[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[req_distinguished_name]
[ v3_req ]
basicConstraints =... |
<p>I have posted this problem from <a href="https://github.com/kubernetes/kubernetes/issues/4825#issuecomment-153567540" rel="noreferrer">here</a></p>
<p>I am running sharded mongodb in a kubernetes environment, with 3 shards, and 3 instances on each shard. for some reasons, my mongodb instance have been rescheduled t... | <p>For those who want to use the old way of setting up mongo (using ReplicationControllers or Deployments instead of PetSet), the problem seems to be in the hostname assignment delay of kubernetes Services. The solution is to add a 10 seconds delay in the container entrypoint (before starting the actual mongo):</p>
<p... |
<p>When I deploy each app using kubernetes/cluster/kube-up.sh over aws I set context using :</p>
<pre><code>CONTEXT=$(kubectl config view | grep current-context | awk '{print $2}')
kubectl config set-context $CONTEXT --namespace=${PROJECT_ID}
</code></pre>
<p>I do this for multiple apps and each deploys fine. Howev... | <p>To switch between contexts use <code>use-context</code>:</p>
<pre><code>kubectl config use-context gke_primacyofdirectexperience_us-east1-b_loudhttpscluster
</code></pre>
<p>Any kubectl commands applied now will be applied to that cluster (using the <code>primacyofdirectexperience</code> namespace, since you set t... |
<p>I'm trying to spin up a new pod that doesn't automatically include a JWT for talking to the k8s cluster.</p>
<p>I've created a new Service Account and tried removing the built in secret, but it is automatically regenerated after each delete.</p>
<p>According to the <a href="http://kubernetes.io/docs/user-guide/sec... | <p>removing the <code>--service-account-private-key-file</code> argument from the controller manager will prevent auto-creation of tokens</p>
<p>removing the ServiceAccount admission plugin will prevent auto-mounting of tokens</p>
<p>however, many services are likely to depend on those tokens being present.</p>
<p>i... |
<p>I setup k8s by <a href="https://github.com/kubernetes/kube-deploy/tree/master/docker-multinode" rel="nofollow">docker-multinode</a></p>
<pre><code>$ https_proxy=http://10.25.30.127:7777 IP_ADDRESS=10.25.24.116 MASTER_IP=10.25.30.127 ./worker.sh
+++ [0828 15:38:35] K8S_VERSION is set to: v1.3.6
+++ [0828 15:38:35] E... | <p>This problem is caused by the ip conflict, provider use 10 as internal network, docker-multinode use 10/8 as default cluster ip range, then something got wired.</p>
<p>This is what I done</p>
<ul>
<li>Copy /etc/kubernetes outside the container</li>
<li>Replace <code>10.0.0.1</code> to <code>172.16.0.1</code> in <c... |
<p>i have a rather recent kubernetes cluster running on GCE. I am trying to get my application to log to Cloud Logging / Stackdriver.</p>
<p>I can see all the kubernetes cluster logs there but no container output ever materializes.</p>
<p>So when I follow this guide: <a href="http://kubernetes.io/docs/getting-started... | <p>Bit of a long shot, but have you enabled the logging API?</p>
<p>"You can do so from the Developers Console, <a href="https://console.developers.google.com/apis/api/logging/overview" rel="noreferrer">here</a>. Try going there, clicking the Enable API button, and seeing whether the errors keep coming."</p>
<p><a hr... |
<p>I'm running a service written in go in a pod in Kubernetes. The service doesn't expose an HTTP interface; it's processing work from a queue.</p>
<p>I could:</p>
<ul>
<li>Use an executable liveness check to see if the process is running</li>
<li>Expose an HTTP health check endpoint</li>
<li>Use expvars to expose ba... | <p>In general I recommend the HTTP mechanism because it is SO easy to add in Go. If you already have an <code>exec</code>able command that will return a useful status, go for it. Or you might consider <a href="https://github.com/kubernetes/contrib/tree/master/exec-healthz" rel="nofollow">https://github.com/kubernetes... |
<p>I have put together a simple cluster with several deploys that interact nicely, dns works, etc. However, as I'm using Deployments, and I have a few questions that I could not find answered in the docs.</p>
<ul>
<li><p>How do I non-destructively update a deployment with a new copy of the deploy file? I've got edit a... | <blockquote>
<p>How do I non-destructively update a deployment</p>
</blockquote>
<p>You can use <code>kubectl replace</code> or <code>kubectl apply</code>. Replace is a full replacement. Apply tries to do a selective patch operation.</p>
<blockquote>
<p>What's the preferred way of exposing a deployment as a ser... |
<p>I have a GCE Container Cluster composed of 3 nodes. On every node I run a POD like that one:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: test-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: none
track: stable
spec:
containers... | <p>A <code>PersistentVolumeClaim</code> reserves a specific instance of storage that satisfies its request. Using that same <code>PersistentVolumeClaim</code> in multiple <code>Pods</code> will attempt to use the same bound <code>PersistentVolume</code> in each of the <code>Pods</code>, which will not be possible in th... |
<p>I have exposed a service on an external port on all nodes in a kubernetes
cluster from:</p>
<p><code>kubectl create -f nginx-service.yaml</code></p>
<p>You have exposed your service on an external port on all nodes in your
cluster. If you want to expose this service to the external internet, you may
need to set u... | <p><code>kubectl get svc --all-namespaces -o go-template='{{range .items}}{{range.spec.ports}}{{if .nodePort}}{{.nodePort}}{{"\n"}}{{end}}{{end}}{{end}}'</code></p>
<p>This gets all services in all namespaces, and does basically: "for each service, for each port, if nodePort is defined, print nodePort".</p>
|
<p>I want to experiment with PetSet on GKE.
I have a 1.3.5 Kubernetes cluster on GKE, but PetSet does not seem to be activated.</p>
<pre><code> > kubectl get petset
Unable to list "petsets": the server could not find the requested resource
</code></pre>
<p>Do I need to activate v1alpha1 feature on GKE ?</p>
| <p>I'm using <code>PetSet</code> in zone <code>europe-west1-d</code> but got the error you're seeing when I tried in zone <code>europe-west1-c</code>.</p>
<p>Update:</p>
<p>Today, September 1, I got an email from Google Cloud Platform announcing that PetSet was "accidentally enabled" and will be disabled on September... |
<p>I followed the load balancer tutorial: <a href="https://cloud.google.com/container-engine/docs/tutorials/http-balancer" rel="noreferrer">https://cloud.google.com/container-engine/docs/tutorials/http-balancer</a> which is working fine when I use the Nginx image, when I try and use my own application image though the... | <p>You need to add a readinessProbe (just copy your livenessProbe).</p>
<p>It's explained in the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="noreferrer">GCE L7 Ingress Docs</a>.</p>
<blockquote>
<p>Health checks</p>
<p>Currently, all service backends must satisfy either of the follow... |
<p>I have been using kubernetes for a while now.</p>
<pre><code>$ kubectl version
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0+2831379", GitCommit:"283137936a
498aed572ee22af6774b6fb6e9fd94", GitTreeState:"not ... | <p>I don't think keeping all resources inside one single manifest helps you with what you want to achieve, since your Service, Ingress and ReplicationController are not likely to change simultaneously.</p>
<p>If all you want to do is roll out new pods, I would recommend you to replace your ReplicationController with a... |
<p><strong>Question</strong>: How can I provide reliable access from (non-K8s) services running in an GCE network to other services running inside Kubernetes?</p>
<p><strong>Background</strong>: We are running a <strong>hosted K8s</strong> setup in the <strong>Google Cloud Platform</strong>. Most services are <strong>... | <p>You can make cluster service IPs meaningful outside of the cluster (but inside the private network) either by creating a "bastion route" or by running kube-proxy on the machine you are connecting from (see <a href="https://stackoverflow.com/questions/31664060/how-to-call-a-service-exposed-by-a-kubernetes-cluster-fro... |
<p>I'm trying to use kubectl locally after creating a cluster via the cloud console but I keep getting an error. Below are the steps I took:</p>
<p>Via Cloud Console</p>
<blockquote>
<p>gcloud containers cluster create test</p>
</blockquote>
<p>Locally</p>
<blockquote>
<p>gcloud container clusters get-credentials test<... | <p>Run again with --v=8 to see a trace of all the network calls</p>
|
<p>Question is similar to following SO question. But I am not looking forward to create classic load balancer. </p>
<p><a href="https://stackoverflow.com/questions/31611503/how-to-create-kubernetes-load-balancer-on-aws">How to create Kubernetes load balancer on aws</a> </p>
<p>AWS now provide 2 types of loadbalancer... | <p>I can tell you that as of K8 v1.2.3/4 there is no built-in support for Application Load Balancers. </p>
<p>That said, what I do is expose internally load balanced pods via a service NodePort. You can then implement any type of AWS load balancing you would like, including new Application Load Balancing features such... |
<p>With the rise of containers, Kuberenetes, 12 Factor etc, it has become easier to replicate an identical environment across dev, staging and production. However, what there appears to be no common standard to domain name conventions.</p>
<p>As far as I can see it, there are two ways of doing it:</p>
<ul>
<li>Use su... | <blockquote>
<p>There are only two hard things in Computer Science: cache invalidation
and naming things.</p>
<p>-- Phil Karlton</p>
</blockquote>
<p>Depends on the company size.</p>
<p>Small businesses usually go for dashes and get the wildcard certificate.
So they would have <code>dev.example.com, test.exa... |
<p>I have configure kubelet to run properly for some days. However, currently, i want to add some image gc parameters to kubelet. I am now curiously about whether i can just add the command parameters and restart kubelet. </p>
<p>Any thing i should take care before of after doing this?</p>
| <p>It should be completely safe to bring Kubelet down for a short while. If it is down too long (40 seconds, I think), the master might detect the node as dead, though :)</p>
|
<p>We wrote some Go code to talk to our Kubernetes cluster and fetch the IP of a Service exposed. We do it like so:</p>
<pre><code>(import "gopkg.in/kubernetes/kubernetes.v1/pkg/client/restclient")
(import kubectl "gopkg.in/kubernetes/kubernetes.v1/pkg/client/unversioned")
svc, err := c.Services(k8sNS).Get(svcName)
... | <p>It looks like a package you imported has changed.</p>
<p>You can update existing repositories:</p>
<pre><code>go get -u
</code></pre>
<blockquote>
<p>The -u flag instructs get to use the network to update the named
packages and their dependencies. By default, get uses the network to
check out missing packa... |
<p>Dependency failed for Docker Application Container Engine. May 20 13:06:52 localhost systemd[1]: docker.service: Job docker.service/start failed with result 'dependency' when I do a systemctl status docker.</p>
<p>Using the CoreOS install documentation, Kubelet(master) all on same node.</p>
<p>Where would I start ... | <p>I know it's a little late, but I think you need to ensure <code>flanneld.service</code> service is running. If you're following the CoreOS step-by-step documentation for building a Kubernetes cluster with CoreOS, then flanneld is a dependency for the docker engine.</p>
<p>If you made a systemd drop-in replacement i... |
<p>first of all any help is appreciated</p>
<p>I want execute a command in a container and I execute:</p>
<pre><code>kubectl exec -ti busybox bash
</code></pre>
<p>but if I input about 70 characters in bash and then I get truncated output and line broken anyway lead to unreadable.</p>
<p>is there a way to increase... | <p>This will be supported in the upcoming Kubernetes 1.4 release (if you're interested, see its <a href="https://github.com/kubernetes/kubernetes/pull/25273" rel="nofollow">fix</a>). </p>
|
<p>My kubernetes pods are all able to resolve hostnames and ping servers that are on the wider Internet, but they can't do either for our VMs running in the same zone & region on Google Compute Engine.</p>
<p>How does one tell kubernetes / docker to allow outbound traffic to the Google Compute Engine environment (... | <p>Very silly mistake on my part. </p>
<p>Our Google Container Cluster was configured to use a custom network in the Google Developer Console, while our Google Compute Engine VMs were all configured to use the default network. </p>
<p>That explains that. Make sure the machines are all on the same network and then eve... |
<p>I've set up a Kubernetes cluster on Ubuntu (trusty) based on the <a href="http://kubernetes.io/docs/getting-started-guides/docker/" rel="nofollow">Running Kubernetes Locally via Docker</a> guide, deployed a DNS and run Heapster with an InfluxDB backend and a Grafana UI.</p>
<p>Everything seems to run smoothly excep... | <p>Heapster has got the list of nodes from Kubernetes and is now trying to pull stats from the kublete process on each node (which has a built in cAdvisor collecting stats on the node). In this case there's only one node and it's known by 127.0.0.1 to kubernetes. And there's the problem. The Heapster container is tryin... |
<p>I've gone through the steps to create a persistent disk in google compute engine and attach it to a running VM instance. I've also created a docker image with a VOLUME directive. It runs fine locally, in the docker run command, i can pass a -v option to mount a host directory as the volume. I thought there would be ... | <p>In your pod spec, you may specify a Kubernetes <a href="http://kubernetes.io/docs/user-guide/volumes/#gcepersistentdisk" rel="nofollow"><code>gcePersistentDisk</code></a> volume (the <code>spec.volumes</code> field) and where to mount that volume into containers (the <code>spec.containers.volumeMounts</code> field).... |
<p>I've set up prometheus to monitor kubernetes metrics by following the prometheus <a href="https://github.com/prometheus/docs/blob/master/content/docs/operating/configuration.md" rel="noreferrer">documentation</a>.</p>
<p>A lot of useful metrics now show up in prometheus.</p>
<p>However, I can't see any metrics re... | <p>The regular kubernetes setup does not expose these metrics - further discussion <a href="https://github.com/kubernetes/kubernetes/pull/31107#discussion_r75673822" rel="noreferrer">here</a>. </p>
<p>However, another service can be used to collect these cluster level metrics: <a href="https://github.com/kubernetes/ku... |
<p>If I do <code>kubectl get deployments</code>, I get:</p>
<pre><code>$ kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
analytics-rethinkdb 1 1 1 1 18h
frontend 1 1 1 1 6h
queue ... | <p>Object names are immutable in Kubernetes. If you want to change a name, you can export/edit/recreate with a different name</p>
|
<p>in a kubernetes Deployment yaml file is there a simple way to run multiple commands in the postStart hook of a container?</p>
<p>I'm trying to do something like this:</p>
<pre><code>lifecycle:
postStart:
exec:
command: ["/bin/cp", "/webapps/myapp.war", "/apps/"]
command: ["/bin/mkdir", "-p", "/co... | <p>Only one <code>command</code> allowed, but you can use <code>sh -c</code> like this</p>
<pre><code> lifecycle:
postStart:
exec:
command:
- "sh"
- "-c"
- >
if [ -s /var/www/mybb/inc/config.php ]; then
rm -rf /var/www/mybb/install;
... |
<p>As per documentation to enable cluster metrics, I should create re-encrypting route as per the below statement</p>
<pre><code>$ oc create route reencrypt hawkular-metrics-reencrypt \
--hostname hawkular-metrics.example.com \
--key /path/to/key \
--cert /path/to/cert \
--ca-cert /path/to/ca.crt \
--service hawk... | <p>Openshift Metrics developer here.</p>
<p>Sorry if the docs were not clear enough.</p>
<p>The route is used to expose Hawkular Metrics, particularly to the browser running the OpenShift console.</p>
<p>If you don't specify any certificates, the system will use a self signed certificate instead. The browser will co... |
<p>I have a Kubernetes pod running on Google Container Engine. It has been running for several days, writing to the log, without any restarts.</p>
<p>Why is the command <code>kubectl logs</code> only showing log rows from today?</p>
<p>Where does this limitation come from and is it based on time or number of log rows... | <p>Logrotate is enabled by default on container engine VMs. You should be able to check conf at below location for docker container logs.</p>
<pre><code>cat /etc/logrotate.d/docker-containers
</code></pre>
<p>So when you run <code>kubectl logs</code>, it streams you from current log file. Past logs are already gzippe... |
<pre><code>kubectl logs <pod-id>
</code></pre>
<p>gets latest logs from my deployment - I am working on a bug and interested to know the logs at runtime - How can I get continuous stream of logs ?</p>
<p>edit: corrected question at the end.</p>
| <pre><code>kubectl logs -f <pod-id>
</code></pre>
<p>You can use the <code>-f</code> flag:</p>
<p><code>-f, --follow=false: Specify if the logs should be streamed.</code></p>
<p><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs" rel="noreferrer">https://kubernetes.io/docs/refer... |
<p>I have setup a Kubernetes cluster (on GKE). Running multiple services but mainly serving a webapp through a stock Ingress controller.</p>
<p>Are there any benefits to running a reverse proxy behind the Ingress? The TLS is terminated at this point, so it's not for that. Maybe for some server hardening?</p>
| <p>The only advantage of chaining GKE ingress and Nginx is ability to use more advanced configuration provided by Nginx.</p>
<p>Currently there are benefits of running your own reverse proxy skipping ingress. Or to use <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx" rel="nofollow"... |
<p>I try to create an autoscaled container cluster on GKE.
When I use the "--enable-autoscaling" option (like the documentation indicates here : <a href="https://cloud.google.com/container-engine/docs/clusters/operations#create_a_cluster_with_autoscaling" rel="nofollow">https://cloud.google.com/container-engine/docs/cl... | <p>Kubernetes cluster autoscaling does not use the Managed Instance Group autoscaler. It runs a <code>cluster-autoscaler</code> controller on the Kubernetes master that uses Kubernetes-specific signals to scale your nodes. <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="nofollow n... |
<p>I’m running into the issues while creating the container, I’m using ubuntu 16.04 OS, docker 1.12.1, flannel 0.5.5, and etcd datastore.</p>
<pre><code>sudo systemctl status kubelet.service
● kubelet.service - Kubernetes Kubelet Server
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabl... | <p>HostConfig is deprecated in docker v1.12. Kubernetes <a href="https://github.com/kubernetes/kubernetes/pull/20615" rel="nofollow">made a corresponding switch</a> to deprecate HostConfig in v1.2, so you will need a newer version (v1.2+) kubernetes to work with docker v1.12.</p>
<p>Another caveat is that only the com... |
<p>I'm hosting on google container engine. Recently one of my team mates left the company and I want to revoke his access rights to the cluster. I removed his account from the compute engine project already, yet he can still access the cluster.</p>
<p>He got access through <code>gcloud container clusters get-credentia... | <p>When using the per-cluster certificate, there is currently no way to revoke/rotate certificates (see <a href="https://github.com/kubernetes/kubernetes/issues/4672" rel="nofollow">Issue #4672</a>). The only way to completely revoke access is to delete and recreate the cluster.</p>
<p>If you instead use Google OAuth2... |
<p>Suppose I want to create a k8s cluster on bare metal servers, with 1 master and 2 nodes. What ports do I have to open in my firewall so that the master and nodes can communicate over the Internet? (I know I can just use VPN, but I just want to know which ports I need). I guess I need at least the following ports. Do... | <p>the ports for kubernetes are the following:</p>
<p><a href="https://i.stack.imgur.com/GY4ae.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GY4ae.png" alt="enter image description here"></a></p>
<p>from the CoreOS <a href="https://coreos.com/kubernetes/docs/latest/kubernetes-networking.html" rel="norefer... |
<p>I've set up a kubernetes cluster with three masters. The kube-apiserver should be stateless. To properly access them from the worker nodes, I've configured an haproxy which is configured to provide the ports (8080) of the apiserver.</p>
<pre><code>frontend http_front_8080
bind *:8080
stats uri /haproxy?stat... | <p>I had the same issue as you. I assume the watch requires some sort of state on the api server side.
The solution is to change the configuration so all the requests from a client go to the same server using balance source. I assume you only have multiple api servers so kubernetes is highly available (instead of load ... |
<p>I need to let the container to run 5 minutes after the <code>kubectl</code> ' termination. It needs to do some work before it's destroyed. It seems that kubernetes contains exactly what I need:</p>
<pre><code>terminationGracePeriodSeconds: 300
</code></pre>
<p>so I defined it within my yaml. I've updated running <... | <p>You can use the <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" rel="nofollow noreferrer">container lifecycle hook</a> <code>preStop</code> to have your pod sleep before terminating. This hook will be executed prior to <code>kubectl</code> sending <code>SIGTERM</co... |
<p>This is the way I understand the flow in question:</p>
<ol>
<li>When requesting a kubernetes service (via http for example) I am using port 80.</li>
<li>The request is forwarded to a pod (still on port 80)</li>
<li>The port forwards the request to the (docker) container that exposes port 80</li>
<li>The container h... | <p>I found that I needed to add some arguments to my second command:</p>
<pre><code>kubectl expose deployment test-app --type="LoadBalancer" --target-port=3000 --port=80
</code></pre>
<p>This creates a service which directs incoming http traffic (on port 80) to its pods on port 3000.</p>
<p>A nicer way to do this wh... |
<p>Here is my deploment template:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
name: XXX
version: {{ xxx-version }}
deploy_time: "{{ xxx-time }}"
name: XXX
spec:
replicas: 1
revisionHistoryLimit : 0
strategy:
type : "RollingUpdate"
rollingUpdate:
... | <p>The key section in the documentation that's relevant to this issues is:</p>
<blockquote>
<p>Existing Replica Set controlling Pods whose labels match <code>.spec.selector</code>but whose template does not match <code>.spec.template</code> are scaled down. Eventually, the new Replica Set will be scaled to <code>.sp... |
<p>I have installed minikube and started up its built in Kubernertes cluster</p>
<pre><code>$ minikube start
Starting local Kubernetes cluster...
Kubernetes is available at https://192.168.99.100:443.
Kubectl is now configured to use the cluster.
</code></pre>
<p>I also have kubectl installed</p>
<pre><code>$ kubect... | <p>To get it running behind the a proxy you need to setup things a bit differently from the documentation.
a. You need to ensure that the docker daemon running with the VM can reach out to the internet via the proxy.
b. You need to ensure kubectl running on the host can get to the VM without going out through the prox... |
<p>on GKE I created some pods and a headless service. The headless service has a selector and I am expecting the endpoint to get the IP of the Pod that matches the selector.</p>
<p>However the endpoint remains empty</p>
<pre><code>$ kubectl get pods -lservice=front-end
NAME READY STATUS ... | <p>if <code>ports</code> is set to <code>null</code> the endpoint will not get populated.</p>
<p>You need to add a port (even a dummy one) for the endpoint to get populated with the PodIPs of the Pods that match the selector.</p>
<p><code>
ports:
- port: 1234
protocol: TCP
targetPort: 1234
</code></p>
|
<p>Created a 2 node Kubernetes cluster as:</p>
<pre><code>KUBERNETES_PROVIDER=aws NUM_NODES=2 kube-up.sh
</code></pre>
<p>This shows the output as:</p>
<pre><code>Found 2 node(s).
NAME STATUS AGE
ip-172-20-0-226.us-west-2.compute.internal Ready 57s
ip-172-20-0-227.us-... | <p>Here is the exact command that worked for me:</p>
<pre><code>ssh -i ~/.ssh/kube_aws_rsa admin@<masterip>
</code></pre>
<p><code>kube_aws_rsa</code> is the default key generated, otherwise controlled with <code>AWS_SSH_KEY</code> environment variable. For AWS, it is specified in the file <code>cluster/aws/con... |
<p>There's a similar question <a href="https://stackoverflow.com/questions/37559704/kubectl-yaml-config-file-equivalent-of-kubectl-run-i-tty">here</a>, but I think I want different thing.
For those who familiar with docker-compose, there's a brilliant command which runs command in container just once, this insanely hel... | <p>Edit:</p>
<p>Kubernetes also got <code>init containers</code> as a beta feature (as of now) - <a href="http://kubernetes.io/docs/user-guide/production-pods/#handling-initialization" rel="nofollow">http://kubernetes.io/docs/user-guide/production-pods/#handling-initialization</a></p>
<hr>
<p>You should probably lev... |
<p>I'm trying to configure the spinnaker to deploy applications in kubernetes environment. </p>
<p>I followed a <a href="http://www.spinnaker.io/docs/kubernetes-source-to-prod" rel="nofollow">documentation</a>,
at <a href="http://www.spinnaker.io/docs/kubernetes-source-to-prod#section-3-create-a-demo-server-group" re... | <p>In <code>/opt/spinnaker/config/clouddriver-local.yml</code> you likely need to change the <code>dockerRegistry.accounts[0].address</code> field to <code>https://index.docker.io</code>, since DockerHub's registry isn't hosted on <code>hub.docker.com</code>, but on <code>index.docker.io</code>.</p>
|
<p>According to Kubernetes API docs it is possible to create/list/delete pods, replication controllers and services:</p>
<p><a href="http://kubernetes.io/third_party/swagger-ui/#!/v1beta1" rel="noreferrer">http://kubernetes.io/third_party/swagger-ui/#!/v1beta1</a></p>
<p>However in the Google Container Engine documen... | <p>I created a <a href="http://blog.ctaggart.com/2016/09/accessing-kubernetes-api-on-google.html" rel="nofollow">blog post</a> just for this topic. It includes a video walkthrough of the code and demo. Essentially, you can get the Kubernetes credentials from the Google Container Engine API. Here is how to do it in gola... |
<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>the log you provided is not enough.
you can see all the detaile log in by use </p>
<pre><code>tail -n 1000 /var/log/messages
</code></pre>
<p>In my case , I stop the kube-apiserver service first and then start it ,and to search in the /var/log/messages.And got my error is a file is removed because I restart the ma... |
<p>I am looking for best option in handling DEV, TEST, CERT and PROD environments in Kubernetes.</p>
| <p>You can use namespaces in Kubernetes. Create one namespace per environment.</p>
<p><a href="http://kubernetes.io/docs/user-guide/namespaces/" rel="nofollow">http://kubernetes.io/docs/user-guide/namespaces/</a></p>
<p>Once things get more involved, you can may be move to one cluster per environment, or something li... |
<p>If i create a secret from an id_rsa file using kubectl as:</p>
<pre><code>kubectl create secret generic hcom-secret --from-file=ssh-privatekey=./.ssh/id_rsa
</code></pre>
<p>And then mount the secret into the container</p>
<pre><code>"volumeMounts": [
{"name": "cfg", "readOnly": false, "mountPath": "/home... | <p>The official Kubernetes docs for secrets cover <a href="https://kubernetes.io/docs/concepts/configuration/secret/#use-case-pod-with-ssh-keys" rel="nofollow noreferrer">this exact use-case</a>.</p>
<p>To create the secret, use:</p>
<pre><code>$ kubectl create secret generic my-secret --from-file=ssh-privatekey=/path/... |
<p>Readiness probe success or not determine the pod ready or not ready. If I set the <code>.spec.minReadySeconds = 60</code> and the Readiness probe is success(<code>.readinessProbe.initialDelaySeconds = 1</code>), so when we created the deployment more than 1 second less than 60 seconds the pod enter the ready status ... | <p>This may be a misunderstanding of the terminology. From the <a href="http://kubernetes.io/docs/user-guide/deployments/" rel="nofollow">deployment documentation</a>, one has:</p>
<blockquote>
<p>.spec.minReadySeconds is an optional field that specifies the minimum
number of seconds for which a newly created Pod ... |
<p>I'm trying to setup a Kubernetes PetSet as described in the documentation. When I create the PetSet I can't seem to get the Persistent Volume Claim to bind to the persistent volume. Here is my Yaml File for defining the PetSet:</p>
<pre><code>apiVersion: apps/v1alpha1
kind: PetSet
metadata:
name: 'ml-nodes'
spec:... | <p>There is an <a href="https://github.com/kubernetes/minikube/issues/524" rel="nofollow">open issue</a> on minikube for this. Persistent volume provisioning support appears to be unfinished in minikube at this time.</p>
<p>For it to work with local storage, it needs the following flag on the controller manager and th... |
<p>I have been trying to wrap my head around how Rancher (or DC/OS) is different from Kubernetes. Both of them say they are Container management tools. Why we do we need both? How are they different?</p>
| <h1>Author's note</h1>
<p>This question was originally posted 3 years ago. Since then the technology landscape has moved on. </p>
<p>For example Mesosphere, the company behind DCOS has <a href="https://techcrunch.com/2019/08/05/mesosphere-changes-name-to-d2iq-shifts-focus-to-kubernetes-cloud-native/" rel="nofollow no... |
<p>I'm trying to run an api (based on Symfony) with kubernetes thanks to Google Container Engine (GKE).
This API also allow user to store and download files, which are supposed to be saved somewhere.</p>
<p>I tried to run it with 1 replica, and noticed a downtime of the service during the creation of the new container... | <p>Using GCS (like tex mentioned) is probably the simplest solution (and will be very fast from a GKE cluster). Here is <a href="https://stackoverflow.com/questions/33591580/how-to-upload-files-to-google-cloud-storage-with-symfony-gauferette-vichuplo">an answer that may help</a>.</p>
<p>If you have a specific need for... |
<p>Kubernetes API server is not getting started due to DefaultStorageClass.</p>
<p><strong>The connection to the server 10.85.40.165:8080 was refused - did you specify the right host or port?
(kubectl failed, will retry 2 times)</strong></p>
<p>Ubuntu: 14.04.4</p>
<p><strong>kubectl version</strong></p>
<pre><code>... | <p>I was having the same issue.</p>
<p>I removed "DefaultStorageClass" from the ADMISSION_CONTROL variable in ubuntu/config-default.sh, and I was able to start my cluster. However, I haven't fully tested everything out to make sure it's all still working.</p>
|
<p>How can I inject code/files directly into a container in Kubernetes on Google Cloud Engine, similar to the way that you can mount host files / directories with Docker, e.g.</p>
<pre><code>docker run -d --name nginx -p 443:443 -v "/nginx.ssl.conf:/etc/nginx/conf.d/default.conf"
</code></pre>
<p>Thanks</p>
| <p>It is possible to use ConfigMaps to achieve that goal:</p>
<p>The following example mounts a mariadb configuration file into a mariadb POD:</p>
<p><strong>ConfigMap</strong></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
data:
charset.cnf: |
[client]
# Default is Latin1, if you n... |
<p>I'm having a bit of hard time figuring out whether the Guestbook example is working in Minikube. My main issue is possibly that the example description <a href="https://github.com/kubernetes/kubernetes/tree/master/examples/guestbook" rel="nofollow">here</a> details all the steps but <em>there is no indication about ... | <p>Well, it seems I figured it out myself (I'll probably send a PR too)</p>
<p>The main thing is that, at least in the Minikube setup, the <code>kubectl</code> command is run in Mac OS X but all the cool stuff happens inside a virtual machine. In my case, it's a VirtualBox VM (I'm still on Mavericks).</p>
<p>When <co... |
<p>I'm trying to delete a Job in Kubernetes, but every time I run "kubectl delete job [JOBNAME]" it just "hangs" indefinitely.</p>
<p>How can I diagnose this issue to try and determine why the Job's not able to be deleted?</p>
| <p>Turn up your debugging by set the verbosity to 9. You will see that <code>kubectl</code> is actually clearing out a lot of different resources created by the job. <code>ctrl-c</code> out of it. </p>
<p>Use <code>--cascade=false</code> it will actually complete shortly. see <a href="https://github.com/kubernetes/kub... |
<p>I am attempting to use Minikube for local kubernetes development. I have set up my docker environment to use the docker daemon running in the provided Minikube VM (boot2docker) as suggested:</p>
<pre><code>eval $(minikube docker-env)
</code></pre>
<p>It sets up these environment variables:</p>
<pre><code>export ... | <p>I've been unable to find anyway to get the cert into the minikube vm. But, minikube has a command line parameter to pass in an insecure-registry.</p>
<pre><code>minikube start --insecure-registry=<HOST>:5000
</code></pre>
<p>Then to configure authentication on the registry, create a secret.</p>
<pre><code>... |
<p>I want to create a replication controller with a POD which will have a PVC (persistent volume claim). My PVC will use an NFS storage for PV(Persistent Volume).</p>
<p>Once the POD is operational the RC would maintain the PODs up and running. In this situation would the data in the POD be available / persistent whe... | <p>that depends a lot on how you define your PV/PVC. From my experience it is pretty easy to use NFS based PV to retain data between pod recreations deletions. I go with following approach for NFS volume shared by multiple pods.</p>
<p>Volume :</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
name: pv... |
<p>I'm very new to kubernetes/docker, so apologies if this is a silly question.</p>
<p>I have a pod that is accessing a few services. In my container I'm running a python script and need to access the service. Currently I'm doing this using the services' IP addresses.</p>
<p>Is the service IP address stable or is it be... | <p>The short answer is "Yes, the service IP can change"</p>
<pre><code>$ kubectl apply -f test.svc.yml
service "test" created
$ kubectl get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.12.0.1 <none> 443/TCP 10d
test 10.12.172.156 <none> 80/TC... |
<p>I’m investigating this letsencrypt controller (<a href="https://github.com/tazjin/kubernetes-letsencrypt" rel="noreferrer">https://github.com/tazjin/kubernetes-letsencrypt</a>).</p>
<p>It requires pods have permission to make changes to records in Cloud DNS. I thought with the pods running on GKE I’d get that acces... | <p>The Google Cloud DNS API's <a href="https://cloud.google.com/dns/api/v1/changes/create#auth" rel="noreferrer">changes.create call</a> requires either the <code>https://www.googleapis.com/auth/ndev.clouddns.readwrite</code> or <code>https://www.googleapis.com/auth/cloud-platform</code> scope, neither of which are ena... |
<p>I am trying to get the stats of the containers that are running inside the kubernetes nodes via <strong>docker stats</strong> command. But unfortunately I am getting all the values as "0" for all the pod containers.</p>
<pre><code>CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
7dc5af... | <p>I resolved this one. I used the kubelet API to get the metrics for the node and well as for individual containers. The following API will return the metrics for a pod container.</p>
<pre><code>http://<nodeIP>:10255/stats/<podName>/<containerName> - POST
</code></pre>
<p><a href="https://stackover... |
<p>I have a docker image pushed to Container Registry with <code>docker push gcr.io/go-demo/servertime</code> and a pod created with <code>kubectl run servertime --image=gcr.io/go-demo-144214/servertime --port=8080</code>.</p>
<p>How can I enable automatic update of the pod everytime I push a new version of the image?... | <p>I would suggest switching to some kind of CI to manage the process, and instead of triggering on docker push triggering the process on pushing the commit to git repository. Also if you switch to using a higher level kubernetes construct such as <code>deployment</code>, you will be able to run a rolling-update of you... |
<p>We are using the hosted version of Kubernetes inside Google Container Engine (GKE).</p>
<p>Currently we are at Version 1.3.x, which comes with an Kubernetes Dashboard v1.1.1.</p>
<p>Some days ago Kubernetes Dashboard v1.4.0 was released which includes some very nice enhancements.</p>
<p>My <strong>Question</stron... | <p>The official way is to update your cluster to 1.4. It should be available a few days after Kubernetes 1.4 is released. You can do this via gcloud CLI or Google Cloud Console (click "Upgrade available" next to your cluster). </p>
|
<p>I have installed Kubernetes on Bare-metal/Ubuntu. I am on <code>6b649d7f9f2b09ca8b0dd8c0d3e14dcb255432d1</code> commit in git. I used <code>cd kubernetes/cluster; KUBERNETES_PROVIDER=ubuntu ./kube-up.sh</code> followed by <code>cd kubernetes/cluster/ubuntu; ./deployAddons.sh</code> to start the cluster. Everything w... | <p>I can answer your <code>ping clusterIP</code> problem.
I met the same problem, want to ping the service's cluster IP from Pod.</p>
<p>The resolution seems that the cluster IP cannot be pinged, but the endpoint can be access using curl with port.</p>
<p>I just work around to find details about ping virtual IP.</p>
|
<pre><code>kubectl get pod run-sh-1816639685-xejyk
NAME READY STATUS RESTARTS AGE
run-sh-1816639685-xejyk 2/2 Running 0 26m
</code></pre>
<p>What's the meaning of "READY=2/2"? The same with "1/1"?</p>
| <p>it shows how many containers in a pod are considered ready. You can have some containers starting faster then others or having their readiness checks not yet fulfilled (or still in initial delay). In such cases there will be less containers ready in pod then their total number (ie. 1/2) hence the whole pod will not ... |
<p>I've followed a few guides, and I've got CI set up with Google Container Engine and Google Container Registry. The problem is my updates aren't being applied to the deployment.</p>
<p>So this is my deployment.yml which contains a Kubernetes Service and Deployment:</p>
<pre><code>apiVersion: v1
kind: Service
metad... | <p>You can force an update of a deployment by changing any field, such as a label. So in my case, I just added this at the end of my CI script:</p>
<pre><code>kubectl patch deployment fb-video-extraction -p \
"{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
</code></pre>
|
<p>I'm using gRPC with Python as client/server inside kubernetes pods...
I would like to be able to launch multiple pods of the same type (gRPC servers) and let the client connect to them (randomly).</p>
<p>I dispatched 10 pods of the server and setup a 'service' to target them. Then, in the client, I connected to the... | <p>Let me take the opportunity to answer by describing how things are supposed to work.</p>
<p>The way client-side LB works in the gRPC C core (the foundation for all but the Java and Go flavors or gRPC) is as follows (the authoritative doc can be found <a href="https://github.com/grpc/grpc/blob/master/doc/load-balanc... |
<p>I'd like to parse ingress nginx logs using fluentd in Kubernetes. That was quite easy in Logstash, but I'm confused regarding fluentd syntax.</p>
<p>Right now I have the following rules:</p>
<pre><code><source>
type tail
path /var/log/containers/*.log
pos_file /var/log/es-containers.log.pos
time_form... | <p>Pipelines are quite different in logstash and fluentd. And it took some time to build working Kubernetes -> Fluentd -> Elasticsearch -> Kibana solution.</p>
<p>Short answer to my question is to install <strong>fluent-plugin-parser</strong> plugin (I wonder why it doesn't ship within standard package) and put this r... |
<p>I'm writing an application to monitor a kubernetes cluster running on Google Container Engine. On the host where my application deployed, there are no <code>kubectl</code> and <code>gcloud</code> CLI nor are they allowed to be installed. So I am trying to do everything through REST API.</p>
<p>For creating the clus... | <p>Token can be retrieve from <a href="https://developers.google.com/oauthplayground/" rel="nofollow">Google OAuth Playground</a></p>
<p>Kubernetes can be reached by the following <code>curl</code> command via REST API</p>
<pre><code># curl --insecure -H "Authorization: Bearer $MyBearerToken" https://${Kubenetes_IP}/... |
<p>Like most applications we have three distinct running environments:</p>
<ul>
<li>Production</li>
<li>Staging / QA</li>
<li>Development</li>
</ul>
<p>These are all basically configured through ENV variables.</p>
<p><strong>How is it best to run all the services/pods/containers in our environments? Through labels? ... | <p>I am not sure if there is an official best practice, but I have always preferred to separate environments using namespaces for the following reasons:</p>
<ol>
<li><p>It allows you to use the exact same YAML files for your deployments, services, etc in all three environments. To switch environments, all you have to ... |
<p>My goal is to make my web application (deployed on Kubernetes 1.4 cluster) see the IP of the client that originally made the HTTP request. As I'm planning to run the application on a bare-metal cluster, GCE and the <code>service.alpha.kubernetes.io/external-traffic: OnlyLocal</code> service annotation introduced in ... | <p>As a layer 4 proxy, Nginx cannot retain the original source IP address in the actual IP packets. You can work around this using the <a href="http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt" rel="noreferrer">Proxy protocol</a> (the link points to the HAProxy documentation, but Nginx also supports it).</p>
... |
<p>I have a small kubernetes (1.3) cluster (basically one node) and would like to install gogs in there. Gogs is "installed" using Helm. I do have the following templates in my helm chart:</p>
<ul>
<li>Deployment (using image gogs:0.9.97, having containerPort 3000 (http) as well as 2222 (ssh)</li>
<li>Ingress (this is... | <p>Answering my own question. This issue is rather a configuration problem and caused by my own fault. </p>
<p>Basically I haven't posted the ReplicationController of the Nginx-Ingress Resource. This one was missing the port 2222. so now it does look like:</p>
<pre><code>apiVersion: v1
kind: ReplicationController
met... |
<p>I am new to kubernetes. In docker I can use the official mongo image and run docker run --name some-mongo -d mongo --auth</p>
<p>And then connect to it and create a default db user. How can I pass --auth in a kube controller spec?</p>
<p>Replication Controller</p>
<pre><code># db-controller.yml
apiVersion: v1
kin... | <p>You can configure pod to run specific command and any arguments, in your case it should be something like this:</p>
<pre><code>containers:
- image: mongo
name: mongo
command: ["mongo", "--auth"]
</code></pre>
<p>or </p>
<pre><code>containers:
- image: mongo
name: mongo
args: ["--auth"]
</code>... |
<p>Most container services have some sort of built in service discovery mechanism. So why is it that someone would still incorporate Consul into their setup? I know that Consul provides other benefits besides service discovery, such as K/V store, Consul templates, and service monitoring, however none of these seem like... | <p>It's simple - it depends on your application. If it needs those features Consul have, and which other systems don't, then you can go for it.</p>
<p>Besides that, there are a lot of Hashicorp products tightly integrated with a Consul in part of HA. Vault, Nomad and Terraform. Consul can be used like a variant of Zoo... |
<p>I am deploying Kubernetes 1.4 on Ubuntu 16 on Raspberry Pi 3 following the instructions at <a href="http://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="nofollow">http://kubernetes.io/docs/getting-started-guides/kubeadm/</a>. The master starts and the minion joins no problem but when I add weave kubedns ... | <p><code>kube-dns</code> won't start until the network is up.</p>
<p>Look in the <code>kubelet</code> logs on each machine for more information about the crash that is causing the CrashLoopBackoff.</p>
<p><del>How did you get ARM images for Weave Net? The <code>weaveworks/weave-kube</code> image on DockerHub is only... |
<p>Im trying to get the <code>kubectl</code> running on a VM. I followed the steps given <a href="https://coreos.com/kubernetes/docs/latest/configure-kubectl.html" rel="nofollow">here</a> and can go thru with the installation. I copied my local kubernetes config (from <code>/Users/me/.kube/config</code>) to the VM in t... | <p>To use kubectl to talk to Google Container Engine cluster in a non-Google VM, you can create a user-managed <a href="https://cloud.google.com/iam/docs/service-accounts" rel="nofollow">IAM Service Account</a>, and use it to authenticate to your cluster:</p>
<pre><code># Set these variables for your project
PROJECT_I... |
<p>If I set to autoscale a deployment using the kubectl autoscale command (<a href="http://kubernetes.io/docs/user-guide/kubectl/kubectl_autoscale/" rel="noreferrer">http://kubernetes.io/docs/user-guide/kubectl/kubectl_autoscale/</a>), how can I turn it off and go back to manual scaling?</p>
| <p>When you autoscale, it creates a <a href="http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/" rel="noreferrer">HorizontalPodScaler</a>.</p>
<p>You can delete it by:</p>
<p><code>kubectl delete hpa NAME-OF-HPA</code>.</p>
<p>You can get <code>NAME-OF-HPA</code> from:</p>
<p><code>kubectl get hpa</co... |
<p>I'm trying to get a GKE ingress to require basic auth like this <a href="https://github.com/kubernetes/contrib/blob/45bdc249bc27bdf427498b42859e1a98d634bff0/ingress/controllers/nginx/examples/auth/README.md" rel="noreferrer">example from github.</a></p>
<p>The ingress works fine. It routes to the service. But the a... | <p>The example you linked to is for nginx ingress controller. GKE uses <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/gce" rel="noreferrer">GLBC</a>, which doesn't support auth.</p>
<p>You can <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx#deploymen... |
<p>I am probably missing some of the basic. kubectl logs command usage is the following:</p>
<pre><code>"kubectl logs [-f] [-p] POD [-c CONTAINER] [options]"
</code></pre>
<p>list of my pods is the following:</p>
<pre><code>ubuntu@master:~$ kubectl get pods --all-namespaces
NAMESPACE NAME ... | <p>It seems you are running your pods in a different namespace than <code>default</code>.</p>
<p><code>ubuntu@master:~$ kubectl get pods --all-namespaces</code> returns your pods but <code>ubuntu@master:~$ kubectl logs etcd-master</code>returns not found. Try running <code>kubectl logs etcd-master --all-namespaces</co... |
<p>How do I get the pod associated with a job via the Kubernetes REST API? I cannot figure out how the two are related/linked other than by similar (but not the same) generated names.</p>
| <p>You can send a LIST request for pods, with <a href="https://github.com/kubernetes/apimachinery/blob/d16981aedf33f88b7434bd3bdbcc2e1f940aecd0/pkg/apis/meta/v1/types.go#L355" rel="nofollow noreferrer">ListOptions.LabelSelector</a> set to the <a href="https://github.com/kubernetes/api/blob/dcce3486da333605791aa8b98536c... |
<p>I'm trying to start FIWARE Orion in Kubernetes.
Here is the manifest:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: broker
spec:
replicas: 1
template:
metadata:
labels:
name: broker
spec:
containers:
- name: mongo
image: waziup/mongodb... | <p>The problem was linked to Kubernetes networking.
It seems that adding and then deleting the "sock shop" does not remove the network "Deny Policy".
The solution is to run:</p>
<p><code>kubectl annotate namespace default net.beta.kubernetes.io/network-policy-</code></p>
<p>That will remove old policies.</p>
|
<p>I am following the <a href="http://kubernetes.io/docs/hellonode/" rel="nofollow">hellonode</a> tutorial, deploying to Google Container Engine, but running into the error below:</p>
<pre><code>kubectl run simple-gke-server --image=us.gcr.io/cloud-assets-henry/simple-gke-server:v1 --port=8888
Error from server: the ... | <p>kubectl uses <a href="https://developers.google.com/identity/protocols/application-default-credentials">Application Default Credentials</a> for authenticating to GKE clusters. It is possible that your Application Default Credentials are configured for a different user than your gcloud credentials if you have previou... |
<p>Trying several options to resolve the issue with weave-net (<a href="https://stackoverflow.com/questions/39872332/how-to-fix-weave-net-crashloopbackoff-for-the-second-node">How to fix weave-net CrashLoopBackOff for the second node?</a>), I have decided to try calico instead of weave-net. The documentation for kubern... | <p>You need to reference the raw YAML file in your command, instead of the full GitHub HTML document:</p>
<pre><code>kubectl create -f https://raw.githubusercontent.com/projectcalico/calico-containers/master/docs/cni/kubernetes/manifests/kubeadm/calico.yaml
</code></pre>
|
<p>This is a similar question as <a href="https://stackoverflow.com/questions/38733801/unable-to-access-kubernetes-dashboard">this</a> but I could not find a resolution from it. I have setup Kubernetes cluster with CoreOS 2 masters and 3 nodes on AWS by following this <a href="https://coreos.com/kubernetes/docs/latest/... | <p>Ah...finally I noticed that there is a mistake on my AWS security setting. That is, I open TCP 8472 port for flanneld about master => node communication, that should be UDP. I knew that should be UDP so it took very long time until I re-checked it and noticed the mistake.</p>
<p>After I updated the setting, <code>k... |
<p>I'm creating an (tls enabled) ingress resource using following configurations:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-app-apis
spec:
tls:
- secretName: tls-secret
backend:
serviceName: my-web-service
servicePort: 80
</code></pre>
<p>A new static IP address is... | <p>You can specify the IP address in an annotation on the Ingress (it looks like you specify it by name rather than IP address). This is only picked up by the GCE controller so don't expect it to work anywhere other than GCE/GKE.</p>
<p><a href="https://github.com/kubernetes/contrib/blob/master/ingress/controllers/gce... |
<p>I am trying to connect Google Container Engine from my local machine using <code>gcloud</code> sdk but i am getting below error.</p>
<pre><code>C:\Program Files (x86)\Google\Cloud SDK>gcloud container clusters get-credential
s cluster-2 --zone us-central1-a --project myapp-00000
Fetching cluster endpoint and au... | <p>I take it you set <code>KUBECONFIG</code> env to 'C:\Tool\config'? That error is gcloud failing to write due to missing admin privileges; I don't know if you need to run the shell as admin. You might also try the <code>HOME</code> directory. Note that gcloud will attempt to create any missing directories on the path... |
<p>I am using <code>yo jhipster:kubernetes</code> to generate kubernetes file, i want to set <code>lower_case_table_names=1</code> for <code>MySQL</code> to make <code>MySQL</code> case insensitive. Below File is generated by command</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata
name: app-mys... | <p>Could you try using <code>args</code> instead of <code>command</code>?
That is to say,</p>
<pre><code>args:
- --lower_case_table_names=1
- --skip-ssl
</code></pre>
<p>If it still doesn't work, how about creating a config volume?
In your yaml file on mysql pod, you can define like</p>
<pre><code>spec:
contai... |
<p>I am deploying <code>symmetricds</code> on <code>google container engine</code>, so i have build <code>symmetricds</code> <code>war</code> file and create <code>docker</code> <code>tomcat</code> image like below :- </p>
<pre><code>FROM tomcat
ENV JAVA_OPTS="-Dcom.sun.management.jmxremote.port=1109 -Dcom.sun.managem... | <p><code>symmetricds.properties</code> file has either to be packed outside of the war file and then manipulated before starting the server so the placeholders could be replaced with concrete values or use the notation <code>${env.variable.value}</code> and try seeing if Spring replaces them with environment variables<... |
<p>Is it correct to assume that one PV can be consumed by several PVCs and each pod instance needs one binding of PVC? I'm asking because I created a PV and then a PVC with different size requirements such as:</p>
<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
name: k8sdisk
labels:
type: amazonEBS
... | <p>When you have a PVC it will look for a PV that will satisfy it's requirements, but unless it is a volume and claim in multi-access mode (and there is a limited amount of backends that support it, like ie. NFS - details in <a href="http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes" rel="noreferrer... |
<p>I configured docker on the same host as my kubernetes-master for the private docker registry.<br>Docker pushing to the private docker registry without https was successful.<br> I also can pull the image just using docker.<br></p>
<p>When I run kubernetes for this image, I get with 'kubectl describe pods' following ... | <p>This rather a docker issue than a kubernetes one. You need to add your http registry as a <code>insecure-registry</code> to your docker daemon on each kubernetes node. </p>
<p><code>docker daemon --insecure-registry=5.179.232.65:5000</code></p>
<p>In most environment there is a file like <code>/etc/default/docker<... |
<p>I have problem login into one container of a multi-container pod.
I get the container id from the <code>kubectl describe pod <pod-name></code></p>
<pre><code>kubectl describe pod ipengine-net-benchmark-488656591-gjrpc -c <container id>
</code></pre>
<p>When i try: </p>
<pre><code>kubectl exec -ti ipe... | <p>Ah once more detailed reading the man page of kubectl exec :</p>
<p>Flags:</p>
<pre><code> -c, --container="": Container name. If omitted, the first container in the pod will be chosen
-p, --pod="": Pod name
-i, --stdin[=false]: Pass stdin to the container
-t, --tty[=false]: Stdin is a TTY... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.