question stringlengths 11 28.2k | answer stringlengths 26 27.7k | tag stringclasses 130
values | question_id int64 935 78.4M | score int64 10 5.49k |
|---|---|---|---|---|
I am getting below error while trying to apply patch :
core@dgoutam22-1-coreos-5760 ~ $ kubectl apply -f ads-central-configuration.yaml
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
Error from server (Conflict): error when applying patch:
{"data":{"def... | It seems likely that your yaml configurations were copy pasted from what was generated, and thus contains fields such as creationTimestamp (and resourceVersion, selfLink, and uid), which don't belong in a declarative configuration file.
Go through your yaml and clean it up. Remove things that are instance specific. Y... | Kubernetes | 51,297,136 | 73 |
I'm debugging log output from kubectl that states:
Error from server (BadRequest): a container name must be specified for pod postgres-operator-49202276-bjtf4, choose one of: [apiserver postgres-operator]
OK, so that's an explanatory error message, but looking at my JSON template it ought to just create both container... | If a pod has more than 1 containers then you need to provide the name of the specific container.
in your case, There is a pod (postgres-operator-49202276-bjtf4) which has 2 containers (apiserver and postgres-operator ).
following commands will provide logs for the specific containers
kubectl logs deployment/postgres-... | Kubernetes | 47,129,376 | 73 |
I have problem login into one container of a multi-container pod.
I get the container id from the kubectl describe pod <pod-name>
kubectl describe pod ipengine-net-benchmark-488656591-gjrpc -c <container id>
When i try:
kubectl exec -ti ipengine-net-benchmark-488656591-gjrpc -c 70761432854f /bin/bash
It says: Error... | Ah once more detailed reading the man page of kubectl exec :
Flags:
-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
So i just used the container name from my m... | Kubernetes | 39,979,880 | 73 |
I have 3 nodes in kubernetes cluster. I create a daemonset and deployed it in all the 3 devices. This daemonset created 3 pods and they were successfully running. But for some reasons, one of the pod failed.
I need to know how can we restart this pod without affecting other pods in the daemon set, also without creati... | kubectl delete pod <podname> it will delete this one pod and Deployment/StatefulSet/ReplicaSet/DaemonSet will reschedule a new one in its place
| Kubernetes | 49,405,924 | 72 |
In a container inside a pod, how can I run a command using kubectl? For example, if i need to do something like this inside a container:
kubectl get pods
I have tried this : In my dockerfile, I have these commands :
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.goo... | I would use kubernetes api, you just need to install curl, instead of kubectl and the rest is restful.
curl http://localhost:8080/api/v1/namespaces/default/pods
Im running above command on one of my apiservers. Change the localhost to apiserver ip address/dns name.
Depending on your configuration you may need to use s... | Kubernetes | 42,642,170 | 72 |
I have defined a Deployment for my app:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: myapp-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: 172.20.34.206:5000/myapp_img:2.0
ports:
... | You could do it via the REST API using the PATCH verb. However, an easier way is to use kubectl patch. The following command updates your app's tag:
kubectl patch deployment myapp-deployment -p \
'{"spec":{"template":{"spec":{"containers":[{"name":"myapp","image":"172.20.34.206:5000/myapp:img:3.0"}]}}}}'
According t... | Kubernetes | 36,920,171 | 72 |
I am trying to test my development helm chat deployment output using --dry-run option. when I run the below command its trying to connect to Kubernetes API server.
Is dry run option required to connect Kubernetes cluster? all I want to check the deployment yaml file output.
helm install mychart-0.1.0.tgz --dry-run --... | There is also an option to run helm template ./mychart to render the generated YAMLs without needing the connection to tiller.
Combined with helm lint it's a great set to verify validity of your chart.
| Kubernetes | 47,894,318 | 71 |
Both Kubernetes Pods and the results of Docker Compose scripts (henceforth: "Compositions") appear to result in clusters of virtual computers.
The computers in the clusters can all be configured to talk to each other so you can write a single script that mirrors your entire end-to-end production config. A single script... | docker compose is just a way to declare the container you have to start: it has no notion of node or cluster, unless it launches swarm master and swarm nodes, but that is docker swarm)
Update July 2016, 7 months later: docker 1.12 blurs the lines and includes a "swarm mode".
It is vastly different from kubernetes, a go... | Kubernetes | 33,946,144 | 71 |
kubectl get command has this flag -o to format the output.
Is there a similar way to format the output of the kubectl describe command?
For example:
kubectl describe -o="jsonpath={...}" pods my-rc
would print a JSON format for the list of pods in my-rc replication controller. But -o is not accepted for the describe co... | kubectl describe doesn't support -o or equivalent. It's meant to be human-readable rather than script-friendly. You can achieve what you described with kubectl get pods -l <selector_of_your_rc> -o <output_format>, for example:
$ kubectl get pods -l app=guestbook,tier=frontend -o name
pod/frontend-a4kjz
pod/frontend-am1... | Kubernetes | 37,464,518 | 69 |
I recently updated my Docker for Desktop to latest Edge channel version: 2.1.1.0 on a Windows 10 machine. Unfortunately, after updating, Kubernetes was no longer working as it is always stuck at "Kubernetes is Starting".
I have tried the following so far.
Restarting Docker
Resetting the Kubernetes Cluster
Restoring Fa... | After hours of trying out different things, here is what finally helped me:
Restore Docker to Factory Default settings and Quit Docker for Desktop
Delete the folder C:\ProgramData\DockerDesktop\pki (Make a backup of it just in case). Note that many have reported the folder to be located elsewhere: C:\Users\<user_name... | Kubernetes | 57,711,639 | 68 |
I don't mean being able to route to a specific port, I mean to actually change the port the ingress listens on.
Is this possible? How? Where is this documented?
| No. From the kubernetes documentation:
An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically uses a service of type Service.Type=NodePort or Service.Type=LoadBalancer.
It may be possible to customize a LoadBalancer on a cloud provider like AWS t... | Kubernetes | 56,243,121 | 68 |
I have a kind: Namespace template YAML, as per below:
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace }}
namespace: ""
How do I make helm install create the above-given namespace ({{ .Values.namespace }}) if and only if above namespace ({{ .Values.namespace }}) doesn't exits in the pointed Kube... | This feature is implemented in helm >= 3.2 (Pull Request)
Use --create-namespace in addition to --namespace <namespace>
| Kubernetes | 51,783,651 | 68 |
I have a docker compose file with the following entries
version: '2.1'
services:
mysql:
container_name: mysql
image: mysql:latest
volumes:
- ./mysqldata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
healthcheck:
test: ["CMD... | That's the beauty of Docker Compose and Docker Swarm... Their simplicity.
We came across this same Kubernetes shortcoming when deploying the ELK stack.
We solved it by using a side-car (initContainer), which is just another container in the same pod thats run first, and when it's complete, kubernetes automatically star... | Kubernetes | 49,368,047 | 68 |
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?
| Author's note
This question was originally posted 3 years ago. Since then the technology landscape has moved on.
For example Mesosphere, the company behind DCOS has renamed itself and refocused it's efforts on Kubernetes. Similarily Rancher positioned itself as a Kubernetes installation and management layer.
If this i... | Kubernetes | 39,608,002 | 68 |
I've created a Kubernetes job that has now failed. Where can I find the logs to this job?
I'm not sure how to find the associated pod (I assume once the job fails it deletes the pod)?
Running kubectl describe job does not seem to show any relevant information:
Name: app-raiden-migration-12-19-58-21-11-2018
Na... | One other approach:
kubectl describe job $JOB
Pod name is shown under "Events"
kubectl logs $POD
| Kubernetes | 53,411,958 | 67 |
by using kubectl exec -ti POD_NAME bash I am able to access the terminal inside the container and execute the command.
I can understand the usability and convenient of the above command. As K8s Operator I use exec regularly.
However, What is the use case of kubectl attach POD_NAME?
How can it be utilised?
What is the... | The use cases for kubectl attach are discussed in kubernetes/issue 23335.
It can attach to the main process run by the container, which is not always bash.
As opposed to exec, which allows you to execute any process within the container (often: bash)
# Get output from running pod 123456-7890, using the first container ... | Kubernetes | 50,030,252 | 67 |
Using kubernetes-kafka as a starting point with minikube.
This uses a StatefulSet and a headless service for service discovery within the cluster.
The goal is to expose the individual Kafka Brokers externally which are internally addressed as:
kafka-0.broker.kafka.svc.cluster.local:9092
kafka-1.broker.kafka.svc.cluster... | We have solved this in 1.7 by changing the headless service to Type=NodePort and setting the externalTrafficPolicy=Local. This bypasses the internal load balancing of a Service and traffic destined to a specific node on that node port will only work if a Kafka pod is on that node.
apiVersion: v1
kind: Service
metadata:... | Kubernetes | 46,456,239 | 67 |
I'm running a MySQL deployment on Kubernetes however seems like my allocated space was not enough, initially I added a persistent volume of 50GB and now I'd like to expand that to 100GB.
I already saw the a persistent volume claim is immutable after creation, but can I somehow just resize the persistent volume and then... | Yes, as of 1.11, persistent volumes can be resized on certain cloud providers. To increase volume size:
Edit the PVC (kubectl edit pvc $your_pvc) to specify the new size. The key to edit is spec.resources.requests.storage:
Terminate the pod using the volume.
Once the pod using the volume is terminated, the filesys... | Kubernetes | 40,335,179 | 67 |
I am creating an InfluxDB deployment in a Kubernetes cluster (v1.15.2), this is my yaml file:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: monitoring-influxdb
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
task: monitoring
k8s-app: influxdb
... | kubectl logs deployment/<name-of-deployment> # logs of deployment
kubectl logs -f deployment/<name-of-deployment> # follow logs
| Kubernetes | 60,518,658 | 66 |
In Kelsey Hightower's Kubernetes Up and Running, he gives two commands :
kubectl get daemonSets --namespace=kube-system kube-proxy
and
kubectl get deployments --namespace=kube-system kube-dns
Why does one use daemonSets and the other deployments?
And what's the difference?
| Kubernetes deployments manage stateless services running on your cluster (as opposed to for example StatefulSets which manage stateful services). Their purpose is to keep a set of identical pods running and upgrade them in a controlled way. For example, you define how many replicas(pods) of your app you want to run in ... | Kubernetes | 53,888,389 | 66 |
I am fairly new to the Google Cloud platform and Docker and set-up a cluster of nodes, made a Dockerfile that copies a repo and runs a Clojure REPL on a public port. I can connect to it from my IDE and play around with my code, awesome!
That REPL should however probably be tunneled through SSH, but here is where my pro... | For more recent Kubernetes versions the shell command should be separated by the --:
kubectl exec -it <POD NAME> -c <CONTAINER NAME> -- bash
Please note that bash needs to be availalble for execution inside of the container. For different OS flavours you might need to use /bin/sh, /bin/bash (or others) instead.
The co... | Kubernetes | 38,485,771 | 66 |
Is there a way to force an SSL upgrade for incoming connections on the ingress load-balancer? Or if that is not possible with, can I disable port :80? I haven't found a good documentation pages that outlines such an option in the YAML file. Thanks a lot in advance!
| https://github.com/kubernetes/ingress-gce#frontend-https
You can block HTTP through the annotation kubernetes.io/ingress.allow-http: "false" or redirect HTTP to HTTPS by specifying a custom backend. Unfortunately GCE doesn't handle redirection or rewriting at the L7 layer directly for you, yet. (see https://github.com/... | Kubernetes | 37,001,557 | 66 |
I am setting up the kubernetes setup for django webapp.
I am passing environment variable while creating deployment as below
kubectl create -f deployment.yml -l key1=value1
I am getting error as below
error: no objects passed to create
Able to create the deployment successfully, If i remove the env variable -l key1=... | I used envsubst (https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html) for this. Create a deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: $NAME
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labe... | Kubernetes | 56,003,777 | 65 |
Can I set the default namespace? That is:
$ kubectl get pods -n NAMESPACE
It saves me having to type it in each time especially when I'm on the one namespace for most of the day.
| Yes, you can set the namespace as per the docs like so:
$ kubectl config set-context --current --namespace=NAMESPACE
Alternatively, you can use kubectx for this.
| Kubernetes | 54,902,676 | 65 |
In most examples about using secrets in Kubernetes, you can find similar examples:
apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
data:
username: User
password: **********
What is the purpose of type: Opaque in the definition above? What other types (and for which use cases) are possible to sp... | type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured, it can contain arbitrary key-value pairs.
In contrast, there is the Secret storing ServiceAccount credentials, or the ones used as ImagePullSecret. These have a constrained contents.
| Kubernetes | 45,120,359 | 65 |
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?
According to the OpenShift 3 documentation, which is built on top of Kubernetes, (https://docs.openshift... | 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.
In the event that they, etcd, or the API are fully offline, the cluster ceases to be a clust... | Kubernetes | 39,172,131 | 65 |
Why do I need 3 different kind of probes in kubernetes:
startupProbe
readinessProbe
livenessProbe
There are some questions (k8s - livenessProbe vs readinessProbe, Setting up a readiness, liveness or startup probe) and articles about this topic. But this is not so clear:
Why do I need 3 different kind of probes?
What... | These 3 kind of probes have 3 different use cases. That's why we need 3 kind of probes.
Liveness Probe
If the Liveness Probe fails, the pod will be restarted (read more about failureThreshold).
Use case: Restart pod, if the pod is dead.
Best practices: Only include basic checks in the liveness probe. Never include chec... | Kubernetes | 65,858,309 | 64 |
I am trying to deploy my microservices into Kubernetes cluster. My cluster having one master and one worker node. I created this cluster for my R&D of Kubernetes deployment. When I am trying to deploy I am getting the even error message like the following,
Events:
Type Reason Age From ... | You can run below command to remove the taint from master node and then you should be able to deploy your pod on that node
kubectl taint nodes mildevkub020 node-role.kubernetes.io/master-
kubectl taint nodes mildevkub040 node-role.kubernetes.io/master-
Now regarding why its showing as master node check the command y... | Kubernetes | 59,484,509 | 64 |
I have a helm repo:
helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
and I want to list all the charts available or search the charts under stable helm repo.
How do I do this?
No command so far to list available charts under a h... | First, always update your local cache:
helm repo update
Then, you can list all charts by doing:
helm search repo
Or, you can do a case insensitive match on any part of chart name using the following:
helm search repo [your_search_string]
Lastly, if you want to list all the versions you can use the -l/--version argum... | Kubernetes | 55,973,901 | 64 |
Recently, prometheus-operator has been promoted to stable helm chart (https://github.com/helm/charts/tree/master/stable/prometheus-operator).
I'd like to understand how to add a custom application to monitoring by prometheus-operator in a k8s cluster. An example for say gitlab runner which by default provides metrics ... | Thanks to Peter who showed me that it idea in principle wasn't entirely incorrect I've found the missing link. As a servicemonitor does monitor services (haha), I missed the part of creating a service which isn't part of the gitlab helm chart. Finally this yaml did the trick for me and the metrics appear in Prometheus:... | Kubernetes | 52,991,038 | 64 |
My Understanding of this doc page is, that I can configure service accounts with Pods and hopefully also deployments, so I can access the k8s API in Kubernetes 1.6+. In order not to alter or use the default one I want to create service account and mount certificate into the pods of a deployment.
How do I achieve someth... | As you will need to specify 'podSpec' in Deployment as well, you should be able to configure the service account in the same way. Something like:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-deployment
spec:
template:
# Below is the podSpec.
metadata:
name: ...
spec:
se... | Kubernetes | 44,505,461 | 64 |
I want to give my application limited access to get the replicas of different statefulsets (and maybe deployment) and if necessary scale them up or down.
I have created ServiceAccount, Rolebinding and Role for this but I can't find the complete list of rule verbs ("get", "watch", "list", "update") and what are their li... | You can get quite a bit of info via this:
kubectl api-resources --sort-by name -o wide
The above api-resources command is explicit and easy to grep. The complete list of possible verbs can be obtained thus:
$ kubectl api-resources --no-headers --sort-by name -o wide | sed 's/.*\[//g' | tr -d "]" | tr " " "\n" | sort |... | Kubernetes | 57,661,494 | 63 |
Is it possible to set the working directory when launching a container with Kubernetes ?
| Yes, through the workingDir field of the container spec. Here's an example replication controller with an nginx container that has workingDir set to /workdir:
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 1
template:
metadata:
labels:
name: nginx
spec:
... | Kubernetes | 36,634,614 | 63 |
Using fleet I can specify a command to be run inside the container when it is started. It seems like this should be easily possible with Kubernetes as well, but I can't seem to find anything that says how. It seems like you have to create the container specifically to launch with a certain command.
Having a general pur... | I spend 45 minutes looking for this. Then I post a question about it and find the solution 9 minutes later.
There is an hint at what I wanted inside the Cassandra example. The command line below the image:
id: cassandra
kind: Pod
apiVersion: v1beta1
desiredState:
manifest:
version: v1beta1
id: cassandra
c... | Kubernetes | 28,976,455 | 63 |
I have a cronjob that sends out emails to customers. It occasionally fails for various reasons. I do not want it to restart, but it still does.
I am running Kubernetes on GKE. To get it to stop, I have to delete the CronJob and then kill all the pods it creates manually.
This is bad, for obvious reasons.
apiVer... | It turns out that you have to set a backoffLimit: 0 in combination with restartPolicy: Never in combination with concurrencyPolicy: Forbid.
backoffLimit means the number of times it will retry before it is considered failed. The default is 6.
concurrencyPolicy set to Forbid means it will run 0 or 1 times, but not ... | Kubernetes | 51,657,105 | 62 |
I have two applications - app1 and app2, where app1 is a config server that holds configs for app2. I have defined /readiness endpoint in app1 and need to wait till it returns OK status to start up pods of app2.
It's crucial that deployment of app2 wait till kubernetes receives Http Status OK from /readiness endpoint ... | You can use initContainers. Following is an example of how you can do in your YAML file
initContainers:
- name: wait-for-other-pod
image: docker.some.image
args:
- /bin/sh
- -c
- >
set -x;
while [ $(curl -sw '%{http_code}' "http://www.<your_pod_health_check_end_point>.com" -o /dev/null) -ne 200 ]; do
... | Kubernetes | 51,079,849 | 62 |
I want to clear cache in all the pods in my Kubernetes namespace. I want to send one request to the end-point which will then send a HTTP call to all the pods in the namespace to clear cache. Currently, I can hit only one pod using Kubernetes and I do not have control over which pod would get hit.
Even though the load-... | Provided you got kubectl in your pod and have access to the api-server, you can get all endpoint adressess and pass them to curl:
kubectl get endpoints <servicename> \
-o jsonpath="{.subsets[*].addresses[*].ip}" | xargs curl
Alternative without kubectl in pod:
the recommended way to access the api server from ... | Kubernetes | 49,612,412 | 62 |
I am trying to debug a pod with the status "ImagePullBackOff".
The pod is in the namespace minio-operator, but when I try to to describe the pod, it is apparently not found.
Why does that happen?
[psr-admin@zon-psr-2-u001 ~]$ kubectl get all -n minio-operator
NAME READY STATUS ... | You've not specified the namespace in your describe pod command.
You did kubectl get all -n minio-operator, which gets all resources in the minio-operator namespace, but your kubectl describe has no namespace, so it's looking in the default namespace for a pod that isn't there.
kubectl describe pod -n minio-operator <p... | Kubernetes | 61,270,313 | 61 |
I want to export already templated Helm Charts as YAML files. I can not use Tiller on my Kubernetes Cluster at the moment, but still want to make use of Helm Charts. Basically, I want Helm to export the YAML that gets send to the Kubernetes API with values that have been templated by Helm. After that, I will upload the... | We need logs to check the Unauthorized issue.
But you can easily generate templates locally:
helm template mychart
Render chart templates locally and display the output.
This does not require Tiller. However, any values that would normally
be looked up or retrieved in-cluster will be faked locally.
Additionally, none... | Kubernetes | 50,584,091 | 61 |
I want to calculate the cpu usage of all pods in a kubernetes cluster. I found two metrics in prometheus may be useful:
container_cpu_usage_seconds_total: Cumulative cpu time consumed per cpu in seconds.
process_cpu_seconds_total: Total user and system CPU time spent in seconds.
Cpu Usage of all pods = increment per s... | This I'm using to get CPU usage at cluster level:
sum (rate (container_cpu_usage_seconds_total{id="/"}[1m])) / sum (machine_cpu_cores) * 100
I also track the CPU usage for each pod.
sum (rate (container_cpu_usage_seconds_total{image!=""}[1m])) by (pod_name)
I have a complete kubernetes-prometheus solution on GitHub, ... | Kubernetes | 40,327,062 | 61 |
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.
As far as I can see it, there are two ways of doing it:
Use subdomains:
*.dev.foobar... |
There are only two hard things in Computer Science: cache invalidation
and naming things.
-- Phil Karlton
Depends on the company size.
Small businesses usually go for dashes and get the wildcard certificate.
So they would have dev.example.com, test.example.com
In larger enterprises they usually have a DNS infrastru... | Kubernetes | 39,336,130 | 61 |
I have been digging through the Kubernetes documentation for hours. I understand the core design, and the notion of services, controllers, pods, etc.
What I don't understand, however, is the process in which I can declaratively configure the cluster. That is, a way for me to write a config file (or a set thereof) t... | If you're still looking, maybe this tool can help: https://github.com/kelseyhightower/compose2kube
You can create a compose file:
# sample compose file with 3 services
web:
image: nginx
ports:
- "80"
- "443"
database:
image: postgres
ports:
- "5432"
cache:
image: memcached
ports:
- "11211"
... | Kubernetes | 37,845,715 | 61 |
I have a kubernetes cluster running on azure. What is the way to access the cluster from local kubectl command. I referred to here but on the kubernetes master node there is no kube config file. Also, kubectl config view results in
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: ... | Found a way to access remote kubernetes cluster without ssh'ing to one of the nodes in cluster. You need to edit ~/.kube/config file as below :
apiVersion: v1
clusters:
- cluster:
server: http://<master-ip>:<port>
name: test
contexts:
- context:
cluster: test
user: test
name: test
Then set contex... | Kubernetes | 36,306,904 | 60 |
When I am using below it deletes the running POD after matching the pattern from commandline:
kubectl get pods -n bi-dev --no-headers=true | awk '/group-react/{print $1}' | xargs kubectl delete -n bi-dev pod
However when I am using this command as an alias in .bash_profile it doesn't execute .
This is how I defined ... |
Am I missing something to delete POD using Pattern Match or with Wilcard?
When using Kubernetes it is more common to use labels and selectors. E.g. if you deployed an application, you usually set a label on the pods e.g. app=my-app and you can then get the pods with e.g. kubectl get pods -l app=my-app.
Using this apr... | Kubernetes | 59,473,707 | 59 |
I am using the following command to create a configMap.
kubectl create configmap test --from-file=./application.properties --from-file=./mongo.properties --from-file=./logback.xml
Now, I have modified a value for a key from mongo.properties which I need to update in Kubernetes.
Option 1:
kubectl edit test
Here, it o... | Now you can. Just throw: kubectl edit configmap <name of the configmap> on your command line. Then you can edit your configuration.
| Kubernetes | 49,989,943 | 59 |
None of the systemd commands are working inside WSL( Ubuntu Bash 18.04). When I ran sudo systemctl is-active kubelet, error is output: System has not been booted with systemd as init system (PID 1). Can't operate.
: running command: sudo systemctl is-active kubelet
How to enable systemd feature in WSL? Whats the way to... | When using WSL2 you can use:
sudo service docker start
This command basically execute the script /etc/init.d/docker.
Some customization, like specifying HTTP proxy, is possible via the script /etc/default/docker.
| Kubernetes | 55,579,342 | 58 |
I'm trying to change the client_max_body_size value, so my NGINX ingress will not return the HTTP 413 Content Too Large error (as seen in the logs).
I've tested a few solutions.
Here is my config map:
kind: ConfigMap
apiVersion: v1
data:
proxy-connect-timeout: "15"
proxy-read-timeout: "600"
proxy-send-timeout: "6... | You can use the annotation nginx.ingress.kubernetes.io/proxy-body-size to set the max-body-size option right in your Ingress object instead of changing a base ConfigMap.
Here is the example of usage:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-app
annotations:
nginx.ingress.kubernetes.io/pro... | Kubernetes | 49,918,313 | 58 |
I have a job definition based on example from kubernetes website.
apiVersion: batch/v1
kind: Job
metadata:
name: pi-with-timeout-6
spec:
activeDeadlineSeconds: 30
completions: 1
parallelism: 1
template:
metadata:
name: pi
spec:
containers:
- name: pi
image: perl
comma... | By now this is possible for Jobs by setting backoffLimit: 0 which tells the controller to do 0 retries. default is 6
| Kubernetes | 39,893,238 | 58 |
I want to store files in Kubernetes Secrets but I haven't found how to do it using a yaml file.
I've been able to make it using the cli with kubectl:
kubectl create secret generic some-secret --from-file=secret1.txt=secrets/secret1.txt
But when I try something similar in a yaml:
apiVersion: v1
kind: Secret
metadata:
... | As answered on previous post, we need to provide the certificate/key encoded as based64 to the file.
Here is generic example for a certiticate (in this case SSL):
The secret.yml.tmpl:
apiVersion: v1
kind: Secret
metadata:
name: test-secret
namespace: default
type: Opaque
data... | Kubernetes | 36,887,946 | 58 |
As per this official document, Kubernetes Persistent Volumes support three types of access modes.
ReadOnlyMany
ReadWriteOnce
ReadWriteMany
The given definitions of them in the document is very high-level. It would be great if someone can explain them in little more detail along with some examples of different use cas... | You should use ReadWriteX when you plan to have Pods that will need to write to the volume, and not only read data from the volume.
You should use XMany when you want the ability for Pods to access the given volume while those workloads are running on different nodes in the Kubernetes cluster. These Pods may be multip... | Kubernetes | 57,798,267 | 57 |
I came to the realization that Windows 10 Docker has the Kubernetes options in it now, so I want to completely uninstall minikube and use the Kubernetes version that comes with docker windows instead.
How can I completely uninstall minikube in windows 10?
| This as simple as running:
minikube stop & REM stops the VM
minikube delete & REM deleted the VM
Then delete the .minikube and .kube directories usually under:
C:\users\{user}\.minikube
and
C:\users\{user}\.kube
Or if you are using chocolatey:
C:\ProgramData\chocolatey\bin\minikube stop
C:\ProgramData\chocolatey\bi... | Kubernetes | 53,263,586 | 57 |
I am using Docker for Mac with Kubernetes support and I'm struggling to create a Kubernetes Deployment that references a locally built image.
Output of docker images:
REPOSITORY TAG IMAGE
test latest 2c3bdb36a5ed
My deployment.yaml :
apiVersion: apps/v1
kind: Deployment
metadata:
name: helloworld-depl... | I was able to run a local image by setting the imagePullPolicy to Never.
For example:
apiVersion: v1
kind: Pod
metadata:
name: local-image-test
spec:
containers:
- name: local-image-container
image: local-image:latest
imagePullPolicy: Never
(Credit to https://github.com/kubernetes/kubernetes/issues/1293#... | Kubernetes | 50,739,405 | 57 |
I am trying to create an S3 bucket using
aws s3api create-bucket —bucket kubernetes-aws-wthamira-io
It gives this error:
An error occurred (IllegalLocationConstraintException) when calling
the CreateBucket operation: The unspecified location constraint is
incompatible for the region specific endpoint this request was... | try this:
aws s3api create-bucket --bucket kubernetes-aws-wthamira-io --create-bucket-configuration LocationConstraint=eu-west-1
Regions outside of us-east-1 require the appropriate LocationConstraint to be specified in order to create the bucket in the desired region.
https://docs.aws.amazon.com/cli/latest/reference/... | Kubernetes | 49,174,673 | 57 |
I know this is some kind of syntax/yaml structure related error but the message is so cryptic I have no idea what the issue is:
Error: render error in "mychart/templates/ingress.yaml": template: mychart/templates/ingress.yaml:35:37: executing "mychart/templates/ingress.yaml" at <.Values.network.appP...>: can't evaluate... | In the range block . refers to the current value in the execution time. Instead of . you can use $ to access to the root data object in the range block instead of declaring top level variables.
Example:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
... | Kubernetes | 56,671,452 | 56 |
I am getting the following error
ERROR 2013 (HY000): Lost connection to MySQL server at
'reading authorization packet', system error: 0
when trying to connect to my MySQL server.
What I am doing:
I have Master - Slave replication in MySQL that is working and just added load balance capabilities using F5.
I have co... | From documentation:
More rarely, it can happen when the client is attempting the initial
connection to the server. In this case, if your connect_timeout value
is set to only a few seconds, you may be able to resolve the problem
by increasing it to ten seconds, perhaps more if you have a very long
distance or s... | F5 | 21,091,850 | 49 |
We are currently using TeamCity for CI builds and we are trying to set up automated deployments as well.
The project I'm currently trying to deploy is a Windows service that sits under an F5 load balancer. In the future we would also like to automate the deployment of our IIS websites which also sit under the F5.
Fro... | I haven't used it, but have you looked at the F5 iControl web service API and the F5 iControl PowerShell cmdlets provided by F5. The PowerShell cmdlets have been around since 2007 and can be downloaded from F5 DevCentral.
It looks like there are Enable-Member and Disable-Member cmdlets that you'll be able to use.
| F5 | 17,244,218 | 12 |
Sources such as this Okta sponsored site (see "Per-Request Customization" section) mention that the redirect_uri parameter of a autorization request SHOULD NEVER have a dynamic query part (ex: for session matching uses).
Quote:
The server should reject any authorization requests with redirect URLs
that are not an ex... | TL;DR:
No, the redirect uri must be static for security reasons. If the client needs to keep a state between the authorization request and its asynchronous response, use the OAuth 2.0 state parameter.
Long version :
RFC6749 (the initial OAuth 2.0 specification) has been published in 2012 and OAuth security landscape ha... | F5 | 55,524,480 | 10 |
I can't access to public IP assigned by MetalLB load Balancer
I created a Kubernetes cluster in Contabo. Its 1 master and 2 workers. Each one has its own public IP.
I did it with kubeadm + flannel. Later I did install MetalLB to use Load Balancing.
I used this manifest for installing nginx:
apiVersion: apps/v1beta2
k... | What you are missing is a routing policy
Your external IP addresses must belong to the same network as your nodes or instead of that you can add a route to your external address at your default gateway level and use a static NAT for each address
| MetalLB | 57,099,703 | 10 |
I have a question about my haproxy config:
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 syslog emerg
maxconn 4000
quiet
user haproxy
group ... | Willy got me an answer by email. I thought I would share it. His answers are in bold.
I have a question about my haproxy config:
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log ... | HAProxy | 8,750,518 | 101 |
So according to the haproxy author, who knows a thing or two about http:
Keep-alive was invented to reduce CPU
usage on servers when CPUs were 100
times slower. But what is not said is
that persistent connections consume a
lot of memory while not being usable
by anybody except the client who
openned them.... | Hey since I'm the author of this citation, I'll respond :-)
There are two big issues on large sites : concurrent connections and latency. Concurrent connection are caused by slow clients which take ages to download contents, and by idle connection states. Those idle connection states are caused by connection reuse to f... | HAProxy | 4,139,379 | 98 |
Is there any way to validate the HAProxy haproxy.cfg file before restarting the HAProxy service? For example: There might be a small spelling/syntax error in a larger haproxy.cfg file. I searched through several forums, but was unable to find anything in relation to validating the haproxy.cfg files for syntax errors.
A... | The official HaProxy configuration file check was buried in the help sections.
/usr/local/sbin/haproxy --help
There are two ways to check the haproxy.cfg syntax is to use..
One way is the /usr/local/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfg
which validates the file syntax. The -c switch in the command represents ... | HAProxy | 39,609,178 | 82 |
haproxy does not start anymore, it shows the error
bind <ip>:443' : unable to load SSL private key from PEM file ...
We did not change anything on the certificates or configuration. Since the last start we only made normal updates to the system.
To find the error, I generated a completely new certificate (self signed)... | The order in which the cert and key files appear in the pem is important. Use the following to create the pem file.
cat example.com.crt example.com.key > example.com.pem
| HAProxy | 27,947,982 | 62 |
We've been fighting with HAProxy for a few days now in Amazon EC2; the experience has so far been great, but we're stuck on squeezing more performance out of the software load balancer. We're not exactly Linux networking whizzes (we're a .NET shop, normally), but we've so far held our own, attempting to set proper ulim... | Not answering the question directly, but EC2 now supports load balancing through Elastic Load Balancing rather than running your own load balancer in an EC2 instance.
EDIT: Amazon's Route 53 DNS service now offers a way to point a top-level domain at an ELB with an "alias" record. Since Amazon knows the current IP add... | HAProxy | 260,413 | 47 |
I am using HAProxy to send requests, on a subdomain, to a node.js app.
I am unable to get WebSockets to work. So far I have only been able to get the client to establish a WebSocket connection but then there is a disconnection which follows very soon after.
I am on ubuntu. I have been using various versions of socket... | Upgrade to latest version of socket.io (0.6.8 -> npm install socket.io@0.6.8, which is patched to work with HAProxy)
and download the latest version of HAProxy.
Here is an example config file:
global
maxconn 4096 # Total Max Connections. This is dependent on ulimit
nbproc 2
defaults
mode ht... | HAProxy | 4,360,221 | 44 |
I'm building an haproxy config file that has multiple front and backends. It's going to be several hundred lines long and I'd rather split it up into separate files for each of the different websites that I want to loadbalance.
Does HAProxy offer the ability to link to partial config files from the main haproxy.cfg fil... | Configuration files can't be linked together from a configuration directive.
However HAProxy can load multiple configuration files from its command line, using the -f switch multiple times:
haproxy -f conf/http-defaults -f conf/http-listeners -f conf/tcp-defaults -f conf/tcp-listeners
If you want to be flexible with ... | HAProxy | 25,775,682 | 37 |
I'm trying to start haproxy (version 1.5.8 2014/10/31) with an "empty" config file and I get:
user@server:~$ sudo service haproxy start
[....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock]
altough it's enabled:
user@server:~$ cat /etc/d... | Haproxy needs to write to /run/haproxy/admin.sock but it wont create the directory for you. Create the directory /run/haproxy/ first or set stats socket to a different path.
| HAProxy | 30,101,075 | 37 |
Google Cloud Network load balancer is a pass-through load balancer and not a proxy load balancer. ( https://cloud.google.com/compute/docs/load-balancing/network/ ).
I can not find any resources in general on a pass through LB. Both HAProxy and Nginx seems to be proxy LBs. I'm guessing that pass through LB would be red... | It's hard to find resources for pass-through load balancing because everyone came up with a different way of calling it: pass-though, direct server return(DSR), direct routing,...
We'll call it pass-through here.
Let me try to explain the thing:
The IP packets are forwarded unmodified to the VM, there is no address or... | HAProxy | 43,205,917 | 31 |
I am really new to sys admin stuff, and have only provisioned a VPS with nginx(serving the static files) and gunicorn as the web server.
I have lately been reading about different other stuff. I came to know about other tools:
nginx : high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server... | Let's say you plan to host a few websites on your new VPS. Let's look at the tools you might need for each site.
HTTP Servers
Website 'Alpha' just consists of a some pure HTML, CSS and Javascript. The content is static.
When someone visits website Alpha, their browser will issue an HTTP request. You have configured (... | HAProxy | 13,210,636 | 30 |
We have recently shifted from HTTP to HTTPS. As we have already moved to HTTPS, we are thinking of moving to HTTP/2 to get performance benefits.
As explained above that requests between browser and LB are secured (HTTPS) while communication between LB and app server still using HTTP
What is the possibility of enabling... | 2017 update: HAProxy 1.8 supports HTTP/2
From the 1.8 announcement:
HAProxy 1.8 now supports HTTP/2 on the client side (in the frontend sections) and can act as a gateway between HTTP/2 clients and your HTTP/1.1 and HTTP/1.0 applications.
You'll need the h2 directive in your haproxy.conf. From CertSimple's HAProxy HT... | HAProxy | 40,656,406 | 30 |
The server is receiving thousands of OPTIONS requests due to CORS (Cross-Origin Resource Sharing). Right now, every options request is being sent to one of the servers, which is a bit wasteful, knowing that HAProxy can add the CORS headers itself without the help of a web server.
frontend https-in
...
use_backe... | Good news, HAProxy 2.2 just introduced the "Native Response Generator" feature. It works with the http-request return directive, and can be used for serving static files or text strings, including dynamic parameters.
The goal is to avoid the usual hacks with errorfile.
Taking advantage of another directive introduced i... | HAProxy | 26,556,838 | 26 |
I installed HAProxy for load ballancing before. How can I check what is my haproxy version which installed before in mu ubuntu?
| haproxy --version
If you want to see the package info on Ubuntu, you can use 'aptitude show haproxy' to get version and other details about what's installed.
| HAProxy | 10,908,929 | 25 |
I need redirect www.foo.com and foo.com to www.bar.com in haproxy, this is my configuration:
frontend http-in
bind *:80
acl bar.com hdr(host) -i www.bar.com
...
use_backend bar.com_cluster if bar.com
...
redirect prefix http://foo.com code 301 if { hdr(host) -i www.bar.com }
redirect ... | Change order of the hostname:
redirect prefix http://www.bar.com code 301 if { hdr(host) -i foo.com }
redirect prefix http://www.bar.com code 301 if { hdr(host) -i www.foo.com }
instead of
redirect prefix http://foo.com code 301 if { hdr(host) -i www.bar.com }
redirect prefix http://www.foo.com code 301 if { hdr(host)... | HAProxy | 28,530,087 | 25 |
I build a HAProxy on CentOS 7 and enable statistics page with port 8080. It seems work properly.
When I set port as 8888, the HAProxy is not working and gives me some feedback.
After that, I tried many ways to solve this problem, but the problem is still there.
Does anyone can help me deal with this issue?
Here is the... | Thanks for you guys at first.
I have solved this issue by following command.
setsebool -P haproxy_connect_any=1
It works for me!
| HAProxy | 34,793,885 | 25 |
It's been on the cards for a while, but now that Amazon have released Elastic Load balancing (ELB), what are your thoughts on deploying this solution for a high-traffic web application?
Should we replace HAProxy or consider ELB as a complimentary service in front of HAProxy?
| I've been running an ELB instead of HAProxy for about a month now on a site that gets about 100,000 visits per day, and I've been pretty pleased with the results.
A gotcha though (UPDATE, this issue has been fixed by Amazon AWS, see comments below):
You can't load balance the root of a domain as you have to create a... | HAProxy | 877,468 | 23 |
I'm currently using Haproxy to balance several express.js nodes. I know that it's possible to redirect using express.js, but I was hoping to do so with Haproxy.
I was wondering how I can do a permanent redirect from www.mysite.com to mysite.com?
| redirect prefix http://example.com code 301 if { hdr(host) -i www.example.com }
Please see the documentation of the redirect prefix rule for more information.
If you are using a newer version of HAProxy, i.e. at least 1.6, you can use a more generic syntax which allows to redirect any host, not just explicitly named
h... | HAProxy | 10,401,621 | 22 |
I'm trying to match various conditions inside one backend, like this:
acl rule1 hdr_dom(host) -i ext1
acl rule2 utl_beg /img
default_backend back-server-http if rule1 and rule2
but, how can I put this "and" between the two rules?
| Yes, this is the solution:
acl rule1 hdr_dom(host) -i www.uno.es hdr_dom(host) -i www.one.com
use_backend uno.com if rule1
| HAProxy | 11,140,021 | 21 |
After to much googling, i finally made my haproxy ssl to works. But now i got problem because root and intermediate certificate is not installed so my ssl don`t have green bar.
My haproxy config
global
maxconn 4096
nbproc 1
#debug
daemon
log 127.0.0.1 local0
defau... | It looks like you'll need to recompile like so:
make clean
make \
TARGET="linux26" \
USE_STATIC_PCRE=1 \
USE_OPENSSL=1
make install PREFIX="/opt/haproxy"
After that, bind should recognise your crt option.
In my case, I used:
bind 0.0.0.0:443 ssl crt /envs/production/ssl/haproxy.pem
I concatenated all ssl ... | HAProxy | 15,048,346 | 18 |
I am trying to use certificate signed for another server. I have both private key and certificate.
My PEM file order is :
subject=/C=***/L=*****/O=**********/CN=*********
issuer=/C=***/O=*****Inc/CN=********Secure Server CA
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
subject=/C=US/O=******** Inc/CN=********* ... | The order of the certificates in your file is wrong. It seems you are putting the intermediate certificate (i.e. Secure Server CA) first which is thus expected to be the server certificate. The order of the certificates needs to be:
server certificate
server private key (without any password)
intermediate certificate ... | HAProxy | 31,291,243 | 18 |
I have an HAProxy HTTP Frontend in my HAProxy config like so:
frontend myaddress.net :10098
bind :80,:8080
mode http
log global
option http-server-close
timeout client 14400000
timeout connect 60000
timeout tunnel 14400000
timeout http-request 14400000
capture request header User-Agent len 64
captur... | Try this in your frontend section:
bind :80
bind :8080
| HAProxy | 20,082,761 | 17 |
I am trying to setup an Haproxy to load balance requests on a few backends identified by the uri path. For example:
https://www.example.com/v1/catalog/foo/bar
Should lead to the "catalog-v1" backends.
Thing is each app responds on a different path so I must not only identify the app but rewrite the URL path. E.g.
ht... | If I understand you correctly, replace the example below:
reqrep ^([^\ ]\*)\ /([-.0-9A-Za-z]\*)/([a-zA-Z]\*)/(.\*) \1\ /\3-\2/\4
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#reqrep
reqrep search string [{if | unless} cond]
You have no spaces.
| HAProxy | 24,784,517 | 17 |
I have a simple condition in my HAproxy config (I tried this for frontend and backend):
acl no_index_url path_end .pdf .doc .xls .docx .xlsx
rspadd X-Robots-Tag:\ noindex if no_index_url
It should add the no-robots header to content that should not be indexed. However it gives me this WARNING when parsing the config:
... | Starting in HaProxy 1.6 you won't be able to just ignore the error message. To get this working use the temporary variable feature:
frontend main
http-request set-var(txn.path) path
backend local
http-response set-header X-Robots-Tag noindex if { var(txn.path) -m end .pdf .doc }
| HAProxy | 29,731,265 | 16 |
I'm looking for a cost effective tool for managing an web app on Ec2. Rightscale seems to the big dog and charges for it. Scalr looks like a more cost effective solution but it's hard to find out any real customer experiences..
The key aspects I'm looking for is a load balancer (http and https) and a way to automatical... | I am a Scalr user, a Scalr.net subscriber, and have become a Scalr enthusiast. I cannot possibly afford Rightscale.
Scalr can do what you ask.
Scalr has three images (each with 32/64 bit versions), plus a base (generic) image:
1) A load balancer image, running nginx. A highly available setup requires two of these. S... | HAProxy | 366,612 | 15 |
I have configured HAProxy (1.5.4, but I tried also 1.5.14) to balance in TCP mode two server exposing AMQP protocol (WSO2 Message Broker) on 5672 port.
The clients create and use permanent connection to the AMQP Servers, via HAProxy.
I've changed the client and server TCP keepalive timeout, setting net.ipv4.tcp_keepali... | TCP keep alive is at the transport layer and is only used to do some traffic on the connection so intermediate systems like packet filters don't loose any states and that the end systems can notice if the connection to the other side broke (maybe because something crashed or a network cable broke).
TCP keep alive has n... | HAProxy | 32,634,980 | 15 |
Does HAProxy support domain name to backend mapping for path based routing.
Currently it does support maps for vhost:
frontend xyz
<other_lines>
use_backend backend1 if { hdr(Host) -i myapp.domain1.com }
use_backend backend2 if { hdr(Host) -i myapp.domain2.com }
Can be rewritten using maps as:
frontend xyz
... | Start with the Layer 7 base fetch --
This returns the concatenation of the first Host header and the path part of
the request, which starts at the first slash and ends before the question
mark.
...then use map_beg() to match the beginning of the string to the map.
use_backend %[base,map_beg(/etc/haproxy/testmap.m... | HAProxy | 37,858,336 | 15 |
As per the (verbose) topic, are there any advantages over using a Keepalived & HAProxy as an HA webserver loadbalancer vs a pure keepalived solution?
| Keepalived is working in layer 4 so doesn't have layer 7 knowledge at all. By using HAProxy and Keepalived together you can get benefit of having some options that HAProxy provides in layer 7 like Stickiness, Sampling and converting information, ACLs and conditions, Content switching, Stick-tables, Formated strings, HT... | HAProxy | 29,292,393 | 14 |
Using HAProxy, I'm trying to (TCP) load balance Rserve(a service listening in TCP socket for calling R scripts) running at port 6311 in 2 nodes.
Below is my config file. When I run HAProxy, its statting without any issues. But when I connect to the balanced nodes, getting below error. Anything wrong with the config?
H... | After struggling for a week for a solution to load balance R, below (full free/open source software stack) solution worked.
If more people are referring this, I'll post a detailed blog on installation to configuration.
Was able to load balance R script requests coming to Rserve via HAProxy TCP load balancer with the be... | HAProxy | 39,016,291 | 14 |
I have an application deployed on OpenShift Container Platform v3.6. It consists of multiple services interconnected to each other.
The frontend service calls a time consuming function of the backend service (through a REST call), but after 30 seconds it receives a "504 Gateway Timeout" message. Frontend runs over ngi... | Your route timeout is the culprit. The haproxy ingress router is terminating the request. You can configure the timeout by following the docs below:
https://docs.openshift.com/container-platform/3.5/install_config/configuring_routing.html
For example:
# Set the timeout on 'longrunningroute' to five minutes.
oc annotate... | HAProxy | 47,812,807 | 14 |
I have setup a HAProxy in front of my backend server application to enable HTTPS. I have read that I need to set X-Forward-Proto https.
In the haproxy.cfg file I have tried to do that in the frontend with:
frontend haproxy
bind :8443 ssl crt frontend/server.pem
reqadd X-Forwarded-Proto:\ https
default_backend my-... | It doesn't matter. When you have multiple backends, it usually makes sense to do this on the frontend.
You could also use http-request set-header X-Forwarded-Proto in the front-end, rather than using reqadd.
The req* directives are much older functionality than http-request so the latter is preferred, generally, but... | HAProxy | 51,928,504 | 14 |
I'm very sure this problem has been solved, but I can't find any information anywhere about it...
How do sysadmins programmatically add a new node to an existing and running load balancer ? Let's say I have a load balancer running and already balancing say my API server between two EC2 instances, and suddenly there's a... | You have a few questions in there. For the "add nodes to haproxy without restarting it":
What I do for a similar problem is prepopulate the config file with server names.. e.g. web01, web02 ... web20 even if I only have 5 web servers at the time. Then in my hosts file I map those to the actual ips of the web servers.... | HAProxy | 9,300,163 | 13 |
Our haproxy loadbalancer opens thousands of connections to its backends
even though its settings say to open no more than 10 connections per server instance (see below). When I uncomment "option http-server-close" the number of backend connection drops however I would like to have keep-alive backend connections.
Why ... | In keep-alive mode idle connections are not accounted. As explained in this HAProxy mailthread
The thing is, you don't want
to leave requests waiting in a server's queue while the server has a ton
of idle connections.
This even makes more sense, knowing that browsers initiate preconnect to improve page performanc... | HAProxy | 44,110,899 | 13 |
I would like to ask how HAProxy can help in routing requests depending on parts of the URL.
To give you an overview of my setup, I have the HAProxy machine and the two backends:
IIS website (main site)
Wordpress blog on NGINX (a subsite)
The use-case:
I'm expecting to route requests depending on the URL:
www.websi... | Your regex is wrong, you're assuming the server is in the request path. To match the request paths in the headers use a regex like this one:
reqrep ^([^\ ]*)\ /lang/blog/(.*) \1\ /blog/lang/\2
you can use reqirep as well but that is only useful if your servers actually serve /BLog/lAnG/ as well.
| HAProxy | 8,202,574 | 12 |
I'm reading up on SockJS node server. Documentation says:
Often WebSockets don't play nicely with proxies and load balancers. Deploying a SockJS server behind Nginx or Apache could be painful. Fortunately recent versions of an excellent load balancer HAProxy are able to proxy WebSocket connections. We propose to put ... |
1. Why websockets don't play nice with proxies and load balancers?
I'd recommend you read this article on How HTML5 Web Sockets Interact With Proxy Servers by Peter Lubbers. It should cover everything you need to know about WebSocket and proxies - and thus, load balancers.
2. Why deploying Sockjs sever behind Apache... | HAProxy | 15,817,784 | 12 |
Can someone please explain what is going on behind the scenes in a RabbitMQ cluster with multiple nodes and queues in mirrored fashion when publishing to a slave node?
From what I read, it seems that all actions other than publishes go only to the master and the master then broadcasts the effect of the actions to the s... |
Can someone please explain what is going on behind the scenes in a RabbitMQ cluster with multiple nodes and queues in mirrored fashion when publishing to a slave node?
This blog outlines exactly what happens.
But what happens when I publish to a slave node? Will this node do the same thing of sending first the messa... | HAProxy | 27,104,726 | 12 |
My problem is that I have a docker-compose.yml file and an haproxy.cfg file and I want docker-compose to copy the haproxy.cfg file to the docker container. As per the post Docker composer copy files I can use volumes to do it but in my case I'm getting the below error. Can anybody help me achieve this.
Below is the cod... | Try this:
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
Instead of mounting the whole directory, this will only mount haproxy.cfg. The ro is an abbreviation for read-only, and its usage guarantees the container won't modify it after it gets mounted.
| HAProxy | 45,573,831 | 12 |
What is the difference between Nginx ingress controller and HAProxy load balancer in kubernetes?
| First, let's have a quick overview of what an Ingress Controller is in Kubernetes.
Ingress Controller: controller that responds to changes in Ingress rules and changes its internal configuration accordingly
So, both the HAProxy ingress controller and the Nginx ingress controller will listen for these Ingress configur... | HAProxy | 55,166,389 | 12 |
here is my config file
listen solr 0.0.0.0:8983
mode http
balance roundrobin
option httpchk GET "/solr/select/?q=id:1234" HTTP/1.1
server solr_slave 1.1.1.1:8983 maxconn 5000 weight 256 check
server solr_master 2.2.2.2:8983 maxconn 5000 weight 1 check
the problem is that my solr server is protected using basic http p... | A little late, but I just came across the same problem, and wanted to share the solution with the world. First, you base64-encode the credentials:
$ echo -n "user:pass" | base64
dXNlcjpwYXNz
(Make sure you use the -n switch so you don't append a newline.)
The option httpchk allows you to add arbitrary HTTP headers to... | HAProxy | 13,325,882 | 11 |
I am trying to understand fundamental use cases between these two and when to prefer one over the other.
For example HAProxy support TCP load balancing. In practical cases when this would be a deciding factor?
Also What HTTP LB can achieve TCP can not and vice versa
Any reference architecture
Any relevant link with ... |
For example HAProxy support TCP load balancing. In practical cases when this would be a deciding factor?
You would probably use this if you are using sockets/comet/full-duplex
Also What HTTP LB can achieve TCP can not and vice versa
Currently HAproxy is the most reliable LB on the market for TCP and websockets.... | HAProxy | 25,743,419 | 11 |
When I open the haproxy statistics report page of my http proxy server, I saw something like this:
Cum. connections: 280073
Cum. sessions : 3802
Cum. HTTP requests: 24245
I'm not using 'appsession' and any other cookie related command in the configuration. So what's 'session' means here?
I guess haproxy identify... | I was asking myself the very same question this morning.
Searching through http://www.haproxy.org/download/1.5/doc/configuration.txt I came accross this very short definition (hidden in a parameter description) :
A session is a connection that was accepted by the layer 4 rules.
In your case, you're obviously using Hap... | HAProxy | 33,168,469 | 11 |
We're working on scaling out our EC2 architecture to a point where we'd like to manage our own load balancing. We currently have a series of machines configured on HAProxy to do basic load balancing, but we're looking for the 'best practice' means to have a new instance come online and automatically (or nearly automati... | You don't need to over-think this solution ;)
You can simply "pre-configure" servers in your HAProxy configuration file. They will appear "down" and will never receive requests until you actually bring them online.
Here's an example, assuming you only have 5 machines online, and expect to have 10 in the next 2 years:
l... | HAProxy | 6,604,096 | 10 |
This issue is driving me insane, so maybe someone could help me understand what the issue is. I have a tomcat web application being fronted by HAProxy. HAProxy is also doing SSL offloading, and is configured to use sticky sessions. I am using Tomcat's session replication feature which seems to be working just fine. ... | Turns out that it was cause by Spring Security. We are using Spring Security 3.1x, and by default it stores the authenticated credentials in the user's session. And to counter session fixation attacks, it automatically copies the contents of the user's session to a new session id and invalidates the old session.
The ... | HAProxy | 14,466,595 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.