Skip to content

Instantly share code, notes, and snippets.

@adamhancock
Last active August 11, 2020 09:02
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 adamhancock/9f55709c3c9ef002eaefb04eb7b6b840 to your computer and use it in GitHub Desktop.
Save adamhancock/9f55709c3c9ef002eaefb04eb7b6b840 to your computer and use it in GitHub Desktop.
apiVersion: v1
data:
config.production.json: |
{
"url": "http://localhost:2368",
"server": {
"port": 2368,
"host": "0.0.0.0"
},
"database": {
"client": "mysql",
"connection": {
"host": "mysql.db.svc.cluster.local",
"user": "ghost",
"password": "changeme",
"database": "ghost",
"charset": "utf8"
}
},
"storage": {
"active": "ghost-storage-azure",
"ghost-storage-azure": {
"container": "blog",
"cdnUrl": "cdn.adamhancock.co.uk",
"useHttps": "true"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
}
}
kind: ConfigMap
metadata:
name: ghostconfig
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ghost
name: ghost
spec:
progressDeadlineSeconds: 600
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
revisionHistoryLimit: 10
selector:
matchLabels:
app: ghost
template:
metadata:
creationTimestamp: null
labels:
app: ghost
spec:
containers:
- env:
- name: url
value: https://blog.adamhancock.co.uk
- name: AZURE_STORAGE_CONNECTION_STRING
valueFrom:
secretKeyRef:
key: AZURE_STORAGE_CONNECTION_STRING
name: azure
image: adamhancock/ghost-azure-storage
imagePullPolicy: Always
name: blog
ports:
- containerPort: 2368
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: config-volume
mountPath: /var/lib/ghost/config.production.json
subPath: config.production.json
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: config-volume
configMap:
# Provide the name of the ConfigMap containing the files you want
# to add to the container
name: ghostconfig
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
name: ingress-blog
spec:
rules:
- host: blog.adamhancock.co.uk
http:
paths:
- backend:
serviceName: ghost
servicePort: 2368
path: /
tls:
- hosts:
- blog.adamhancock.co.uk
secretName: blog-cert-1
apiVersion: v1
kind: Service
metadata:
labels:
app: ghost
name: ghost
spec:
ports:
- name: "2368"
port: 2368
protocol: TCP
targetPort: 2368
selector:
app: ghost
sessionAffinity: None
type: ClusterIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment