Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade kpt to 1.x.x (3d) #308

Closed
Tracked by #301
zijianjoy opened this issue Sep 13, 2021 · 6 comments
Closed
Tracked by #301

Upgrade kpt to 1.x.x (3d) #308

zijianjoy opened this issue Sep 13, 2021 · 6 comments
Assignees

Comments

@zijianjoy
Copy link
Collaborator

zijianjoy commented Sep 13, 2021

@zijianjoy
Copy link
Collaborator Author

zijianjoy commented Sep 13, 2021

Summary of work after reviewing https://kpt.dev/installation/migration:
It needs to be applied to kubeflow and management folders.

  • Change Kptfile format from v1alpha1 to v1.
  • Change # {"$kpt-set":"foo"} comments to # kpt-set: ${foo} in yaml files.
  • Add configmap for values in env.sh to kpt-setter-config.yaml.
  • Uses apply-setters mutator for high level Kptfile
  • Update kpt-set.sh to apply kpt values
  • Consider removing env.sh
  • Automatic fix tool not working kpt fn eval --image gcr.io/kpt-fn/fix:unstable --include-meta-resources failed with error wrong Node Kind for expected: MappingNode was SequenceNode. Reference: Some commands fail on YAML that only contains a list kptdev/kpt#1218
  • Documentations
  • Makfile uses yq to grab variables for kptfile. Change to use new approach.
  • Kubeflow and management directories.

@zijianjoy zijianjoy self-assigned this Sep 13, 2021
@zijianjoy
Copy link
Collaborator Author

zijianjoy commented Sep 14, 2021

Note:

Download kpt:

curl -L https://github.com/GoogleContainerTools/kpt/releases/download/v1.0.0-beta.4/kpt_linux_amd64 --output kpt
chmod +x kpt

Use new kpt:

export PATH=<path-to-kpt>:$PATH

Apply setter:

kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.1 ./ --fn-config ./kpt-setter-config.yaml

Migrate:

kpt fn eval --image gcr.io/kpt-fn/fix:v0.2 --include-meta-resources --truncate-output=false

Revert a file

 git checkout 3b7c99baed48bcd0c2b2553773e5d55a2d256262 <filename>

A trick to debug when the error message not helpful:

kpt fn eval -i list-setters:v0.1

configure managed-project

kpt fn eval --image gcr.io/kpt-fn/apply-setters:v0.1 ./managed-project -- \
         name="${MGMT_NAME}" \
         gcloud.core.project="${MGMT_PROJECT}" \
         managed-project="${KF_PROJECT}"

@zijianjoy
Copy link
Collaborator Author

Questions:

  1. Do we need to set environment variables in env.sh?

@zijianjoy
Copy link
Collaborator Author

zijianjoy commented Sep 14, 2021

Draft:

  • krmignore
  • apply-setters. -> kpt-set.sh
  • kptconfig/kpt-setter-config.yaml
  • kpt pkg get
  • remove Kptfile
  • yq to overcome yaml file issue with kpt.

@zijianjoy
Copy link
Collaborator Author

Created kptdev/kpt#2506 for kpt pkg get error.

@zijianjoy
Copy link
Collaborator Author

While waiting for TODO in #311 which are outside of the gcp-blueprints scope. Closing this issue. And the tips here are very useful too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant