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

Added PVC and PV pkg #24

Merged
merged 2 commits into from
Mar 4, 2022
Merged

Added PVC and PV pkg #24

merged 2 commits into from
Mar 4, 2022

Conversation

zv0n
Copy link
Contributor

@zv0n zv0n commented Mar 4, 2022

I've added pkgs to work with Persistent Volumes and Persistent Volume Claims.

With the PV example I only guesstimated in the apply-get-delete version because in our cluster we're not allowed to create PVs directly. I hope it works, but if anyone has a cluster where they could try it out I'd be happy if you tested it out and edited the YAML in case it doesn't work :)

@javaducky javaducky self-requested a review March 4, 2022 12:36
@javaducky
Copy link
Contributor

Hello @zv0n! Thank you for your PR! If you would, please be sure to run go fmt ./... on the project to ensure format.

I'll be taking a look at this today.

Also, given this is now your second PR, I'd love to send out some swag for you! If you'd like, please send me an email at paul@k6.io with your T-shirt size and I'll get a care package sent out.

@zv0n
Copy link
Contributor Author

zv0n commented Mar 4, 2022

I've formatted the code, I didn't know go had this command, thanks for letting me know :)

Thank you for the T-shirt offer! I'll be sure to get in touch :)

@javaducky
Copy link
Contributor

With the PV example I only guesstimated in the apply-get-delete version because in our cluster we're not allowed to create PVs directly. I hope it works, but if anyone has a cluster where they could try it out I'd be happy if you tested it out and edited the YAML in case it doesn't work :)

Running k3d locally, I was able to confirm PV creation and deletion. I did have to modify the YAML function as follows:

function getPVYaml(name, size, storageClass) {
    return `apiVersion: v1
kind: PersistentVolume
metadata:
  name: ` + name + `
spec:
  capacity:
    storage: ` + size + `
  accessModes:
  - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: ` + storageClass + `
  hostPath:
    path: "/tmp/k3dvol"`
}

tl;dr ... I added the hostPath section.

Copy link
Contributor

@javaducky javaducky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Confirmed operation with minor tweaks to example YAML definitions for local environment.

@javaducky javaducky merged commit bca1d86 into grafana:main Mar 4, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants