portainer
1 | docker compose -f portainer.yml |
portainer.yml
portainer.yml
version: '3.8' # 根据你的Docker Compose版本选择合适的版本号
services:
portainer:
image: portainer/portainer-ce:alpine-sts
container_name: portainer
ports:
- 8000:9000
- 9443:9443
extra_hosts:
- "portainer.ui.k8s.cn:192.168.122.1" # 添加主机名
volumes:
- /mnt/oss/portainer/data:/data
- /var/run/docker.sock:/var/run/docker.sock
- /mnt/oss/portainer/public:/public #chinese
chinese https://github.com/outlovecn/portainer-cn
docker pull m.daocloud.io/docker.io/portainer/portainer-ce:2.19.5
docker tag m.daocloud.io/docker.io/portainer/portainer-ce:2.19.5 portainer/portainer-ce:2.19.5
https://docs.portainer.io/advanced/ssl#using-your-own-ssl-certificate-on-docker-standalone
k8s agent
1 | kubectl apply -f https://downloads.portainer.io/ce2-20/portainer-agent-k8s-nodeport.yaml |
nodeport nodename:port
集群任意节点ip:port即可访问
1 | ❯ kubectl get pod/portainer-agent-656bfc4479-knj4v --template='{{(index (index .spec.containers 0).ports 0).containerPort}}{{"\n"}}' -n portainer |