Annotated import
This feature is deprecated and we are not maintaining it anymore, for auto import/deletion of Kubernetes workload please follow instruction here
Once an administrator for your Snyk account has installed the Snyk controller on your Kubernetes cluster, add workloads for testing. Kubernetes collaborators can mark workloads from the cluster to be automatically added to Snyk
Automatically add, update and remove workloads
Once you’ve configured the integration between Snyk and your cluster, you can annotate your workloads in order to have them automatically added as projects for testing in Snyk.
Annotate any of the following workload types:
Deployments
ReplicaSets
DaemonSets
StatefulSets
Jobs
CronJobs
ReplicationControllers
Pods
The steps follow:
Log in to your account and navigate to the relevant group and organization that you want to manage.
Click on settings
> General.
Copy the Organization ID value.
Add an annotation to the workload with the key
orgs.k8s.snyk.io/v1
, entering the Organization ID as the value in a comma-separated list.
You can also annotate a single workload to be added to multiple organizations.
The Snyk controller automatically picks up on the changes to your workload and ensures that the workload is automatically imported to Snyk as a Snyk project.
Example: Deployment YAML file annotated to be automatically imported into an organization
apiVersion: apps/v1 kind: Deployment metadata: name: my-app-deployment annotations: orgs.k8s.snyk.io/v1: cacb791e-07cc-4b10-b4be-64de19f532f1 spec: template: spec: containers: …
To annotate for multiple organizations use a comma-separated list.
Once imported, the project remains in your Snyk organization even if you remove the annotation. To remove the project from Snyk, you should delete the annotation and delete it from the Snyk UI or with the API.
Last updated
Was this helpful?