Skip to content

Commit

Permalink
Add kubernetes deployment and service yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
codophobia committed May 4, 2022
1 parent d6c1f9c commit b76765a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: flask-hello-deployment # name of the deployment

spec:
template: # pod defintion
metadata:
name: flask-hello # name of the pod
labels:
app: flask-hello
tier: frontend
spec:
containers:
- name: flask-hello
image: shivammitra/flask-hello-world:latest
replicas: 3
selector: # Mandatory, Select the pods which needs to be in the replicaset
matchLabels:
app: flask-hello
tier: frontend
Binary file added images/add_jenkins_credentials_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/jenkins_global_credentials_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/kubernetes_service_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/open_jenkins_credentials_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: flask-hello-service-nodeport # name of the service

spec:
type: NodePort # Used for accessing a port externally
ports:
- port: 5000 # Service port
targetPort: 5000 # Pod port, default: same as port
nodePort: 30008 # Node port which can be used externally, default: auto-assign any free port
selector: # Which pods to expose externally ?
app: flask-hello
tier: frontend

0 comments on commit b76765a

Please sign in to comment.