Browse Source

add yamls

master
Justin Duch 12 months ago
parent
commit
9f6631691d
  1. 2
      README.md
  2. 38
      blog.yaml
  3. 16
      cert-issuer.yaml
  4. 42
      ingress.yaml
  5. 83
      old.yaml

2
README.md

@ -1,3 +1,3 @@
# k8s.justin.duch.me
K8s deployment files for justin.duch.me.
K8s deployment files for justin.duch.me. Docker images come from a private registry, so they need a secret `regcred`. Refer to the [docs](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) for more info.

38
blog.yaml

@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog-deployment
labels:
app: blog
spec:
replicas: 3
selector:
matchLabels:
app: blog
template:
metadata:
labels:
app: blog
spec:
containers:
- name: blog
image: docker.duch.me/jd/blog:latest
ports:
- containerPort: 3000
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: blog-svc
labels:
app: blog
spec:
ports:
- port: 80
targetPort: 3000
protocol: TCP
name: http
selector:
app: blog

16
cert-issuer.yaml

@ -0,0 +1,16 @@
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt
labels:
name: letsencrypt
spec:
acme:
email: justin@duch.me
privateKeySecretRef:
name: letsencrypt
server: https://acme-v02.api.letsencrypt.org/directory
solvers:
- http01:
ingress:
class: nginx

42
ingress.yaml

@ -0,0 +1,42 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/enable-cors: "true"
spec:
tls:
- hosts:
- justin.duch.me
secretName: tls-secret
- hosts:
- blog.justinduch.me
secretName: tls-secret
rules:
- host: justin.duch.me
http:
paths:
- backend:
serviceName: blog-svc
servicePort: 80
# TODO: remove
- host: blog.justinduch.com
http:
paths:
- backend:
serviceName: blog-svc
servicePort: 80
- host: old.justin.duch.me
http:
paths:
- backend:
serviceName: blog-2018-01-22-svc
servicePort: 80
path: /2018-01-22/*
- backend:
serviceName: blog-2018-05-30-svc
servicePort: 80
path: /2018-05-30/*

83
old.yaml

@ -0,0 +1,83 @@
##############
# 2018-01-22 #
##############
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog-2018-01-22-deployment
labels:
app: blog-2018-01-22
spec:
replicas: 2
selector:
matchLabels:
app: blog-2018-01-22
template:
metadata:
labels:
app: blog-2018-01-22
spec:
containers:
- name: blog-2018-01-22
image: docker.duch.me/jd/blog:2018-01-22
ports:
- containerPort: 80
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: blog-2018-01-22-svc
labels:
app: blog-2018-01-22
spec:
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
app: blog-2018-01-22
---
##############
# 2018-05-30 #
##############
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog-2018-05-30-deployment
labels:
app: blog-2018-05-30
spec:
replicas: 2
selector:
matchLabels:
app: blog-2018-05-30
template:
metadata:
labels:
app: blog-2018-05-30
spec:
containers:
- name: blog-2018-05-30
image: docker.duch.me/jd/blog:2018-05-30
ports:
- containerPort: 5000
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: blog-2018-05-30-svc
labels:
app: blog-2018-05-30
spec:
ports:
- port: 80
targetPort: 5000
protocol: TCP
name: http
selector:
app: blog-2018-05-30