Guest User

Untitled

a guest
Aug 4th, 2025
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.32 KB | None | 0 0
  1. {
  2.   "apiVersion": "apps/v1",
  3.   "kind": "Deployment",
  4.   "metadata": {
  5.     "name": "sample-app"
  6.   },
  7.   "spec": {
  8.     "replicas": 1,
  9.     "selector": {
  10.       "matchLabels": {
  11.         "app": "sample-app"
  12.       }
  13.     },
  14.     "template": {
  15.       "metadata": {
  16.         "labels": {
  17.           "app": "sample-app"
  18.         }
  19.       },
  20.       "spec": {
  21.     "imagePullSecrets": [
  22.       {"name": "registrysecret"}
  23.     ],      
  24.         "containers": [
  25.           {
  26.             "image": "ghcr.io/syncro/sample-app:latest",
  27.             "imagePullPolicy": "Always",
  28.             "name": "sample-app",
  29.             "env": [
  30.               {
  31.                 "name": "DB_NAME",
  32.                 "valueFrom": {
  33.                   "configMapKeyRef": {
  34.                     "name": "sample-db-config",
  35.                     "key": "db_name"
  36.                   }
  37.                 }
  38.               },
  39.               {
  40.                 "name": "DB_USER",
  41.                 "valueFrom": {
  42.                   "configMapKeyRef": {
  43.                     "name": "sample-db-config",
  44.                     "key": "db_user"
  45.                   }
  46.                 }
  47.               },
  48.               {
  49.                 "name": "DB_PASSWORD",
  50.                 "valueFrom": {
  51.                   "configMapKeyRef": {
  52.                     "name": "sample-db-config",
  53.                     "key": "db_password"
  54.                   }
  55.                 }
  56.               },
  57.               {
  58.                 "name": "DB_HOST",
  59.                 "value": "sample-db-service"
  60.               },
  61.               {
  62.                 "name": "DB_PORT",
  63.                 "valueFrom": {
  64.                   "configMapKeyRef": {
  65.                     "name": "sample-db-config",
  66.                     "key": "db_port"
  67.                   }
  68.                 }
  69.               },
  70.               {
  71.                 "name": "SPRING_PROFILES_ACTIVE",
  72.                 "value": "k8s"
  73.               }
  74.             ],
  75.             "lifecycle": {
  76.               "preStop": {
  77.                 "exec": {
  78.                   "command": ["sh", "-c", "sleep 10"]
  79.                 }
  80.               }
  81.             },
  82.             "ports": [
  83.               {
  84.                 "containerPort": 8080
  85.               },
  86.               {
  87.                 "containerPort": 5701
  88.               }
  89.             ]
  90.           }
  91.         ]
  92.       }
  93.     }
  94.   }
  95. }
  96.  
Advertisement
Add Comment
Please, Sign In to add comment