Skip to content

Releases: Sayed-Imran/application-operator

v1.0.0

11 Mar 17:12
Compare
Choose a tag to compare

Application Operator

The Application Operator is a Kubernetes operator built using the Go plugin of Operator SDK. It automates the process of deploying an application as a Kubernetes Deployment and exposing it as a Kubernetes Service.

Prerequisites

  • Kubernetes cluster
  • kubectl installed and configured to interact with your cluster
  • Operator SDK

Operator Installation

  1. Clone the repository:
git clone https://github.com/yourusername/application-operator.git
cd application-operator
  1. Install the CRD:
kubectl apply -f config/crd/bases/
  1. Install the Operator:
kubectl apply -f config/manager/

Usage

  1. Create an Application resource:
apiVersion: api.app.op/v1alpha1
kind: Application
metadata:
  labels:
    app.kubernetes.io/name: application
    app.kubernetes.io/instance: application-sample
    app.kubernetes.io/part-of: application-operator
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/created-by: application-operator
  name: application-sample
spec:
  replicas: 2
  image: sayedimran/fastapi-sample-app:v4
  port: 7000
  env:
  - name: APP_ENV
    value: production
  - name: APP_NAME
    value: fastapi-sample-app
  1. Apply the resource:
kubectl apply -f config/samples/
  1. Verify that the Application resource has been created:
kubectl get app
  1. Verify that the Deployment and Service resources have been created:
kubectl get deployment
kubectl get service