All Projects → Azure → k8s-create-secret

Azure / k8s-create-secret

Licence: MIT license
GitHub Action to create Kubernetes cluster secrets

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to k8s-create-secret

public-ip
Queries GitHub actions runner's public IP address
Stars: ✭ 64 (+166.67%)
Mutual labels:  actions, github-actions
scan-action
Anchore container analysis and scan provided as a GitHub Action
Stars: ✭ 140 (+483.33%)
Mutual labels:  actions, github-actions
changed-files
Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
Stars: ✭ 733 (+2954.17%)
Mutual labels:  actions, github-actions
chrome-addon
☁ GitHub action to upload addon to Chrome
Stars: ✭ 53 (+120.83%)
Mutual labels:  actions, github-actions
action-netlify-deploy
🙌 Netlify deployments via GitHub actions
Stars: ✭ 32 (+33.33%)
Mutual labels:  actions, github-actions
python-actions-alpha-archived
Please note that this was for the *alpha* version of GitHub Actions for Python.
Stars: ✭ 15 (-37.5%)
Mutual labels:  actions, github-actions
csharp-docs-generator
An action that generates html documentation for C# programs to use for GitHub pages.
Stars: ✭ 21 (-12.5%)
Mutual labels:  actions, github-actions
actions-deploy-gist
📌 Deploy file to Github Gist
Stars: ✭ 26 (+8.33%)
Mutual labels:  actions, github-actions
clojure-dependency-update-action
A simple GitHub Actions job to create Pull Requests for outdated dependencies in clojure projects
Stars: ✭ 37 (+54.17%)
Mutual labels:  actions, github-actions
dart-package-publisher
Action to Publish Dart / Flutter Package To https://pub.dev When you need to publish a package, just bump the version in pubspec.yaml
Stars: ✭ 45 (+87.5%)
Mutual labels:  actions, github-actions
branch-names
Github action to retrieve branch or tag names with support for all events.
Stars: ✭ 99 (+312.5%)
Mutual labels:  actions, github-actions
Real Time Social Media Mining
DevOps pipeline for Real Time Social/Web Mining
Stars: ✭ 22 (-8.33%)
Mutual labels:  actions, github-actions
action.playbook
Github Action for running Ansible Playbooks.
Stars: ✭ 26 (+8.33%)
Mutual labels:  actions, github-actions
actions
A set of GitHub actions for Infracost. See cloud cost estimates for Terraform in pull requests. 💰📉 Love your cloud bill!
Stars: ✭ 147 (+512.5%)
Mutual labels:  actions, github-actions
actions
Set of actions for implementing CI/CD with werf and GitHub Actions
Stars: ✭ 67 (+179.17%)
Mutual labels:  actions, github-actions
gh-action-get-changed-files
GitHub Action that saves changed files as JSON for use by other actions.
Stars: ✭ 82 (+241.67%)
Mutual labels:  actions, github-actions
ghaction-virustotal
GitHub Action to upload and scan files with VirusTotal
Stars: ✭ 105 (+337.5%)
Mutual labels:  actions, github-actions
netlify-build-github-actions
An example of triggering a Netlify build using Github Actions Scheduled Events
Stars: ✭ 31 (+29.17%)
Mutual labels:  actions, github-actions
deploy-cloudrun
This action deploys your container image to Cloud Run.
Stars: ✭ 238 (+891.67%)
Mutual labels:  actions, github-actions
setup-jdk
(DEPRECATED) Set up your GitHub Actions workflow with a specific version of AdoptOpenJDK
Stars: ✭ 32 (+33.33%)
Mutual labels:  actions, github-actions

Kubernetes create secret

Create a generic secret or docker-registry secret in Kubernetes cluster, replacing the secret if it already exists.

The secret will be created in the cluster context which was set earlier in the workflow by using either azure/aks-set-context or azure/k8s-set-context

Refer to the action metadata file for details about all the inputs https://github.com/Azure/k8s-create-secret/blob/master/action.yml

For 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 section.

Sample workflow for docker-registry secret (imagepullsecret, stringData)

# File: .github/workflows/workflow.yml

on: push

jobs:
   example-job:
      runs-on: ubuntu-latest
      steps:
         - name: Set imagePullSecret
           uses: azure/k8s-create-secret@v4
           with:
              namespace: 'myapp'
              secret-name: 'contoso-cr'
              container-registry-url: 'containerregistry.contoso.com'
              container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
              container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
           id: create-secret

Sample workflow for generic secret (base64 data)

# File: .github/workflows/workflow.yml

on: push

jobs:
   example-job:
      runs-on: ubuntu-latest
      steps:
         - uses: azure/k8s-create-secret@v2
           with:
              namespace: 'default'
              secret-type: 'generic'
              secret-name: azure-storage
              data: ${{ secrets.AZURE_STORAGE_ACCOUNT_DATA }}

Alternative for Container Registry Secrets

Get the username and password of your container registry and create secrets for them. For Azure Container registry refer to admin account document for username and password.

For creating docker-registery secrets, kubectl can generate the JSON

kubectl create secret docker-registry secret-tiger-docker \
  --docker-username=tiger \
  --docker-password=pass113 \
  [email protected] \
  --docker-server=my-registry.example:5000

Example output:

{
    "apiVersion": "v1",
    "data": {
        ".dockerconfigjson": "eyJhdXRocyI6eyJteS1yZWdpc3RyeTo1MDAwIjp7InVzZXJuYW1lIjoidGlnZXIiLCJwYXNzd29yZCI6InBhc3MxMTMiLCJlbWFpbCI6InRpZ2VyQGFjbWUuY29tIiwiYXV0aCI6ImRHbG5aWEk2Y0dGemN6RXhNdz09In19fQ=="
    },
    "kind": "Secret",
    "metadata": {
        "creationTimestamp": "2021-07-01T07:30:59Z",
        "name": "secret-tiger-docker",
        "namespace": "default",
        "resourceVersion": "566718",
        "uid": "e15c1d7b-9071-4100-8681-f3a7a2ce89ca"
    },
    "type": "kubernetes.io/dockerconfigjson"
}

Testing

Unit tests are run with jest with ts-jest and can be found in the ./test directory

Integration tests use Minikube and are executed within workflows in ./github/workflows

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].