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
73 changes: 18 additions & 55 deletions Jenkinsfile-K8s-Deploy
Original file line number Diff line number Diff line change
@@ -1,65 +1,28 @@
pipeline {
agent any
environment {
//once you sign up for Docker hub, use that user_id here
registry = "ananthkannan/mypython-app-may20"
//- update your credentials ID after creating credentials for connecting to Docker Hub
registryCredential = 'dockerhub'
dockerImage = ''
}
stages {
agent any

stage ('checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/akannan1087/myPythonDockerRepo']]])
}
}

stage ('Build docker image') {
steps {
script {
dockerImage = docker.build registry + ":$BUILD_NUMBER"
//dockerImage = docker.build registry + ":$BUILD_NUMBER"
environment {
// Once you sign up for Docker Hub, use that user ID here
registry = "richiyo26/richiyo26myphp"

}
}
}

// Uploading Docker images into Docker Hub
stage('Upload Image') {
steps{
script {
docker.withRegistry( '', registryCredential ) {
dockerImage.push()
}
}
}
}
// Jenkins credentials ID for Docker Hub
registryCredential = '7e654cd6-0f01-499f-9b11-58023ed1c877'

stage('Remove Unused docker image') {
steps{
sh "docker rmi $registry:$BUILD_NUMBER"
}
}

stage ('K8S Deploy') {
dockerImage = ''
}

stages {
stage('checkout') {
steps {
script {
kubernetesDeploy(
configs: 'k8s-deployment.yaml',
kubeconfigId: 'K8S',
enableConfigSubstitution: true
)

}
checkout scmGit(
branches: [[name: '*/master']],
extensions: [],
userRemoteConfigs: [[
url: 'https://github.com/Richiyo07/myPythonDockerRepo'
]]
)
}
}

}
}

always {
// remove built docker image and prune system
print 'Cleaning up the Docker system.'
sh 'docker system prune -f'
}
2 changes: 1 addition & 1 deletion mychart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: 211223789150.dkr.ecr.us-east-1.amazonaws.com/my-docker-repo
repository: 136356824322.dkr.ecr.us-east-2.amazonaws.com/mybuilder/dodo/repo:latest
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
Expand Down
6 changes: 4 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<style type="text/css">
body {
background: black;
color: red;
color: yellow;
}
div.container {
max-width: 500px;
Expand All @@ -19,9 +19,11 @@
</head>
<body>
<div class="container">
<h4>Welcome to Richiyo Dickson Docker Container running inside EKS Cluster - Feb 11th, 2026!!</h4>
<h4>Deploying Containers into EKS cluster using Jenkins Pipeline !!!!!</h4>
<h4>Welcome to Docker Container running inside Docker container.. on June 11th, 2025!!</h4>
<br>
<h4>Learning containers is really fun and awesome!!!!!</h4>
<h4>Learning containers is really fun and awesome i love it !!!!!</h4>
</div>
</body>
</html>
Loading