An example of how you can create entities in Kubernetes using AWS Lambda. The function will be in Python3, so we will use Kubernetes Python Client More usage examples can be found here. Since AWS Lambda does not support this package, we will pack the "kubernetes" and "boto3" modules in our function. "boto3" is needed …
Continue reading "AWS – Lambda: kubectl"
When trying to execute the Lambda Python function, the following error occurs: { "errorMessage": "main() takes 0 positional arguments but 2 were given", "errorType": "TypeError", "stackTrace": [ " File \"/var/runtime/bootstrap.py\", line 131, in handle_event_request\n response = request_handler(event, lambda_context)\n" ] } Solution: From the message, we see that we use the "main" function as a …
Continue reading "FIX ERROR – AWS Lambda Python: "main() takes 0 positional arguments but 2 were given""
Python3 sample script to get metrics from AWS CloudWatch. In the example, we get the maximum value in the last minute and display only the value, this is necessary if you want to collect metrics for example in Zabbix. Script:
Where, "XXXXXXXXXXX" – AWS Account ID, "us-east-1" – AWS Region
For a parameterized assembly with an image tag selection, you will need the Active Choices plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and select "Active Choices" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized assembly, and …
Continue reading "Jenkins – Active Choice: Harbor – Images tag"
When running Nginx as a reverse proxy to Jenkins on CentOS, a 502 error may occur. Nginx error log will be as follows: 2020/05/07 13:32:33 [crit] 9665#9665: *1 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 1.2.3.4, server: jenkins.artem.services, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "jenkins.artem.services" Solution: Reason SELinux. …
Continue reading "FIX ERROR – CentOS+Nginx+Jenkins: 502 Bad Gateway"
List of labels You can view the list of existing labels in the following path: If this directory does not exist, then there are no labels in the system Adding a label For different file systems, the label is added differently. ext2/ext3/ext4: reiserfs: jfs: xfs: Where, "LABEL" – a unique label, "/dev/sda1" …
Continue reading "Linux – Mount partition by label"
For a parameterized assembly with an image tag selection, you will need the Active Choices plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and select "Active Choices" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized assembly, and …
Continue reading "Jenkins – Active Choice: AWS ECR Images tag (AWS SDK)"
For a parameterized assembly with an image tag selection, you will need the Active Choices plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and select "Active Choices" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized assembly, and …
Continue reading "Jenkins – Active Choice: AWS ECR Images tag (AWS Cli)"
Example using AWS Cli only, without third-party utilities Example using "jq" utility