imfreedom/k8s-cluster

lower the resources for imfreedom.org

2020-01-27, Gary Kramlich
11fbdc9b40c6
lower the resources for imfreedom.org
# this manifest contains an ingress that does path based matching to route to
# individual services that are runnings the docs via a simple http server.
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: pidgin
name: docs
annotations:
cert-manager.io/issuer: letsencrypt
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_headers "X-Frame-Options: SAMEORIGIN";
rewrite ^(/gplugin/latest)$ $1/ redirect;
rewrite ^(/gplugin-gtk/latest)$ $1/ redirect;
rewrite ^(/libgnt/latest)$ $1/ redirect;
rewrite ^(/libgnt/next)$ $1/ redirect;
rewrite ^(/pidgin/2.x.y)$ $1/ redirect;
rewrite ^(/talkatu/latest)$ $1/ redirect;
labels:
app: docs
spec:
rules:
- host: docs.pidgin.im
http:
paths:
- backend:
serviceName: docs-gplugin-latest
servicePort: 3000
path: /gplugin/latest(/|$)(.*)
- backend:
serviceName: docs-gplugin-gtk-latest
servicePort: 3000
path: /gplugin-gtk/latest(/|$)(.*)
- backend:
serviceName: docs-libgnt-latest
servicePort: 3000
path: /libgnt/latest(/|$)(.*)
- backend:
serviceName: docs-libgnt-next
servicePort: 3000
path: /libgnt/next(/|$)(.*)
- backend:
serviceName: docs-pidgin-2-x-y
servicePort: 3000
path: /pidgin/2.x.y(/|$)(.*)
- backend:
serviceName: docs-talkatu-latest
servicePort: 3000
path: /talkatu/latest(/|$)(.*)
tls:
- hosts:
- docs.pidgin.im
secretName: docs-tls
---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
namespace: pidgin
name: docs
spec:
secretName: docs-tls
issuerRef:
name: letsencrypt
commonName: docs.pidgin.im
dnsNames:
- docs.pidgin.im
---
apiVersion: v1
kind: Service
metadata:
namespace: pidgin
name: docs-gplugin-latest
labels:
app: gplugin
version: latest
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: gplugin
version: latest
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: pidgin
name: docs-gplugin-latest
labels:
app: gplugin
version: latest
spec:
podSelector:
matchLabels:
app: gplugin
version: latest
ingress:
- from:
- namespaceSelector:
matchLabels:
name: kube-public
podSelector:
matchLabels:
app: ingress
role: controller
ports:
- port: 3000
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: pidgin
name: docs-gplugin-latest
labels:
app: gplugin
version: latest
spec:
replicas: 2
selector:
matchLabels:
app: gplugin
version: latest
template:
metadata:
labels:
app: gplugin
version: latest
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- gplugin
- key: version
operator: In
values:
- latest
topologyKey: failure-domain.beta.kubernetes.io/region
weight: 100
containers:
- name: docs-gplugin-latest
image: gplugin/gplugin-docs:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi
---
apiVersion: v1
kind: Service
metadata:
namespace: pidgin
name: docs-gplugin-gtk-latest
labels:
app: gplugin-gtk
version: latest
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: gplugin-gtk
version: latest
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: pidgin
name: docs-gplugin-gtk-latest
labels:
app: gplugin-gtk
version: latest
spec:
podSelector:
matchLabels:
app: gplugin-gtk
version: latest
ingress:
- from:
- namespaceSelector:
matchLabels:
name: kube-public
podSelector:
matchLabels:
app: ingress
role: controller
ports:
- port: 3000
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: pidgin
name: docs-gplugin-gtk-latest
labels:
app: gplugin-gtk
version: latest
spec:
replicas: 2
selector:
matchLabels:
app: gplugin-gtk
version: latest
template:
metadata:
labels:
app: gplugin-gtk
version: latest
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- gplugin-gtk
- key: version
operator: In
values:
- latest
topologyKey: failure-domain.beta.kubernetes.io/region
weight: 100
containers:
- name: docs-gplugin-gtk-latest
image: gplugin/gplugin-gtk-docs:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi
---
apiVersion: v1
kind: Service
metadata:
namespace: pidgin
name: docs-libgnt-latest
labels:
app: libgnt
version: latest
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: libgnt
version: latest
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: pidgin
name: docs-libgnt-latest
labels:
app: libgnt
version: latest
spec:
podSelector:
matchLabels:
app: libgnt
version: latest
ingress:
- from:
- namespaceSelector:
matchLabels:
name: kube-public
podSelector:
matchLabels:
app: ingress
role: controller
ports:
- port: 3000
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: pidgin
name: docs-libgnt-latest
labels:
app: libgnt
version: latest
spec:
replicas: 2
selector:
matchLabels:
app: libgnt
version: latest
template:
metadata:
labels:
app: libgnt
version: latest
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- libgnt
- key: version
operator: In
values:
- latest
topologyKey: failure-domain.beta.kubernetes.io/region
weight: 100
containers:
- name: docs-libgnt-latest
image: libgnt/docs:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi
---
apiVersion: v1
kind: Service
metadata:
namespace: pidgin
name: docs-libgnt-next
labels:
app: libgnt
version: next
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: libgnt
version: next
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: pidgin
name: docs-libgnt-next
labels:
app: libgnt
version: next
spec:
podSelector:
matchLabels:
app: libgnt
version: next
ingress:
- from:
- namespaceSelector:
matchLabels:
name: kube-public
podSelector:
matchLabels:
app: ingress
role: controller
ports:
- port: 3000
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: pidgin
name: docs-libgnt-next
labels:
app: libgnt
version: next
spec:
replicas: 2
selector:
matchLabels:
app: libgnt
version: next
template:
metadata:
labels:
app: libgnt
version: next
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- libgnt
- key: version
operator: In
values:
- next
topologyKey: failure-domain.beta.kubernetes.io/region
weight: 100
containers:
- name: docs-libgnt-next
image: libgnt/docs:next
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi
---
apiVersion: v1
kind: Service
metadata:
namespace: pidgin
name: docs-pidgin-2-x-y
labels:
app: pidgin
version: 2.x.y
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: pidgin
version: 2.x.y
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: pidgin
name: docs-pidgin-2-x-y
labels:
app: pidgin
version: 2.x.y
spec:
podSelector:
matchLabels:
app: pidgin
version: 2.x.y
ingress:
- from:
- namespaceSelector:
matchLabels:
name: kube-public
podSelector:
matchLabels:
app: ingress
role: controller
ports:
- port: 3000
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: pidgin
name: docs-pidgin-2-x-y
labels:
app: pidgin
version: 2.x.y
spec:
replicas: 2
selector:
matchLabels:
app: pidgin
version: 2.x.y
template:
metadata:
labels:
app: pidgin
version: 2.x.y
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- pidgin
- key: version
operator: In
values:
- 2.x.y
topologyKey: failure-domain.beta.kubernetes.io/region
weight: 100
containers:
- name: docs-pidgin-2-x-y
image: pidgin/pidgin2-docs:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi
---
apiVersion: v1
kind: Service
metadata:
namespace: pidgin
name: docs-talkatu-latest
labels:
app: talkatu
version: latest
spec:
ports:
- port: 3000
protocol: TCP
selector:
app: talkatu
version: latest
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
namespace: pidgin
name: docs-talkatu-latest
labels:
app: talkatu
version: latest
spec:
podSelector:
matchLabels:
app: talkatu
version: latest
ingress:
- from:
- namespaceSelector:
matchLabels:
name: kube-public
podSelector:
matchLabels:
app: ingress
role: controller
ports:
- port: 3000
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: pidgin
name: docs-talkatu-latest
labels:
app: talkatu
version: latest
spec:
replicas: 2
selector:
matchLabels:
app: talkatu
version: latest
template:
metadata:
labels:
app: talkatu
version: latest
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- talkatu
- key: version
operator: In
values:
- latest
topologyKey: failure-domain.beta.kubernetes.io/region
weight: 100
containers:
- name: docs-talkatu-lastest
image: talkatu/docs:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 10m
memory: 32Mi
---