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. | |
| # |
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 |
| def array_chunk(arr, size): | |
| chunks=[arr[x:x+size] for x in xrange(0, len(arr), size)] | |
| return chunks |
| <?php | |
| /** | |
| * QR Code + Logo Generator | |
| * | |
| * http://labs.nticompassinc.com | |
| */ | |
| $data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com'; | |
| $size = isset($_GET['size']) ? $_GET['size'] : '200x200'; | |
| $logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE; |