Preventing duplicate virtual servers in NSX-T when using PKS

As of version 1.1.4, PKS uses version 2.0 of the NCP pod. This pod is responsible for performing managing resources in NSX-T, which includes creating routers, switches, allocating IPs, etc. Unfortunately, in version 2.0 of the NCP pod there is an issue where each time the pod is restarted, it will create duplicate virtual servers in NSX-T. This is especially problematic because PKS uses a small load balancer which can only have 10 virtual servers. Let’s see this in action.

First I’m going to explain the issue, but if you’d like to go directly to the fix, see the section Preventing the duplicate virtual servers below.

Read the rest of this entry »


Using Jenkins with PKS

I’m going to show how to create a Jenkins pipeline to deploy an application to Pivotal Container Service (PKS). You can also check out Route to Cloud’s article on how to use Jenkins X and PKS. In order to keep the length down, I’m going to cut some corners such as installing most things on the Jenkins master and not using any slaves so please don’t consider this production grade.

Read the rest of this entry »


PKS NSX-T Cleanup Utility

There will eventually be a KB for this, but in the meantime I wanted to show how you can clean up PKS created NSX-T resources in NSX-T manager. You may need to do this when a PKS cluster fails to create or delete properly, and doing it manually is tedious and error prone.

Please make sure you have valid backups of the NSX-T manager before proceeding.

Installation

  1. curl -LO https://storage.googleapis.com/pks-releases/pks_cleanup_linux
  2. chmod +x pks_cleanup_linux
  3. sudo mv pks_cleanup_linux /usr/local/bin/pks_cleanup

Read the rest of this entry »


Storage Classes in Pivotal Container Service (PKS)

I’m going to show how to use Kubernetes Storage Classes in Pivotal Container Service (PKS) and discuss some limitations you may run into. You can check out more info on vSphere Storage classes at Dynamic Provisioning and StorageClass API.

Read the rest of this entry »


Creating an Ingress in Pivotal Container Service (PKS)

In this post I’m going to show how to create an Ingress in PKS. I’m going to deliberately keep it as simple as possible so don’t expect anything fancy.

I’ll start by creating a Docker container that runs a web server written in Golang:

main.go

package main

import (
    "fmt"
    "net/http"
)

func homeHandler(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
    fmt.Fprint(w, "home")
}

func usersHandler(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
    fmt.Fprint(w, "users")
}

func main() {
    http.HandleFunc("/home", homeHandler)
    http.HandleFunc("/users", usersHandler)
    http.ListenAndServe(":8181", nil)
}

Read the rest of this entry »


Delete an orphaned PKS cluster

You may run into a situation where your PKS cluster is orphaned or you’re unable to delete it with the pks delete-cluster command. I’m going to show how to manually clean up the PKS cluster in the database.

Read the rest of this entry »