prompt
stringlengths
65
38.7k
response
stringlengths
41
29.1k
<p>I am new to docker and Kubernetes, I am trying to create a container having <code>tomcat7/Java7</code> so that I could deploy my <code>webapps</code> into it. The only concern I have are the <code>tomcat/conf</code> config files, which have details of <code>database connections</code>, <code>threadpool</code>, <code...
<p>You could add a ConfigMap in your Kubernetes, from your tomcat config (files or a whole dir)</p> <pre><code>kubectl -n staging create configmap special-config --from-file={path-to-tomcat-conf}/server.xml </code></pre> <p>And then mount it on your pod (kubectl create -f path/to/the/pod.yaml)</p> <pre><code>apiVers...
<p>There are a lot of options available for deploying kubernetes including Redshift, CoreOS, hosted options. I was wondering if there is anyone exploring kubeadm for non-prod enironments. Is it a viable option for standing up a multi-node k8s cluster. Thanks in advance.</p>
<p>Yes, kubeadm is a viable option for a non-production cluster, but it is currently (late 2017) undergoing significant development. Two features that I would watch closely are support for <a href="https://github.com/kubernetes/kubernetes/pull/50872" rel="nofollow noreferrer">upgrades</a>, and support for <a href="htt...
<p>I am using Kubernetes to run a Docker service. This is a defective service that requires a restart everyday. For multiple reasons we can't programmatically solve the problem and just restarting the docker everyday will do. When I migrated to Kubernetes I noticed I can't do "docker restart [mydocker]" but as the dock...
<p>You can use a scheduled job pod:</p> <p>A scheduled job pod has build in cron behavior making it possible to restart jobs, combined with the time-out behavior, it leads to your required behavior or restarting your app every X hours.</p> <pre><code>apiVersion: batch/v2alpha1 kind: ScheduledJob metadata: name: app...
<p>I'm trying to figure out how to run openvpn server running inside a pod using UDP protocol.</p> <p>Since it's easier to test using http than openvpn connections, I have also nginx-container running inside that same pod as openvpn-container is.</p> <p>I can get everything working inside the cluster but I cannot exp...
<p>Rather than use an IP address you could get K8S to use the type: <code>LoadBalancer</code> which will setup a Classic AWS ELB. From there you could CNAME a domain / sub-domain to the ELB and access the service that way?</p> <p>A quick example:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: MyApp l...
<p>I'm trying to run different helm charts and I keep running into this error. It's much more cost effective for me to run 3-4 cheaper nodes than 1 or 2 very expensive nodes that can have more disks attached to them.</p> <p>Is there a way to configure kubernetes or helm to have a disk attach limit or to set the affini...
<blockquote> <p>Is there a way to configure kubernetes or helm to have a disk attach limit or to set the affinity of one deployment to a particular node?</p> </blockquote> <p>For now, ACS k8s provision PVC based on Azure managed disks or blob disks, so the limit is the number of VM disks.</p> <p>For now, Azure do...
<p>I am considering BigQuery as my data warehouse requirement. Right now, I have my data in google cloud (cloud SQL and BigTable). I have exposed my REST APIs to retrieve data from both. Now, I would like to retrieve data from these APIs, do the ETL and load the data into BigQuery. I am evaluating 2 options of ETL (dai...
<p>Without knowing your data volumes, specifically how much new or diff data you have per day and how you are doing paging with your REST APIs - here is my guidance...</p> <p>If you go down the path of a using Spring Batch you are more than likely going to have to come up with your own sharding mechanism: how will you...
<p>I have a cluster configuration using Kubernetes on GCE, I have a pod for zookeeper and other for Kafka; it was working normally until Zookeeper get crashed and restarted, and it start refusing connections from the kafka pod:</p> <blockquote> <p>Refusing session request for client <code>/10.4.4.58:52260</code> as ...
<p>Because the kafka maintain a zookeeper session which remember the last zxid it has seen. So when the zookeeper sevice go down and come again, the zk's zxid begin from a smaller value. and ZKserver think the kafka has seen a bigger zxid, so it refuse it. </p> <p>Have a try to restart the kafka.</p>
<p>So i created a cluster containing 4 machines using this command</p> <pre><code>gcloud container clusters create "[cluster-name]" \ --machine-type "n1-standard-1" \ --image-type "COS" \ --disk-size "100" \ --num-nodes "4" </code></pre> <p>and i can see that it's creating 4 VM instances inside my <a href="ht...
<p>Currently all GKE VMs get a public IP address, but they have firewall rules set up to block unauthorized network connections. Your Service or Ingress resources are still accessed through Load Balancer’s public IP address.</p> <p>As of writing there's no way to prevent cluster nodes from getting public IP addresses....
<p>I am trying to push spring boot application in google kubernetes(Google Container Engine).</p> <p>I have performed all the step which given in below link.</p> <p><a href="https://codelabs.developers.google.com/codelabs/cloud-springboot-kubernetes/index.html?index=..%2F..%2Findex#0" rel="nofollow noreferrer">https:...
<p><strong>I hope you have created cluster in google container engine</strong></p> <p>Follow the first 5 step given in this link </p> <p><a href="https://cloud.google.com/sql/docs/mysql/connect-container-engine" rel="nofollow noreferrer">https://cloud.google.com/sql/docs/mysql/connect-container-engine</a></p> <p>cha...
<p>I have a angular application running in a docker ubuntu image that has nginx installed. I want to deploy this image to Kubernetes and use a nginx proxy to redirect all calls to /api to my backend service in Kubernetes.</p> <p>My static web resources lie in /var/www/html and I add the following config to /etc/nginx/...
<p>From your troubleshooting of nginx, it appears that the nginx configuration file you have has effectively no effect — you report getting <code>404 Not Found</code> errors for everything other than the index page, with all the directives, from <code>try_files</code> in <code>location /</code>, to <code>proxy_pass</co...
<p>I use Kubernetes 1.6 and Docker to deploy instances/pods of a microservice.</p> <p>I have a service that needs to regularly pull continuously updated data from an external repository. This update can be triggered manually on runtime, but the service is unusable during that time. Furthermore, the up-to-date data is ...
<p>This meant to be as a comment but might become an answer. I am posting it as an answer so that the approach is easy to read.</p> <p>So I have possible approach that might work for you. You run a global download pod which will download the files into specific folder. Let's assume download happens every 1 hour. So yo...
<p>I am running a sample spark job in kubernetes cluster with following command:</p> <pre><code>bin/spark-submit \ --deploy-mode cluster \ --class org.apache.spark.examples.SparkPi \ --master k8s://https://XXXXX \ --kubernetes-namespace sidartha-spark-cluster \ --conf spark.executor.instances=2 \ --conf sp...
<p>This issue is resolved. We need to build the spark/resource-manager/kubernetes from the source.</p>
<p>I would like to upgrade kubernetes from 1.5 to a recent version (i installed it with yum install kubernetes-master kubernetes-client ...) but i don't understand how to achieve it.</p> <p>Is there yum repos to upgrade kubernetes?</p> <p>Thanks in advance!</p>
<p>As far as I know there is no official (with official I mean supported by the kubernetes team) way of installing kubernetes on any linux distro using system packages.</p> <p>Centos provides packages for the old 1.5 version on their extra repository, the packages you actually have installed.</p> <p>I think you best ...
<p>I want to spin up a single <strong>installer pod</strong> with <code>helm install</code> that once running, will apply some logic and install other applications into my cluster using <code>helm install</code>. </p> <p>I'm aware of the helm dependencies, but I want to run some business logic with the installations a...
<p>It seems this was a <strong>lot</strong> easier than I thought...</p> <p>On a simple pod running Debian, I just <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="noreferrer">installed <strong>kubectl</strong></a>, and with the default service account's secret that's already mounted, the <strong...
<p>I am trying to install Kubernetes on Red Hat Linux (RHEL 7) . Any advice on the best and easiest way to do this ? I would not like to use minikube. Thank you very much</p>
<p><code>kubeadm</code> is the way to go for installing kubernetes on RHEL. Though in alpha, it works for most of the use cases.</p> <p>You can find the installation instructions on the <a href="https://kubernetes.io/docs/setup/independent/install-kubeadm/" rel="nofollow noreferrer">kubeadm installation page</a> and s...
<p>Just started with kubernetes. I have three physical machines: 1 master, 2 nodes. I did basically getting started configuration. Everything seems up and running, nodes can communicate with master, but when I try to install a sample application (<a href="https://kubernetes.io/docs/setup/independent/create-cluster-kube...
<p><strong>The kubelet service needs a command-line flag to set the cluster DNS IP</strong> - it looks like you're running kube-dns, so you can get that IP by either running <code>kubectl get services --namespace=kube-system</code> or grabbing the IP from the "ClusterIP" field on the kube-dns service YAML or JSON confi...
<p>I'm attempting to update from Traefik v1.2.3 to v1.3.6 on Kubernetes. I have my TLS certificates mounted inside of the pods from secrets. Under v1.2.3, everything works as expected. When I try to apply my v1.3.6 deployment (only change being the new docker image), the pods fail to start with the following message...
<p>This issue turned out to be new <a href="https://github.com/golang/go/blob/release-branch.go1.8/src/encoding/pem/pem.go#L138" rel="nofollow noreferrer">validation logic in the crypto/tls library in Go 1.8</a>. They are now validating the certificate blocks end in <code>-----</code> where as before they did not. The ...
<p>I see this error in <code>kubectl describe podName</code>:</p> <pre><code> 9m 2s 118 kubelet, gke-wordpress-default-pool-2e82c1f4-0zpw spec.containers{nginx} Warning Unhealthy Readiness probe failed: Get http://10.24.0.27:80/: net/http: request canceled (Client.Timeout exceeded while a...
<p>ARGHUGIHIRHHHHHH.</p> <p>I've been staring at this error for a day at least and for some reason I didn't comprehend it.</p> <p>Essentially the error <code>net/http: request canceled (Client.Timeout exceeded while awaiting headers)</code> means the container took longer then the timeout period (default of 1s).</p>
<p>I'm currently looking through an Istio and Kubernetes talk and mention the management of services along with the use of sidecars. I'm not sure what that is.</p>
<p>I think of them as helper containers. A pod can have 1 or more containers. A container should do only one thing, like a web server or load balancer. So if you need some extra work to be done inside the pod, like github sync or data processing, you create an additional container AKA sidecar.</p>
<p>I'm trying to route incoming traffic into specific pods inside Kubernetes: As suggested here: <a href="https://stackoverflow.com/questions/45606977/is-it-possible-to-specific-custom-rules-for-running-new-containers-in-kubernetes">Is it possible to specific custom rules for running new containers in Kubernetes/Docker...
<p>Ingress is for HTTP traffic so you're right to say that it cannot meet your needs.</p> <p>The best way to do this is to use a Service. A Service performs automatic Layer 3 load-balancing across the Pods tagged to it. It will look something like this:</p> <pre><code>kind: Service apiVersion: v1 metadata: name: nt...
<p>I am working on securing my Kubernetes cluster with a TLS connection configured in the ingress rule, which essentially terminates the SSL connection at the load balancer. So far so good. </p> <p>A question came up about whether it would make sense to secure the connection from the load balancer to each of the servi...
<p>By <code>service</code> I presume you refer to the <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">kubernetes Service primitive</a>.</p> <p>Services are not supposed to go up and down dynamically. What you refer to is the Pod which is ephemeral in nature. To make...
<p>I'm looking for a way to set service/status/loadBalance/ingress-ip after creating k8s service of type=loadbalancer (as appears in 'Type LoadBalancer' section at the next link <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/ser...
<p>There's two ways to do this. With a <a href="http://jsonpatchjs.com/" rel="nofollow noreferrer">json patch</a> or with a merge patch. Here's how you do the latter:</p> <pre><code>[centos@ost-controller ~]$ cat patch.json { "status": { "loadBalancer": { "ingress": [ {"ip": "8....
<p>I'm new to Kubernetes and Docker and I'm having trouble finding if these services offer functionality I'm looking for.</p> <p>My goal is to host a Node.JS website server inside of a Docker container and have Kubernetes scale that container to match the load to the website and load balance to those containers. This ...
<p>You can terminate SSL in docker (you integrate your certificates in the docker container itself), in kubernetes (by configuring the <code>ingress controller</code> for instance) or even externally in a load balancer (a component you will need if you want to scale to multiple servers).</p> <p>About the documentation...
<p>I have this JSON output from Kubernetes and got it from <code>kubectl get pods -o jsonpath={.items[*]}</code></p> <pre><code> &lt;json&gt; { &quot;apiVersion&quot;: &quot;v1&quot;, &quot;items&quot;: [ { &quot;apiVersion&quot;: &quot;v1&quot;, &quot...
<p>If you want that output, my advice would be to execute the command like this:</p> <pre><code> kubectl get pods -n kube-system some-appdeployment -o jsonpath="Name: {.metadata.name} Status: {.status.phase}" </code></pre> <p>Would this work for your case?</p>
<p>My pod has two containers - a primary container, and a sidecar container that monitors the <code>/var/run/utmp</code> file in the primary container and takes action when it changes. I'm trying to figure out how to make this file visible in the sidecar container.</p> <p><a href="https://kubernetes.io/docs/tasks/acce...
<p>If you can move the file to be shared in an empty subfolder this could be a simple solution.</p> <p>For example, move your file to /var/run/utmp/utmp and share /var/run/utmp folder with an emptydir.</p>
<p>I am using k8s 1.5 and am stuck in one issue. I am trying to deploy 2 pods and related service. We can consider one as UI and another as DB. I have seen that using Service Discovery, we can achieve the connectivity between both the pods.</p> <p><strong>Problem 1</strong>: While getting inside the container of UI P...
<p>In the examples that I've seen (<a href="https://github.com/kubernetes/kubernetes/blob/master/examples/guestbook-go/main.go" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/examples/guestbook-go/main.go</a>, line 77), they use the service dns name instead of environment variables (just...
<p>I have tectonic kubernetes cluster installed on Azure. It's made from tectonic-installer GH repo, from master (commit 0a7a1edb0a2eec8f3fb9e1e612a8ef1fd890c332).</p> <pre><code>&gt; kubectl version Client Version: version.Info{Major:"1", Minor:"...
<p>I had test in lab, use your yaml file to create pod, after one hour, it still show pending.</p> <pre><code>root@k8s-master-ED3DFF55-0:~# kubectl get pod NAME READY STATUS RESTARTS AGE mypod 0/1 Pending 0 1h task-pv-pod 1/1 Running 0 2h </code></pre> <p>...
<p>I was looking to quickly install InfluxDB on my Kubernetes cluster (built using kubeadm). This would just be a single pod running on a node (since non-enterprise InfluxDB doesn't support clustering). I was looking to persist the data to whatever node the pod is hosted on (i.e. hostPath solution that Kubernetes provi...
<p>Take a look at Helm, it's a package manager for Kubernetes,</p> <p>Here is the package of InfluxDB : <a href="https://github.com/kubernetes/charts/tree/master/stable/influxdb" rel="nofollow noreferrer">https://github.com/kubernetes/charts/tree/master/stable/influxdb</a></p> <p>=)</p>
<p>I've set a <strong>kubernetes</strong> cluster with master in <strong>high availability</strong>: 3 etcd nodes, 3 apiservers, 3 controller managers and 3 schedulers. There is a load balancer in front of the api servers. I see apiservers running as <strong>Active-Active</strong> while Controller Manager and Scheduler...
<p>In my case, retrieving the endpoints yaml and looking in the "holderIdentity" field of the "...kubernetes.io/leader" annotation.</p>
<p>Fore few days I've been playing with Kubernetes cluster on Azure Container Service, with goal to host Unreal game servers on it.</p> <p>After days of experiments and few questions on SO I got to the point where I can host few servers on single node and connect to them with clients.</p> <p>In my latest setup I depl...
<p>I suggest you to take a look on Ingresses controller, I know that the Nginx one support UDP routing.</p> <p>So, you expose Nginx-ingress with load-balancer IP and you create UDP configmap to route directly on your pods. </p> <p>You should give it a try. </p> <p><a href="https://github.com/kubernetes/contrib/tree...
<p>I created a kubernetes cluster using Kops on aws in private subnet. When using NAT gateway as a point of egress in the cluster, everything just works fine. But when i try to deploy a NAT instance as a point of egress in my cluster, it does not work. I cannot figure out a way to use nat instance as egress in my clust...
<p>A few gotchas that are easy to miss: </p> <ul> <li>The NAT instance needs to be deployed into a <em>public</em> subnet (i.e. one with an internet gateway attached and a route out through that internet gateway).</li> <li>The NAT instance needs the Source/Destination check disabled (in the AWS console, you can get to...
<p>Running a cluster on Google Container engine. </p> <p>Expect it to respect rewrite rule. Running the debug <a href="http://gcr.io/google_containers/echoserver:1.4" rel="noreferrer">echo server</a> it shows it's not respecting the http-rewrite rule as documented here in <a href="https://github.com/kubernetes/ingress...
<p><code>rewrite-target</code> is not supported by Google Container Engine Ingress. See this page for a comparison of features:</p> <p><a href="https://github.com/kubernetes/ingress/blob/master/docs/annotations.md" rel="nofollow noreferrer">https://github.com/kubernetes/ingress/blob/master/docs/annotations.md</a></p>
<p>I am trying to deploy Kong API Gateway via template to my openshift project. The problem is that Kong seems to be doing some DNS stuff that causes <a href="https://github.com/Mashape/kong/issues/2524#issuecomment-302233645" rel="nofollow noreferrer">sporadic failure of DNS resolution</a>. The workaround is to use ...
<p>You can read the namespace(project name) from the Kubernetes downward API into an environment variable and then use that in the value perhaps.</p> <p>See the OpenShift docs <a href="https://docs.openshift.com/container-platform/3.4/dev_guide/downward_api.html#dapi-values-using-environment-variables" rel="nofollow n...
<p>I'm implementing a function which can make a node offline/online from kubernetes cluster. </p> <p>When I run <code>kubectl delete node $nodename</code>, how can I read this node to the cluster? </p> <p>It's said that if use API <code>POST /api/v1/nodes</code> will cause the node state <code>Not ready</code>. Is th...
<p>The way to (re)create a node depends on your cluster setup and Kubernetes version.</p> <ul> <li><a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#joining-your-nodes" rel="noreferrer">kubeadm</a>: run <code>kubeadm reset</code> and <code>kubeadm join ...</code> again on the node (you migh...
<p>I have a Kubernetes deployment which uses image: <code>test:latest</code> (not real image name but it's the latest tag). This image is on docker hub. I have just pushed a new version of <code>test:latest</code> to dockerhub. I was expecting a new deployment of my pod in Kubernetes but nothing happends.</p> <p>I've ...
<p>Kubernetes is <strong>not</strong> watching for a new version of the image. The image pull policy specifies how to acquire the image to run the container. <code>Always</code> means it will try to pull a new version each time it's starting a container. To see the update you'd need to delete the Pod (not the Deploymen...
<p>I need to configure heapster to send kubernetes cluster metrics to our custom influx db server . For this I tried to edit heapster deployment in kube-system namespace but after some time deployment is getting reverted to original state .<br> I am using GKE , master version is 1.5.7 and node version is 1.5.6 .</p>
<p>As for now, a custom configuration of addons is not supported on GKE. Any changes to the default Heapster configuration will be reverted by <a href="https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/addon-manager" rel="nofollow noreferrer">addon-manager</a>.</p> <p>If the default Heapster configur...
<p>I am deploying the sample bookshelf node app (<a href="https://cloud.google.com/nodejs/tutorials/bookshelf-on-container-engine" rel="nofollow noreferrer">https://cloud.google.com/nodejs/tutorials/bookshelf-on-container-engine</a>). This app does OAUTH2 callback. </p> <p>My question is where do I get the IP Address ...
<p>If you already have kubectl configured to access your cluster, you should be able to find the ip address of the service with:</p> <pre><code>$ kubectl get services </code></pre> <p>A <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> is separate from ac...
<p>I've created a secret using</p> <pre class="lang-shell prettyprint-override"><code>kubectl create secret generic production-tls \ --from-file=./tls.key \ --from-file=./tls.crt </code></pre> <p>If I'd like to update the values - how can I do this?</p>
<p>This should work:</p> <pre class="lang-shell prettyprint-override"><code>kubectl create secret generic production-tls \ --save-config \ --dry-run=client \ --from-file=./tls.key --from-file=./tls.crt \ -o yaml | \ kubectl apply -f - </code></pre>
<p>We are using openShift V3 Enterprise product. I would like to create a externalName type service called serviceA in ProjectA and it will point to a route in projectB. and I will create a another route in ProjectA which will point to ServiceA service.</p> <p>Is this possible to do?</p> <p>Thanks!!!</p>
<p>You don't need to involve a route, you can use the service name directly to connect to it. The only caveat on that is that you need to (as admin), set up a pod network between the two projects. This is better as creating a route means it will also be exposed outside of the OpenShift cluster and so publicly accessibl...
<p>Just curious about the intent for this default namespace.</p>
<p>That namespace exists in clusters created with kubeadm for now. It contains a single ConfigMap object, cluster-info, that aids discovery and security bootstrap (basically, contains the CA for the cluster and such). This object is readable without authentication.</p> <p>If you are courious:</p> <pre><code>$ kubectl...
<p>When we use kubeadm to set up a k8s cluster, there are two options to config:</p> <p><code>--pod-network-cidr</code></p> <p><code>--service-cidr</code> (default ‘10.96.0.0/12’)</p> <p>Question is:</p> <ol> <li><p>If I use <code>10.244.0.0./12</code> for <code>pod-network-cidr</code>, do I need to save that IP ra...
<p>To reply briefly:</p> <ul> <li><ol> <li>You do have to reserve <strong>both</strong> the pod-network range and the service network range. You can't use those on your LAN (and you can't have routes to it). Both ranges are configurable so you can pick something that is not used. Use ipcalc if you are unsure.</li> </o...
<p>Kubernetes has a concept of pods where containers can share ports between them. For example within the same pod, a container can access another container (listening on port 80) via <code>localhost:80</code>.</p> <p>However on docker-compose, <code>localhost</code> refers to the container itself.</p> <p>Is there an...
<p>I seem to have gotten it to work by adding <code>network_mode: host</code> to each of the container configs within my docker-compose config.</p>
<p><strong>Context</strong></p> <p>Access to a Google Cloud (GKE) kubernetes cluster is managed through the Google Cloud IAM feature;</p> <ol> <li><p>An admin invites a new user (using their google account/login) and assigns them a role.</p> <p>The example role below is &quot;Container Engine Viewer&quot;, which will a...
<p>Weird how writing out the problem gets you to an answer sooner huh?</p> <p>Theres a new &quot;Alpha&quot; feature in Google Cloud's IAM which wasn't there last time I tried to tackle this problem;</p> <p>Under IAM &gt; Roles, you can now create custom IAM roles with your own subset of permissions.</p> <p>I created a...
<p>I have a nodejs app which has refers to the IP Address of the kubernetes service/load balancer public IP. Is there a way to get it from the process/env variables in runtime?</p> <p>e..g <code>process.env.ENV_VARIABLE</code> and what is the env variable name</p> <p>Thanks</p>
<p>It's <strong>not available</strong> as an environment variable. Also keep in mind that a pod can receive traffic from multiple load balancers and also the external IP could change after the Pod started, leaving a stale value; so an IP in an environment variable might not be an adequate solution.</p> <p>If you are u...
<p>I'm benchmarking a tool that monitors docker containers. To do that I need to launch several dummy containers with an orchestration tool such Kubernetes. The containers should be lightweight and shouldn't take any of the machine resources (e.g. ports), since the idea is to run 15 or more of these dummy containers in...
<p>You can just run an alpine container with a sleep command.</p> <p>Something like this:</p> <p><code>docker run -d alpine sh -c 'while sleep 3600; do :; done'</code></p>
<p>Both Docker images &amp; Kubernetes clusters have mechanisms to configure persistent storage on the host machine, a separate container, or just some form of cloud/network storage mechanism. </p> <p>I'm trying to understand how they are different in use cases and why you'd use one over the other. For context, I'm al...
<p>using docker volumes on a cluster like Kubernetes gives you no data persistency. The workload can get scheduled on different node and you're done. To provide persistent storage in K8S cluster you need to use K8S solution to the problem.</p>
<p>I have deployed envoy containers as part of an Istio deployment over k8s. Each Envoy proxy container is installed as a "sidecar" next to the app container within the k8s's pod.</p> <p>I'm able to initiate HTTP traffic from within the application, but when trying to contact Redis server (another container with anoth...
<p>Getting into envoy (istio proxy):</p> <pre><code>kubectl exec -it my-pod -c proxy bash </code></pre> <p>Looking at envoy configuration:</p> <pre><code>cat /etc/envoy/envoy-rev2.json </code></pre> <p>You will see that it generates a TCP proxy filter which handles TCP only traffic. Redis example:</p> <pre><code>"...
<p>I'm try to run Kubernetes with minikube, and hangs on creating volume... My HOME partition is almost 100% used. I saw that minikube create a .minikube folder into my HOME, so there are way to change this folder?</p>
<p>You can set the MINIKUBE_HOME env var to specify the path for minikube to use for the .minikube directory. From: <strike>https://github.com/kubernetes/minikube/blob/master/docs/env_vars.md</strike></p> <p>EDIT: information has moved, now at - <a href="https://minikube.sigs.k8s.io/docs/handbook/config" rel="nofollow...
<p>I have a GKE based Kubernetes setup and a POD that requires a storage volume. I attempt to use the config below:</p> <pre><code>kind: PersistentVolumeClaim apiVersion: v1 metadata: name: my-scratch-space spec: accessModes: - ReadWriteOnce resources: requests: storage: 2000Gi storageClassName: standard <...
<p>There is no configuration problem at your side - there are actually not enough resources in the <code>europe-west2-b</code> zone to create a 2T persistent disk. Either try for a smaller volume or use a different zone.</p> <p>There is an <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#gce" r...
<p>I put elasticsearch in the kubernetes cluster as statefulset. When I using rollingUpdate to updte the statefulset. I got a problem, k8s restart the elasticsearch node and think it's ready, and then move on to next node, however, the node is not ready in elasticsearch cluster. The es cluster sitll yellow even red.</p...
<p>the best thing you can do is to implement a readinessProbe <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes</a>. As long as it returns not ready...
<p>I was experimenting load balancing our service by having two replicas on a cluster of two nodes.</p> <p>Then I noticed the following:</p> <p>Yesterday when I checked the pods, it looked like this:</p> <pre><code>pod-jq5vr 4/4 Running 0 2m 10.4.1.5 node-vvmb pod-qbs69 4/4 Runni...
<p>You can use the <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature" rel="nofollow noreferrer">pod anti-affinity</a> feature to tell the scheduler that you don't want the pods in the same service to run on the same node. </p> <p>The kubernete...
<p>I am running a kubernetes cluster on coreos.</p> <p>I have a kubernetes replication controller that works fine. It looks like this:</p> <pre><code>id: "redis-controller" kind: "ReplicationController" apiVersion: "v1beta3" metadata: name: "rediscontroller" lables: name: "rediscontroller" spec: replicas: ...
<p>Extra thing to check for.</p> <p>Endpoints are only created if your deployment is considered healthy. If you have defined your <code>readinessProbe</code> incorrectly (mea culpa) or the deployment does not react to it correctly, an endpoint will not be created.</p>
<p>Is it possible to have a <em>restricted</em> Kubernetes dashboard? The idea is to have a pod running <code>kubectl proxy</code> in the cluster (protected with basic HTTP authentication) to get a quick overview of the status:</p> <ul> <li>Log output of the pods</li> <li>Running services and pods</li> <li>Current CPU...
<p>Based on the answer from lwolf, I used <a href="https://github.com/kubernetes/dashboard/blob/master/src/deploy/kubernetes-dashboard.yaml" rel="nofollow noreferrer">the kubernetes-dashboard.yaml</a> and changed it to run on the slaves, in the default namespace.</p> <p>The important change is the <code>kind: ClusterR...
<p>I followed the tutorial here <a href="https://cloud.google.com/python/django/container-engine#initialize_your_cloud_sql_instance" rel="nofollow noreferrer">https://cloud.google.com/python/django/container-engine#initialize_your_cloud_sql_instance</a></p> <p>I have successfully deployed my service but the tutorial s...
<p>See the note and example in the docs about <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="nofollow noreferrer">updating a Deployment</a>:</p> <blockquote> <p><strong>Note:</strong> A Deployment’s rollout is triggered if and only if the Deployment’s pod t...
<p>I have setup a web application in kubernetes with a nginx-ingress controller. I am able to access my application over the Nginx ingress controller public IP.</p> <p>For requests which are taking more than 1 min, we are getting gateway connection timeout error (504). I've checked the Nginx ingress controller configu...
<p>The nginx ingress controller is customizable via a configmap.</p> <p>You can achieve this by passing the argument <code>--configmap</code> to the ingress controller. Source: <a href="https://github.com/kubernetes/ingress/tree/master/controllers/nginx#command-line-arguments" rel="nofollow noreferrer">https://github....
<p>I am new to Helm. I have installed Minikube &amp; Helm on my windows system. I am able create pods using Helm and see deployment,pods &amp; replicaset in dashboard. </p> <p>I want to do rolling update using Helm. Guide me how to do rolling update in K8s using Helm.</p> <p>Creating Tomcat pod using Helm</p> <bloc...
<p>Below command is working fine for Rolling update. </p> <ol> <li>First time it will be install </li> <li>next time it will be upgrade</li> </ol> <blockquote> <p>helm upgrade --install tom-release --set appName=mytomcatcon hello-world</p> </blockquote> <p>tom-release is my release name and passing runtime valu...
<p>I have a deployment created with a YAML file, the image for the containers is <code>image:v1</code>.</p> <p>Now I update the file to <code>image:v2</code>, and do <code>kubectl apply -f newDeploymentFile.yml</code>. Does Kubernetes use rolling update behind the scenes to update my deployment or some other way?</p>...
<p>What happens exactly is controlled by the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="nofollow noreferrer"><code>Deployment</code></a> itself:</p> <ul> <li><a href="https://kubernetes.io/docs/api-reference/v1.7/#deploymentstrategy-v1beta1-apps" rel="nof...
<p>We are analyzing the integration of the <a href="https://kubernetes.io/" rel="nofollow noreferrer">Kubernetes</a> service in our on premise environment. We have SaaS based services which can be exposed publicly. </p> <p>We have doubts in setting up the external endpoints for the services. Is there any way to create...
<p>My suggestion is to use an Ingress Controller that acts as a proxy for all your services in kubernetes.</p> <p>Of course your ingress controller has to be somehow exposed to the outside world. My suggestion is to use the <code>hostNetwork</code> setting for the ingress controller pod (this way, the pod will be list...
<p>I have a running node in a kubernetes cluster. Is there a way I can change its name?</p> <p>I have tried to </p> <ol> <li>delete the node using kubectl delete</li> <li>change the name in the node's manifest</li> <li>add the node back.</li> </ol> <p>But the node won't start.</p> <p>Anyone know how it should be d...
<p>Usualy it's kubelet that is responsible for registering the node under particular name, so you should make changes to your nodes kubelet configuration and then it should pop up as new node.</p>
<p>I am looking on how can I change the parameter of containers depending on the number of replica ?</p> <p>For example, I would like to have an environment variable ( which is the name of my hubot) as follow :</p> <ol> <li>First Replica : Name1</li> <li>Second replica : Name2...</li> </ol> <p>Do you have an idea o...
<p>The feature is called "<a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset" rel="nofollow noreferrer">StatefulSets</a>" in Kubernetes. Have a look at the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id" rel="nofollow noreferrer">Stable Netw...
<p>I have a kubernetes cluster running with one master and 2 nodes. I want to run e2e tests on this cluster. How should I run it? I tried doing <code>go run hack/e2e.go -v --test</code> but that command wants to create a cluster first and then run the test, while I want to run the tests on my already present cluster. A...
<p>If what you want to do is run the conformance tests and verify your cluster, you might also consider looking into the tool that Heptio created called <a href="https://github.com/heptio/sonobuoy" rel="nofollow noreferrer">sonobuoy</a>, which was created specifically to run the non-destructive conformance tests for Ku...
<p>I am running a Kubernethes cluster with many services, I am getting the IPv4 using the command:</p> <pre><code>kubectl get svc </code></pre> <p>But I need also IPv6, how to get it?</p>
<p><a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/networking.md#ipv6" rel="nofollow noreferrer">IPv6 is currently not supported by Kubernetes.</a></p>
<p>I am trying to get some custom application metrics captured in golang using the prometheus client library to show up in Prometheus.</p> <p>I have the following working:</p> <ul> <li><p>I have a go application which is exposing metrics on localhost:8080/metrics as described in this article:</p> <p><a href="https:/...
<p>The kubernetes_sd_config directive can be used to discover all pods with a given tag. Your Prometheus.yml config file should have something like so: <code> - job_name: 'some-app' kubernetes_sd_configs: - role: pod relabel_configs: - source_labels: [__meta_kubernetes_pod_label_app] regex: python-app...
<p>I'm developing a service using Spring and deploying it on OpenShift. Currently I'm using Spring Actuator health endpoint to serve as a liveness and readiness probe for Kubernetes. </p> <p>However, I will add a call to another service in a Actuator health endpoint, and it looks to me that in that case I need to impl...
<h1>Liveness Probe</h1> <p>Include only those checks which you think, if fails, will get cured with a pod restart. There is nothing wrong in having a new endpoint that always return an HTTP 200, which will serve as a liveness probe endpoint; provided you have an independent monitoring and alert in place for other serv...
<p>I want to submit a function (via http-trigger) from a NodeJS process to kubeless but I do not want to use the javascript equivalent of </p> <pre><code>curl --data '{"term":"Albemarle"}' localhost:8080/api/v1/proxy/namespaces/default/services/bikesearch/ --header "Content-Type:application/json" </code></pre> <p>bec...
<p>kubeless also creates services for functions, so you should able to just do a http get to <code>http://bikesearch:8080</code> if your DNS setup is working and your application is in the same namespace. If you are in another namespace you need to use a more qualified name, e.g. <code>bikesearch.&lt;function-namespace...
<p>Inside a service yaml file, you can use jsonpath to select a named nodeport value like so:</p> <pre><code> - name: MY_NODE_PORT valueFrom: fieldRef: fieldPath: spec.ports[?(@.name=="http")].nodePort </code></pre> <p>However, in my deployment yaml file, I would like to have an environment...
<p>As in <a href="https://stackoverflow.com/users/371954/janos-lenart">Janos Lenart</a>'s answer and <a href="https://stackoverflow.com/users/4763788/marc-sluiter">Marc Sluiter</a> commented, a service and a deployment are different resources and might as easily be specified in separate files. They have no direct knowl...
<p>I am trying to add if great than condition in Helm chart. it is throwing error.</p> <p>I have defined value in values.yaml and using that value in deployment.yaml for condition.</p> <p><strong>values.yaml</strong></p> <pre><code>replicaCount: 2 </code></pre> <p><strong>deployment.yaml</strong></p> <pre><code>ro...
<p>Try using float number in comparison instead:</p> <p><strong>deployment.yaml</strong></p> <pre><code>rollingUpdate: maxSurge: 1 {{ if gt .Values.replicaCount 2.0}} maxUnavailable: 0 {{ else }} maxUnavailable: 1 {{ end }} </code></pre> <p>Helm (along with underlying Golang templates and Yaml) can be we...
<p>I have multiple instance of containers deployed in kubernetes.</p> <p>The application in the container requires the public IP from the pod / node. </p> <p>From the deployment manifest, I tried to use the following, </p> <ul> <li>status.podIP</li> <li>spec.nodeName</li> </ul> <p>But both of them return the priva...
<p>Public IP may not be available through Kubernetes. But you can use external services to query the IP.</p> <pre><code>$ curl ipinfo.io/ip </code></pre> <p>Is one possible way. But they have rate limiting. You might find other options also. Next option is to set a Nginx server on a know machine with below config</p>...
<p>I am evaluating Kubernetes (with Docker containers, not Kubernetes) and Docker Swarm and could use your input. </p> <p>If I'm looking at 3 (8.76 hours) or 4 (52 min) 9's reliability in a server farm that is &lt; 100 servers, would Kubernetes be overkill due to its complexity? Would Docker Swarm suffice? </p>
<p>Docker swarm will be able to meet your requirements. I recommend you start with Docker swarm as it is robust and very straightforward to use for anyone who has used Docker before. </p> <p>For a Docker user, there are many new concepts that you need to learn to be able to use Kubernetes. Moreover, setting up Kuberne...
<p>Could be a basic one..</p> <p>I have created a pod in Openshift Enterprise 3.2 with the configuration set as <strong><code>restartPolicy: Always</code></strong> . So ideally when the pod is destroyed Openshift will make sure to re-run/re-create the pod because of the restart policy.</p> <p><strong>Now I no longer ...
<p>The deployment config (and related replication controller) is the reason your pod is getting recreated when you delete it. The replication controller's job is literally to "ensure that a specified number of replicas of a pod are running at all times."</p> <p>To destroy the pod (and leave the deployment config and o...
<p>My company has decided to transition to a micro/service based architecture.</p> <p>We have been doing a bunch of research for the last couple of months on exactly what the architecture of this thing is going to look like. </p> <p>So far, we've settled on:</p> <ul> <li><p>Dotnet core for service development (altho...
<p>If you want to use Jenkins, Pipelines are indeed the way to go. Our setup does pretty much what you want, so let me explain how we set it up.</p> <p>We use a Jenkins agent that has <code>docker</code> and <code>kubectl</code> installed. This agent first builds the docker container and pushes it to our docker regist...
<p>I ran a hadoop cluster in kubernetes, with 4 journalnodes and 2 namenodes. Sometimes, my datanodes cannot register to namenodes.</p> <pre><code>17/06/08 07:45:32 INFO datanode.DataNode: Block pool BP-541956668-10.100.81.42-1496827795971 (Datanode Uuid null) service to hadoop-namenode-0.myhadoopcluster/10.100.81.42:...
<p>In my situation, I included three configuration to the namenode and datanode as well:</p> <ul> <li><code>dfs.namenode.datanode.registration.ip-hostname-check: false</code></li> <li><code>dfs.client.use.datanode.hostname: false</code> (default)</li> <li><code>dfs.datanode.use.datanode.hostname: false</code> (default)...
<p>One way I could think of is to set an environment which value is the namespace of the Pod when defining the Pod.<br> Getting the namespace dynamically without requiring changes for Pod will be better because it lessens the burden of constructing a Pod. </p> <p>So is there a way to get current namespace in a Pod?<...
<p>Try the file:</p> <pre><code>/var/run/secrets/kubernetes.io/serviceaccount/namespace </code></pre>
<p>I have setup docker on my machine and also minikube which have docker inside it, so probably i have two docker instances running on different VM</p> <p>I build an image and tag it then push it to local registry and it pushed successfully and i can pull it from registry too and also when i run curl to get tags list ...
<p>The issue is your notion using <code>127.0.0.1</code> anywhere you want. This is wrong.</p> <p>So if your machine IP is 192.168.0.101. Then below works</p> <pre><code>1- docker build -t 127.0.0.1:5000/eliza/console:0.0.1 . 2- docker run -d -p 5000:5000 --name registry registry:2 3- docker tag a3703d02a199 127.0.0.1:...
<p>Recently when practicing kubernetes , I found there is no doc and example specifically explaining how to use cinder correctly in kubernetes. </p> <p>So how to setup cinder to be used in kubernetes ? </p>
<p>I did some experiment and worked out how to setup cinder with kubernetes. Just find a suitable to document and share.</p> <p><strong>Preparation</strong></p> <ul> <li>kubernetes cluster </li> <li>openstack environment and make sure cinder service is available</li> </ul> <p><strong>Background</strong></p> <p>From...
<p>We need to deploy redundant haproxy load-balancers(VRRP) and 2~3 apiservers to build high-availability clusters on bare-metal</p> <p>But, we have 4 bare-metal servers.(the number of nodes will increase)</p> <p>So we are thinking of installing load-balancers in VMs assigned flat IPs on Master nodes, as you see the ...
<p>Seems like an overkill to build HA control plane and have one worker node, but I guess you plan to add more in future. Other then that it looks solid. Although I assume you also have some network equipment in the environment. This could open a possibility of ditching dedicated haproxy vrrp for apiserver in favor of ...
<p>I'm following an example from <a href="https://www.manning.com/books/kubernetes-in-action" rel="nofollow noreferrer">Kubernetes in Action</a> to run a simple docker image in kubernetes:</p> <pre><code>$ bx login --apikey @apiKey.json -a https://api.eu-de.bluemix.net $ bx cs cluster-config my_kubernetes $ export KU...
<p>To close out the thread here, LoadBalancer cannot be used in a lite (aka free) cluster tier. The differences between lite and standard clusters can be found here - <a href="https://console.bluemix.net/docs/containers/cs_planning.html#cs_planning" rel="noreferrer">https://console.bluemix.net/docs/containers/cs_plann...
<p>I have to create a cluster with support of insecure docker registry. I want to use <code>Kops</code> for this. Is there any way to create cluster with insecure registry using <code>Kops</code>?</p>
<p>You can set insecure registry at cluster config edit time, after <code>kops create cluster ...</code> command (navigate to clusterSpec part of file):</p> <pre><code>$ kops edit cluster $NAME ... docker: insecureRegistry: registry.example.com logDriver: json-file ... </code></pre> <p><a href="https://githu...
<p>I've got a local deployment system that is mirroring our production system. Both are deployed by calling kubectl apply -f deployments-and-services.yaml</p> <p>I'm tagging all builds with the current git hash, which means that for clean deploys to GKE, all the services have a new docker image tag which means that ap...
<p>I'm not entirely sure I understood your question but that may very well be my reading comprehension :) In any case here's a few thoughts that popped up while reading this (again not sure what you're trying to accomplish)</p> <p>Option 1: maybe what you're looking for is to scale down and back up, i.e. scale your de...
<p>I ran <code>eval $(minikube docker-env)</code> then built a docker container. When I run <code>docker images</code> on my host I can see the image. When I run <code>minikube ssh</code> then <code>docker images</code> I can see it.</p> <p>When I try to run it, the pod fails to launch. <code>kubectl describe pod</cod...
<p>You aren't exactly pulling from your local registry, you are using your previously downloaded images or your locally builded, since you are specifying <code>imagePullPolicy: Always</code> this will always try to pull it from the registry.</p> <p>Your image doesn't contain a specific docker registry <code>personalis...
<p>I have server with 2 nic's. Internet&lt;--->kube-worker&lt;--->internal network&lt;---->kube-master.</p> <p>After I've applied nginx ingress configuration (only change that I made, was uncomment "hostNetwork: true" field), placed <a href="https://github.com/kubernetes/ingress/blob/master/examples/deployment/nginx/...
<p>with <code>hostNetwork: true</code> your pod does not get assigned any IP, it should see full networking of the host machine. So, if the host has internal network on eth0 and public on eth1 this is the same that your nginx pod will see from inside.</p>
<p>How can we conditionally append "index.html" to a request for a url that ends in a slash?</p> <p>As background: We deploy multiple static, single page apps for multiple domain names to a single S3 bucket with web hosting enabled. This bucket is available as: <a href="https://our-bucket-name.s3.amazonaws.com" r...
<p>You could use AddPrefix or ReplacePath modifier, though you would also need to create a matcher on your fontend as well.</p> <p>STEPS</p> <ol> <li>create front end to match blank path rule</li> <li>add modifier to that front end. ReplacePath should do the trick</li> <li>route to backend</li> </ol>
<p>I have .NET Core 1.1 Test project and I am building this project inside kubernetes pods using VSTS linux agent. In one of tests, I am trying to connect to SQL Server (installed inside one VM in Google Compute Engine). Whenever this test executes (with dotnet test command), I am getting below exception</p> <p>**Syst...
<p>This problem is resolved now...the issue was my kubernetes build cluster was in some other network and my google compute engine's VM was in default network..Once I changed network of VM..it started working</p>
<p>I am running GKE k8s deployments/jobs that take a long time to execute - from days to weeks (Machine Learning). Default GKE Events expire after 1h, which is not enough to debug problems that can occur during training, like OOMKilling, etc. </p> <p><code>kube-apiserver</code> isn't exposed in GKE, so I'd like to fin...
<p>It's currently not possible. As you said, the <code>kube-apiserver</code> flags are currently not user-configurable on GKE. There are plans to expose more such knobs to the users but I don’t know when would this be available.</p>
<p>I have a pod <code>test-1495806908-xn5jn</code> with 2 containers. I'd like to restart one of them called <code>container-test</code>. Is it possible to restart a single container within a pod and how? If not, how do I restart the pod?</p> <p>The pod was created using a <code>deployment.yaml</code> with:</p> <pre>...
<blockquote> <p>Is it possible to restart a single container</p> </blockquote> <p>Not through <code>kubectl</code>, although depending on the setup of your cluster you can "cheat" and <code>docker kill the-sha-goes-here</code>, which will cause kubelet to restart the "failed" container (assuming, of course, the rest...
<p>I'm trying to deploy my Spring Boot/JHipster app on Google's Container Engine (GKE). I've figured out most things, but I'm having a problem with my database instance (a PostgreSQL instance running on Google Cloud SQL, with the Google SQL Proxy).</p> <p>I've followed the instructions <a href="https://cloud.google.co...
<p>Vadim solved the problem that I asked about, but the second problem -- the socket already connected problem -- was eventually figured out by one of my co-workers.</p> <p>The root of the socket problem relates to the datasource configuration. It turns out that I'm mixing and matching two different mechanisms for acc...
<p><strong>Problem</strong></p> <p>I have deployed csanchez's jenkins-kubernetes plugin (version 0.12) to a local Minikube / Kubernetes environment. When configuring Pod-Templates and Container-Templates from within the Jenkins UI, the PODS are spawned automatically and process simple jobs. Howerver when the Pod-Temp...
<p>Im using a kubernetes plugin 0.12 and have a problem ClosedChannelException (I think this is not problem on connection to master but a communicate doesn't acceptable then connection timeout and closed) on Jenkins slave too and I solved this problem when I upgrade Jenkins version from 2.60-alpine to 2.75-apline. Jenk...
<p>I have been browsing looking and reading why my external ip is not resolving on Poc I am doing with Minikube .</p> <p>I am running Minikube on a Ubuntu 16.04 distro.</p> <p>When i do an http get at <a href="http://192.168.99.100:32431/" rel="nofollow noreferrer">http://192.168.99.100:32431/</a> i get the nginx pag...
<blockquote> <p>I am running Minikube on a Ubuntu 16.04 distro.</p> </blockquote> <p>Minikube is not designed to have an "external ip", it's for simple development-time testing. One will observe it is not even using the <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/08-bootstrap...
<p>I would like to know, if HPA considers the mean of CPU utilization of multiple containers in a pod, in order to scale up/down the no. of pods. For instance, if I specify a HPA like below for a deployment(pod) that has 2 containers. In order for the HPA to scale up, does it require the CPU utilization to be reached t...
<p>The controller calculates the utilization value as a percentage on the containers in each pod and then takes the mean. So in your scenerio mean will be 70% <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/h...
<p>I am super new to kubernetes and would like your help regarding following matter. </p> <p>I have used <strong>docker pull php</strong> to pull httpd on my local. </p> <p>How do I modify this image on my local?</p>
<p>Ok, I will start with the basics: as stated in the previous comments and answers, you cannot modify this image that is coming from <a href="https://hub.docker.com/_/php/" rel="noreferrer">the official PHP image on Docker Hub.</a></p> <p>However, you have a couple of options when it comes to creating your own image:...
<p>After some intense google and SO search i couldn't find any document that mentions both rolling update and set image, and can stress the difference between the two.</p> <p>Can anyone shed light? When would I rather use either of those?</p> <p>EDIT: It's worth mentioning that i'm already working with deployments (r...
<p>In older k8s versions the <code>ReplicationController</code> was the only resource to manage a group of replicated pods. To update the pods of a <code>ReplicationController</code> you use <code>kubectl rolling-update</code>. </p> <p>Later, k8s introduced the <code>Deployment</code> which manages <code>ReplicaSet</c...
<p>Basic example of what I want my Jenkinsfile to do:</p> <pre><code>node { sh 'docker build -t foo/bar .' } </code></pre> <p>It seems like I need to install docker onto the Jenkins slave image that's executing my Jenkinsfile. Is there an easy way of doing this? (That Jenkins slave image is itself a docker contain...
<p>My assumption is that you want to <code>docker build</code> inside the Jenkins slave (which is a Kubernetes pod, I assume created by the <a href="https://github.com/jenkinsci/kubernetes-plugin" rel="noreferrer">Kubernetes Jenkins Plugin</a>)</p> <p>To set the stage, when Kubernetes creates pod that will act as a Jen...
<p>I've been trying to use Traefik as an Ingress Controller on Google Cloud's container engine.</p> <p>I got my http deployment/service up and running (when I exposed it with a normal LoadBalancer, it was answering fine).</p> <p>I then removed the LoadBalancer, and followed this tutorial: <a href="https://docs.traefi...
<p>You need to expose the Traefik service. Set the service spec type to <code>LoadBalancer</code>. Try the below service file that i've used previously:</p> <pre><code>apiVersion: v1 kind: Service metadata: name: traefik spec: type: LoadBalancer selector: app: traefik tier: proxy ports: - port: 80 ...
<p>i do not know why ,my master node in not ready status,all pods on cluster run normally, and i use cabernets v1.7.5 ,and network plugin use calico,and os version is &quot;centos7.2.1511&quot;</p> <pre><code># kubectl get nodes NAME STATUS AGE VERSION k8s-node1 Ready 1h v1.7.5 k8s-node2 ...
<p>It's good practice to run a describe command in order to see what's wrong with your node:</p> <pre><code>kubectl describe nodes &lt;NODE_NAME&gt; </code></pre> <p>e.g.: kubectl describe nodes k8s-node2 You should be able to start your investigations from there and add more info to this question if needed.</p>
<p>I have troubles configuring ingress service</p> <p>This is how i configure kubernetes:</p> <pre><code>apiVersion: apps/v1beta1 kind: Deployment metadata: name: web-spa-development-deployment spec: template: metadata: labels: app: web-spa-development-291 spec: containers: - name: web-spa-devel...
<p>Try this:</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: development-ingress annotations: kubernetes.io/ingress.global-static-ip-name: staging spec: tls: - hosts: - dev-app.example.com secretName: wildcard-cert rules: - host: dev-app.example.com http: ...
<p>I'm being hit with a vulnerability probe which uses <code>User-Agent: Mozilla/5.0 Jorgee</code> and I want to drop/reject any requests from that user agent. </p> <p>I've been digging around the k8s examples but I can't seem to find a solution.</p> <p>Is there any way I can deny requests based on <code>User-Agent</...
<p>As best I can tell from <a href="https://github.com/kubernetes/ingress/blob/nginx-0.9.0-beta.13/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl" rel="nofollow noreferrer">the nginx go-template</a>, that is not something the current implementation of their ingress controller offers. I believe that in their men...
<p>Is there a simple <code>kubectl</code> command to take a <code>kubeconfig</code> file (that contains a cluster+context+user) and merge it into the ~/.kube/config file as an additional context?</p>
<p>Do this:</p> <pre><code>export KUBECONFIG=~/.kube/config:~/someotherconfig kubectl config view --flatten </code></pre> <p>You can then pipe that out to a new file if needed.</p>
<p>What is correct way to kubernetes cluster setup using minikube through the kubernetes api ? At the moment, I can't find a port through which the kubernetes cluster can be accessed.</p>
<p>The easiest way to access the Kubernetes API with when running minikube is to use</p> <pre><code>kubectl proxy --port=8080 </code></pre> <p>You can then access the API with</p> <pre><code>curl http://localhost:8080/api/ </code></pre> <p>This also allows you to browse the API in your browser. Start minikube usin...
<p>I get the following error when trying to use Kubespray to install Kubernetes on an EC2 cluster</p> <pre><code>TASK [network_plugin/calico : Calico | wait for etcd] ********************************************************************************************************************************************************...
<p>TLDR; open both ports 2379 and 2380</p> <p>I encountered this same issue and found that I needed to open two ports for etcd. The obvious port is <code>2379</code>, because it is in the ansible error message. When I examined the logs for the etcd container on one of the failed nodes I found that it was trying to com...
<p>I'm being hit with a vulnerability probe which uses <code>User-Agent: Mozilla/5.0 Jorgee</code> and I want to drop/reject any requests from that user agent. </p> <p>I've been digging around the k8s examples but I can't seem to find a solution.</p> <p>Is there any way I can deny requests based on <code>User-Agent</...
<p>you can add custom nginx configuration snippets to Ingresses with annotations, at least for the "normal" nginx controller, not sure if that works with the GCE controller too. See e.g. here: <a href="https://github.com/kubernetes/ingress/blob/master/examples/customization/configuration-snippets/nginx/ingress.yaml#L8"...