Skip to content

Commit

Permalink
Add k8s tolerations for aarch64 and x86 (pixie-io#867)
Browse files Browse the repository at this point in the history
Summary: Adds k8s tolerations for aarch64 and x86.
The base has patches for multiarch.
For skaffold deploys we use single arch versions of the patches.

Relevant Issues: pixie-io#147

Type of change: /kind cleanup

Test Plan: Tested that I can build the yamls, and skaffold deploy. Will
cut an RC to test that the yamls look good there.

Signed-off-by: James Bartlett <jamesbartlett@pixielabs.ai>
  • Loading branch information
JamesMBartlett authored Feb 14, 2023
1 parent 92ed07e commit 25a31d5
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 1 deletion.
25 changes: 25 additions & 0 deletions k8s/vizier/base/arch_tolerations/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
25 changes: 25 additions & 0 deletions k8s/vizier/base/arch_tolerations/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
25 changes: 25 additions & 0 deletions k8s/vizier/base/arch_tolerations/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
9 changes: 9 additions & 0 deletions k8s/vizier/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ patches:
target:
kind: Deployment
labelSelector: vizier-bootstrap!=true
- path: arch_tolerations/deployment.yaml
target:
kind: Deployment
- path: arch_tolerations/job.yaml
target:
kind: Job
- path: arch_tolerations/statefulset.yaml
target:
kind: StatefulSet
resources:
- ../bootstrap
- kelvin_deployment.yaml
Expand Down
25 changes: 25 additions & 0 deletions k8s/vizier/pem/base/arch_tolerations/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
4 changes: 4 additions & 0 deletions k8s/vizier/pem/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ kind: Kustomization
namespace: pl
resources:
- pem_daemonset.yaml
patches:
- path: arch_tolerations/daemonset.yaml
target:
kind: DaemonSet
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/aarch64/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/aarch64/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/aarch64/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
19 changes: 19 additions & 0 deletions k8s/vizier/persistent_metadata/aarch64/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
- ../../pem
patches:
- path: deployment.yaml
target:
kind: Deployment
- path: job.yaml
target:
kind: Job
- path: statefulset.yaml
target:
kind: StatefulSet
- path: daemonset.yaml
target:
kind: DaemonSet
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/aarch64/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "arm64"
effect: "NoExecute"
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/x86/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/x86/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/x86/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
19 changes: 19 additions & 0 deletions k8s/vizier/persistent_metadata/x86/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
- ../../pem
patches:
- path: deployment.yaml
target:
kind: Deployment
- path: job.yaml
target:
kind: Job
- path: statefulset.yaml
target:
kind: StatefulSet
- path: daemonset.yaml
target:
kind: DaemonSet
17 changes: 17 additions & 0 deletions k8s/vizier/persistent_metadata/x86/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: unused
spec:
template:
spec:
tolerations:
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoSchedule"
- key: "kubernetes.io/arch"
operator: "Equal"
value: "amd64"
effect: "NoExecute"
6 changes: 5 additions & 1 deletion skaffold/skaffold_vizier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ build:
manifests:
kustomize:
paths:
- k8s/vizier/persistent_metadata
- k8s/vizier/persistent_metadata/x86
profiles:
- name: minikube
activation:
Expand Down Expand Up @@ -114,6 +114,10 @@ profiles:
path: /build/artifacts/context=./bazel/args
value:
- --config=aarch64_sysroot
- op: replace
path: /manifests/kustomize/paths
value:
- k8s/vizier/persistent_metadata/aarch64
- name: x86_64_sysroot
patches:
- op: add
Expand Down

0 comments on commit 25a31d5

Please sign in to comment.