ducky/nginx
2015-06-30
ducky/nginx/replication-controllers/nginx.json
Make nginx kubernetes-ready. Add our upstream definitions, to route requests to our ducky-authd service and our ducky-subscriptionsd service. Remove the test handler that was installed at /. Update our proxy-redirect rules so the proxy redirects actually work now, and what used to redirect us to /profiles now redirects us to /auth/profiles. Define a Replication Controller that will spin up nginx pods for us and auto-attach the necessary JWT secret volume to read our JWT secret. Define a Service that will route to nginx for us.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/replication-controllers/nginx.json Tue Jun 30 00:40:12 2015 -0400 1.3 @@ -0,0 +1,61 @@ 1.4 +{ 1.5 + "kind":"ReplicationController", 1.6 + "apiVersion":"v1", 1.7 + "metadata":{ 1.8 + "name": "ducky-nginx", 1.9 + "labels": { 1.10 + "name": "nginx", 1.11 + "context": "ducky", 1.12 + "repo": "ducky--nginx", 1.13 + "role": "proxy" 1.14 + } 1.15 + }, 1.16 + "spec":{ 1.17 + "replicas":1, 1.18 + "selector":{ 1.19 + "context": "ducky", 1.20 + "name":"nginx", 1.21 + "repo": "ducky--nginx", 1.22 + "role": "proxy" 1.23 + }, 1.24 + "template":{ 1.25 + "metadata":{ 1.26 + "labels":{ 1.27 + "context": "ducky", 1.28 + "name":"nginx", 1.29 + "repo": "ducky--nginx", 1.30 + "role": "proxy" 1.31 + } 1.32 + }, 1.33 + "spec":{ 1.34 + "volumes": [ 1.35 + { 1.36 + "name": "jwt-volume", 1.37 + "secret": { 1.38 + "secretName": "jwt" 1.39 + } 1.40 + } 1.41 + ], 1.42 + "containers":[ 1.43 + { 1.44 + "name":"ducky-nginx", 1.45 + "image": "ducky/nginx:latest", 1.46 + "volumeMounts": [ 1.47 + { 1.48 + "name": "jwt-volume", 1.49 + "readOnly": true, 1.50 + "mountPath": "/private/kubernetes/jwt" 1.51 + } 1.52 + ], 1.53 + "ports":[ 1.54 + { 1.55 + "name": "http", 1.56 + "containerPort":8080 1.57 + } 1.58 + ] 1.59 + } 1.60 + ] 1.61 + } 1.62 + } 1.63 + } 1.64 +}