Pulls the repository.
Deploys change changes to the pods.
Push changes to the repository.
xxxxxxxxxx
pipeline
agent {
label "ilab-control"
}
stages {
stage('git main branch') {
steps {
git branch: 'main', url: 'https://github.com/01010101Basics/k8s-bg-deployment.git'
}
}
stage('Build'){
steps{
sh "./updateimgdeployed.sh \" image: kmgoddard/bgapp:1.${version}\""
}
}
stage('Build k8s BG Application'){
steps{
sh '''
./runkube.sh
'''
}
}
}
}
xxxxxxxxxx
#https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80