欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

k8s启动owncloud服务

程序员文章站 2024-03-14 13:33:16
...
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