shore icon indicating copy to clipboard operation
shore copied to clipboard

Added packages to support render/save/apply kubernetes manifests

Open swapnachagam opened this issue 11 months ago • 2 comments

Overview

Github Issue: {LINK TO ISSUE}

As part of the Hackathon in Autodesk team, I have updated the existing shore render,save and exec functions to be able to generate the k8smanifests. This is a PoC only and still needs to be developed

Summary (required always)

shore render -k k

  • This function will be able to generate the kubernetes manifests based on main.pipeline.jsonnet in a json format which will be again converted to yaml file

**shore save -e d **

  • This function will be generate the kubernetes manifests in a yaml format and save them to folder called generated in the current directory.
  • All the different manifests(iampolicy, iam role) will be saved as separate yaml files, so we can apply them separately if requried

shore exec -e d

  • This function will fetch all the manifests in generated folder and apply them into kubernetes cluster using native k8sclient.
  • I am checking if the format generated is as expected and applying to the cluster
  • If a context is not defined, you will get an error and it will do an apply
  • Also added the capability to delete the manfiests both from the generated folder as well from the kubernetes cluster

shore delete -e d

  • This function will delete all the manifests from generated folder
  • This will also delete the manifests from the kubernetes cluster and returns an error if cluster config is not present

Tested the above scenarios from local using the unit tests which are present using a local kubernetes cluster and some sample files

kind: Namespace
metadata:
  name: example-namespace
  labels:
    environment: development
    team: devops

Test Results

shore render image

Shore save

image

shore exec

image

shore delete image

Notes

Checklist

  • [ ] My pull request title follows the format <username>/<gh-issue-#number>:<short-description>
  • [ ] My code passes existing unit tests
  • [ ] My code follows the code style set for the project
  • [ ] I have added at least one reviewer for this PR

swapnachagam avatar Apr 09 '25 13:04 swapnachagam

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Apr 09 '25 13:04 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

swapnachagam avatar Apr 09 '25 14:04 swapnachagam