Skip to content

Instantly share code, notes, and snippets.

@ramiyengar
Created January 22, 2021 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramiyengar/cadd02973bdbd6c945c9c1ce6eb7301e to your computer and use it in GitHub Desktop.
Save ramiyengar/cadd02973bdbd6c945c9c1ce6eb7301e to your computer and use it in GitHub Desktop.
This gist describes the steps you need to take to install kubernetes locally on your machine and then deploy CF-for-k8s to the locally installed cluster.
#Clone the cf-for-k8s repo. And cd into it.
git clone https://github.com/cloudfoundry/cf-for-k8s.git
cd cf-for-k8s
#You could deploy to your choice of KiND clusters or minikube. Installation instructions for them are available on the #individual project page. Once installed, start a cluster by using the following command:
#For minikube
minikube start --cpus=6 --memory=8g --kubernetes-version="1.19.2" --driver=docker
minikube addons enable metrics-server
#For KiND
kind create cluster --config=./deploy/kind/cluster.yml
kubectl cluster-info --context kind-kind
#Generate the cf-values.yaml file.
./hack/generate-values.sh -d vcap.me > /home/tempdir/cf-install-values.yml
#Add the following entries to the end of the cf-values file generated:
app_registry:
hostname: https://index.docker.io/v1/
repository_prefix: "<my_username>"
username: "<my_username>"
password: "<my_password>"
remove_resource_requirements: true
enable_automount_service_account_token: true
use_first_party_jwt_tokens: true
#Replace the entries for <my_username>, and <my_password> with your Docker Hub credentials. Alternatively, you could also use #other container registries that you might have access to.
#Generate the final YAML template using ytt
ytt -f config -f /home/tempdir/cf-values.yml > /home/tempdir/cf-for-k8s-rendered.yml
#Deploy to Kubernetes using the kapp command and including the declarative template just generated.
kapp deploy -a cf -f /home/tempdir/cf-for-k8s-rendered.yml -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment