Use kubeadm setup kubernetes cluster and enable ingress-rbac, prometheus etc...
Also check sample spring boot kubernetes if you are interesting
- Install docker first
- prepare
sh prepare-ubuntu.sh
orsh prepare-centos.sh
- setup
sh setup.sh
copy $HOME/.kube/config
to your localhost and edith below section:
apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://ip_address:port
- Run
kubectl proxy
- access
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
use the token generated above to login
Click Here to check the samples
follow the instruction Here
- Prometheus
kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090
Then access via http://localhost:9090
- Grafana
kubectl --namespace monitoring port-forward svc/grafana 3000
Then access via http://localhost:3000 and use the default grafana user:password of admin:admin
.
- Alert Manager
kubectl --namespace monitoring port-forward svc/alertmanager-main 9093
Then access via http://localhost:9093
See more here
- create secret
kubectl create secret docker-registry --dry-run=true secret_name \
--docker-server=<DOCKER_REGISTRY_SERVER> \
--docker-username=<DOCKER_USER> \
--docker-password=<DOCKER_PASSWORD> \
--docker-email=<DOCKER_EMAIL>
- patch secret to default service account
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "secret_name"}]}'
then all the pods created in current namespace will have follow content:
spec:
imagePullSecrets:
- name: docker-registry-secret