d31cd79e0396d8457013d98289ed90d9.jpg

构建VeryNginx docker 镜像

git clone https://github.com/alexazhou/VeryNginx.git
cd VeryNginx
docker build -t verynginx .
docker tag verynginx hub.***.com/base/verynginx:latest
docker push hub.***.com/base/verynginx:latest

Deployment

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: verynginx
  labels:
    name: verynginx
spec:
  template:
    metadata:
      name: verynginx
      labels:
        name: verynginx
    spec:
      containers:
      - name: verynginx
        image: hub.***.com/base/verynginx:latest
        imagePullPolicy: IfNotPresent
        ports:
        - name: tcp
          containerPort: 80

service

apiVersion: v1
kind: Service
metadata:
  name: verynginx
  labels:
    name: verynginx
spec:
  type: NodePort
  ports:
    - name: tcp
      port: 80
      nodePort: 30006
      targetPort: 80
  selector:
    name: verynginx

浏览器打开 http://192.168.2.12:30006/verynginx/index.html
默认用户名和密码是 verynginx / verynginx

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code