{"id":20840746,"url":"https://github.com/kong/apiops-lab","last_synced_at":"2025-03-12T10:15:19.725Z","repository":{"id":41984631,"uuid":"399250074","full_name":"Kong/apiops-lab","owner":"Kong","description":"Template for the Kong APIOps Learning Lab course","archived":false,"fork":false,"pushed_at":"2024-03-22T13:35:59.000Z","size":140,"stargazers_count":11,"open_issues_count":7,"forks_count":20,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-01-19T00:02:36.243Z","etag":null,"topics":["api","apiops","automation","kong"],"latest_commit_sha":null,"homepage":"https://education.konghq.com/courses/course-v1:kong+KGLL-107+Perpetual/course/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kong.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":null,"security":null,"support":null}},"created_at":"2021-08-23T21:17:07.000Z","updated_at":"2024-08-30T20:46:22.000Z","dependencies_parsed_at":"2023-01-24T23:01:44.588Z","dependency_job_id":null,"html_url":"https://github.com/Kong/apiops-lab","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fapiops-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fapiops-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fapiops-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kong%2Fapiops-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kong","download_url":"https://codeload.github.com/Kong/apiops-lab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196657,"owners_count":20251861,"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":["api","apiops","automation","kong"],"created_at":"2024-11-18T01:17:36.453Z","updated_at":"2025-03-12T10:15:19.689Z","avatar_url":"https://github.com/Kong.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automating the Dev Pipeline to Rapidly Design, Publish, and Consume APIs with Kong\n\n\u003e This project assumes you are running in the [Kong Learning Lab\nenvironment](https://education.konghq.com/courses/course-v1:kong+KGLL-107+Perpetual/course/).\nPlease reach out to your Kong Account Representative if you would like to access\nthe course material.\n\nThis repository provides a template for creating your own end-to-end [APIOps\nworkflow](https://konghq.com/blog/what-is-apiops) leveraging the [Kong API\nGateway](https://konghq.com/kong/), the world's most popular API gateway.\nFollowing this workshop, you will:\n\n- Using [Insomnia's](https://insomnia.rest/) `inso` CLI, convert an OpenAPI\n  specification file into an equivalent Kong Gateway configuration format.\n- Apply the configuration to the Gateway using Kong's declarative configuration\n    tool [`decK`](https://docs.konghq.com/deck/overview/)\n- Update the Developer Portal documentation using a single API call\n\nHere is a diagram containing the full workflow:\n\n![Workflow Overview](assets/images/gitops-demo.png)\n\nThis repository also includes sample Github Action runner scripts (under\n`~/.github`) that can be used to initiate the full APIOps/GitOps workflow\nout-of-the-box when running in Github.\n\n## The APIOps Workflow\n\nAll automation is driven by two interactions within this repository: opening a\nPull Request (PR) or merging a commit to the `master` branch. Let's get started.\n\n### 1. Generating the Configuration\n\nThe first step is to generate a Kong configuration from our OpenAPI\nspecification file using the `inso` CLI. The output of this step is a\ndeclarative configuration that can be applied with `deck`.\n\n![Generate a Kong configuration directly from your OpenAPI\nfile](assets/images/generate_config.png)\n\nTo generate a declarative configuration, run:\n\n```sh\ninso generate config ./openapi/orders.yaml --type declarative -o kong.yaml\n```\n\nFeel free to inspect the `kong.yaml` file to see what the underlying\nconfiguration looks like.\n\n### 2. Validating the Configuration\n\nThe second step is to validate the configuration to ensure that it contains\nvalid syntax, and that it is ready to applied to a Kong Gateway. \n\nTo validate our generated configuration file, run:\n\n```sh\ndeck validate\n```\n\n### 3. Applying the Configuration\n\nWith our configuration generated with `kong.yaml`, we can now apply it to our\nKong instance using `deck`.\n\n![Apply the generated configurating with deck](assets/images/deck_sync.png)\n\nTo apply the configuration with `deck`, run the commands below:\n\n```sh\n# BONUS: backup your current configuration - just to be safe\ndeck dump -o deck-backup.$(date +%s).yaml\n\n# BONUS: review any changes prior to applying them\ndeck diff\n\n# make it happen!\ndeck sync\n```\n\n\u003e If you have RBAC enabled, then you'll want to add a `--headers\n\u003e \"Kong-Admin-Token:yourtoken\"` flag to the commands above in order to\n\u003e authenticate.\n\n\u003e If needed, you can scope your updates to a particular Kong workspace using the\n\u003e `--workspace` flag.\n\nWith the configuration successfully applied, you should see the changes take\nplace immediately. Try sending a request to any available routes for\nverification.\n\n### 4. Updating the documentation\n\nWith the runtime configuration in place, now it's time to update the API\ndocumentation. This ensures that any consumer of our API has readily available,\nup-to-date documentation.\n\nTo update the developer portal documentation for our service, run the following\ncommand:\n\n```sh\ncurl -XPUT localhost:8001/default/files/specs/httpbin.yaml --data contents=@openapi/orders.yaml\n```\n\n\u003e The command above assumes you are updating the \"default\" workspace (noted by\n\u003e the `/default` URL prefix) with Kong running locally (noted by\n\u003e `localhost:8001`). You may need to update the command above to match your\n\u003e environment if you are running in a different environment.\n\nIn this example, we updated a single API in the Kong Developer Portal. While\nthis works for this use case, we could also have used the [`portal`\nCLI](https://docs.konghq.com/enterprise/latest/developer-portal/helpers/cli/) to\nupdate the entire developer documentation at once. If you or your team prefer\nfollowing a \"GitOps\" or \"DocOps\"-based workflow, the [`portal`\nCLI](https://docs.konghq.com/enterprise/latest/developer-portal/helpers/cli/)\nmay provide a better alternative for updating your API documentation.\n\n\u003e [Insomnia](https://insomnia.rest/) also has built-in functionality for\n\u003e publishing APIs to your Kong developer portal using a graphical interface.\n\n## Extras\n\n### Enabling More Plugins\n\nIf you would like to include other plugins for your service, you can do so by\nadding an `x-` extension to the API specification matching the plugin name and\nconfiguration. \n\nFor example, to configure the [rate limiting\nplugin](https://docs.konghq.com/hub/kong-inc/rate-limiting/):\n\n```yaml\nx-kong-plugin-rate-limiting:\n  enabled: true\n  config:\n    minute: 6\n    limit_by: ip\n    policy: local\n```\n\nThe extension must start with `x-kong-plugin-` and then include the plugin name\nin kebab-case format.\n\nYou can find a list of all available plugins in the Kong documentation\n[here](https://docs.konghq.com/hub/).\n\n## Questions?\n\nIssues? Questions? Problems? Concerns? Don't hesitate to [reach\nout](https://konghq.com/contact/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkong%2Fapiops-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkong%2Fapiops-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkong%2Fapiops-lab/lists"}