Skip to content

Latest commit

 

History

History
119 lines (83 loc) · 4.39 KB

deploy-local.md

File metadata and controls

119 lines (83 loc) · 4.39 KB

Deploying CF for K8s Locally

Table of contents generated with markdown-toc

Prerequisites

Required Tools

See the requirements in Deploying CF for K8s.

Machine Requirements

In addition to the Kubernetes version requirement in Deploying CF for K8s, the cluster should:

  • have a minimum of 6 CPU, 6GB memory if using 1 node
    • commonly configured via Docker Desktop > Preferences > Resources
  • have a running metrics-server (this is an important consideration for Kind or kubeadm clusters. You can see one way to install it in the Kind deploy instructions)

Considerations

  1. Using minikube allows local image development via the included docker daemon without having to push to a public image registry, whereas kind uses containerd as its backing driver, which doesn't allow for local image creation.

  2. The docker driver for minikube is significantly faster than the default virtualbox driver as it uses the local Docker for Mac installation.

Steps to Deploy on Kind

  • Use vcap.me as the domain for the installation. This means that you do not have to configure DNS for the domain.
  1. Create a kind cluster:

    kind create cluster --config=./deploy/kind/cluster.yml
    # optional flag: "--image kindest/node:v1.18.2", for example
  2. Follow the instructions in Deploying CF for K8s.

    • Include the remove-resource-requirements.yml and remove-ingressgateway-service.yml overlay files in the set of templates to be deployed. This can be achieved by using the following commands:

      TMP_DIR=<your-tmp-dir-path> ; mkdir -p ${TMP_DIR}
      ytt -f config -f config-optional/remove-resource-requirements.yml -f config-optional/remove-ingressgateway-service.yml -f <cf_install_values_path> > ${TMP_DIR}/cf-for-k8s-rendered.yml
      kapp deploy -a cf -f ${TMP_DIR}/cf-for-k8s-rendered.yml -y
  3. Make sure you've installed a metrics-server.

    • this may be as simple as running something like kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
  4. Once the kapp deploy succeeds, you should be able to run cf api api.vcap.me --skip-ssl-validation, etc

Steps to Deploy on Minikube

  1. Start minikube using the docker driver:

    minikube start --cpus=4 --memory=8g --kubernetes-version=1.16.8 --driver=docker
  2. Obtain minikube IP.

    minikube ip
    • The domain used for the installation will use this IP with the following format <minikube ip>.nip.io.
  3. Use minikube tunnel to expose the LoadBalancer service for the ingress gateway:

    minikube tunnel
    • This should be run in a separate terminal as this will block.
    • The kapp deploy command will not exit successfully until this command is run to allow minikube to create the LoadBalancer service.
  4. Follow the instructions in Deploying CF for K8s.

    • Use <minikube ip>.nip.io as the domain for the installation. This means that you do not have to configure DNS for the domain.

    • Include the remove-resource-requirements.yml overlay file in the set of templates to be deployed. This can be achieved by using the following commands:

      TMP_DIR=<your-tmp-dir-path> ; mkdir -p ${TMP_DIR}
      ytt -f config -f config-optional/remove-resource-requirements.yml -f <cf_install_values_path> > ${TMP_DIR}/cf-for-k8s-rendered.yml
      kapp deploy -a cf -f ${TMP_DIR}/cf-for-k8s-rendered.yml -y
  5. You will be able to target your CF CLI to point to the new CF instance

    cf api --skip-ssl-validation https://api.<minikube ip>.nip.io
  6. To access the kubelet's docker engine, run:

    eval $(minikube docker-env)
    docker ps
    ...