Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49781

Please provide a means for securely providing credentials for Kubernetes deployments.

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-cd-plugin
    • None
    • Jenkins 2.109 with kubernetes-cd-plugin

      I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

      This is what I'm imagining:

      kubernetesCredentials: [ 
          clientCertificateCredentialsId: '<credentials-id-for-client-certificate>', 
          clientKeyCredentialsId: '<credentials-id-for-client-key>', 
          serverUrl: '<server-url>', 
          certificateAuthorityData: '<certificate-authority-data>' 
      ]  

      Am I missing something? Is there a way to achieve this now, that I'm missing.

          [JENKINS-49781] Please provide a means for securely providing credentials for Kubernetes deployments.

          Tony Flint created issue -
          Tony Flint made changes -
          Description Original: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          This is what I'm imagining:
          ```
          kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ],

          kubernetesCredentials: [
              clientCertificateCredentialsId: '<credentials-id-for-client-certificate>',
              clientKeyCredentialsId: '<credentials-id-for-client-key>',
              serverUrl: '<server-url>',
              certificateAuthorityData: '<certificate-authority-data>'
          ]
          ```

          Am I missing something? Is there a way to achieve this now, that I'm missing.
          New: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          This is what I'm imagining:


          {{ kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ],}}{{kubernetesCredentials: [ }}
          {{     clientCertificateCredentialsId: '<credentials-id-for-client-certificate>',}}
          {{     clientKeyCredentialsId: '<credentials-id-for-client-key>',}}
          {{     serverUrl: '<server-url>',}}
          {{     certificateAuthorityData: '<certificate-authority-data>'}}
          {{ ]}}

          Am I missing something? Is there a way to achieve this now, that I'm missing.
          Tony Flint made changes -
          Description Original: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          This is what I'm imagining:


          {{ kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ],}}{{kubernetesCredentials: [ }}
          {{     clientCertificateCredentialsId: '<credentials-id-for-client-certificate>',}}
          {{     clientKeyCredentialsId: '<credentials-id-for-client-key>',}}
          {{     serverUrl: '<server-url>',}}
          {{     certificateAuthorityData: '<certificate-authority-data>'}}
          {{ ]}}

          Am I missing something? Is there a way to achieve this now, that I'm missing.
          New: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          This is what I'm imagining:
          {quote}\{\{ kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ],}}\{\{kubernetesCredentials: [ }}
           \{\{     clientCertificateCredentialsId: '<credentials-id-for-client-certificate>',}}
           \{\{     clientKeyCredentialsId: '<credentials-id-for-client-key>',}}
           \{\{     serverUrl: '<server-url>',}}
           \{\{     certificateAuthorityData: '<certificate-authority-data>'}}
           \{\{ ]}}
          {quote}
          Am I missing something? Is there a way to achieve this now, that I'm missing.
          Tony Flint made changes -
          Description Original: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          This is what I'm imagining:
          {quote}\{\{ kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ],}}\{\{kubernetesCredentials: [ }}
           \{\{     clientCertificateCredentialsId: '<credentials-id-for-client-certificate>',}}
           \{\{     clientKeyCredentialsId: '<credentials-id-for-client-key>',}}
           \{\{     serverUrl: '<server-url>',}}
           \{\{     certificateAuthorityData: '<certificate-authority-data>'}}
           \{\{ ]}}
          {quote}
          Am I missing something? Is there a way to achieve this now, that I'm missing.
          New: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          {{This is what I'm imagining:}}

          {{kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ], }}

          {{kubernetesCredentials: [ }}
          {{    clientCertificateCredentialsId: '<credentials-id-for-client-certificate>', }}
          {{    clientKeyCredentialsId: '<credentials-id-for-client-key>', }}
          {{    serverUrl: '<server-url>', }}
          {{    certificateAuthorityData: '<certificate-authority-data>' }}
          {{]  }}

          Am I missing something? Is there a way to achieve this now, that I'm missing.
          Tony Flint made changes -
          Description Original: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          {{This is what I'm imagining:}}

          {{kubernetesDeploy( credentialsType: 'Text', textCredentials: [ serverUrl: '<server-url>', certificateAuthorityData: '<certificate-authority-data>', clientCertificateData: '<client-certificate-data>', clientKeyData: '<client-key-data>', ], }}

          {{kubernetesCredentials: [ }}
          {{    clientCertificateCredentialsId: '<credentials-id-for-client-certificate>', }}
          {{    clientKeyCredentialsId: '<credentials-id-for-client-key>', }}
          {{    serverUrl: '<server-url>', }}
          {{    certificateAuthorityData: '<certificate-authority-data>' }}
          {{]  }}

          Am I missing something? Is there a way to achieve this now, that I'm missing.
          New: I would like a way to provide the kubernetesDeploy method with credentials that are stored in Jenkins' credentials store. Right now, I am using the SSH credentials type, which requires that I manually lay down a kubeconfig file somewhere that contains sensitive information.

          {{This is what I'm imagining:}}

          {{kubernetesCredentials: [ }}
           {{    clientCertificateCredentialsId: '<credentials-id-for-client-certificate>', }}
           {{    clientKeyCredentialsId: '<credentials-id-for-client-key>', }}
           {{    serverUrl: '<server-url>', }}
           {{    certificateAuthorityData: '<certificate-authority-data>' }}
           {{]  }}

          Am I missing something? Is there a way to achieve this now, that I'm missing.
          Azure DevOps made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Menghua Xiao made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

            arieshout Menghua Xiao
            tonyflint Tony Flint
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: