k8s启动owncloud服务

apiVersion: apps/v1
kind: Deployment
metadata:
  name: owncloud
spec:
  selector:
    matchLabels:
      app: owncloud
  template:
    metadata:
      labels:
        app: owncloud
    spec:
      containers:
      - name: owncloud
        image: 10.18.4.10/library/owncloud:latest
        ports:
        - containerPort: 80
        volumeMounts:
        - name: cache-volume
          mountPath: /src
      - name: mysql
        image: 10.18.4.10/library/mysql:5.6
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: owncloud
        - name: MYSQL_DATABASE
          value: owncloud
        ports:
        - containerPort: 3306
        volumeMounts:
        - name: cache-volume
          mountPath: /src
      volumes:
      - name: cache-volume
        emptyDir: {
    
    }
apiVersion: v1
kind: Service
metadata:
  name: owncloud-svc
spec:
  type: NodePort
  ports:
  - name: owncloud
    port: 80
    targetPort: 80
    nodePort: 30003
  - name: mysql-owncloud
    port: 3306
    targetPort: 3306
    nodePort: 30004
  selector:
    app: owncloud

猜你喜欢

转载自blog.csdn.net/m0_52426915/article/details/116003265
k8s