Skip to content

Commit

Permalink
chore(k8s): add labels to ietfwww + fix iabwww
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Aug 27, 2024
1 parent f03dd8b commit e3936bb
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 11 deletions.
3 changes: 3 additions & 0 deletions k8s/iabweb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace: iabwww
commonLabels:
app.kubernetes.io/part-of: iabwww
io.portainer.kubernetes.application.stack: iabwww
configMapGenerator:
- name: iabwww-files-cfgmap
files:
Expand Down
11 changes: 10 additions & 1 deletion k8s/iabweb/memcached.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: iabwww-memcached
labels:
app.kubernetes.io/name: memcached
app.kubernetes.io/instance: iabwww-memcached
app.kubernetes.io/version: "0.14.3"
app.kubernetes.io/component: memcached
spec:
replicas: 1
revisionHistoryLimit: 2
Expand All @@ -15,7 +20,6 @@ spec:
app.kubernetes.io/instance: iabwww-memcached
app.kubernetes.io/version: "0.14.3"
app.kubernetes.io/component: memcached
app.kubernetes.io/part-of: iabwww
spec:
securityContext:
runAsNonRoot: true
Expand Down Expand Up @@ -74,6 +78,11 @@ metadata:
annotations:
k8s.grafana.com/scrape: "true" # this is not a bool
k8s.grafana.com/metrics.portName: "metrics"
labels:
app.kubernetes.io/name: memcached
app.kubernetes.io/instance: iabwww-memcached
app.kubernetes.io/version: "0.14.3"
app.kubernetes.io/component: memcached
spec:
type: ClusterIP
ports:
Expand Down
11 changes: 10 additions & 1 deletion k8s/iabweb/wagtail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: iabwww-wagtail
labels:
app.kubernetes.io/name: wagtail
app.kubernetes.io/instance: iabwww-wagtail
app.kubernetes.io/version: "$APP_IMAGE_TAG"
app.kubernetes.io/component: website
spec:
replicas: 1
revisionHistoryLimit: 2
Expand All @@ -15,7 +20,6 @@ spec:
app.kubernetes.io/instance: iabwww-wagtail
app.kubernetes.io/version: "$APP_IMAGE_TAG"
app.kubernetes.io/component: website
app.kubernetes.io/part-of: iabwww
spec:
securityContext:
fsGroup: 1000
Expand Down Expand Up @@ -109,6 +113,11 @@ apiVersion: v1
kind: Service
metadata:
name: iabwww-wagtail
labels:
app.kubernetes.io/name: wagtail
app.kubernetes.io/instance: iabwww-wagtail
app.kubernetes.io/version: "$APP_IMAGE_TAG"
app.kubernetes.io/component: website
spec:
type: ClusterIP
ports:
Expand Down
3 changes: 3 additions & 0 deletions k8s/ietfweb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace: ietfwww
commonLabels:
app.kubernetes.io/part-of: ietfwww
io.portainer.kubernetes.application.stack: ietfwww
configMapGenerator:
- name: ietfwww-files-cfgmap
files:
Expand Down
22 changes: 18 additions & 4 deletions k8s/ietfweb/memcached.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: ietfwww-memcached
labels:
app.kubernetes.io/name: memcached
app.kubernetes.io/instance: ietfwww-memcached
app.kubernetes.io/version: "0.14.3"
app.kubernetes.io/component: memcached
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: ietfwww-memcached
app.kubernetes.io/instance: ietfwww-memcached
template:
metadata:
labels:
app: ietfwww-memcached
app.kubernetes.io/name: memcached
app.kubernetes.io/instance: ietfwww-memcached
app.kubernetes.io/version: "0.14.3"
app.kubernetes.io/component: memcached
spec:
securityContext:
runAsNonRoot: true
Expand Down Expand Up @@ -51,12 +59,13 @@ spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
# ensures pod gets scheduled on the same node as wagtail:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
- key: app.kubernetes.io/instance
operator: In
values:
- ietfwww-wagtail
Expand All @@ -69,6 +78,11 @@ metadata:
annotations:
k8s.grafana.com/scrape: "true" # this is not a bool
k8s.grafana.com/metrics.portName: "metrics"
labels:
app.kubernetes.io/name: memcached
app.kubernetes.io/instance: ietfwww-memcached
app.kubernetes.io/version: "0.14.3"
app.kubernetes.io/component: memcached
spec:
type: ClusterIP
ports:
Expand All @@ -81,4 +95,4 @@ spec:
protocol: TCP
name: metrics
selector:
app: ietfwww-memcached
app.kubernetes.io/instance: ietfwww-memcached
25 changes: 20 additions & 5 deletions k8s/ietfweb/wagtail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ietfwww-wagtail
labels:
app.kubernetes.io/name: wagtail
app.kubernetes.io/instance: ietfwww-wagtail
app.kubernetes.io/version: "$APP_IMAGE_TAG"
app.kubernetes.io/component: website
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: ietfwww-wagtail
app.kubernetes.io/instance: ietfwww-wagtail
template:
metadata:
labels:
app: ietfwww-wagtail
app.kubernetes.io/name: wagtail
app.kubernetes.io/instance: ietfwww-wagtail
app.kubernetes.io/version: "$APP_IMAGE_TAG"
app.kubernetes.io/component: website
spec:
securityContext:
fsGroup: 1000
Expand Down Expand Up @@ -79,20 +87,22 @@ spec:
sizeLimit: "1Gi"
- name: www-cfg
configMap:
name: files-cfgmap
name: ietfwww-files-cfgmap
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
# ensures we don't schedule this pod on the same node as iabwww:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
- key: app.kubernetes.io/instance
operator: In
values:
- iabwww-wagtail
topologyKey: "kubernetes.io/hostname"
namespaceSelector: {}
volumeClaimTemplates:
- metadata:
name: www-media
Expand All @@ -108,6 +118,11 @@ apiVersion: v1
kind: Service
metadata:
name: ietfwww-wagtail
labels:
app.kubernetes.io/name: wagtail
app.kubernetes.io/instance: ietfwww-wagtail
app.kubernetes.io/version: "$APP_IMAGE_TAG"
app.kubernetes.io/component: website
spec:
type: ClusterIP
ports:
Expand All @@ -116,4 +131,4 @@ spec:
protocol: TCP
name: http
selector:
app: ietfwww-wagtail
app.kubernetes.io/instance: ietfwww-wagtail

0 comments on commit e3936bb

Please sign in to comment.