https://github.com/replicatedhq/kgrid
https://github.com/replicatedhq/kgrid
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/replicatedhq/kgrid
- Owner: replicatedhq
- Created: 2021-05-12T23:26:02.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-15T19:28:26.000Z (over 3 years ago)
- Last Synced: 2025-03-23T03:33:14.113Z (about 1 year ago)
- Language: Go
- Size: 300 KB
- Stars: 2
- Watchers: 16
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kgrid
A Kubernetes operator to create test clusters and manage test runs on the clusters.
## Deploying
The operator can be deployed to a kubernetes by applying the YAML specs from release assets.
## Defining a test grid
Currenly only EKS clusters are supported for testing. These can be defined by deploying a `Grid` spec. For example:
```yaml
apiVersion: kgrid.replicated.com/v1alpha1
kind: Grid
metadata:
name: test-kgrid
namespace: kgrid-system
spec:
clusters:
- name: test-cluster
eks:
region: us-west-1
version: "1.18"
create: true
accessKeyId:
valueFrom:
secretKeyRef:
name: aws-access
key: AWS_ACCESS_KEY_ID
secretAccessKey:
valueFrom:
secretKeyRef:
name: aws-access
key: AWS_SECRET_ACCESS_KEY
```
## Defining an application
Currently only KOTS applications are supported. An application can be defined by deploying an `Application` spec. For example:
```yaml
apiVersion: kgrid.replicated.com/v1alpha1
kind: Application
metadata:
name: my-app
namespace: kgrid-system
spec:
kots:
clusters:
- test-cluster
version: "latest"
appSlug: myappp
licenseID:
channelID:
channelSequence:
skipPreflights: true
namespace: test
configValues:
spec:
values:
a_flag:
value: "0"
a_text_value:
value: test value
```
KOTS version can be specified in the `version` field. However, if the value `latest` is used, the release version will be looked up in the `Version` object deployed to the same namespace. For example:
```yaml
apiVersion: kgrid.replicated.com/v1alpha1
kind: Version
metadata:
name: version
namespace: kgrid-system
spec:
kots:
latest: "1.41.0"
```
## Running locally
1. Install CRDs: `make install`
1. Build images: `make docker-build docker-push docker-build-kgrid docker-push-kgrid`
1. Deploy controller: `make deploy`
1. Create `grid` (required) and `version` (optional) specs: `./dev/deploy_dev_specs.sh`
## RBAC
In order for a k8s ServiceAccount that does not have cluster level access to be able to manage kgrid application specs, it must have editor access. The following RoleBinding needs to be created.
```
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name:
namespace: kgrid-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kgrid-application-editor-role
subjects:
- kind: ServiceAccount
name:
namespace:
```