{"id":23093393,"url":"https://github.com/kartverket/argokit","last_synced_at":"2025-08-16T10:31:56.081Z","repository":{"id":154163419,"uuid":"606074394","full_name":"kartverket/argokit","owner":"kartverket","description":"Reusable Kubernetes manifests and jsonnet templates for Argo CD","archived":false,"fork":false,"pushed_at":"2024-10-28T12:32:27.000Z","size":978,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-28T16:16:05.920Z","etag":null,"topics":["argocd","jsonnet","kubernetes"],"latest_commit_sha":null,"homepage":"https://skip.kartverket.no","language":"Jsonnet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kartverket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T14:41:35.000Z","updated_at":"2024-10-28T12:32:32.000Z","dependencies_parsed_at":"2024-10-28T13:57:05.146Z","dependency_job_id":"bc529ac0-a852-4e85-bc97-0cfceda81bb5","html_url":"https://github.com/kartverket/argokit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartverket%2Fargokit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartverket%2Fargokit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartverket%2Fargokit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartverket%2Fargokit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kartverket","download_url":"https://codeload.github.com/kartverket/argokit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230031113,"owners_count":18162268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argocd","jsonnet","kubernetes"],"created_at":"2024-12-16T21:47:18.822Z","updated_at":"2025-08-16T10:31:56.057Z","avatar_url":"https://github.com/kartverket.png","language":"Jsonnet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArgoKit\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"logo.png\" alt=\"ArgoKit Logo\" width=\"300px\" /\u003e\n\u003c/p\u003e\n\nArgoKit is a set of reusable jsonnet templates that makes it easier to deploy\nArgoCD applications on SKIP. It is a work in progress and will be updated as we\nlearn more about how to best deploy with ArgoCD on SKIP. If you have any\nquestions, please reach out to the #gen-argocd channel in Slack.\n\n## Installation\n\nAssuming you have followed the [Getting Started](https://kartverket.atlassian.net/wiki/spaces/SKIPDOK/pages/554827836/Komme+i+gang+med+Argo+CD)\nguide, you can use ArgoKit in your apps-repo. The first step is to include the\nArgoKit library by running the following command:\n\n```bash\n$ git submodule add https://github.com/kartverket/argokit.git\n```\n\nAlternatively you can use jsonnet-bundler if prefer package managers over\nsubmodules. To do this, install the CLI by following the instructions in the\n[jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) repo and\nrun the following command:\n\n```bash\n$ jb install https://github.com/kartverket/argokit@main\n```\n\n### Automatic version updates\n\nIt is highly recommended to use dependabot to automatically update the ArgoKit\nversion when a new version is released. To do this, add the following to your\n`.github/dependabot.yml` file:\n\n```yaml\nversion: 2\nupdates:\n  - package-ecosystem: git-submodules\n    directory: /\n    schedule:\n      interval: daily\n```\n\nWith this configuration, dependabot will automatically create a PR to update the\nArgoKit version once a day provided that a new version has been released.\n\n## Usage with jsonnet\n\nIf you use jsonnet in your apps-repo, you can use the ArgoKit library to deploy\nArgoCD applications by including the `argokit.libsonnet` file in your jsonnet\nfile and calling the `argokit.Application` function. For example, to deploy an\napplication, you can use the following jsonnet file:\n\n```jsonnet\nlocal argokit = import 'argokit/jsonnet/argokit.libsonnet';\n\nlocal Probe = {\n    path: \"/healthz\",\n    port: 8080,\n    failureThreshold: 3,\n    timeout: 1,\n    initialDelay: 0,\n};\n\nlocal BaseApp = {\n    spec: {\n        port: 8080,\n        replicas: {\n            min: 2,\n            max: 5,\n            targetCPUUtilization: 80,\n        },\n        liveness: Probe,\n        readiness: Probe,\n    },\n};\n\n[\n    BaseApp + argokit.Application(\"foo-backend\") {\n        spec+: {\n            image: \"hello-world\",\n            ingresses: [\"foo.bar.com\"],\n            accessPolicy: {\n                inbound: {\n                    rules: [{\n                        application: \"foo-frontend\",\n                    }],\n                },\n            },\n        },\n    },\n]\n```\n\n### jsonnet argokit API\n\nThe following templates are available for use in the `argokit.libsonnet` file:\n\n| Template                 | Description                                                    | Example                                                                              |\n|--------------------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| `argokit.Application`    | Creates a Skiperator application                               | See above                                                                            |\n| `argokit.GSMSecretStore` | Creates a Google Secret Manager External Secrets `SecretStore` | [examples/jsonnet/secretstore-gsm.jsonnet](examples/jsonnet/secretstore-gsm.jsonnet) |\n| `argokit.GSMSecret`      | Creates a Google Secret Manager External Secrets `Secret`      | [examples/jsonnet/secretstore-gsm.jsonnet](examples/jsonnet/secretstore-gsm.jsonnet) |\n| `argokit.Roles`          | Creates a set of RBAC roles for this namespace                 | [examples/jsonnet/roles.jsonnet](examples/jsonnet/roles.jsonnet)                     |\n\nThe following templates are available for use in the `dbArchive.libsonnet` file:\n\n| Template                 | Description                                                   | Example                                                                  |\n|--------------------------|---------------------------------------------------------------|--------------------------------------------------------------------------|\n| `dbArchive.dbArchiveJob` | Creates a SKIPJob that creates a sql dump and stores it in S3 | [examples/jsonnet/dbArchive.jsonnet](examples/jsonnet/dbArchive.jsonnet) |\n\n### Input parameters \n\n#### dbArchiveJob\n\n| Parameter                            | Type    | Default Value            | Description                                                                                                                       |\n|:-------------------------------------|:--------|:-------------------------|:----------------------------------------------------------------------------------------------------------------------------------|\n| **`instanceName`**                   | String  | -                        | **Required.** A unique name for the job and related resources. This name is used as a base for `SKIPJob` and secrets.             |\n| **`schedule`**                       | String  | -                        | **Required.** A cron string defining when the job should run (e.g., `\"0 2 * * *\"` to run at 02:00 every night).                   |\n| **`databaseIP`**                     | String  | -                        | **Required.** The IP address of the PostgreSQL database to be archived.                                                           |\n| **`gcpS3CredentialsSecret`**         | String  | -                        | **Required.** Name of the secret in GSM containing S3 credentials (`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`).              |\n| **`databaseName`**                   | String  | -                        | **Required.** Name of the database to be archived.                                                                                |\n| **`archiveUser`**                    | String  | `'postgres'`             | The database user the job should use to connect.                                                                                  |\n| **`serviceAccount`**                 | String  | `'dummyaccount@gcp.iam'` | GCP Service Account used by the Kubernetes job to authenticate against Google Cloud (e.g., to fetch secrets from GSM).            |\n| **`cloudsqlInstanceConnectionName`** | String  | -                        | **Required.** The connection name of the Cloud SQL instance (format: `project:region:instance`). Needed for Cloud SQL Auth Proxy. |\n| **`port`**                           | Integer | `5432`                   | The port number of the PostgreSQL database.                                                                                       |\n| **`S3Host`**                         | String  | `'s3-rin.statkart.no'`   | The hostname of the S3 endpoint where the archive should be stored.                                                               |\n| **`S3DestinationPath`**              | String  | -                        | **Required.** Full S3 path where the database archive should be placed (e.g., `s3://my-bucket/archive/database/`).                |\n| **`fullDump`**                       | Bool    | false                    | Flag to include database roles `without passwords` in the dump.                                                                   |\n\n## Contributing\n\nContributions are welcome! Please open an issue or PR if you would like to\nsee something changed or added.\n\n## License\n\nArgoKit is licensed under the MIT License. See [LICENSE](LICENSE) for the full\nlicense text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartverket%2Fargokit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkartverket%2Fargokit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartverket%2Fargokit/lists"}