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

Add script to generate manifest of pod with specified amount of volumes #1852

Closed

Conversation

AndrewSirenko
Copy link
Contributor

Is this a bug fix or adding new feature?
Tool
What is this PR about? / Why do we need it?
Adds a script to generate manifest of pod with certain # PVs and node-afinity via the go templating package.

This script will be used in a bash script that tests the attachment limit of a specified instance type.

What testing is done?
Generating a manifest with script, and deploying it to active cluster

❯ go run generate_example_manifest.go --node-affinity 'kubernetes.io/os:linux' --volume-count 4
apiVersion: v1
kind: Pod
metadata:
  name: device-limit-tester-4-volumes
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/os
            operator: In
            values:
            - linux
  containers:
  - name: device-limit-tester-4-volumes
    image: centos
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"]
    volumeMounts:
    - name: persistent-storage-0
      mountPath: /data-0
    - name: persistent-storage-1
      mountPath: /data-1
    - name: persistent-storage-2
      mountPath: /data-2
    - name: persistent-storage-3
      mountPath: /data-3
  volumes:
    - name: persistent-storage-0
      persistentVolumeClaim:
        claimName: ebs-claim-0
    - name: persistent-storage-1
      persistentVolumeClaim:
        claimName: ebs-claim-1
    - name: persistent-storage-2
      persistentVolumeClaim:
        claimName: ebs-claim-2
    - name: persistent-storage-3
      persistentVolumeClaim:
        claimName: ebs-claim-3
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim-0
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 4Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim-1
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 4Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim-2
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 4Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim-3
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 4Gi
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer

Add script to generate manifest of pod with certain # PVs

Add to --node-affinity flag to generate_example_manifest.go
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 6, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from andrewsirenko. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

Code Coverage Diff

This PR does not change the code coverage

@torredil
Copy link
Member

torredil commented Dec 7, 2023

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants