apiVersion: app.sealos.io/v1
kind: Instance
metadata:
  name: wordpress-zkcfudve
  labels:
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
spec:
  gitRepo: https://github.com/WordPress/WordPress
  templateType: inline
  categories:
    - blog
  defaults:
    app_host:
      type: string
      value: pikdptvl
    app_name:
      type: string
      value: wordpress-zkcfudve
  inputs: null
  title: WordPress
  url: https://wordpress.org
  author: Sealos
  description: >-
    WordPress is a powerful, user-friendly and open source content management
    system (CMS) that can be used to publish websites, news, blogs and other
    content on the Internet.
  readme: https://cdn.jsdelivr.net/gh/WordPress/WordPress@master/readme.html
  icon: >-
    https://cdn.jsdelivr.net/gh/WordPress/WordPress@master/wp-admin/images/wordpress-logo.svg
  deployCount: 7

---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    sealos-db-provider-cr: wordpress-zkcfudve-mysql
    app.kubernetes.io/instance: wordpress-zkcfudve-mysql
    app.kubernetes.io/managed-by: kbcli
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
  name: wordpress-zkcfudve-mysql

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: wordpress-zkcfudve
  annotations:
    originImageName: wordpress:6.5.4
    deploy.cloud.sealos.io/minReplicas: '1'
    deploy.cloud.sealos.io/maxReplicas: '1'
  labels:
    cloud.sealos.io/app-deploy-manager: wordpress-zkcfudve
    app: wordpress-zkcfudve
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
spec:
  replicas: 1
  revisionHistoryLimit: 1
  minReadySeconds: 10
  serviceName: wordpress-zkcfudve
  selector:
    matchLabels:
      app: wordpress-zkcfudve
  template:
    metadata:
      labels:
        app: wordpress-zkcfudve
    spec:
      terminationGracePeriodSeconds: 10
      automountServiceAccountToken: false
      containers:
        - name: wordpress-zkcfudve
          image: wordpress:6.5.4
          env:
            - name: WORDPRESS_DB_HOST
              value: wordpress-zkcfudve-mysql-mysql..svc
            - name: WORDPRESS_DB_USER
              value: root
            - name: WORDPRESS_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: wordpress-zkcfudve-mysql-conn-credential
                  key: password
            - name: WORDPRESS_DB_NAME
              value: mydb
          resources:
            requests:
              cpu: 100m
              memory: 102Mi
            limits:
              cpu: 1000m
              memory: 1024Mi
          command: []
          args: []
          ports:
            - containerPort: 80
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: var-www-html
              mountPath: /var/www/html
      volumes: []
  volumeClaimTemplates:
    - metadata:
        annotations:
          path: /var/www/html
          value: '1'
        name: var-www-html
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi

---
apiVersion: v1
kind: Service
metadata:
  name: wordpress-zkcfudve
  labels:
    cloud.sealos.io/app-deploy-manager: wordpress-zkcfudve
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
spec:
  ports:
    - port: 80
  selector:
    app: wordpress-zkcfudve

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: wordpress-zkcfudve
  labels:
    cloud.sealos.io/app-deploy-manager: wordpress-zkcfudve
    cloud.sealos.io/app-deploy-manager-domain: pikdptvl
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-body-size: 32m
    nginx.ingress.kubernetes.io/server-snippet: |
      client_header_buffer_size 64k;
      large_client_header_buffers 4 128k;
    nginx.ingress.kubernetes.io/ssl-redirect: 'false'
    nginx.ingress.kubernetes.io/backend-protocol: HTTP
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/client-body-buffer-size: 64k
    nginx.ingress.kubernetes.io/proxy-buffer-size: 64k
    nginx.ingress.kubernetes.io/configuration-snippet: |
      if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
        expires 30d;
        add_header Cache-Control "public";
      }
spec:
  rules:
    - host: pikdptvl.sealoshzh.site
      http:
        paths:
          - pathType: Prefix
            path: /()(.*)
            backend:
              service:
                name: wordpress-zkcfudve
                port:
                  number: 80
  tls:
    - hosts:
        - pikdptvl.sealoshzh.site
      secretName: wildcard-cert

---
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  finalizers:
    - cluster.kubeblocks.io/finalizer
  labels:
    clusterdefinition.kubeblocks.io/name: apecloud-mysql
    clusterversion.kubeblocks.io/name: ac-mysql-8.0.30
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
  name: wordpress-zkcfudve-mysql
spec:
  affinity:
    nodeLabels: {}
    podAntiAffinity: Preferred
    tenancy: SharedNode
    topologyKeys: []
  clusterDefinitionRef: apecloud-mysql
  clusterVersionRef: ac-mysql-8.0.30
  componentSpecs:
    - componentDefRef: mysql
      monitor: true
      name: mysql
      replicas: 1
      resources:
        limits:
          cpu: 500m
          memory: 512Mi
        requests:
          cpu: 50m
          memory: 51Mi
      serviceAccountName: wordpress-zkcfudve-mysql
      volumeClaimTemplates:
        - name: data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi
            storageClassName: openebs-backup
  terminationPolicy: Delete
  tolerations: []

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    sealos-db-provider-cr: wordpress-zkcfudve-mysql
    app.kubernetes.io/instance: wordpress-zkcfudve-mysql
    app.kubernetes.io/managed-by: kbcli
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
  name: wordpress-zkcfudve-mysql
rules:
  - apiGroups:
      - '*'
    resources:
      - '*'
    verbs:
      - '*'

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    sealos-db-provider-cr: wordpress-zkcfudve-mysql
    app.kubernetes.io/instance: wordpress-zkcfudve-mysql
    app.kubernetes.io/managed-by: kbcli
    cloud.sealos.io/deploy-on-sealos: wordpress-zkcfudve
  name: wordpress-zkcfudve-mysql
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: wordpress-zkcfudve-mysql
subjects:
  - kind: ServiceAccount
    name: wordpress-zkcfudve-mysql
