Skip to content

Instantly share code, notes, and snippets.

@cjimti
Created May 28, 2018 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjimti/f006a4f57dd2ef6245866bf5ba0250fd to your computer and use it in GitHub Desktop.
Save cjimti/f006a4f57dd2ef6245866bf5ba0250fd to your computer and use it in GitHub Desktop.
Example k8s Configuration for txToken
apiVersion: v1
kind: Service
metadata:
name: authtoken
namespace: default
labels:
app: authtoken
spec:
selector:
app: authtoken
ports:
- protocol: "TCP"
port: 80
targetPort: 80
type: ClusterIP
---
apiVersion: v1
kind: ConfigMap
metadata:
name: authtoken
namespace: default
labels:
app: authtoken
data:
txtoken.yml: |-
port: 80
debug: false
encKey: "4uydXMddQINg2o4C8M6R2OMImt089hdLl26Y5Rzz2Nf909yRVLdQ2A0LQ05m5M4W"
remote: https://auth.example.com/login/
expHours: 1
getTokenRoute: "/txtoken/getToken"
checkTokenRoute: "/txtoken/checkToken"
requestTokenData:
authorization: "internal"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: authtoken
namespace: default
labels:
app: authtoken
spec:
replicas: 1
selector:
matchLabels:
app: authtoken
template:
metadata:
labels:
app: authtoken
spec:
containers:
- name: authtoken
image: txn2/txtoken:latest
imagePullPolicy: Always
env:
- name: CFG_FILE
value: "/etc/config/txtoken.yml"
ports:
- name: http
containerPort: 80
volumeMounts:
- name: config-volume
mountPath: /etc/config
volumes:
- name: config-volume
configMap:
name: authtoken
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: authtoken
namespace: default
labels:
app: authtoken
spec:
rules:
- host: some.example.com
http:
paths:
- backend:
serviceName: authtoken
servicePort: 80
path: /txtoken/
tls:
- hosts:
- some.example.com
secretName: some-example-production-tls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment