Gotok8s Save

Goto Kubernetes

Project README

Goto Kubernetes

github workflow

安装 Kubernetes

Helm

安装

详细使用说明请参考 Helm官方文档

$ brew install helm

使用

# 添加 charts repo
$ helm repo add bitnami https://charts.bitnami.com/bitnami

# 测试安装 redis chart
$ helm install my-redis bitnami/redis

# 删除 redis
$ helm uninstall my-redis

Kubernetes Dashboard

部署 Kubernetes Dashboard

$ helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
$ helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard

创建Dashboard管理员用户并用token登陆

# 创建 ServiceAccount admin-user 并绑定集群管理员权限
$ kubectl apply -f https://raw.githubusercontent.com/gotok8s/gotok8s/master/dashboard-adminuser.yaml

# 获取登陆 token
$ kubectl get secret admin-user -n kubernetes-dashboard -o jsonpath={".data.token"} | base64 -d

访问Dashboard

$ kubectl -n kubernetes-dashboard port-forward service/kubernetes-dashboard 8443:443

通过下面的连接访问 Dashboard: https://127.0.0.1:8443/

输入上一步获取的token, 验证并登陆。

NGINX Ingress

# install by helm
$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
$ helm repo update

$ helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace

Istio

下载并安装 Istio

$ curl -L https://istio.io/downloadIstio | sh -
# 进入下载的文件夹,这里以 `istio-1.18.1` 为例
$ cd istio-1.18.1
$ export PATH=$PWD/bin:$PATH
# 安装
$ istioctl install --set profile=demo -y
# 设置自动注入 Envoy sidecar proxies
$ kubectl label namespace default istio-injection=enabled

部署示例

# 部署
$ kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
# 查看示例返回
$ kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"
Open Source Agenda is not affiliated with "Gotok8s" Project. README Source: maguowei/gotok8s
Stars
412
Open Issues
1
Last Commit
5 months ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating