Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Dockerfile

This file was deleted.

48 changes: 15 additions & 33 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
pipeline {

environment {
registry = "192.168.1.81:5000/justme/myweb"
dockerImage = ""
}

agent any

agent any
stages {

stage('Checkout Source') {
steps {
git 'https://github.com/justmeandopensource/playjenkins.git'
git 'https://github.com/jhasourav141/playjenkins.git'
}
}

stage('Build image') {
steps{
script {
dockerImage = docker.build registry + ":$BUILD_NUMBER"
}
}
}

stage('Push Image') {
steps{
script {
docker.withRegistry( "" ) {
dockerImage.push()
}
}
}
}


stage('Deploy App') {
steps {
script {
kubernetesDeploy(configs: "myweb.yaml", kubeconfigId: "mykubeconfig")
steps {
echo 'deploying the application'
echo "deploying with ${my-kubeconfig}"
bat '${my-kubeconfig}'

}
}
}

}
}


}
}




2 changes: 0 additions & 2 deletions README.md

This file was deleted.

7 changes: 0 additions & 7 deletions index.html

This file was deleted.

38 changes: 0 additions & 38 deletions myweb.yaml

This file was deleted.

77 changes: 77 additions & 0 deletions testpod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
kind: Pod
apiVersion: v1
metadata:
name: testpod
spec:
containers:
- name: c01
image: httpd
ports:
- containerPort: 80
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: testpod
spec:
replicas: 1
selector: # tells the controller which pods to watch/belong to
matchLabels:
name: deployment
template:
metadata:
name: testpod1
labels:
name: deployment
spec:
containers:
- name: c00
image: httpd
ports:
- containerPort: 80
---
kind: Service # Defines to create Service type Object
apiVersion: v1
metadata:
name: testpod
spec:
ports:
- port: 80 # Containers port exposed
targetPort: 80 # Pods port
selector:
name: deployment # Apply this service to any pods which has the specific label
type: NodePort
# Specifies the service type i.e ClusterIP or NodePort
---

kind: ReplicationController
apiVersion: v1
metadata:
name: testpod
spec:
replicas: 2
selector:
myname: deployment
template:
metadata:
name: testpod
labels:
myname: deployment
spec:
containers:
- name: c01
image: httpd
command: ["/bin/bash", "-c", "while true; do echo Hello-Bhupinder; sleep 5 ; done"]
---
kind: Service # Defines to create Service type Object
apiVersion: v1
metadata:
name: testpod
spec:
ports:
- port: 80 # Containers port exposed
targetPort: 80 # Pods port
selector:
name: deployment # Apply this service to any pods which has the specific label
type: LoadBalancer