Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: use Job object to control cert-spammer (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
foo0x29a authored Apr 15, 2024
1 parent 8976076 commit 1631d7e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/cert-spammer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.1
version: 0.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
52 changes: 29 additions & 23 deletions charts/cert-spammer/templates/00-cert-spammer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,38 @@
{{- $name := $.Values.env.TOPOS_RUN_ID | required "$.Values.env.TOPOS_RUN_ID is required." -}}
{{- $name := $.Values.env.TOPOS_RUN_NUMBER | required "$.Values.env.TOPOS_RUN_NUMBER is required." -}}

apiVersion: v1
kind: Pod
apiVersion: batch/v1
kind: Job
metadata:
name: cert-spammer
labels:
app: cert-spammer
spec:
completions: {{ $.Values.replicas }}
parallelism: {{ $.Values.replicas }}
completionMode: Indexed
restartPolicy: Never
containers:
- name: topos
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
imagePullPolicy: Always
command: ["topos"]
args: ["regtest", "spam", "--benchmark", "--target-hosts", "{{ $.Values.validator.target }}", "--number", "{{ $.Values.validator.replicas }}"]
env:
- name: RUST_LOG
value: info
- name: TOPOS_NETWORK_SPAMMER_BATCH_INTERVAL
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_BATCH_INTERVAL }}"
- name: TOPOS_NETWORK_SPAMMER_NUMBER_OF_SUBNETS
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_NUMBER_OF_SUBNETS }}"
- name: TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH }}"
- name: TOPOS_NETWORK_SPAMMER_NUMBER_OF_BATCHES
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_NUMBER_OF_BATCHES }}"
- name: TOPOS_RUN_ID
value: "{{ $.Values.env.TOPOS_RUN_ID }}"
- name: TOPOS_RUN_NUMBER
value: "{{ $.Values.env.TOPOS_RUN_NUMBER }}"
template:
spec:
restartPolicy: Never # required for the feature
containers:
- name: topos
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
imagePullPolicy: Always
command: ["topos"]
args: ["regtest", "spam", "--benchmark", "--target-hosts", "{{ $.Values.validator.target }}", "--number", "{{ $.Values.validator.replicas }}"]
env:
- name: RUST_LOG
value: info
- name: TOPOS_NETWORK_SPAMMER_BATCH_INTERVAL
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_BATCH_INTERVAL }}"
- name: TOPOS_NETWORK_SPAMMER_NUMBER_OF_SUBNETS
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_NUMBER_OF_SUBNETS }}"
- name: TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH }}"
- name: TOPOS_NETWORK_SPAMMER_NUMBER_OF_BATCHES
value: "{{ $.Values.env.TOPOS_NETWORK_SPAMMER_NUMBER_OF_BATCHES }}"
- name: TOPOS_RUN_ID
value: "{{ $.Values.env.TOPOS_RUN_ID }}"
- name: TOPOS_RUN_NUMBER
value: "{{ $.Values.env.TOPOS_RUN_NUMBER }}"
2 changes: 2 additions & 0 deletions charts/cert-spammer/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Default values for tce-all-in-one.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicas: 1

image:
repository: nobody
tag: main
Expand Down

0 comments on commit 1631d7e

Please sign in to comment.