kctrl to support offline rendering for given AppCr.
Describe the problem/challenge you have
Currently, kctrl have dev subcommand which can be used to deploy an app without having kapp-ctrl on the target Kubernetes cluster.
That's a very powerful feature. However, as a user of kctrl it's not clear as to what the helm template <imgpkg_bundle> would look like unless it's deployed.
Describe the solution you'd like
Once a user has his/her AppCr.yaml ready, he/she should be able to leverage kctrl to render the app without having a cluster in place.
Expectation: kctrl dev -a <app_name> --template should return rendered resources.
- Imgpkg bundle pushed to the registry, creds can be passed through command line args or any other means.
- This should not expect a kubeconfig file or a kubernetes cluster.
- Should not deploy any app on cluster even if kubeconfig is provided.
Example:
Given AppCr:
apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
...
spec:
deploy:
- kapp:
delete:
rawOptions:
- --apply-ignored=true
rawOptions:
- --diff-changes=true
fetch:
- imgpkgBundle:
image: kind-registry.local:5000/tcxtest/sheikhmo/es-operator:sheikhmo_v1
secretRef:
name: kubelet-pull-secret
serviceAccountName: cluster-admin-sa
syncPeriod: 2m0s
template:
- helmTemplate:
path: es-operator
valuesFrom:
- path: es-operator/values.yaml
- configMapRef:
name: override-es-operator-app-cr-config
- kbld:
paths:
- '-'
- .imgpkg/images.yml
...
Expected to see the rendered output, similar to what I see when deploying an app. Like the following:
| Target cluster 'https://127.0.0.1:56744/' (nodes: kind-control-plane)
| @@ create serviceaccount/es-operator (v1) namespace: default @@
| 0 + apiVersion: v1
| 1 + kind: ServiceAccount
| 2 + metadata:
| 3 + labels:
| 4 + kapp.k14s.io/app: "1664322049183094000"
| 5 + kapp.k14s.io/association: v1.2d46bb26f0d47b1e8a9796066618739b
| 6 + name: es-operator
| 7 + namespace: default
| 8 +
| @@ create clusterrole/es-operator (rbac.authorization.k8s.io/v1) cluster @@
| 0 + apiVersion: rbac.authorization.k8s.io/v1
| 1 + kind: ClusterRole
| 2 + metadata:
| 3 + labels:
| 4 + kapp.k14s.io/app: "1664322049183094000"
| 5 + kapp.k14s.io/association: v1.cf41f0c7ac
That way as a user I would be able to see what resources going to get deployed and what values would look like.
Anything else you would like to add:
I believe under the covers that's what kctrl does. I.e. pull imgpkg bundle from registry and renders the resources on shell terminal before deploying and app. So, seems like it's possible to achieve this.
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
cc @renuy
my 2c --offline => --template
cc @renuy
my 2c
--offline=>--template
thanks updated my post