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

adding kubernetes manifests to deploy and test kernelci-pipeline on minikube #285

Closed
19 changes: 19 additions & 0 deletions kube/init-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Pod
metadata:
name: github-cloning-pod
spec:
containers:
- name: github-cloning-container
image: alpine/git
command: ["git", "clone", "https://github.com/kernelci/kernelci-pipeline.git", "/home/kernelci-pipeline"]
volumeMounts:
- name: github-repo
mountPath: /home/kernelci-pipeline
# Resource limits needs to be discussed.
resources:
volumes:
- name: github-repo
hostPath:
path: /home/docker/kernelci-pipeline

51 changes: 51 additions & 0 deletions kube/notifier-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 KernelCI Authors.
# Author: Sanskar Bhushan <sbdtu5498@gmail.com>

apiVersion: apps/v1
kind: Deployment
metadata:
name: kernelci-pipeline-notifier
spec:
replicas: 1
selector:
matchLabels:
app: kernelci-pipeline-notifier
template:
metadata:
labels:
app: kernelci-pipeline-notifier
spec:
containers:
- name: kernelci-pipeline-notifier
image: kernelci/staging-kernelci
env:
- name: KCI_API_TOKEN
valueFrom:
secretKeyRef:
name: kernelci-pipeline-secrets
key: kci-api-token
- name: SETTINGS
valueFrom:
configMapKeyRef:
name: kernelci-pipeline-config
key: settings
command:
- "./pipeline/notifier.py"
- "--settings=${SETTINGS:-/home/kernelci/config/kernelci.toml}"
- "run"
volumeMounts:
- name: pipeline-volume
mountPath: /home/kernelci/pipeline
- name: config-volume
mountPath: /home/kernelci/config
# Resource limits needs to be discussed.
resources:
volumes:
- name: pipeline-volume
hostPath:
path: /home/docker/kernelci-pipeline/src
- name: config-volume
hostPath:
path: /home/docker/kernelci-pipeline/config
53 changes: 53 additions & 0 deletions kube/regression-tracker-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 KernelCI Authors.
# Author: Sanskar Bhushan <sbdtu5498@gmail.com>

apiVersion: apps/v1
kind: Deployment
metadata:
name: kernelci-pipeline-regression-tracker
spec:
replicas: 1
selector:
matchLabels:
app: kernelci-pipeline-regression-tracker
template:
metadata:
labels:
app: kernelci-pipeline-regression-tracker
spec:
containers:
- name: kernelci-pipeline-regression-tracker
image: kernelci/staging-kernelci
env:
- name: KCI_API_TOKEN
valueFrom:
secretKeyRef:
name: kernelci-pipeline-secrets
key: kci-api-token
- name: SETTINGS
valueFrom:
configMapKeyRef:
name: kernelci-pipeline-config
key: settings
command:
- "/usr/bin/env"
- "python3"
- "/home/kernelci/pipeline/regression_tracker.py"
- "--settings=${SETTINGS:-/home/kernelci/config/kernelci.toml}"
- "run"
volumeMounts:
- name: pipeline-volume
mountPath: /home/kernelci/pipeline
- name: config-volume
mountPath: /home/kernelci/config
# Resource limits needs to be discussed.
resources:
volumes:
- name: pipeline-volume
hostPath:
path: /home/docker/kernelci-pipeline/src
- name: config-volume
hostPath:
path: /home/docker/kernelci-pipeline/config
68 changes: 68 additions & 0 deletions kube/runner-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 KernelCI Authors.
# Author: Sanskar Bhushan <sbdtu5498@gmail.com>

apiVersion: apps/v1
kind: Deployment
metadata:
name: kernelci-pipeline-runner
spec:
replicas: 1
selector:
matchLabels:
app: kernelci-pipeline-runner
template:
metadata:
labels:
app: kernelci-pipeline-runner
spec:
containers:
- name: kernelci-pipeline-runner
image: kernelci/staging-kernelci
env:
- name: KCI_API_TOKEN
valueFrom:
secretKeyRef:
name: kernelci-pipeline-secrets
key: kci-api-token
- name: SETTINGS
valueFrom:
configMapKeyRef:
name: kernelci-pipeline-config
key: settings
command: ["/home/kernelci/pipeline/runner.py", "--setting=${SETTINGS:-/home/kernelci/config/kernelci.toml}", "loop", "--runtimes=shell"]
volumeMounts:
- name: pipeline-volume
mountPath: /home/kernelci/pipeline
- name: config-volume
mountPath: /home/kernelci/config
- name: output-volume
mountPath: /home/kernelci/output
- name: kube-volume
mountPath: /home/kernelci/.kube
- name: gcloud-volume
mountPath: /home/kernelci/.config/gcloud
- name: azure-volume
mountPath: /home/kernelci/.azure
# Resource limits needs to be discussed.
resources:
volumes:
- name: pipeline-volume
hostPath:
path: /home/docker/kernelci-pipeline/src
- name: config-volume
hostPath:
path: /home/docker/kernelci-pipeline/config
- name: output-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/output
- name: kube-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/k8s-credentials/.kube
- name: gcloud-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/k8s-credentials/.config/gcloud
- name: azure-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/k8s-credentials/.azure
73 changes: 73 additions & 0 deletions kube/runner-docker-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 KernelCI Authors.
# Author: Sanskar Bhushan <sbdtu5498@gmail.com>

apiVersion: apps/v1
kind: Deployment
metadata:
name: kernelci-pipeline-runner-docker
spec:
replicas: 1
selector:
matchLabels:
app: kernelci-pipeline-runner-docker
template:
metadata:
labels:
app: kernelci-pipeline-runner-docker
spec:
containers:
- name: kernelci-pipeline-runner-docker
image: kernelci/staging-kernelci
env:
- name: KCI_API_TOKEN
valueFrom:
secretKeyRef:
name: kernelci-pipeline-secrets
key: kci-api-token
- name: SETTINGS
valueFrom:
configMapKeyRef:
name: kernelci-pipeline-config
key: settings
command:
- "./pipeline/runner.py"
- "--settings=${SETTINGS:-/home/kernelci/config/kernelci.toml}"
- "loop"
- "--runtimes=docker"
volumeMounts:
- name: pipeline-volume
mountPath: /home/kernelci/pipeline
- name: config-volume
mountPath: /home/kernelci/config
- name: output-volume
mountPath: /home/kernelci/data/output
- name: docker-env-file
mountPath: /home/kernelci/.docker-env
- name: docker-sock
mountPath: /var/run/docker.sock
# Need to discuss whether docker:dind-rootless can work instead,
# and whether it might be a better option from security perspective.
- name: dind-sidecar
image: docker:dind
securityContext:
privileged: true
volumeMounts:
- name: docker-sock
mountPath: /var/run/docker.sock
# Resource limits needs to be discussed.
resources:
volumes:
- name: pipeline-volume
hostPath:
path: /home/docker/kernelci-pipeline/src
- name: config-volume
hostPath:
path: /home/docker/kernelci-pipeline/config
- name: output-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/output
- name: docker-env-file
hostPath:
path: /home/docker/kernelci-pipeline/.docker-env
72 changes: 72 additions & 0 deletions kube/runner-k8s-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 KernelCI Authors.
# Author: Sanskar Bhushan <sbdtu5498@gmail.com>

apiVersion: apps/v1
kind: Deployment
metadata:
name: kernelci-pipeline-runner
spec:
replicas: 1
selector:
matchLabels:
app: kernelci-pipeline-runner
template:
metadata:
labels:
app: kernelci-pipeline-runner
spec:
containers:
- name: kernelci-pipeline-runner
image: kernelci/staging-kernelci
env:
- name: KCI_API_TOKEN
valueFrom:
secretKeyRef:
name: kernelci-pipeline-secrets
key: kci-api-token
- name: SETTINGS
valueFrom:
configMapKeyRef:
name: kernelci-pipeline-config
key: settings
command:
- "home/kernelci/pipeline/runner.py"
- "--settings=${SETTINGS:-/home/kernelci/config/kernelci.conf}"
- "loop"
- "--runtimes=k8s-gke-eu-west4"
volumeMounts:
- name: pipeline-volume
mountPath: /home/kernelci/pipeline
- name: config-volume
mountPath: /home/kernelci/config
- name: output-volume
mountPath: /home/kernelci/output
- name: kube-volume
mountPath: /home/kernelci/.kube
- name: gcloud-volume
mountPath: /home/kernelci/.config/gcloud
- name: azure-volume
mountPath: /home/kernelci/.azure
# Resource limits needs to be discussed.
resources:
volumes:
- name: pipeline-volume
hostPath:
path: /home/docker/kernelci-pipeline/src
- name: config-volume
hostPath:
path: /home/docker/kernelci-pipeline/config
- name: output-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/output
- name: kube-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/k8s-credentials/.kube
- name: gcloud-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/k8s-credentials/.config/gcloud
- name: azure-volume
hostPath:
path: /home/docker/kernelci-pipeline/data/k8s-credentials/.azure
Loading
Loading