All Projects → karmab → samplecontroller

karmab / samplecontroller

Licence: other
a demo of how to run a python custom controller with crd on kubernetes

Programming Languages

python
139335 projects - #7 most used programming language
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to samplecontroller

cert-manager
Automatically provision and manage TLS certificates in Kubernetes
Stars: ✭ 8,781 (+13005.97%)
Mutual labels:  crd
pykorm
A python 🐍 kubernetes ☸️ ORM 🚀. Very useful when writing operators for your CRDs with Kopf.
Stars: ✭ 56 (-16.42%)
Mutual labels:  crd
kubereplay
Seamless integration of goReplay and Kubernetes
Stars: ✭ 30 (-55.22%)
Mutual labels:  crd
kaos
Kinda Chaos Monkey for Kubernetes
Stars: ✭ 18 (-73.13%)
Mutual labels:  crd
GenerateDynamicCustomForm
You can generate a dynamic form view in a few minutes for a signup, add a record. Creating a form is very easy.
Stars: ✭ 18 (-73.13%)
Mutual labels:  customcontroller
gen-crd-api-reference-docs
API Reference Docs generator for Kubernetes CRDs (used by Knative, Kubeflow and others)
Stars: ✭ 205 (+205.97%)
Mutual labels:  crd
minikube-operator
An operator for Minikube - Kubernetes on Kubernetes
Stars: ✭ 26 (-61.19%)
Mutual labels:  crd
configurator
Synchronize and Version Control ConfigMaps & Secrets across Deployment Rollouts.
Stars: ✭ 68 (+1.49%)
Mutual labels:  crd
scheduled-scaler
No description or website provided.
Stars: ✭ 68 (+1.49%)
Mutual labels:  crd
codis-operator
Codis Operator creates and manages codis clusters(proxy based Redis cluster solution) running in kubernetes.(WIP)
Stars: ✭ 21 (-68.66%)
Mutual labels:  crd
apis
The API (CRD) of Volcano
Stars: ✭ 16 (-76.12%)
Mutual labels:  crd
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (-10.45%)
Mutual labels:  crd
helm-controller
A simple way to manage helm charts with a Custom Resource Definitions in k8s.
Stars: ✭ 49 (-26.87%)
Mutual labels:  crd
gcp-serviceaccount-controller
This is a controller to automatically create gcp service accounts an save them into kubernetes secrets
Stars: ✭ 14 (-79.1%)
Mutual labels:  crd
deployment-controller
基于Fabric8模拟Kubernetes的Deployment实现一个Controller
Stars: ✭ 60 (-10.45%)
Mutual labels:  crd
kanarini
Canary Deployment Controller for Kubernetes
Stars: ✭ 32 (-52.24%)
Mutual labels:  crd
Litmus
Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
Stars: ✭ 2,377 (+3447.76%)
Mutual labels:  crd
Chaos Mesh
A Chaos Engineering Platform for Kubernetes.
Stars: ✭ 4,265 (+6265.67%)
Mutual labels:  crd

samplecontroller repository

This is a simple controller to demonstrate how to interact within kubernetes using python api and custom resource definitions

Requisites

  • a running kubernetes/openshift cluster

Running

on minikub/gce

kubectl run samplecontroller --image=karmab/samplecontroller --restart=Always
kubectl run sampleui --image=karmab/sampleui
kubectl expose deployment sampleui --port=9000 --target-port=9000 --type=LoadBalancer
  • on openshift ( enough privileges needed as i m checking guitars cluster wide)
oc new-project guitarcenter
oc adm policy add-cluster-role-to-user cluster-admin -z default -n guitarcenter
oc new-app karmab/samplecontroller

Note that the guitar custom resource definition gets created when launching the controller

How to use

Create some guitars and see the review made for you

oc create -f crd/stratocaster.yml
oc create -f crd/lespaul.yml
oc get guitars -o yaml

UI

To ease testing, you can also use the provided UI to list, create and delete guitars

oc new-app karmab/sampleui
oc expose svc sampleui

BONUS

You can also have a look at initializer for extra code around Initializers

Also, if you prefer to use kopf, you can use the code in kopf_handler.py

Copyright

Copyright 2017 Karim Boumedhel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Problems?

Send me a mail at [email protected] !

Mc Fly!!!

karmab

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].