Changes between Version 5 and Version 6 of minikubedeployment2023
- Timestamp:
- Nov 28, 2023, 4:21:36 PM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
minikubedeployment2023
v5 v6 169 169 ==== Part 2 ==== 170 170 Create a file simple-pod.yaml 171 171 {{{ 172 172 apiVersion: v1 173 173 kind: Pod … … 180 180 ports: 181 181 - containerPort: 80 182 }}} 182 183 183 184 To create the Pod shown above, run the following command: … … 195 196 Save the following YAML to a file named webapp-deployment.yaml: 196 197 198 {{{ 197 199 apiVersion: apps/v1 198 200 kind: Deployment … … 216 218 ports: 217 219 - containerPort: 80 220 }}} 218 221 219 222 2. Create a Service Manifest: … … 221 224 Save the following YAML to a file named webapp-service.yaml: 222 225 226 {{{ 223 227 apiVersion: v1 224 228 kind: Service … … 234 238 nodePort: 30080 235 239 type: NodePort 240 }}} 236 241 237 242 3. Deploy the Application: … … 278 283 279 284 MySQL needs persistent storage to store its data. Save the following YAML to a file named mysql-pvc.yaml: 285 286 {{{ 280 287 apiVersion: v1 281 288 kind: PersistentVolumeClaim … … 288 295 requests: 289 296 storage: 1Gi 297 }}} 290 298 291 299 Apply the PVC: … … 296 304 Save the following YAML to a file named mysql-deployment.yaml: 297 305 306 {{{ 298 307 apiVersion: apps/v1 299 308 kind: Deployment … … 327 336 persistentVolumeClaim: 328 337 claimName: mysql-pvc 338 }}} 329 339 330 340 Apply the Deployment: … … 336 346 This will allow WordPress to communicate with MySQL. Save the following YAML to a file named mysql-service.yaml: 337 347 348 {{{ 338 349 apiVersion: v1 339 350 kind: Service … … 347 358 port: 3306 348 359 targetPort: 3306 360 }}} 349 361 350 362 Apply the Service: … … 354 366 Save the following YAML to a file named wordpress-deployment.yaml: 355 367 368 {{{ 356 369 apiVersion: apps/v1 357 370 kind: Deployment … … 380 393 ports: 381 394 - containerPort: 80 395 }}} 382 396 383 397 Apply the Deployment: … … 388 402 This will expose WordPress to external traffic. Save the following YAML to a file named wordpress-service.yaml: 389 403 404 {{{ 390 405 apiVersion: v1 391 406 kind: Service … … 400 415 targetPort: 80 401 416 type: NodePort 417 }}} 402 418 403 419 Apply the Service: