Skip to content

rappizs/deployment-operator

Repository files navigation

deployment-operator

Simple Kubernetes operator to deploy your application.

Description

The deployment-operator can take care of all the resources and configurations that are needed in order to properly operate your application in a Kubernetes cluster. It configures, creates and monitors a Deployment, a Service and an Ingress. All you need to do is install the required Custom Resource Definitions, deploy the operator and create your Custom Resource. After that you will be able to access your application on the defined Host address with HTTPS.

Getting Started

You’ll need a Kubernetes cluster to run against. You can use KIND to get a local cluster for testing, or run against a remote cluster. Note: Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster kubectl cluster-info shows).

Installation

Prerequisites

Deploy the operator

  1. Install the AppDeployer Custom Resource Definition:
make install
  1. Deploy the controller to the cluster with the image specified by IMG. Itt will apply all manifests required to properly deploy the operator in a separate namespace.
make deploy IMG=ghcr.io/rappizs/deployment-operator:latest
  1. Create an AppDeployer Custom Resource in your cluster: you can find an example in config/samples. Make sure that your cluster has every prerequisite and change the clusterIssuer field to the name of your ClusterIssuer CR, if needed. The AppDeployer type has the following spec structure:
apiVersion: deployer.rappizs.com/v1
kind: AppDeployer
...
spec:
  replicas: 4 --- replica count for the Deployment
  host: local.nginx.com --- your host address
  image: ghcr.io/rappizs/nginx-hello:latest --- image to deploy
  containerPort: 80 --- port to expose on the containers
  servicePort: 80 --- port of the service
  clusterIssuer: appdeployer-issuer --- name of your ClusterIssuer
  1. That's it, you should be able to access your application on the configured host address using HTTPS. If you have HTTPS problems with the certifications, check the configuration of cert-manager and your ClusterIssuer. Happy Hacking!

Uninstall CRDs

To delete the CRDs from the cluster:

make uninstall

Undeploy controller

UnDeploy the controller from the cluster:

make undeploy

How it works

This project aims to follow the Kubernetes Operator pattern.

It uses Controllers, which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages