Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add priorityClass to stabilize important apps #37

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion argo-events/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: workflow-playground

resources:
- https://github.com/argoproj/argo-events/manifests/namespace-install
- https://raw.githubusercontent.com/argoproj/argo-events/master/examples/eventbus/native.yaml
Expand All @@ -10,4 +12,10 @@ resources:
- base/workflow-sensor.yaml
- base/log-sensor.yaml

namespace: workflow-playground
patches:
- path: overlays/patch-priority-class.yaml
target:
kind: Deployment
- path: overlays/patch-priority-class.yaml
target:
kind: StatefulSet
8 changes: 8 additions & 0 deletions argo-events/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-medium
8 changes: 8 additions & 0 deletions argo-rollouts/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ kind: Kustomization

resources:
- https://github.com/argoproj/argo-rollouts/releases/download/v1.6.6/install.yaml

patches:
- path: overlays/patch-priority-class.yaml
target:
kind: Deployment
- path: overlays/patch-priority-class.yaml
target:
kind: StatefulSet
8 changes: 8 additions & 0 deletions argo-rollouts/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-medium
6 changes: 6 additions & 0 deletions argo-workflows/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ patches:
group: rbac.authorization.k8s.io
kind: RoleBinding
name: argo-server-binding
- path: overlays/patch-priority-class.yaml
target:
kind: Deployment
- path: overlays/patch-priority-class.yaml
target:
kind: StatefulSet
8 changes: 8 additions & 0 deletions argo-workflows/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-medium
10 changes: 9 additions & 1 deletion argocd-image-updater/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/master/manifests/install.yaml
- https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/master/manifests/install.yaml

patches:
- path: overlays/patch-priority-class.yaml
target:
kind: Deployment
- path: overlays/patch-priority-class.yaml
target:
kind: StatefulSet
8 changes: 8 additions & 0 deletions argocd-image-updater/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-medium
6 changes: 6 additions & 0 deletions argocd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ patches:
- path: overlays/production/argocd-cmd-params-cm.yaml
- path: overlays/production/argocd-rbac-cm.yaml
- path: https://raw.githubusercontent.com/argoproj/argo-cd/master/notifications_catalog/install.yaml
- path: overlays/production/patch-priority-class.yaml
target:
kind: Deployment
- path: overlays/production/patch-priority-class.yaml
target:
kind: StatefulSet

images:
- name: quay.io/argoproj/argocd
Expand Down
8 changes: 8 additions & 0 deletions argocd/overlays/production/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-critical
20 changes: 20 additions & 0 deletions argoproj/base/cluster-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cluster-config
namespace: argocd
spec:
project: default
source:
path: cluster-config
repoURL: https://github.com/argoproj/argoproj-deployments
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: kube-system
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true
4 changes: 4 additions & 0 deletions argoproj/base/ingress-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
repoURL: https://kubernetes.github.io/ingress-nginx
chart: ingress-nginx
targetRevision: 4.9.1
helm:
valuesObject:
controller:
priorityClassName: cluster-critical
syncPolicy:
syncOptions:
- CreateNamespace=true
Expand Down
1 change: 1 addition & 0 deletions argoproj/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- base/argo-rollouts.yaml
- base/argo-workflows.yaml
- base/argocd-image-updater.yaml
- base/cluster-config.yaml
- base/cert-manager.yaml
- base/dex.yaml
- base/external-dns.yaml
Expand Down
3 changes: 3 additions & 0 deletions cert-manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ resources:

patches:
- path: overlays/cert-manager-namespace.yaml
- path: overlays/patch-priority-class.yaml
target:
kind: Deployment
8 changes: 8 additions & 0 deletions cert-manager/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-critical
12 changes: 12 additions & 0 deletions cluster-config/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Namespace
metadata:
name: argocd
annotations:
argocd.argoproj.io/sync-options: Prune=false, Delete=false
---
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager
---
27 changes: 27 additions & 0 deletions cluster-config/base/priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: cluster-critical
value: 99999999
description: >-
Custom priority class for critical cluster components
globalDefault: false
---
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: cluster-medium
value: 50000000
description: >-
Custom priority class for important cluster components
globalDefault: false
---
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: cluster-low
value: 10000000
description: >-
Custom priority class for cluster components
globalDefault: false
---
6 changes: 6 additions & 0 deletions cluster-config/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- base/namespace.yaml
- base/priority-class.yaml
2 changes: 2 additions & 0 deletions dex/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
dex:
replicaCount: 1

priorityClassName: cluster-medium

configSecret:
# TODO: need to manually create configs as a Secret
create: false
Expand Down
5 changes: 4 additions & 1 deletion external-dns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ external-dns:
extraArgs:
- --google-project=argo-demo-apps

priorityClassName: cluster-critical

logFormat: json
logLevel: info
serviceMonitor:
enabled: false
enabled: true

serviceAccount:
annotations:
iam.gke.io/gcp-service-account: [email protected]
Expand Down
10 changes: 6 additions & 4 deletions governor/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ images:
newName: keikoproj/governor
newTag: v0.4.1

patchesStrategicMerge:
- pod-reaper-cr.yaml

patches:
- path: pod-reaper-job-patch.yaml
- path: overlays/pod-reaper-cr.yaml
- path: overlays/pod-reaper-job-patch.yaml
target:
group: batch
kind: CronJob
name: pod-reaper
- path: overlays/patch-priority-class.yaml
target:
group: batch
kind: CronJob
10 changes: 10 additions & 0 deletions governor/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: any
spec:
jobTemplate:
spec:
template:
spec:
priorityClassName: cluster-low
File renamed without changes.
1 change: 1 addition & 0 deletions infrastructure/terraform/gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ components. Some componenets that are dependencies for ArgoCD to work properly,
need to be deployed manually first.

```
kubectl apply -k cluster-config -n kube-system
kubectl apply -k cert-manager -n cert-manager
kubectl apply -k argocd -n argocd
// If the apply for argocd fails, run it again. It might fail the first time due to missing CRDs
Expand Down
20 changes: 12 additions & 8 deletions prometheus-operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ configMapGenerator:
files:
- dashboard.json

patchesJson6902:
- target:
patches:
- path: overlays/prometheus-operator-grafana-cm.yaml
- path: overlays/prometheus-operator-grafana-secret.yaml
target:
name: prometheus-operator-grafana
namespace: prometheus-operator
version: v1
kind: Secret
path: overlays/prometheus-operator-grafana-secret.yaml
- target:
- path: overlays/prometheus-crds-annotations.yaml
target:
name: .*
version: v1
group: apiextensions.k8s.io
kind: CustomResourceDefinition
path: overlays/prometheus-crds-annotations.yaml

patchesStrategicMerge:
- overlays/prometheus-operator-grafana-cm.yaml
- path: overlays/patch-priority-class.yaml
target:
kind: Deployment
- path: overlays/patch-priority-class.yaml
target:
kind: StatefulSet
8 changes: 8 additions & 0 deletions prometheus-operator/overlays/patch-priority-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: any
metadata:
name: any
spec:
template:
spec:
priorityClassName: cluster-low
2 changes: 2 additions & 0 deletions prometheus-operator/resources/upstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45238,6 +45238,7 @@ spec:
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
priorityClassName: cluster-low
portName: http-web
---
# Source: prometheus-operator/charts/kube-prometheus-stack/templates/prometheus-operator/admission-webhooks/mutatingWebhookConfiguration.yaml
Expand Down Expand Up @@ -45351,6 +45352,7 @@ spec:
release: "prometheus-operator"

scrapeConfigNamespaceSelector: {}
priorityClassName: cluster-low
portName: http-web
hostNetwork: false
---
Expand Down
1 change: 1 addition & 0 deletions prometheus-operator/upstream.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
helm dependency update upstream
helm template \
-f ./upstream/values.yaml \
--include-crds \
--namespace prometheus-operator \
prometheus-operator \
Expand Down
7 changes: 7 additions & 0 deletions prometheus-operator/upstream/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kube-prometheus-stack:
alertmanager:
alertmanagerSpec:
priorityClassName: cluster-low
prometheus:
prometheusSpec:
priorityClassName: cluster-low