Skip to content

Latest commit

 

History

History
103 lines (81 loc) · 2.73 KB

DEVELOPMENT.md

File metadata and controls

103 lines (81 loc) · 2.73 KB

Local Development Install

Create a cluster

Access to a Kubernetes cluster is needed in order to install the kpack controllers.

An easy way to get a cluster up and running is to use kind.

You'll also need:

When using public registries

kubectl cluster-info # ensure you have access to a cluster
./hack/local.sh --help #this will provide all options for building/deploying kpack

When using private registries

Create a kubernetes secret with the registry creds

kubectl create secret docker-registry regcreds -n kpack --docker-server=gcr.io/<some-project> --docker-username=_json_key --docker-password="$(cat gcp.json)"

Create an overlay to use those registry creds

cat > ./config/overlay.yaml <<EOF
#@ load("@ytt:overlay", "overlay")

#@overlay/match by=overlay.subset({"kind": "ServiceAccount"}),expects=2
---
#@overlay/match missing_ok=True
imagePullSecrets:
  #@overlay/append
  - name: regcreds
#@overlay/match missing_ok=True
secrets:
  #@overlay/append
  - name: regcreds

#@overlay/match by=overlay.subset({"metadata":{"name":"kpack-controller"}, "kind": "Deployment"})
---
spec:
  template:
    spec:
      containers:
        #@overlay/match by="name"
        - name: controller
          #@overlay/match missing_ok=True
          env:
            #@overlay/append
            - name: CREDENTIAL_PROVIDER_SECRET_PATH
              value: /var/kpack/credentials
          #@overlay/match missing_ok=True
          volumeMounts:
            #@overlay/append
            - name: credentials
              mountPath: /var/kpack/credentials
              readOnly: true
      #@overlay/match missing_ok=True
      volumes:
        #@overlay/append
        - name: credentials
          secret:
            secretName: regcreds
EOF

Running Unit Tests

make unit

Running End-to-end Tests

  • To run the e2e tests, kpack must be installed and running on a cluster
  • 🍿 These tests can take anywhere from 20-30 minutes depending on your setup
  IMAGE_REGISTRY=gcr.io/<some-project> \
  IMAGE_REGISTRY_USERNAME=_json_key \
  IMAGE_REGISTRY_PASSWORD=$(cat gcp.json) \
  make e2e
  • The IMAGE_REGISTRY environment variable must point at a registry with local write access - e.g.
export IMAGE_REGISTRY="gcr.io/<some-project>"
  • The KPACK_TEST_NAMESPACE_LABELS environment variable allows you to define additional labels for the test namespace, e.g.
export KPACK_TEST_NAMESPACE_LABELS="istio-injection=disabled,purpose=test"