Created
February 25, 2023 15:39
-
-
Save curx/6dcd5b060fa2210164fc4eec42b4dfd2 to your computer and use it in GitHub Desktop.
create a helmChart CRD yaml for neuvector
This file contains hidden or 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
| #!/usr/bin/env bash | |
| ## desc: create k3s/rke2 crd helmChart for neuvector | |
| ## author: Thorsten Schifferdecker https://github.com/curx | |
| ## license: Apache 2.0 | |
| ## vars | |
| le_acme_email="${1:?ERR | no lets encypt email for acme is given, abort.}" | |
| neuvector_admin_password="${2:?ERR | no neuvector admin password is given, abort.}" | |
| neuvector_ingress_hostname="${3:?ERR | no neuvector ingress hostname is given, abort.}" | |
| helmchart_crd_export="${4:-zz-helmchart-neuvector.yaml}" | |
| # template CustomResourceDefinintion helmChart | |
| cat << EOL > ${helmchart_crd_export} | |
| --- | |
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: cattle-neuvector-system | |
| --- | |
| apiVersion: cert-manager.io/v1 | |
| kind: Issuer | |
| metadata: | |
| name: letsencrypt-production | |
| namespace: cattle-neuvector-system | |
| spec: | |
| acme: | |
| email: ${le_acme_email} | |
| preferredChain: "" | |
| privateKeySecretRef: | |
| name: letsencrypt-production | |
| server: https://acme-v02.api.letsencrypt.org/directory | |
| solvers: | |
| - http01: | |
| ingress: | |
| class: nginx | |
| --- | |
| apiVersion: helm.cattle.io/v1 | |
| kind: HelmChart | |
| metadata: | |
| name: neuvector | |
| namespace: cattle-neuvector-system | |
| spec: | |
| chart: https://neuvector.github.io/neuvector-helm/core-2.4.2.tgz | |
| valuesContent: |- | |
| k3s: | |
| enabled: true | |
| controller: | |
| replicas: 1 | |
| secret: | |
| enabled: true | |
| data: | |
| userinitcfg.yaml: | |
| users: | |
| - Fullname: admin | |
| Password: ${neuvector_admin_password} | |
| Role: admin | |
| cve: | |
| scanner: | |
| replicas: 1 | |
| manager: | |
| ingress: | |
| enabled: true | |
| host: ${neuvector_ingress_hostname} | |
| annotations: | |
| cert-manager.io/issuer: letsencrypt-production | |
| nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | |
| tls: true | |
| secretName: neuvector-tls-secret | |
| EOL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment