Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/angudadevops/service-deployment-operator

Kubernetes Operator Controller to deploy a Deployment and Service on Kubernetes Cluster. Operator Example with Operator SDK
https://github.com/angudadevops/service-deployment-operator

k8s-operator k8s-operator-controller k8s-operator-example k8s-service-operator kubernetes-controller kubernetes-operator kubernetes-test-operator operator-example operator-sdk-example service-deployment-operator

Last synced: 28 days ago
JSON representation

Kubernetes Operator Controller to deploy a Deployment and Service on Kubernetes Cluster. Operator Example with Operator SDK

Awesome Lists containing this project

README

        

# Service Deployment Operator

This Operator help you to deploy Application Deployment and Service on Kubernetes/Openshift Cluster.

## Prerequisites
- [Operator Framework](https://github.com/operator-framework)
- [Golang](https://golang.org/dl/)
- Kubernetes/Openshift Cluster

## Build an Operator

Run the below commands to build an operator on your machine

```
operator-sdk generate k8s ## if you change the types of varaibles
operator-sdk generate crds

operator-sdk build
```

## Deploy on your cluster

Create a CRD on your cluster with below command

```
kubectl apply -f deploy/crds/servicedeployment_v1alpha1_sd_crd.yaml
```

Now Create service Account and role bindings for SD Operator with below commands
```
kubectl apply -f deploy/service_account.yaml
kubectl apply -f deploy/role.yaml
kubectl apply -f deploy/role_binding.yaml
```
Deploy Service Deployment Operator with below command
```
kubectl apply -f deploy/operator.yaml
```

## Create a Custom Resource

Once Operator is up and running, use the below snippet and update your parameters to deploy your code on your cluster.

```
apiVersion: servicedeployment.com/v1alpha1
kind: SD
metadata:
name: nginx-sd
spec:
# Add fields here
replicas: 3
image: nginx
containerPort: 80
nodePort: 31001
```

You can apply the below yaml for your testing
```
kubectl apply -f deploy/crds/servicedeployment.com_v1alpha1_sd_cr.yaml
```