---
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: db
  name: db
spec:
  clusterIP: None
  ports:
    - name: "3306"
      port: 3306
      targetPort: 3306
  selector:
    io.kompose.service: db
  type: ClusterIP


---
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: wordpress
  name: wordpress
spec:
  clusterIP: None
  ports:
    - name: "8000"
      port: 8000
      targetPort: 80
  selector:
    io.kompose.service: wordpress
  type: ClusterIP


---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: db
  name: db
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: db
  serviceName: db
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.network/statefulset-default: "true"
        io.kompose.service: db
    spec:
      containers:
        - env:
            - name: MYSQL_DATABASE
              value: wordpress
            - name: MYSQL_PASSWORD
              value: wordpress
            - name: MYSQL_ROOT_PASSWORD
              value: somewordpress
            - name: MYSQL_USER
              value: wordpress
          image: mysql:5.7
          name: db
          ports:
            - containerPort: 3306
              hostPort: 3306
              protocol: TCP
          resources: {}
          volumeMounts:
            - mountPath: /var/lib/mysql
              name: db-data
      restartPolicy: Always
  updateStrategy: {}
  volumeClaimTemplates:
    - metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: db-data
        name: db-data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 100Mi

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: wordpress
  name: wordpress
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: wordpress
  serviceName: wordpress
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.network/statefulset-default: "true"
        io.kompose.service: wordpress
    spec:
      containers:
        - env:
            - name: WORDPRESS_DB_HOST
              value: db:3306
            - name: WORDPRESS_DB_NAME
              value: wordpress
            - name: WORDPRESS_DB_PASSWORD
              value: wordpress
            - name: WORDPRESS_DB_USER
              value: wordpress
          image: wordpress:latest
          name: wordpress
          ports:
            - containerPort: 80
              hostPort: 8000
              protocol: TCP
          resources: {}
          volumeMounts:
            - mountPath: /var/www/html
              name: wordpress-data
      restartPolicy: Always
  updateStrategy: {}
  volumeClaimTemplates:
    - metadata:
        creationTimestamp: null
        labels:
          io.kompose.service: wordpress-data
        name: wordpress-data
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 100Mi

