Reduced resource usage

This commit is contained in:
Marcus Noble 2022-01-15 10:49:21 +00:00
parent 52896a6202
commit d9be926e1c
7 changed files with 5 additions and 133 deletions

View File

@ -31,7 +31,7 @@ metadata:
name: anniversary
namespace: anniversary
spec:
replicas: 1
replicas: 0
selector:
matchLabels:
app: anniversary

View File

@ -1,24 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kube-janitor
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: cluster.fun
destination:
namespace: kube-janitor
name: cluster-fun (scaleway)
source:
path: manifests/kube-janitor
repoURL: "https://git.cluster.fun/AverageMarcus/cluster.fun.git"
targetRevision: HEAD
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
ignoreDifferences:
- kind: Secret
jsonPointers:
- /data

View File

@ -18,7 +18,7 @@ metadata:
name: blog
namespace: blog
spec:
replicas: 4
replicas: 2
selector:
matchLabels:
app: blog

View File

@ -18,7 +18,7 @@ metadata:
name: feed-fetcher
namespace: feed-fetcher
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: feed-fetcher

View File

@ -1,104 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-janitor
namespace: kube-janitor
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-janitor
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- apiGroups:
- "*"
resources:
- "*"
verbs:
- get
- watch
- list
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kube-janitor
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-janitor
subjects:
- kind: ServiceAccount
name: kube-janitor
namespace: kube-janitor
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-janitor
namespace: kube-janitor
data:
rules.yaml: |-
rules:
- id: tekton-tasks
resources:
- pods
- pipelineruns
jmespath: "(metadata.labels.\"tekton.dev/pipeline\")"
ttl: 3h
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
application: kube-janitor
version: v20.4.1
name: kube-janitor
namespace: kube-janitor
annotations:
configmap.reloader.stakater.com/reload: "kube-janitor"
spec:
replicas: 1
selector:
matchLabels:
application: kube-janitor
template:
metadata:
labels:
application: kube-janitor
version: v20.4.1
spec:
serviceAccountName: kube-janitor
containers:
- name: janitor
image: hjacobs/kube-janitor:20.4.1
args:
- --interval=15
- --rules-file=/config/rules.yaml
- --include-namespaces=tekton-pipelines
- --include-resources=pods,pipelineruns,taskruns
resources:
limits:
memory: 100Mi
requests:
memory: 100Mi
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
volumeMounts:
- name: config-volume
mountPath: /config
volumes:
- name: config-volume
configMap:
name: kube-janitor

View File

@ -18,7 +18,7 @@ metadata:
name: talks
namespace: talks
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: talks

View File

@ -18,7 +18,7 @@ metadata:
name: til
namespace: til
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: til