K8S dashboard与openfaas的安装与配置
一.安装Dashboard1.安装Dashboardkubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml2.外部访问:修改recommended.yaml文件kind: Service…k8s-app: kubernetes-dashboa
一.安装Dashboard
1.安装Dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
2.外部访问:
修改recommended.yaml文件
kind: Service
…
k8s-app: kubernetes-dashboard
…
spec:
type: NodePort
ports:
- port: 443
targetPort: 8443
nodePort: 30000
3.创建管理员:
创建dashboard-adminuser.yaml
cat > dashboard-adminuser.yaml << EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
EOF
应用文件:
kubectl apply -f dashboard-adminuser.yaml
4.查看token:
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk ‘{print $1}’)
5.Token:eyJhbGciOiJSUzI1NiIsImtpZCI6ImwyRDMtSmd6eU1xYWlNYjdrSXpHc1dJd3VqREdqYWJ4M0pTeUJBYVlVTjAifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLW5tYmNqIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiI4NzJjOGE1Yi0wMGM5LTRiZmMtOTkyYS0wZjVkZGRmNmQ3NDYiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZXJuZXRlcy1kYXNoYm9hcmQ6YWRtaW4tdXNlciJ9.ZN7LMBvXBIIBN93LWkvPkD9cL5Bli19LuKK96iOjjOHMhTLyXF70wdkVnmvzUAuqLW3dtET5nQWAN_FI4nhddjaHr63F-LD8n6fgfAxJX6KdanwRmnBzBQjIquf0fUF0zZmg8gVM3diORVfVmNb6Q18mYYCxe9feoYVSgmD4qMaoIJXgjTZNH7opxmFvoWsrPRtneW6I5wgMp7Ag67w2zr_rtzh9IZgSVWXwKAlCLPMeAYLCJYYYZMdULcVDwj_2xb4FoWH0thGqjR9w3hZyPDcB59gB4nbBGdFhOYGPI2SroN1-oodn_mmu342VI4baxuduIMcqKwOTzWnFL0eC-g
二.安装openfass
1.安装fass-netes:
git clone https://github.com/openfaas/faas-netes
cd faas-netes
kubectl apply -f ./namespaces.yml
2.查看是否成功:
kubectl get namespaces
3.给openfass创建密码:
kubectl -n openfaas create secret generic basic-auth
–from-literal=basic-auth-user=admin
–from-literal=basic-auth-password=123456
用户:admin
密码:123456
4.安装openfass所有组件:
git clone https://github.com/openfaas/faas-netes
cd faas-netes
kubectl apply -f ./yaml/
5.下载faas-cli:
curl -sSL https://cli.openfaas.com | sudo sh
更多推荐
所有评论(0)