Skip to content
Draft
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
80 changes: 80 additions & 0 deletions k8s/minikube/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Testground Infrastructure Setup for Minikube

This directory contains the necessary Kubernetes manifests to set up Testground infrastructure locally using Minikube.

## Prerequisites

1. Minikube installed and running
2. kubectl configured to use minikube context
3. Kubevirt installed in the cluster

## Setup Instructions

1. Start minikube with sufficient resources:
```bash
minikube start --cpus 4 --memory 8192 --disk-size 50g
```

2. Apply the manifests in order:
```bash
kubectl apply -f testground-infra/00-namespace.yaml
kubectl apply -f testground-infra/01-rbac.yaml
kubectl apply -f testground-infra/02-redis.yaml
kubectl apply -f testground-infra/03-sync-service.yaml
```

3. Verify the setup:
```bash
kubectl get all -n testground-infra
```

4. Configure testground to use the local infrastructure:
```bash
mkdir -p ~/.config/testground
cat > ~/.config/testground/.env.toml << EOF
["client"]
endpoint = "localhost:8042"

["daemon"]
listen = "0.0.0.0:8042"
runner = "cluster:kubevirt"

["daemon.scheduler"]
task_timeout = "30m"
task_workers = 10

["builders"]
[builders."docker:generic"]
enabled = true
push_registry = ""
registry_type = "local"

["runners"]
[runners."cluster:kubevirt"]
enabled = true
kubeconfig_path = "" # Leave empty to use default ~/.kube/config
EOF
```

5. Start the testground daemon:
```bash
testground daemon
```

## Troubleshooting

1. Check pod status:
```bash
kubectl get pods -n testground-infra
```

2. Check pod logs:
```bash
kubectl logs -n testground-infra deployment/testground-sync-service
kubectl logs -n testground-infra deployment/testground-redis
```

3. Check services:
```bash
kubectl get svc -n testground-infra
```
7 changes: 7 additions & 0 deletions k8s/minikube/kubevirt/00-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: kubevirt
labels:
kubevirt.io: ""
pod-security.kubernetes.io/enforce: "privileged"
13 changes: 13 additions & 0 deletions k8s/minikube/kubevirt/01-kubevirt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
name: kubevirt
namespace: kubevirt
spec:
certificateRotateStrategy: {}
configuration:
developerConfiguration:
featureGates: []
customizeComponents: {}
imagePullPolicy: IfNotPresent
workloadUpdateStrategy: {}
42 changes: 42 additions & 0 deletions k8s/minikube/kubevirt/01-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubevirt-operator
namespace: kubevirt
labels:
kubevirt.io: ""
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubevirt-operator
labels:
kubevirt.io: ""
rules:
- apiGroups: [""]
resources: ["pods", "services", "configmaps", "endpoints", "persistentvolumeclaims", "events", "secrets"]
verbs: ["*"]
- apiGroups: ["apps"]
resources: ["deployments", "daemonsets"]
verbs: ["*"]
- apiGroups: ["kubevirt.io"]
resources: ["*"]
verbs: ["*"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubevirt-operator
labels:
kubevirt.io: ""
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubevirt-operator
subjects:
- kind: ServiceAccount
name: kubevirt-operator
namespace: kubevirt
14 changes: 14 additions & 0 deletions k8s/minikube/kubevirt/kubevirt-cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
name: kubevirt
namespace: kubevirt
spec:
certificateRotateStrategy: {}
configuration:
developerConfiguration:
featureGates: []
customizeComponents: {}
imagePullPolicy: IfNotPresent
workloadUpdateStrategy: {}
Loading