Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Actions to create secret on K8S

I'm trying to create a secret in k8s using github actions like following (I've pre step which install lightweight k8s - k3s)

  - name: example tests
    shell: bash
    env:
      SUPER_SECRET: ${{ secrets.KUBECONFIG }}
   run: |
       kubectl create secret generic mysec --from-literal="$SUPER_SECRET" -n default

But I got error, any idea how to do it using github actions?

I use the settings->secrets and create a KUBECONFIG value and put the file content

in my local env I created a secret successfully with a kubeconfig file like:

 kubectl create secret generic mysec --from-file=./kubeconfig -n default

But in the CI I want to use it from the secret env in github ...

The error is: Error: Error: The process '/usr/local/bin/kubectl' failed with exit code 1

Error: ENAMETOOLONG: name too long, open '/home/runner/work/_temp/*** *** *** *** *** ***

What am I missing here?

I tried also with

kubectl create secret generic mysec --from-literal kubeconfig=$SUPER_SECRET -n default

If there is other way to make it work please let me know.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!