Created
December 6, 2024 13:29
-
-
Save Bhavdip/85091753b7bf6783911a67116726fb4a to your computer and use it in GitHub Desktop.
Kubernetes Deployment and Service Sample file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
# kind include service, deployment, job etc. | |
##### This is a Deployment object | |
kind: Deployment | |
# This metadata is about Deployment what is deployment name in kubernetes cluster | |
# You want to see to identify the deployment. | |
metadata: | |
name: kub-deployment-second-app | |
# Below is the specification of our deployment `kub-deployment-second-app` | |
spec: | |
# This is replicas of your pod instance if you know more traffic coming with start then you can | |
# update this default value. K8S then will Spin up that amount of pods containing the same container | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: kub-pod-second-app | |
tier: backend | |
##### This is a Template: POD objects. Template describe the pod that will be created. | |
##### This is where you specify the metadata and the containers that will run in the Pods. | |
##### This object tells kubernetes we want to create pods object inside cluster | |
template: | |
metadata: | |
labels: | |
# This is our pod name | |
app: kub-pod-second-app | |
tier: backend | |
spec: # Below is the specification of our pods | |
containers: | |
- name: kub-container-second-app | |
image: dockercamp2023/kube-deployment-first-app:latest | |
#- name : kub-container-second-app | |
# image: <your-image> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment