schedar-task

command module
v0.0.0-...-fb3aea1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Go version Kubernetes version GitHub downloads

Schedar Task

This repository is meant for VSHN candidates that want to join VSHN Schedar Team

Requirements

  • go (latest)
  • kubectl
  • helm3
  • make
  • docker

Context

The customer wants an easy way to deploy PostgreSQL instances using a single CustomResourceDefinition (CRD) in Kubernetes. There are a couple of Kubernetes Operators that can help us achieve this goal such as Stackgres Operator. Once the Operator is installed in a cluster a PostgreSQL instance can be easily created with SGCluster (CRD). There are other CRDs such as SGInstanceProfile or SGPostgresConfig which can further configure a PostgreSQL instance. Our goal is to abstract some of these CRDs into one single CRD (ex. API) of our own thus we need to create an Operator for that. The bootstrap of the Operator is already done, moreover the bare-bones of Operator itself can be already deployed in a Kind cluster using the following commands:

  • make install - installs a kind cluster and deploys the Stackgres Operator.
  • make generate - generates CRDs.
  • make deploy - builds and deploys the docker image in the cluster.

The Task

  1. Update the API (CRD) of this project so that the customer can issue a single resource to create a PostgreSQL instance. The API should expose at least the attributes found in Custom Resource under spec.
  2. Implement the Reconciliation Loop so that the PostgreSQL instance is created (more details on operator reconciliation). The update operation is allowed but should not perform any changes.
  3. Resolve any issue that may arise during deployment.
  4. If you successfully deployed and implemented all the above steps, try to implement the delete operation.

Notes

  • After installation use the following command to connect to the cluster: kind get kubeconfig --name schedar-task > ~/.kube/config
  • Whenever a make deploy is issued, delete the current pod running in the cluster so that the latest changes apply. kubectl -n schedar-task delete pod <pod name>
  • Creating an SGCluster object requires:
    • Number of instances spec.instances
    • The storage capacity for the persistent volume spec.pods.persistentvolume.size
    • The version of the postgres spec.postgres.version
  • Use the existing CR to try your operator.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL