k3s运行apisix控制台


首先创建控制台资源

apiVersion: apps/v1
kind: Deployment
metadata:
  name: apisix-dashboard
  namespace: apisix
  labels:
    app: apisix-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: apisix-server
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: apisix-server
    spec:
      containers:
        - name: apisix-server
          image: docker.io/apache/apisix-dashboard:2.9.0
          imagePullPolicy: Always
          volumeMounts:
            - mountPath: /usr/local/apisix-dashboard/conf/conf.yaml
              name: volume
          ports:
            - name: http
              containerPort: 9000
      volumes:
        - name: volume
          hostPath:
            path: /www/docker/apisix-dashboard/conf.yaml
            type: File

然后创建控制台服务

apiVersion: v1
kind: Service
metadata:
  name: dashboard-service
  namespace: apisix
spec:
  type: NodePort 
  selector:
    app: apisix-server
  ports:
  - port: 9000
    targetPort: 9000
    nodePort: 30083

对外暴露的端口就是 30083