To store and switch between Kubernetes configurations, you can use the Kubernetes CLI plugin, to work with it, "kubectl" must be installed in the system Install the plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and in the search indicate "Kubernetes CLI" Install it. Add Kubernetes …
Continue reading "Jenkins – Kubeconfig"
When trying to execute any "kubectl" command on an EKS cluster, the following error occurs: Invalid choice: 'eks', maybe you meant: A possible reason for this is the old version of "kubectl" available in the repository. Solution: Install the latest version of "kubectl" using PIP3 To use "kubectl" installed using PIP, you …
Continue reading "FIX ERROR – CentOS 7 kubectl: Invalid choice: 'eks', maybe you meant"
To add the path to the Jenkins environment globally, without doing this every time in Pipeline, we’ll go to the Jenkins settings Next is the tab "Configure System" Find the "Global properties" block, check the "Environment variables" checkbox. And we add a variable with the name "PATH + EXTRA" and the value …
Continue reading "Jenkins – Add new path to PATH"
In order to save the value of the variable as Secret, the variable must be encoded in base64, for this we use "_helpers.tpl" For example, we need to save the value of the variable "applicationSecret" values.yaml: Add the following to "_helpers.tpl": _helpers.tpl: Now in the "templates" directory, create the file "secret.yaml" secret.yaml:
For example, there is an instance on which Python of the 2nd and 3rd versions is installed, but the default is 2nd, and in order not to change the default version and start the Playbook using Python3, you can use the following command: You can also specify the interpreter in the inventory file: …
Continue reading "Ansible – Launch Playbook with a specific version of Python"
In order to create a file from the template and immediately save it as "Pretty JSON", you can use the "copy" module with the "content" key. For example, save the template "config.j2" as the file "/app/config.json" Playbook:
When working with the Active Choice CheckBox parameter, you can select the default values by adding the ": selected" parameter Pipeline: When assembling with parameters, two environments at once, "Development" and "Production" will be selected by default
When working with the Active Choice CheckBox parameter, the parameter values are written to the variable, separated by commas. To work with them as separate elements, you need to save them in an array. For example, there is the following Active Choice, which displays a list of environments in the form of a CheckBox. Pipeline: …
Continue reading "Jenkins – Active Choice: CheckBox – Working with an Array"
A few examples of how Active Choices parameters in Pipeline as a code Example 1 Single selection from the list provided. A drop-down list of environments, by default, the first item in the list is selected. Pipeline:
In order to find out Jenkins username, you need a plugin user build vars Go to Jenkins settings Section "Manage Plugins" Go to the "Available" tab and specify "user build vars" in the search. Install it. An example of using a plugin from Pipeline: The module also has the following variables: …
Continue reading "Jenkins – Username"