- Prerequisites
- Kubernetes version is between 1.14 and 1.20.
- The version of Prometheus Operator is v0.49.0.
- Requirements:
- For production environment (recommended): Worker >= 4 vCPU 8 GB of Memory.
- For test environment (minimum): Worker >= 2 vCPU 2 GB of Memory.
- Can access the managed etcd.
-
Configure Virtual Box Network (Allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges)
sudo mkdir -p /etc/vbox && sudo bash -c "cat > /etc/vbox/networks.conf" << EOF
* 10.0.0.0/8 192.168.0.0/16
* 2001::/64
EOF
- Install Minikube (e.g. Mac OSX)
- Requirements:version <= 1.20.x
VERSION=v1.20.0
curl -LO https://github.com/kubernetes/minikube/releases/download/${VERSION}/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube
minikube start --vm-driver=virtualbox
- Alias
minikube kubectl
alias kubectl="minikube kubectl --"
- Deploy ingress controller
minikube addons enable ingress
- Install helm:
Please refer to helm installation
- Download Helm Repo:
git clone -b release-0.2 [email protected]:tkestack/kstone.git
cd ./charts
- Get Admin TOKEN from Minikube cluster
kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}" -n kube-system|base64 --decode
- Fill in the TOKEN of the cluster to deploy.
// charts/charts/dashboard-api/values.yaml
kube:
token: $token
target: kubernetes.default.svc.cluster.local:443
- Requirements:
- $token is the access credential TOKEN of the cluster to be deployed.
- $token needs to have access to all resources in the cluster.
- Set
prometheusOperator.enabled=false
in the filecharts/charts/kube-prometheus-stack/values.yaml
. - Set
prometheus.enabled=false
in the filecharts/charts/kube-prometheus-stack/values.yaml
. - Modify the file:
charts/charts/grafana/templates/configmap.yaml
, replacehttp://{{ .Release.Name }}-prometheus-prometheus.{{ .Release.Namespace }}.svc.cluster.local:9090
to the query URL from the existing Prometheus Operator.
- Create kstone namespace
kubectl create ns kstone
- Helm install for production environment
cd charts/
helm install kstone . -n kstone -f values.yaml
or
- Helm install for test environment
cd charts/
helm install kstone . -n kstone -f values.test.yaml
- Create Ingress Rule
cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kstone-ingress
namespace: kstone
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kstone-dashboard
port:
number: 80
- path: /apis
pathType: Prefix
backend:
service:
name: kstone-dashboard-api
port:
number: 80
- path: /grafana
pathType: Prefix
backend:
service:
name: kstone-grafana
port:
number: 80
EOF
- Expose Ingress Port
kubectl port-forward deployment/ingress-nginx-controller 8080:80 --namespace ingress-nginx --address 0.0.0.0
- Visit kstone dashboard
http://127.0.0.1:8080
in the browser
- Create an ETCD cluster
- Cluster is Running
- Helm upgrade for production environment
cd charts
helm upgrade kstone . -n kstone -f values.yaml
or
- Helm upgrade for test environment
cd charts
helm upgrade kstone . -n kstone -f values.test.yaml
- Uninstall Kstone
helm uninstall kstone -n kstone
kubectl delete crd alertmanagerconfigs.monitoring.coreos.com
kubectl delete crd alertmanagers.monitoring.coreos.com
kubectl delete crd podmonitors.monitoring.coreos.com
kubectl delete crd probes.monitoring.coreos.com
kubectl delete crd prometheuses.monitoring.coreos.com
kubectl delete crd prometheusrules.monitoring.coreos.com
kubectl delete crd servicemonitors.monitoring.coreos.com
kubectl delete crd thanosrulers.monitoring.coreos.com
kubectl delete crd etcdclusters.kstone.tkestack.io
kubectl delete crd etcdinspections.kstone.tkestack.io
- Uninstall Minikube
minikube stop && minikube delete