Why?
Because we wanted to achive the following while developing a webapp using websockets:
Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)
- on the same IP
| #!/usr/bin/python | |
| # | |
| # Coldfusion Password Tool | |
| # Copyright (C) 2013 Adam Boeglin <[email protected]> | |
| # | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # |
| [Unit] | |
| Description=Kibana | |
| After=network.target | |
| [Service] | |
| User=elasticsearch | |
| ExecStart=/opt/kibana/bin/kibana | |
| Type=simple | |
| PIDFile=/var/run/kibana.pid | |
| Restart=always |
https://stackoverflow.com/questions/48993286/is-it-possible-to-route-traffic-to-a-specific-pod?rq=1
You can guarantee session affinity with services, but not as you are describing. So, your customers 1-1000 won't use pod-1, but they will use all the pods (as a service makes a simple load balancing), but each customer, when gets back to hit your service, will be redirected to the same pod.
Note: always within time specified in (default 10800):
| #!/usr/bin/env bash | |
| KUBEAPI=127.0.0.1:8001/api/v1/nodes | |
| function getNodes() { | |
| curl -s $KUBEAPI | jq -r '.items[].metadata.name' | |
| } | |
| function getPVCs() { | |
| jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\ |
| import UUID | |
| from sqlalchemy.dialects.mysql import BINARY | |
| from sqlalchemy.types import TypeDecorator | |
| class BinaryUUID(TypeDecorator): | |
| '''Optimize UUID keys. Store as 16 bit binary, retrieve as uuid. | |
| inspired by: | |
| http://mysqlserverteam.com/storing-uuid-values-in-mysql-tables/ |
| #!/usr/bin/python | |
| from OpenSSL import crypto | |
| import os | |
| import sys | |
| import datetime | |
| import whois | |
| #Variables | |
| TYPE_RSA = crypto.TYPE_RSA | |
| TYPE_DSA = crypto.TYPE_DSA |
| # Server log compression | |
| find /opt/jboss/standalone/log -maxdepth 1 -type f -name 'server.log.*' -not -name '*xz' -not -name '*gz' -exec xz -3 {} \; | |
| # default-host log compression | |
| test -d /opt/jboss/standalone/log/default-host && find /opt/jboss/standalone/log/default-host -type f -mtime +0 -not -name '*xz' -exec xz -3 {} \; |
| #!/bin/bash | |
| for FILE in *gz | |
| do | |
| gunzip ${FILE} | |
| UNFILE=${FILE%.*} | |
| xz -3vv ${UNFILE} | |
| done |