mysql.yaml

[root@lab2 mysql]# cat mysql.yaml 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mysql
  namespace: development
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: mysql
    spec:
      containers:
      - name: mysql
        image: 10.1.1.71:5000/library/mysql/latest
        ports:
        - containerPort: 3306
---
apiVersion: v1
kind: Service
metadata:
  name: mysql
  namespace: development
spec:
  type: NodePort
  ports: 
  - port: 3306
    nodePort: 13306
    targetPort: 3306
  selector:
    name: mysql
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mysql
  namespace: development
spec:
  rules:
  - host: mysql
    http:
      paths:
      - path: /
        backend:
          serviceName: mysql
          servicePort: 3306

 

posted @ 2019-03-04 13:19  effortsing  阅读(1471)  评论(0编辑  收藏  举报