wordpress.yaml (4670B)
1 apiVersion: v1 2 kind: PersistentVolumeClaim 3 metadata: 4 name: wordpress-pvc 5 namespace: blog 6 spec: 7 storageClassName: "longhorn" 8 accessModes: 9 - ReadWriteMany 10 resources: 11 requests: 12 storage: 2Gi 13 --- 14 apiVersion: apps/v1 15 kind: Deployment 16 metadata: 17 name: wordpress 18 namespace: blog 19 spec: 20 replicas: 1 21 selector: 22 matchLabels: 23 app: wordpress 24 template: 25 metadata: 26 labels: 27 app: wordpress 28 spec: 29 securityContext: 30 fsGroup: 33 31 containers: 32 - name: wordpress 33 image: registry.midnightthoughts.space/mtrnord/blog:20260424-161756 # {"$imagepolicy": "flux-system:blog"} 34 env: 35 - name: DB_HOST 36 value: mysql-service.blog.svc.cluster.local 37 - name: DB_USER 38 valueFrom: 39 secretKeyRef: 40 name: mysql-cred 41 key: username 42 - name: DB_PASSWORD 43 valueFrom: 44 secretKeyRef: 45 name: mysql-cred 46 key: password 47 - name: DB_NAME 48 valueFrom: 49 secretKeyRef: 50 name: mysql-cred 51 key: db-name 52 - name: AUTH_KEY 53 valueFrom: 54 secretKeyRef: 55 name: mysql-cred 56 key: auth-key 57 - name: SECURE_AUTH_KEY 58 valueFrom: 59 secretKeyRef: 60 name: mysql-cred 61 key: secure-auth-key 62 - name: LOGGED_IN_KEY 63 valueFrom: 64 secretKeyRef: 65 name: mysql-cred 66 key: logged-in-key 67 - name: NONCE_KEY 68 valueFrom: 69 secretKeyRef: 70 name: mysql-cred 71 key: nonce-key 72 - name: AUTH_SALT 73 valueFrom: 74 secretKeyRef: 75 name: mysql-cred 76 key: auth-salt 77 - name: SECURE_AUTH_SALT 78 valueFrom: 79 secretKeyRef: 80 name: mysql-cred 81 key: secure-auth-salt 82 - name: LOGGED_IN_SALT 83 valueFrom: 84 secretKeyRef: 85 name: mysql-cred 86 key: logged-in-salt 87 - name: NONCE_SALT 88 valueFrom: 89 secretKeyRef: 90 name: mysql-cred 91 key: nonce-salt 92 - name: SMTP_PASS 93 valueFrom: 94 secretKeyRef: 95 name: mysql-cred 96 key: smtp-pass 97 ports: 98 - containerPort: 8080 99 name: wordpress 100 resources: 101 requests: 102 memory: "256Mi" 103 cpu: "100m" 104 limits: 105 memory: "2048Mi" 106 cpu: "2000m" 107 volumeMounts: 108 - name: wordpress-persistent-storage 109 mountPath: /var/www/html/wordpress/wp-content/uploads 110 subPath: uploads 111 #- name: wordpress-persistent-storage 112 # mountPath: /var/www/html/wordpress/wp-content/plugins 113 # subPath: plugins 114 #- name: wordpress-persistent-storage 115 # mountPath: /var/www/html/wordpress/wp-content/themes 116 # subPath: themes 117 readinessProbe: 118 httpGet: 119 path: /wp-login.php 120 port: 8080 121 scheme: "HTTP" 122 initialDelaySeconds: 30 123 periodSeconds: 10 124 timeoutSeconds: 15 125 successThreshold: 1 126 failureThreshold: 3 127 livenessProbe: 128 httpGet: 129 path: /wp-login.php 130 port: 8080 131 scheme: "HTTP" 132 initialDelaySeconds: 60 133 periodSeconds: 10 134 timeoutSeconds: 15 135 successThreshold: 1 136 failureThreshold: 3 137 volumes: 138 - name: wordpress-persistent-storage 139 persistentVolumeClaim: 140 claimName: wordpress-pvc 141 --- 142 kind: Service 143 apiVersion: v1 144 metadata: 145 name: wordpress-service 146 namespace: blog 147 spec: 148 type: ClusterIP 149 selector: 150 app: wordpress 151 ports: 152 - name: http 153 protocol: TCP 154 port: 8080 155 targetPort: 8080 156 --- 157 apiVersion: gateway.networking.k8s.io/v1 158 kind: HTTPRoute 159 metadata: 160 name: blog 161 namespace: blog 162 spec: 163 parentRefs: 164 - name: envoy-gateway 165 namespace: envoy-gateway 166 hostnames: 167 - mtrnord.blog 168 rules: 169 - backendRefs: 170 - name: wordpress-service 171 port: 8080 172 timeouts: 173 request: 240s 174 backendRequest: 0s