{"id":15290898,"url":"https://github.com/azure/k8s-create-secret","last_synced_at":"2025-04-04T12:07:25.942Z","repository":{"id":36992281,"uuid":"206292862","full_name":"Azure/k8s-create-secret","owner":"Azure","description":"GitHub Action to create Kubernetes cluster secrets","archived":false,"fork":false,"pushed_at":"2025-04-01T19:10:10.000Z","size":25545,"stargazers_count":38,"open_issues_count":6,"forks_count":32,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-04T02:34:18.230Z","etag":null,"topics":["action","actions","aks","azure","github-action","github-actions","kubernetes","secrets"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Azure.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-04T10:25:10.000Z","updated_at":"2025-04-01T19:10:08.000Z","dependencies_parsed_at":"2024-06-18T13:46:04.027Z","dependency_job_id":"85daa29b-cd2f-408f-87d2-97938ee61975","html_url":"https://github.com/Azure/k8s-create-secret","commit_stats":{"total_commits":73,"total_committers":20,"mean_commits":3.65,"dds":0.6986301369863014,"last_synced_commit":"e045fed81bfa3dc898de72cea7daa51861a7c554"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fk8s-create-secret","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fk8s-create-secret/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fk8s-create-secret/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fk8s-create-secret/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/k8s-create-secret/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247112563,"owners_count":20885605,"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":["action","actions","aks","azure","github-action","github-actions","kubernetes","secrets"],"created_at":"2024-09-30T16:09:59.662Z","updated_at":"2025-04-04T12:07:25.923Z","avatar_url":"https://github.com/Azure.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes create secret\n\nCreate a [generic secret or docker-registry secret](https://kubernetes.io/docs/concepts/configuration/secret/) in Kubernetes cluster, replacing the secret if it already exists.\n\nThe secret will be created in the cluster context which was set earlier in the workflow by using either [`azure/aks-set-context`](https://github.com/Azure/aks-set-context/tree/master) or [`azure/k8s-set-context`](https://github.com/Azure/k8s-set-context/tree/master)\n\nRefer to the action metadata file for details about all the inputs https://github.com/Azure/k8s-create-secret/blob/master/action.yml\n\nFor `docker-registry` type secrets, the fields `.dockercfg` or `.dockerconfigjson` can be supplied in plaintext on the `string-data` JSON object, or base64 encoded on the `data` JSON object as included in the [docker-config-secrets](https://kubernetes.io/docs/concepts/configuration/secret/#docker-config-secrets) section.\n\n## Sample workflow for docker-registry secret (imagepullsecret, stringData)\n\n```yaml\n# File: .github/workflows/workflow.yml\n\non: push\n\njobs:\n   example-job:\n      runs-on: ubuntu-latest\n      steps:\n         - name: Set imagePullSecret\n           uses: azure/k8s-create-secret@v4\n           with:\n              namespace: 'myapp'\n              secret-name: 'contoso-cr'\n              container-registry-url: 'containerregistry.contoso.com'\n              container-registry-username: ${{ secrets.REGISTRY_USERNAME }}\n              container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}\n           id: create-secret\n```\n\n## Sample workflow for generic secret (base64 data)\n\n```yaml\n# File: .github/workflows/workflow.yml\n\non: push\n\njobs:\n   example-job:\n      runs-on: ubuntu-latest\n      steps:\n         - uses: azure/k8s-create-secret@v2\n           with:\n              namespace: 'default'\n              secret-type: 'generic'\n              secret-name: azure-storage\n              data: ${{ secrets.AZURE_STORAGE_ACCOUNT_DATA }}\n```\n\n### Alternative for Container Registry Secrets\n\nGet the username and password of your container registry and create secrets for them. For Azure Container registry refer to **admin [account document](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication#admin-account)** for username and password.\n\nFor creating docker-registery secrets, [kubectl can generate the JSON](https://kubernetes.io/docs/concepts/configuration/secret/#docker-config-secrets)\n\n```\nkubectl create secret docker-registry secret-tiger-docker \\\n  --docker-username=tiger \\\n  --docker-password=pass113 \\\n  --docker-email=tiger@acme.com \\\n  --docker-server=my-registry.example:5000\n```\n\nExample output:\n\n```\n{\n    \"apiVersion\": \"v1\",\n    \"data\": {\n        \".dockerconfigjson\": \"eyJhdXRocyI6eyJteS1yZWdpc3RyeTo1MDAwIjp7InVzZXJuYW1lIjoidGlnZXIiLCJwYXNzd29yZCI6InBhc3MxMTMiLCJlbWFpbCI6InRpZ2VyQGFjbWUuY29tIiwiYXV0aCI6ImRHbG5aWEk2Y0dGemN6RXhNdz09In19fQ==\"\n    },\n    \"kind\": \"Secret\",\n    \"metadata\": {\n        \"creationTimestamp\": \"2021-07-01T07:30:59Z\",\n        \"name\": \"secret-tiger-docker\",\n        \"namespace\": \"default\",\n        \"resourceVersion\": \"566718\",\n        \"uid\": \"e15c1d7b-9071-4100-8681-f3a7a2ce89ca\"\n    },\n    \"type\": \"kubernetes.io/dockerconfigjson\"\n}\n```\n\n# Testing\n\nUnit tests are run with [jest](https://jestjs.io/) with [ts-jest](https://www.npmjs.com/package/ts-jest) and can be found in the `./test` directory\n\nIntegration tests use [Minikube](https://minikube.sigs.k8s.io/docs/) and are executed within workflows in `./github/workflows`\n\n# Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Support\n\nk8s-create-secret is an open source project that is [**not** covered by the Microsoft Azure support policy](https://support.microsoft.com/en-us/help/2941892/support-for-linux-and-open-source-technology-in-azure). [Please search open issues here](https://github.com/Azure/k8s-create-secret/issues), and if your issue isn't already represented please [open a new one](https://github.com/Azure/k8s-create-secret/issues/new/choose). The project maintainers will respond to the best of their abilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fk8s-create-secret","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fk8s-create-secret","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fk8s-create-secret/lists"}