Microservice demo, run nginx as webserver
$ kubectl run --image=nginx nginx
$ kubectl get po --show-labels -owide -w
$ kubectl expose deploy nginx --selector run=nginx --port=80 --type=NodePort
$ minikube ssh
$ ifconfig eth1
$ curl < nodeip> :< nodeport>
$ kubectl create configmap envoy-config --from-file=envoy.yaml
$ kubectl create -f envoy-deploy.yaml
$ kubectl expose deploy envoy --selector run=envoy --port=10000 --type=NodePort
$ curl < nodeip> :< nodeport>
$ kubectl scale deploy < deployment-name> --replicas=< n>
cat game.properties
# configmap from file
kubectl create configmap game-config --from-file=game.properties
kubectl create configmap game-env-config --from-env-file=game.properties
kubectl get configmap -oyaml game-config
kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm
# downward api pod
kubectl create -f downward-api-pod.yaml
kubectl get po downward-api-pod
kubectl logs -f downward-api-pod
kubectl create -f configmap-volume-pod.yaml
kubectl get po
kubectl logs -f configmap-volume-pod
kubectl create -f centos-readiness.yaml
kubectl get svc -o=custom-columns=NAME:.metadata.name,CREATED:' .metadata.annotations'
$ kubebuilder init --domain example.com
$ kubebuilder create api --group infra --version v1 --kind WebService
$ make install
operator-sdk new memorycache-operator
cd memorycache-operator
operator-sdk add api --api-version=cache.example.com/v1alpha1 --kind=Memcached
Modify types and generate new code
operator-sdk generate k8s
operator-sdk generate openapi
operator-sdk new nginx-operator --type=helm --kind=Nginx --api-version=web.example.com/v1alpha1
operator-sdk add crd --api-version=web.example.com/v1alpha1 --kind=Envoy --update-watches=true