Support Online
Skip to main content

Kubernetes CI/CD Setup

What Will You Learn in This Guide?

In this guide, you will set up a fully automated, event-driven and serverless CI/CD pipeline on Kubernetes.

Technical Summary

Topic: Modern CI/CD architecture based on Kubernetes
Problem: Traditional tools like Jenkins are unfamiliar with Kubernetes
Solution: End-to-end automation with Kubernetes-native open source tools

In this guide:

-**

oaicite:0

**with CI,

-**

oaicite:1

**with CD,
  • Secure image production with Kaniko,
  • An event-driven and serverless working model is established with Knative.

Architectural Flow (With the Clarity That Google Loves)

  1. Code**

    oaicite:2

    ** pushed to the repo

  2. Knative Eventing captures the event

  3. Tekton Pipeline is triggered automatically

  4. Kaniko generates the Docker image

  5. Argo CD does GitOps synchronization

  6. Knative Service is published over HTTPS


Prerequisites

  • A domain name of your own -**

    oaicite:3

    **v1.21+ cluster

  • At least 2 nodes (2 CPU / 4 GB RAM)

  • kubectl, helm, tkn, argocd, kn CLI tools

  • GitHub account and Personal Access Token


Basic Components Used

  • Kaniko: Docker generates image without daemon
  • Tekton Pipelines & Triggers: Executes the CI process
  • Argo CD: GitOps based deploy management
  • Knative Serving: Serverless application publishing
  • Knative Eventing: Captures GitHub events
  • Cert-Manager: Automatic TLS and SSL management

Step 1: Installing Cert-Manager

There is no prod without HTTPS, chief.

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.0/cert-manager.yaml
  • This command provides automatic management of TLS certificates.

Step 2: Tekton Setup (CI Layer)


kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
kubectl apply -f https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml

  • Tekton Dashboard access:

kubectl port-forward svc/tekton-dashboard -n tekton-pipelines 9097:9097
  • This panel is for monitoring pipelines live.

Step 3: Argo CD Installation (CD Layer)


kubectl create namespace argocd
kubectl apply -n argocd \
-f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  • Argo CD keeps the cluster state synchronized with Git.

Step 4: Knative Installation (Serverless + Eventing)


kubectl apply -f https://github.com/knative/operator/releases/download/knative-v1.11.0/operator.yaml
kubectl apply -f https://github.com/knative/operator/releases/download/knative-v1.11.0/serving-core.yaml
kubectl apply -f https://github.com/knative/operator/releases/download/knative-v1.11.0/eventing-core.yaml
  • Thanks to Knative, the pod drops to zero when there is no traffic.

Step 5: DNS and Automatic SSL Settings

  1. Learn Kourier LoadBalancer IP:

kubectl get svc -n knative-serving

In the domain panel, add a wildcard A record in the following format:

  • *.doks-ci-cd.domainyour.com → LOAD_BALANCER_IP

Knative domain mapping:


kubectl patch configmap/config-domain \
-n knative-serving \
--type merge \
--patch '{"data":{"domaininiz.com":""}}'

Step 6: GitHub Eventing Integration

  1. Source listening for GitHub push events:

apiVersion: sources.knative.dev/v1alpha1
kind: GitHubSource
metadata:
name: uygulama-github-source
spec:
eventTypes:
- push
ownerAndRepository: kullanici/proje
sink:
ref:
apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
name: tekton-listener
  • This structure triggers the pipeline when there is a push.

Step 7: Tekton CI/CD Pipeline

  1. Pipeline flow:
  • git clone

  • Image production with Kaniko

  • Argo CD sync



kind: Pipeline
spec:
tasks:
- name: kodu-cek
taskRef:
name: git-clone
- name: imaji-derle
runAfter: [kodu-cek]
taskRef:
name: kaniko
- name: dagitimi-baslat
runAfter: [imaji-derle]
taskRef:
name: argocd-task-sync-and-wait

Testing and Verification

  1. Make a small commit to the repo

  2. Open Tekton Dashboard

  3. See if PipelineRun is green

  4. Open Knative URL

  5. Check for HTTPS lock


Frequently Asked Questions

1. Why is Kaniko better than Docker? No Docker daemon, secure, Kubernetes compatible.

2. Can't Tekton deploy? It can, but Argo CD is more stable for GitOps.

3. Is Knative necessary? It is not necessary, but serverless and event-driven make a difference.

4. Can it be used in a prod environment? Yes. All industry standard.


Result

With this guide:

  • You have installed Kubernetes-native CI/CD

  • You did event-driven DevOps

  • You switched to serverless architecture

GenixNode Can be implemented exactly in the Kubernetes infrastructure.