Zum Inhalt springen
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
Referenzen Technologien Blog Know-how Tools
Über uns Zusammenarbeit Karriere
CS EN DE
Lassen Sie uns sprechen

CI/CD pipeline pro Kubernetes s Jenkins

14. 06. 2017 2 Min. Lesezeit CORE SYSTEMSdevops
CI/CD pipeline pro Kubernetes s Jenkins

Mít Kubernetes cluster je polovina práce. Druhá polovina je dostat do něj kód — spolehlivě, rychle a automaticky. Sdílíme náš CI/CD pipeline s Jenkinsem, který za posledních pár měsíců prošel dramatickou evolucí.

Od Jenkins freestyle k Pipeline-as-Code

Naše staré Jenkins joby byly freestyle projekty — klikací konfigurace v GUI. Nespolehlivé, nereplikovatelné. Jenkins Pipeline to změnil: celý build proces je Groovy skript v Jenkinsfile, verzovaný přímo v repozitáři projektu.

Jenkins na Kubernetes

Jenkins samotný běží v Kubernetes clusteru. Kubernetes plugin pro Jenkins dynamicky spouští build agenty jako pody — každý build dostane čistý, izolovaný agent. Žádné „znečištěné” build prostředí.

Když není co buildovat, běží jen Jenkins master. Nulové náklady na idle agenty. Při peak zátěži cluster automaticky naskáluje.

Náš standardní Jenkinsfile

pipeline {
    agent {
        kubernetes {
            yaml |-
              apiVersion: v1
              kind: Pod
              spec:
                containers:
                - name: maven
                  image: maven:3.5-jdk-8
                - name: docker
                  image: docker:17.06
        }
    }
    stages {
        stage('Build') {
            steps { container('maven') { sh 'mvn clean package' } }
        }
        stage('Docker Build') {
            steps {
                container('docker') {
                    sh "docker build -t registry.core.cz/app:${BUILD_NUMBER} ."
                    sh "docker push registry.core.cz/app:${BUILD_NUMBER}"
                }
            }
        }
        stage('Deploy') {
            steps {
                sh "helm upgrade --install app ./chart --set image.tag=${BUILD_NUMBER}"
            }
        }
    }
}

Deployment strategie

Pro staging: automatický deploy po každém úspěšném buildu. Pro produkci: manuální approval step v Jenkins Pipeline. Helm upgrade --install zajistí rolling update bez downtime.

Rollback je jednoduchý: helm rollback release-name revision-number. Helm uchovává historii revizí.

Co chceme zlepšit

  • Canary deploymenty — zatím jen rolling update
  • Automatické smoke testy po deploy
  • Image vulnerability scanning v pipeline
  • GitOps přístup — deploy triggerovaný změnou v Git

CI/CD je klíč k agilnímu Kubernetes

Kubernetes bez automatizovaného CI/CD je jako závodní auto bez benzínu. Jenkins s Pipeline-as-Code a Kubernetes pluginem nám umožňuje deployovat desítky služeb denně s důvěrou.

ci/cdjenkinskuberneteshelm
Teilen:

CORE SYSTEMS

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.

Brauchen Sie Hilfe bei der Implementierung?

Unsere Experten helfen Ihnen bei Design, Implementierung und Betrieb. Von der Architektur bis zur Produktion.

Kontaktieren Sie uns