minikube+eggjs+traefik

providers: kubernetesCRD: namespaces: - default - traefik - k8seggjs#这里添加 namespace kubernetesIngress: namespaces: - default - traefik - k8seggjs# 这里可以添加 namespace

ports: traefik: expose: true nodePort: 32090 web: nodePort: 32080 websecure: nodePort: 32443 cassandra: expose: true port: 9042 nodePort: 32091 cassandrasecure: expose: true port: 9142 nodePort: 32092

1
2

更新配置文件

helm upgrade traefik traefik/traefik -n traefik –create-namespace -f traefik.values.yaml

1
2
3
4
5
6
7
8

minikube tunnel

即可访问traefik dashboard:

localhost:9000/dashboard/

### 3. Port forward to the Traefik dashboard

kubectl port-forward –namespace traefik services/traefik 9000:9000

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22

![image-20230719124140265](https://cdn.jsdelivr.net/gh/huangxiaofeng10047/blogimage@main/img/image-20230719124140265.png)

参考文档:

# Quickstart for developers

https://docs.k8ssandra.io/tasks/connect/ingress/minikube-deployment/

clash-for-windows配置

## 绕过系统代理[](https://docs.mebi.me/docs/advanced-usage-for-clash#绕过系统代理)

- 进入 Settings 页面
- 点击 System proxy Bypass 右边 Edit 小字打开编辑界面
- 若要增加绕过example.com域名,只需在修改编辑界面内容为:

```undefined
bypass:
  - "example.com" # 下面字段可不删除
  - 127.0.0.1
  - ...

image-20230719132028154

点击编辑器右下角保存

bypass 类型为数组,item 为需要绕过的域名或节点,支持通配符*

即可访问 eggjs 服务

image-20230719132109096

为了访问 kubernets-dashboard,配置 ingress 如何编写,请看下面配置文件:

ingress-k8s-dashboard.yaml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: "traefik" # 从nginx修改traefik
  name: ingress-k8s-dashboard
  namespace: kubernetes-dashboard
spec:
  rules:
    - host: k8s.local
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name:  kubernetes-dashboard
                port:
                  number: 80

创建成功后,可以在 traefik 的 dashboard 上看见 http 对应的服务。

访问地址试试http://k8s.local/#/workloads?namespace=traefik

image-20230719133626952

dockerfile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
mkdir -p /var/ftp/centos6.9
mkdir -p /var/ftp/centos7.5

cat > /etc/yum.repos.d/ftp_6.repo <<EOF
[ftp]
name=ftpbase
baseurl=ftp://192.168.184.70/centos6.9
enable=1
gpgcheck=0
EOF

cat > /etc/yum.repos.d/ftp_7.repo <<EOF
[ftp]
name=ftpbase
baseurl=ftp://192.168.184.70/centos7.5
enable=1
gpgcheck=0
EOF
Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up