Kaushal's Photo
Home Follow on LinkedIn Share on LinkedIn Share on Twitter

Example Blog Post

PKS stands for Pivotal Container Service, a Kubernetes-based platform developed by VMware in partnership with Pivotal (now part of VMware) and Google Cloud. It's designed to simplify the deployment, management, and scaling of containerized applications using Kubernetes, with enterprise-grade features.

Key Features of PKS:

Key Features of PKS:

  1. Kubernetes Management
    PKS offers a simplified way to deploy and manage Kubernetes clusters, making it easier for enterprises to adopt and use Kubernetes in production environments.
  2. Multi-cloud Support
    PKS allows deployment on multiple environments, including private data centers (using vSphere) and public clouds like Google Cloud and AWS.
  3. BOSH Integration
    PKS uses BOSH (a toolchain for release engineering, deployment, and lifecycle management) for cluster management. This ensures reliable scaling, updates, and maintenance of Kubernetes clusters.
  4. Container Networking
    PKS integrates with VMware NSX-T for advanced container networking and security, providing features like:
    • Load balancing
    • Micro-segmentation
    • Dynamic networking policies
  5. High Availability
    PKS ensures high availability and resilience by leveraging Kubernetes-native features and VMware's infrastructure.
  6. Automated Scaling and Upgrades
    PKS simplifies the process of scaling Kubernetes clusters and rolling out updates without manual intervention.
  7. Enterprise-Grade Security
    • NSX-T-based network isolation and micro-segmentation.
    • Role-based access control (RBAC) for securing workloads.
  8. Integration with CI/CD
    PKS integrates seamlessly with CI/CD pipelines, enabling smooth workflows for containerized application deployment.

Benefits:

  • Developer Productivity: Developers can focus on application development without worrying about underlying infrastructure complexities.
  • Operational Efficiency: Centralized management of Kubernetes clusters reduces the operational overhead.
  • Flexibility: Deploy on-premises, in public clouds, or hybrid setups.

PKS has been succeeded by VMware Tanzu Kubernetes Grid as part of VMware's modern application platform strategy, but many of its core ideas and functionalities live on in the Tanzu portfolio.

The architecture of Pivotal Container Service (PKS) is designed to provide a robust and scalable Kubernetes platform that integrates with VMware infrastructure and enables multi-cloud deployments. Below is an overview of the PKS architecture and its core components:

  1. Key Components a. Kubernetes Clusters
    • PKS provisions and manages Kubernetes clusters.
    • Each cluster is isolated and managed independently for better resource utilization and security.

b. BOSH Director

  • BOSH is a critical component for lifecycle management of Kubernetes clusters.
  • Functions:
    • Deploys and monitors Kubernetes clusters.
    • Handles cluster upgrades, scaling, and patching.
    • Ensures cluster health by replacing failed nodes automatically.

. PKS API Server

  • A central interface for interacting with PKS.
  • Functions:
    • Developers and operators use the API to create, manage, and delete Kubernetes clusters.
    • Supports integration with CI/CD pipelines and other tools.

d. NSX-T Data Center

  • Provides advanced networking and security features.
  • Functions:
    • Container Networking: Manages networking for pods, services, and ingress/egress traffic.
    • Load Balancing: Ensures high availability and scalability of Kubernetes workloads.
    • Micro-Segmentation: Implements fine-grained security policies.

e. VMware Infrastructure (vSphere)

  • PKS leverages VMware vSphere as the underlying infrastructure for running Kubernetes clusters.
  • Functions:
    • Virtual machine provisioning.
    • Resource management for compute, storage, and networking.

. Harbor (Optional)

  • An enterprise-grade container registry.
  • Functions:
    • Stores and manages container images.
    • Scans images for vulnerabilities.

g. Monitoring and Logging

  • PKS integrates with tools like Prometheus, Grafana, and VMware vRealize Log Insight for cluster monitoring and centralized logging.

  1. Architecture Diagram (Description)

  2. PKS Control Plane

    • Composed of the PKS API Server and BOSH Director.
    • Manages interactions between users and the underlying infrastructure.
    • Handles cluster creation, scaling, and updates.
  3. Kubernetes Cluster Layer

    • Consists of Kubernetes nodes (control plane nodes and worker nodes) deployed and managed by PKS.
    • Uses overlay networks (NSX-T) for pod-to-pod and service communication.
  4. NSX-T Networking

    • Provides a software-defined networking layer.
    • Functions as an abstraction over the physical network.
  5. Infrastructure Layer

    • Based on vSphere for on-premises deployments or public cloud infrastructure for hybrid scenarios.
    • Manages the compute, storage, and networking resources required by Kubernetes clusters.

  1. Workflow

  2. Cluster Creation:

    • User submits a cluster creation request to the PKS API Server.
    • PKS API interacts with BOSH to provision the cluster.
  3. Networking:

    • NSX-T dynamically configures network and security policies for the new cluster.
    • Kubernetes workloads communicate securely using overlay networks.
  4. Scaling/Updates:

    • BOSH ensures clusters are scaled or updated with minimal downtime.
    • Failed nodes are automatically replaced.
  5. Day-2 Operations:

    • Centralized monitoring and logging tools provide visibility into cluster health and performance.
    • Secure and manage container images with Harbor.
  6. Deployment Models

  • On-premises: Runs on VMware vSphere and NSX-T.
  • Public Cloud: Supports AWS, Google Cloud, or other cloud providers with VMware integrations.
  • Hybrid Cloud: Combines on-premises and public cloud setups for flexibility.

This architecture ensures enterprise-grade reliability, security, and scalability for containerized workloads.

https://raw.githubusercontent.com/kaushal1977/kf-blog-image-archive/refs/heads/main/blog/api/img_1.png

alt text

To demonstrate how a Spring Boot application can be deployed in a Pivotal Container Service (PKS) environment, let’s outline the steps and architecture that integrates the application with PKS's Kubernetes capabilities.


  • Spring Boot Application: A containerized Java application (e.g., REST API, microservice).
  • Docker: To package the Spring Boot application into a container image.
  • PKS Kubernetes Cluster: Hosts the application and manages container orchestration.
  • Harbor (or Container Registry): Stores the Docker image of the application.
  • CI/CD Pipeline: Automates build, test, and deployment (optional).

  1. Deployment Workflow

Step 1: Containerize the Spring Boot Application

  1. Create a Dockerfile for your Spring Boot application:

    FROM openjdk:17-jdk-slim
    ARG JAR_FILE=target/my-spring-app.jar
    COPY ${JAR_FILE} app.jar
    ENTRYPOINT ["java", "-jar", "/app.jar"]
  2. Build the Docker image:

    docker build -t my-spring-app:v1 .
  3. Push the image to a container registry:

    docker tag my-spring-app:v1 harbor.myregistry.com/my-spring-app:v1
    docker push harbor.myregistry.com/my-spring-app:v1

#Step 2: Deploy the Spring Boot Application in PKS

  1. Create a Kubernetes Deployment YAML:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: spring-boot-app
    spec:
      replicas: 2
      selector:
        matchLabels:
          app: spring-boot-app
      template:
        metadata:
          labels:
            app: spring-boot-app
        spec:
          containers:
          - name: spring-boot-app
            image: harbor.myregistry.com/my-spring-app:v1
            ports:
            - containerPort: 8080
  2. Create a Kubernetes Service YAML:

    apiVersion: v1
    kind: Service
    metadata:
      name: spring-boot-service
    spec:
      type: LoadBalancer
      selector:
        app: spring-boot-app
      ports:
      - protocol: TCP
        port: 80
        targetPort: 8080
  3. Deploy to PKS Kubernetes Cluster:

    • Connect to the PKS Kubernetes cluster:

      kubectl config use-context pks-cluster-context
    • Deploy the resources:

      kubectl apply -f deployment.yaml
      kubectl apply -f service.yaml

#Step 3: Access the Application

  1. After deployment, Kubernetes will assign a LoadBalancer IP or domain name for your service. Use kubectl get services to retrieve it:

    kubectl get services spring-boot-service
  2. Access the application:

    http://<LoadBalancer-IP>

  1. Extended PKS Integration Example

#Advanced Networking with NSX-T

  • Use NSX-T policies for advanced networking:
    • Ingress Rules: Limit incoming traffic to specific sources or ports.
    • Micro-segmentation: Secure the application by isolating it from other workloads.

#Monitoring with Prometheus/Grafana

  • Deploy Prometheus and Grafana in the PKS cluster to monitor application metrics.
  • Integrate Spring Boot Actuator endpoints (/actuator/prometheus) with Prometheus.

#Scaling the Application

  • Scale up/down the Spring Boot application using Kubernetes commands:

    kubectl scale deployment spring-boot-app --replicas=5

#CI/CD Pipeline Integration

  • Integrate with Jenkins or GitHub Actions:
    • Automate Docker image builds and pushes.
    • Automate YAML application deployment to the PKS cluster.

  1. Diagram Description The extended architecture includes:
  2. Spring Boot Application packaged as a Docker container.
  3. PKS Kubernetes Cluster hosting the app with a Load Balancer service.
  4. Integration with:
    • Harbor as a container registry.
    • Prometheus/Grafana for monitoring.
    • NSX-T for advanced networking.
  apiVersion: v1
  kind: Service
  metadata:
    name: spring-boot-service
  spec:
    type: LoadBalancer
    selector:
      app: spring-boot-app
    ports:
    - protocol: TCP
      port: 80
      targetPort: 8080

© 2024 Kaushal Kishor. All rights reserved..

© 2025 Kaushal Kishor. All rights reserved.

Follow on LinkedIn