-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces a `Job` that executes in the `post-install` and `post-upgrade` phases of a Helm deployment. The job executes initialization tasks and exits. Pods that depend on successful execution of the job will wait for it, using new init containers. Since this waiting requires interacting with the Kubernetes API, pods will need `get`, `list`, and `watch` permissions on the `batch/jobs` resource. Creation of a `Role` with those permissions can be enabled. This new functionality is disabled by default for now. The plan is to enable it per default once it's thoroughly tested, and we are confident it's the best way forward. Depends on DependencyTrack/hyades-apiserver#873 Closes #136 Signed-off-by: nscuro <[email protected]>
- Loading branch information
Showing
15 changed files
with
531 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
common: | ||
database: | ||
jdbcUrl: "jdbc:postgresql://postgres.{{ .Release.Namespace }}.svc.cluster.local:5432/dtrack" | ||
username: "dtrack" | ||
password: "dtrack" | ||
kafka: | ||
bootstrapServers: "redpanda.{{ .Release.Namespace }}.svc.cluster.local:9092" | ||
secretKey: | ||
createSecret: true | ||
serviceAccount: | ||
automount: true | ||
|
||
apiServer: | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 512Mi | ||
limits: | ||
cpu: "2" | ||
memory: 512Mi | ||
|
||
initializer: | ||
enabled: true | ||
# chart-testing executes `helm install` with `--wait` flag, | ||
# causing post-install hooks to never run. | ||
# See https://github.com/helm/chart-testing/issues/202. | ||
noHelmHook: true | ||
|
||
mirrorService: | ||
resources: &hyadesResources | ||
requests: | ||
cpu: 100m | ||
memory: 256Mi | ||
limits: | ||
cpu: 500m | ||
memory: 256Mi | ||
|
||
repoMetaAnalyzer: | ||
resources: *hyadesResources | ||
|
||
vulnAnalyzer: | ||
resources: *hyadesResources | ||
|
||
extraObjects: | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: postgres | ||
namespace: "{{ .Release.Namespace }}" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-postgres\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: postgres | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-postgres\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: postgres | ||
spec: | ||
containers: | ||
- name: postgres | ||
image: postgres:16-alpine | ||
env: | ||
- name: POSTGRES_DB | ||
value: dtrack | ||
- name: POSTGRES_USER | ||
value: dtrack | ||
- name: POSTGRES_PASSWORD | ||
value: dtrack | ||
ports: | ||
- name: postgres | ||
containerPort: 5432 | ||
protocol: TCP | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: postgres | ||
namespace: "{{ .Release.Namespace }}" | ||
labels: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-postgres\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: postgres | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-postgres\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: postgres | ||
ports: | ||
- port: 5432 | ||
targetPort: 5432 | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: redpanda | ||
namespace: "{{ .Release.Namespace }}" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-redpanda\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: redpanda | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-redpanda\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: redpanda | ||
spec: | ||
containers: | ||
- name: redpanda | ||
image: docker.redpanda.com/vectorized/redpanda:v24.1.7 | ||
args: | ||
- redpanda | ||
- start | ||
- --smp | ||
- '1' | ||
- --reserve-memory | ||
- 0M | ||
- --memory | ||
- 512M | ||
- --overprovisioned | ||
- --node-id | ||
- '0' | ||
- --kafka-addr | ||
- PLAINTEXT://0.0.0.0:9092 | ||
- --advertise-kafka-addr | ||
- PLAINTEXT://redpanda.{{ .Release.Namespace }}.svc.cluster.local:9092 | ||
ports: | ||
- name: kafka-api | ||
containerPort: 9092 | ||
protocol: TCP | ||
- name: redpanda-admin | ||
containerPort: 9644 | ||
protocol: TCP | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: redpanda | ||
namespace: "{{ .Release.Namespace }}" | ||
labels: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-redpanda\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: redpanda | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app.kubernetes.io/instance: "{{ .Release.Name }}" | ||
app.kubernetes.io/name: "{{ printf \"%s-redpanda\" (include \"hyades.name\" .) }}" | ||
app.kubernetes.io/component: redpanda | ||
ports: | ||
- name: kafka-api | ||
port: 9092 | ||
targetPort: 9092 | ||
- name: redpanda-admin | ||
port: 9644 | ||
targetPort: 9644 | ||
- apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: redpanda-init | ||
namespace: "{{ .Release.Namespace }}" | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: redpanda | ||
image: docker.redpanda.com/vectorized/redpanda:v24.1.7 | ||
command: | ||
- /bin/bash | ||
args: | ||
- -c | ||
- bash <(curl -s https://raw.githubusercontent.com/DependencyTrack/hyades/main/scripts/create-topics.sh) | ||
env: | ||
- name: REDPANDA_BROKERS | ||
value: "redpanda.{{ .Release.Namespace }}.svc.cluster.local:9092" | ||
restartPolicy: OnFailure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.