首页 > 其他分享 >k3s 基础 —— 配置 traefik dashboard

k3s 基础 —— 配置 traefik dashboard

时间:2023-04-22 15:22:35浏览次数:45  
标签:web kind name k3s traefik yaml dashboard

访问 traefik dashboard

端口转发

# 访问地址 http://192.168.0.201:9000/dashboard/#/
kubectl -n kube-system port-forward $(kubectl -n kube-system get pods --selector "app.kubernetes.io/name=traefik" --output=name) 9000:9000 --address 0.0.0.0

配置域名

1、创建 ingress 配置文件 traefik-dashboard-web.yaml

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-dashboard-web
  namespace: kube-system
spec:
  entryPoints:
    - web
  routes:
    - kind: Rule
      match: Host(`traefik.domain.com`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
      services:
        - kind: TraefikService
          name: api@internal # 固定值,不用修改

2、执行部署

kubectl apply -f traefik-dashboard-web.yaml

3、配置 DNS 解析,访问地址 https://traefik.domain.com/dashboard/#/

开启跨命名空间访问

默认情况 traefik ingress 是不开启此项功能的,需要手动启用

新增配置文件 /var/lib/rancher/k3s/server/manifests/traefik-config.yaml

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    globalArguments:
    - "--providers.kubernetescrd.allowCrossNamespace=true"

部署

kubectl apply -f traefik-config.yaml

标签:web,kind,name,k3s,traefik,yaml,dashboard
From: https://www.cnblogs.com/lemos/p/17343143.html

相关文章

  • k3s 基础 —— 配置 kubernetes dashboard
    安装请参考部署仪表盘GITHUB_URL=https://github.com/kubernetes/dashboard/releasesVERSION_KUBE_DASHBOARD=$(curl-w'%{url_effective}'-I-L-s-S${GITHUB_URL}/latest-o/dev/null|sed-e's|.*/||')sudok3skubectlcreate-fhttps://raw.githu......
  • k3s 基础 —— 配置 kubernetes-dashboard 的 token 过期时间
    拉取配置到本地:kubectlgetdeploykubernetes-dashboard-nkubernetes-dashboard-oyaml>dashboard-deploy.yaml增加参数:spec:containers:-args:---auto-generate-certificates---namespace=kubernetes-dashboard---to......
  • k3s 基础 —— 配置 traefik ingress 跨命名空间访问
    新增配置文件/var/lib/rancher/k3s/server/manifests/traefik-config.yaml参考apiVersion:helm.cattle.io/v1kind:HelmChartConfigmetadata:name:traefiknamespace:kube-systemspec:valuesContent:|-globalArguments:-"--providers.kubernetescrd......
  • kube-dashboard
    kubernetesv1.26.xyaml部署kubectlapply-fhttps://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml#修改配置,如servicetype:NodePort等helm部署helminstallkubernetes-dashboardkubernetes-dashboard/kubernetes-dashboard\--se......
  • k3s 基础 —— 配置 traefik dashboard & k8s dashboard 域名访问
    配置k8sdashboard域名访问安装略①kubectl代理(只支持localhost或http):kubectlproxy--address='0.0.0.0'--accept-hosts='^*$'②若k8s在虚拟机中部署,局域网中临时访问,可使用端口转发:kubectlport-forward-nkubernetes-dashboardservice/kubernetes-dashboard......
  • 部署kubernetes-dashboard顺便搞懂kubernetes中的ServiceAccount和RBAC
    "种草"kubernetes-dashboard安装部署dashboard创建用于登录面板的ServiceAccount权限控制"种草"kubernetes-dashboardKubernetesDashboard是通用的用于管理Kubernetes集群的WebUI面板kubernetes-dashboard代码库readme中对自己的介绍:KubernetesDashboardi......
  • 51、K8S-流量调度-Ingress、Ingress-nginx、Dashboard
    Kubernetes学习目录1、Ingress基础1.1、简介在实际的应用中,kubenetes接受的不仅仅有内部的流量,还有外部流量,我们可以通过两种方式实现将集群外部的流量引入到集群的内部中来,从而实现外部客户的正常访问。service方式: nodePort、externalIP等service对象方式,借助于names......
  • 在Linux部署RocketMQ可视控制台Dashboard
    前言Dashboard是一个Javaweb项目,Maven工程。通过源码编译成jar包后启动即可通过浏览器访问。通过html界面可以查看RockeMQ集群状态、创建/删除Topic、生产/消费等。安装echo"从GitHub下载源码包">/dev/nullwget-P~/soft/rocketmqhttps://github.com/apache/rocketmq......
  • 39、K8S-安全机制-Dashboard认证之令牌、Kubeconfig文件
    1、Dashboard1.1、安装请参考7、Dashboard部署:https://www.cnblogs.com/ygbh/p/17221496.html1.2、确认dashboard正常访问1.2.1、查询布署到哪个节点上master1~]#kubectlgetpods-nkubernetes-dashboard-owideNAMEREADY......
  • RocketMQ-Windows安装-客户端rocketmq-dashboard 20230331
     一、Windows安装 https://github.com/apache/rocketmq/releases 1、解压rocketmq-all-4.8.0-bin-release.zip到D:\XXXA\rocketmq-all-4.8.0 2、RocketMQ配置环境变量:ROCKETMQ_HOMED:\XXXA\rocketmq-all-4.8.0NAMESRV_ADDRlocalhost:9876 PATH属性增加:......