You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apply receives the configuration for custom resources in the form of environment variables. the above Elasticsearch resource will result in K8S_METADATA_NAME=es-test-cluster, K8S_SPEC_MASTER_REPLICAS=1, etc being available in the environment variables.
applymust only write valid yaml to stdout.
Any yaml written to stdout is captured and saved on the status field of the custom resource. This means on the next iteration it can be accessed in the environment prefixed with K8S_STATUS_ like any other field in the custom resoruce.
This pattern allows very simple scripts to take deterministic single steps towards their ideal state.
delete
delete receives the configuration environment variables in the same way as apply.
deletemust only write either valid yaml or nothing (techincally yaml null) to stdout.
If it writes yaml this will be written to the status field of the custom resource without deleting the resource and delete will be called again.
This is to allow convergant deletes without requiring complex logic in the delete command.
If it writes nothing the object is permanantly deleted from Kubernetes.