Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/angudadevops/service-deployment-operator
- Owner: angudadevops
- Created: 2021-01-04T21:28:29.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-04T22:20:23.000Z (about 4 years ago)
- Last Synced: 2023-07-19T19:56:02.312Z (over 1 year ago)
- Topics: 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
- Language: Go
- Homepage:
- Size: 15.7 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 crdsoperator-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
```