Skip to content

Instantly share code, notes, and snippets.

@zaneclaes
Last active July 17, 2019 04:09
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 zaneclaes/62c2c5bc9dfd5897b38f696e7b7dab0b to your computer and use it in GitHub Desktop.
Save zaneclaes/62c2c5bc9dfd5897b38f696e7b7dab0b to your computer and use it in GitHub Desktop.
Sample kubernetes deployment of multipress: multiple wordpress sites with nginx in a single docker container
apiVersion: apps/v1
kind: Deployment
metadata:
name: multipress
labels:
app: multipress
spec:
replicas: 2
selector:
matchLabels:
app: multipress
template:
metadata:
labels:
app: multipress
annotations:
iam.amazonaws.com/role: arn:aws:iam::xxxxxxx:role/k8s-multipress
spec:
initContainers:
# Wait for permissions (kube2iam may take a moment)
- name: startup
image: mesosphere/aws-cli:latest
command: ['sh', '-c', 'until aws s3 ls; do echo waiting for s3 permissions; sleep 2; done;']
containers:
# Multipress
- name: multipress
image: inzania/multipress:latest
imagePullPolicy: Always
volumeMounts:
- name: www-storage
mountPath: /var/www/html
ports:
- containerPort: 8888
env:
- name: SERVER_PORT
value: "8888"
- name: S3_BUCKET
value: "multipress-secure"
- name: RESTORE_MODE
value: "zip"
- name: BACKUP_MODE
value: "zip sync"
- name: SITES
value: "skillcookbook experium technicallywizardry"
- name: EXPERIUM_SERVER_NAME
value: "blog.experium.online"
- name: LOG_FORMAT
value: '{"@timestamp": "%(asctime)s", "level": "%(levelname)s", "site": "%(name)s", "message": "%(message)s"}'
- name: NGINX_MAIN_LOG_FORMAT
value: >
escape=json
'{'
'"processor": "net",'
'"http.status_code": "$status",'
'"http.referer":"$http_referer",'
'"http.request_id":"$http_x_request_id",'
'"http.useragent":"$http_user_agent",'
'"http.method":"$request_method",'
'"http.protocol":"$server_protocol",'
'"http.url":"$http_x_forwarded_proto://$host$request_uri",'
'"network.client.ip":"$http_x_forwarded_for",'
'"network.bytes_written":"$body_bytes_sent",'
'"duration":"$request_time",'
'"response_content_type":"$sent_http_content_type",'
'"@timestamp":"$msec"'
'}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment