All Projects → abhirockzz → kubexpose-operator

abhirockzz / kubexpose-operator

Licence: other
CRD and Operator to access your Kubernetes Deployment over the Internet

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to kubexpose-operator

falcon-operator
artifacthub.io/packages/olm/falcon-operator/falcon-operator
Stars: ✭ 28 (-37.78%)
Mutual labels:  operator
kubegres
Kubegres is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql instances and manage databases replication, failover and backup.
Stars: ✭ 1,107 (+2360%)
Mutual labels:  operator
actions-runner-controller
Kubernetes controller for GitHub Actions self-hosted runners
Stars: ✭ 2,636 (+5757.78%)
Mutual labels:  operator
s2ioperator
Operator for Source to image
Stars: ✭ 41 (-8.89%)
Mutual labels:  operator
clowder
Operator for operating cloud.redhat.com
Stars: ✭ 21 (-53.33%)
Mutual labels:  operator
microcks-ansible-operator
Kubernetes Operator for easy setup and management of Microcks installs
Stars: ✭ 21 (-53.33%)
Mutual labels:  operator
akka-cluster-operator
Run Akka Cluster applications in Kubernetes.
Stars: ✭ 72 (+60%)
Mutual labels:  operator
kstone
Kstone is an etcd management platform, providing cluster management, monitoring, backup, inspection, data migration, visual viewing of etcd data, and intelligent diagnosis.
Stars: ✭ 592 (+1215.56%)
Mutual labels:  operator
anthill
A Kubernetes/OpenShift operator to manage Gluster clusters
Stars: ✭ 35 (-22.22%)
Mutual labels:  operator
cmak-operator
CMAK (prev. Kafka Manager) for Kubernetes
Stars: ✭ 45 (+0%)
Mutual labels:  operator
pulp-operator
Kubernetes Operator for Pulp 3. Under active development.
Stars: ✭ 32 (-28.89%)
Mutual labels:  operator
tarantool-operator
Tarantool Operator manages Tarantool Cartridge clusters atop Kubernetes
Stars: ✭ 48 (+6.67%)
Mutual labels:  operator
vpc-peering-operator
A Kubernetes Operator to manage the lifecycle of AWS VPC Peering Connections
Stars: ✭ 23 (-48.89%)
Mutual labels:  operator
CrownLabs
Kubernetes-based Remote Laboratories
Stars: ✭ 96 (+113.33%)
Mutual labels:  kubebuilder
logging-operator
A golang based operator to create and manage EFK (Elasticsearch, Fluentd, and Kibana) stack on Kubernetes
Stars: ✭ 42 (-6.67%)
Mutual labels:  operator
ts-action-operators
TypeScript action operators for NgRx and redux-observable
Stars: ✭ 34 (-24.44%)
Mutual labels:  operator
mongodb
MongoDB Operator for Kubernetes
Stars: ✭ 38 (-15.56%)
Mutual labels:  operator
sieve
Automatic Reliability Testing for Kubernetes Controllers
Stars: ✭ 183 (+306.67%)
Mutual labels:  operator
r6operators
r6operators is a collection of high-quality vectorized Rainbow Six: Siege Operator icons & metadata for Node.js
Stars: ✭ 75 (+66.67%)
Mutual labels:  operator
marin3r
Lightweight, CRD based envoy control plane for kubernetes
Stars: ✭ 51 (+13.33%)
Mutual labels:  operator

Kubexpose: Access your Kubernetes Deployment over the Internet

Kubexpose makes it easy to access a Kubernetes Deployment over a public URL. It's a Kubernetes Operator backed by a Custom Resource Definition.

Kubexpose is an experimental project built using kubebuilder

Quick start

Any Kubernetes cluster will work (minikube, kind, Docker Desktop, on the cloud, whatever...). To deploy the operator and required components:

kubectl apply -f https://raw.githubusercontent.com/abhirockzz/kubexpose-operator/master/kubexpose-all-in-one.yaml

# check CRD
kubectl get crd

Make sure Operator is up and running:

export OPERATOR_NAMESPACE=kubexpose-operator-system

# check Pods
kubectl get pods -n $OPERATOR_NAMESPACE

# check logs
kubectl logs -f $(kubectl get pods --namespace $OPERATOR_NAMESPACE -o=jsonpath='{.items[0].metadata.name}') -c manager -n $OPERATOR_NAMESPACE

Create nginx Deployment (this is the one you want to expose over the internet using a public URL) and kubexpose resource (which will help you do that!):

kubectl apply -f https://raw.githubusercontent.com/abhirockzz/kubexpose-operator/master/quickstart/nginx.yaml

kubectl apply -f https://raw.githubusercontent.com/abhirockzz/kubexpose-operator/master/quickstart/kubexpose.yaml

Wait for a few seconds and check the public URL at which the Nginx Deployment can be accessed:

kubectl get kubexpose/kubexpose-test -o=jsonpath='{.status.url}'

Access the publlic URL using your browser or test it using curl

Confirm that the Service and Deployment have been created as well:

kubectl get svc/nginx-test-svc-kubexpose-test
kubectl get deployment/nginx-test-expose-kubexpose-test

You can try out other scenarios such as trying to Deployment and/or Service - the Operator will reconcile or bring things back to the state as specified in the resource.

To delete the kubexpose resource:

kubectl delete kubexpose/kubexpose-test

This will also delete the Service and Deployment which were created for this resource

Delete the Nginx deployment:

kubectl delete deployment/nginx-test

To uninstall the Operator:

kubectl delete -f https://raw.githubusercontent.com/abhirockzz/kubexpose-operator/master/kubexpose-all-in-one.yaml

This will delete the CRD, kubexpose operator and other resources.

How does it work?

Behind the scenes, Kubexpose uses the awesome ngrok project to get the job done! When you create a kubexpose resource, the operator:

  • Creates a ClusterIP type Service for the Deployment you want to access (naming format: <deployment name>-svc-<kubexpose resource name>)
  • Creates a Deployment (using this ngrok Docker image) that runs ngrok - which is configured to point to the Service (naming format: <deployment name>-expose-<kubexpose resource name>). It's equivalent to starting ngrok as such: ngrok http foo-svc-bar 80

The Deployment and Service and owned and managed by the Kubexpose resource instance.

Build from source

You need to have kubebuilder installed on your machine. If you don't want to do that, simply leverage the devcontainer config that comes with the project to setup the entire environment in just a few clicks.

Clone the repository:

git clone https://github.com/abhirockzz/kubexpose-operator

First, build a Docker image and push it to a registry of your choice:

export IMG=<enter docker image e.g. my-docker-repo/kubexpose>
docker login
make docker-build docker-push IMG=$IMG

You can now setup the operator and associated resources on the Kubernetes cluster:

export IMG=<enter docker image e.g. my-docker-repo/kubexpose>
make deploy IMG=$IMG

This single command will create a bunch of resources, such as the Kubexpose Custom Resource Definition (CRD), Kubexpose Operator Deployment, RBAC policies etc.

Check the output for details:

/workspaces/kubexpose-operator/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
cd config/manager && /workspaces/kubexpose-operator/bin/kustomize edit set image controller=abhirockzz/kubexpose
/workspaces/kubexpose-operator/bin/kustomize build config/default | kubectl apply -f -
namespace/kubexpose-operator-system created
customresourcedefinition.apiextensions.k8s.io/kubexposes.kubexpose.kubexpose.io created
serviceaccount/kubexpose-operator-controller-manager created
role.rbac.authorization.k8s.io/kubexpose-operator-leader-election-role created
clusterrole.rbac.authorization.k8s.io/kubexpose-operator-manager-role created
clusterrole.rbac.authorization.k8s.io/kubexpose-operator-metrics-reader created
clusterrole.rbac.authorization.k8s.io/kubexpose-operator-proxy-role created
rolebinding.rbac.authorization.k8s.io/kubexpose-operator-leader-election-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/kubexpose-operator-manager-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/kubexpose-operator-proxy-rolebinding created
configmap/kubexpose-operator-manager-config created
service/kubexpose-operator-controller-manager-metrics-service created
deployment.apps/kubexpose-operator-controller-manager created

The operator runs in a different namespace - kubexpose-operator-system

To check the operator Deployment:

export OPERATOR_NAMESPACE=kubexpose-operator-system

# wait for Pod to come up
kubectl get pods -n $OPERATOR_NAMESPACE -w

# check logs
kubectl logs -f $(kubectl get pods --namespace $OPERATOR_NAMESPACE -o=jsonpath='{.items[0].metadata.name}') -c manager -n $OPERATOR_NAMESPACE
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].