diff --git a/.gitignore b/.gitignore index 2adba52b..e0a8ff5f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,8 @@ Dockerfile.cross !vendor/**/zz_generated.* +rendered/ + # editor and IDE paraphernalia .idea .vscode @@ -35,4 +37,4 @@ cover.html .design .DS_Store TODO.* -# package-lock.json \ No newline at end of file +# package-lock.json diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 81848a6f..4787322d 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -33,7 +33,11 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.deployment.securityContext | nindent 12 }} + {{- if .Values.image.ko }} + image: "ko://github.com/kro-run/kro/cmd/controller" + {{- else }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: metricsport diff --git a/helm/values.yaml b/helm/values.yaml index d52c92aa..534d5343 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -6,10 +6,12 @@ fullnameOverride: "" image: # The location of the container image repository repository: ghcr.io/kro-run/kro/controller - # Image pull policy (IfNotPresent: pull the image only if it is not present locally) - pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "0.2.0" + # Ignores the repository and tag settings and uses the controllers ko entrypoint. + ko: false + # Image pull policy (IfNotPresent: pull the image only if it is not present locally) + pullPolicy: IfNotPresent # List of secrets for pulling images from a private registry imagePullSecrets: [] diff --git a/website/docs/examples/kind/01-Installation.md b/website/docs/examples/kind/01-Installation.md new file mode 100644 index 00000000..ad8336c3 --- /dev/null +++ b/website/docs/examples/kind/01-Installation.md @@ -0,0 +1,92 @@ +--- +sidebar_position: 10 +--- + +# Local development with [`ko`][ko] and [`KinD`][kind] +[ko]: https://ko.build +[kind]: https://kind.sigs.k8s.io/ + +## Installing Kro + +1. Create a `KinD` cluster. + + ```sh + kind create cluster + ``` + +2. Create the `kro-system` namespace. + + ```sh + kubectl create namespace kro-system + ``` + +3. Set the `KO_DOCKER_REPO` env var. + + ```sh + export KO_DOCKER_REPO=kind.local + ``` + + > _Note_, if not using the default kind cluster name, set KIND_CLUSTER_NAME + + ```sh + export KIND_CLUSTER_NAME=my-other-cluster + ``` +4. Apply the Kro CRDs. + + ```sh + make manifests + kubectl apply -f ./helm/crds + ``` + +5. Render and apply the local helm chart. + + ```sh + helm template kro ./helm \ + --namespace kro-system \ + --set image.pullPolicy=Never \ + --set image.ko=true | ko apply -f - + ``` + +## Hello World + +1. Create a `NoOp` ResourceGraph using the `ResourceGraphDefinition`. + + ```sh + kubectl apply -f - <