in28minutes / devops-master-class Goto Github PK
View Code? Open in Web Editor NEWDevops Tutorial for Beginners - Learn Docker, Kubernetes, Terraform, Ansible, Jenkins and Azure Devops
Home Page: https://links.in28minutes.com/DevOps-SBT
Devops Tutorial for Beginners - Learn Docker, Kubernetes, Terraform, Ansible, Jenkins and Azure Devops
Home Page: https://links.in28minutes.com/DevOps-SBT
Docker file mentions entry point to use app.jar. But the app folder is missing the file.
ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ]
Error seen while building the app is as below:
PS C:\GitHub\devops-master-class\kubernetes\01-hello-world-rest-api> docker build -t ainebula/hello-world-rest-api:0.0.1-RELEASE .
[+] Building 2.6s (7/7) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 163B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/openjdk:8-jdk-alpine 2.5s
=> [auth] library/openjdk:pull token for registry-1.docker.io 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [1/2] FROM docker.io/library/openjdk:8-jdk-alpine@sha256:94792824df2df33402f201713f932b58cb9de94a0cd524164a0f2283343547b3 0.0s
=> ERROR [2/2] ADD target/*.jar app.jar 0.0s
------
> [2/2] ADD target/*.jar app.jar:
------
Dockerfile:4
--------------------
2 | VOLUME /tmp
3 | EXPOSE 8080
4 | >>> ADD target/*.jar app.jar
5 | ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ]
--------------------
ERROR: failed to solve: lstat /var/lib/docker/tmp/buildkit-mount4165508193/target: no such file or directory
The presentation.pdf file is not opening. Please look into it.
deployment.yaml file is missing
Hi @in28minutes, I'm loving the course, thank you for the content!
I'm on step 149 and having an issue with the creation of the backendAzureRmStorageAccountName
, I've copied the content provided to the letter but each time I run the pipeline I see the below errors in the output:
2024-05-30T14:21:43.6289629Z ##[section]Starting: TerraformCLI
2024-05-30T14:21:43.6295767Z ==============================================================================
2024-05-30T14:21:43.6295928Z Task : Terraform CLI
2024-05-30T14:21:43.6296007Z Description : Execute terraform cli commands
2024-05-30T14:21:43.6296103Z Version : 2.1.2
2024-05-30T14:21:43.6296189Z Author : Charles Zipp
2024-05-30T14:21:43.6296270Z Help :
2024-05-30T14:21:43.6296333Z ==============================================================================
2024-05-30T14:21:48.0830792Z [command]/usr/local/bin/terraform version
2024-05-30T14:21:56.4031321Z Terraform v1.8.4
2024-05-30T14:21:56.4032241Z on linux_amd64
2024-05-30T14:21:56.4215356Z [command]/usr/bin/az login --service-principal -t 6b9ca1ab-2493-4d57-ad52-9ac0e86be0f1 -u *** -p ***
2024-05-30T14:22:17.6850138Z [
2024-05-30T14:22:17.6850640Z {
2024-05-30T14:22:17.6851503Z "cloudName": "AzureCloud",
2024-05-30T14:22:17.6851998Z "homeTenantId": "6b9ca1ab-2493-4d57-ad52-9ac0e86be0f1",
2024-05-30T14:22:17.6852379Z "id": "1694212d-b07d-4db6-9852-7a33c8e2c3fe",
2024-05-30T14:22:17.6852575Z "isDefault": true,
2024-05-30T14:22:17.6852750Z "managedByTenants": [],
2024-05-30T14:22:17.6852912Z "name": "theRealGavlar",
2024-05-30T14:22:17.6853087Z "state": "Enabled",
2024-05-30T14:22:17.6853367Z "tenantId": "6b9ca1ab-2493-4d57-ad52-9ac0e86be0f1",
2024-05-30T14:22:17.6853562Z "user": {
2024-05-30T14:22:17.6853930Z "name": "***",
2024-05-30T14:22:17.6854105Z "type": "servicePrincipal"
2024-05-30T14:22:17.6854268Z }
2024-05-30T14:22:17.6854401Z }
2024-05-30T14:22:17.6854532Z ]
2024-05-30T14:22:18.0140602Z [command]/usr/bin/az account set -s 1694212d-b07d-4db6-9852-7a33c8e2c3fe
2024-05-30T14:22:18.4689004Z [command]/usr/bin/az group create --name therealgavlar-terraform-backend-resource-group --location westeurope
2024-05-30T14:22:19.7626501Z {
2024-05-30T14:22:19.7627191Z "id": "/subscriptions/1694212d-b07d-4db6-9852-7a33c8e2c3fe/resourceGroups/therealgavlar-terraform-backend-resource-group",
2024-05-30T14:22:19.7627685Z "location": "westeurope",
2024-05-30T14:22:19.7627887Z "managedBy": null,
2024-05-30T14:22:19.7628279Z "name": "therealgavlar-terraform-backend-resource-group",
2024-05-30T14:22:19.7628574Z "properties": {
2024-05-30T14:22:19.7628775Z "provisioningState": "Succeeded"
2024-05-30T14:22:19.7628945Z },
2024-05-30T14:22:19.7629079Z "tags": null,
2024-05-30T14:22:19.7629359Z "type": "Microsoft.Resources/resourceGroups"
2024-05-30T14:22:19.7629628Z }
2024-05-30T14:22:19.8521479Z [command]/usr/bin/az storage account show --name trgavlar-storage-account --resource-group therealgavlar-terraform-backend-resource-group
2024-05-30T14:22:23.1054402Z ERROR: (ResourceNotFound) The Resource 'Microsoft.Storage/storageAccounts/trgavlar-storage-account' under resource group 'therealgavlar-terraform-backend-resource-group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
2024-05-30T14:22:23.1055183Z Code: ResourceNotFound
2024-05-30T14:22:23.1056478Z Message: The Resource 'Microsoft.Storage/storageAccounts/trgavlar-storage-account' under resource group 'therealgavlar-terraform-backend-resource-group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
2024-05-30T14:22:23.3113338Z ##[error]Error: ERROR: (ResourceNotFound) The Resource 'Microsoft.Storage/storageAccounts/trgavlar-storage-account' under resource group 'therealgavlar-terraform-backend-resource-group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.Storage/storageAccounts/trgavlar-storage-account' under resource group 'therealgavlar-terraform-backend-resource-group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
2024-05-30T14:22:23.3122848Z az storage account create: storage account not found, creating...
2024-05-30T14:22:23.3135853Z [command]/usr/bin/az storage account create --name trgavlar-storage-account --resource-group therealgavlar-terraform-backend-resource-group --sku Standard_RAGRS --kind StorageV2 --encryption-services blob --access-tier hot --allow-blob-public-access false --https-only true --min-tls-version TLS1_2
2024-05-30T14:22:24.4779455Z ERROR: (SubscriptionNotFound) Subscription 1694212d-b07d-4db6-9852-7a33c8e2c3fe was not found.
2024-05-30T14:22:24.4780340Z Code: SubscriptionNotFound
2024-05-30T14:22:24.4782232Z Message: Subscription 1694212d-b07d-4db6-9852-7a33c8e2c3fe was not found.
2024-05-30T14:22:24.6957708Z ##[error]Error: ERROR: (SubscriptionNotFound) Subscription 1694212d-b07d-4db6-9852-7a33c8e2c3fe was not found.
Code: SubscriptionNotFound
Message: Subscription 1694212d-b07d-4db6-9852-7a33c8e2c3fe was not found.
2024-05-30T14:22:24.7020345Z [command]/usr/bin/az storage container create --auth-mode login --name therealgavlarstorageaccountcontainer --account-name trgavlar-storage-account
2024-05-30T14:23:51.7991590Z ERROR: <urllib3.connection.HTTPSConnection object at 0x7f6c52261090>: Failed to establish a new connection: [Errno -2] Name or service not known
2024-05-30T14:23:52.0178165Z ##[error]Error: ERROR: <urllib3.connection.HTTPSConnection object at 0x7f6c52261090>: Failed to establish a new connection: [Errno -2] Name or service not known
2024-05-30T14:23:52.0192729Z [command]/usr/local/bin/terraform init -backend-config=storage_account_name=trgavlar-storage-account -backend-config=container_name=therealgavlarstorageaccountcontainer -backend-config=key=kubernetes-dev.tfstate -backend-config=resource_group_name=therealgavlar-terraform-backend-resource-group -backend-config=subscription_id=1694212d-b07d-4db6-9852-7a33c8e2c3fe -backend-config=tenant_id=6b9ca1ab-2493-4d57-ad52-9ac0e86be0f1 -backend-config=client_id=*** -backend-config=client_secret=***
2024-05-30T14:23:52.2917317Z
2024-05-30T14:23:52.2918723Z �[0m�[1mInitializing the backend...�[0m
2024-05-30T14:23:52.9541814Z �[31m�[31m╷�[0m�[0m
2024-05-30T14:23:52.9543698Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mFailed to get existing workspaces: Error retrieving keys for Storage Account "trgavlar-storage-account": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/trgavlar-storage-account' under resource group 'therealgavlar-terraform-backend-resource-group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"�[0m
2024-05-30T14:23:52.9592722Z �[31m│�[0m �[0m
2024-05-30T14:23:52.9601204Z �[31m│�[0m �[0m�[0m
2024-05-30T14:23:52.9601448Z �[31m╵�[0m�[0m
2024-05-30T14:23:52.9601629Z �[0m�[0m
2024-05-30T14:23:52.9609241Z ##[error]Terraform command 'init' failed with exit code '1'.
2024-05-30T14:23:52.9627948Z ##[error]�[31m�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mFailed to get existing workspaces: Error retrieving keys for Storage Account "trgavlar-storage-account": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/trgavlar-storage-account' under resource group 'therealgavlar-terraform-backend-resource-group' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0m
�[31m╵�[0m�[0m
�[0m�[0m
2024-05-30T14:23:52.9672574Z ##[section]Finishing: TerraformCLI
I'm not entirely sure what's going wrong as the resource group is created, it's only when the storage account attempts to be created the pipeline fails.
I'm using a free tier Azure account so I'm wondering if that could be the issue?
Please see my pipeline below for reference:
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: echo k8s terraform azure
displayName: 'Run a one-line script'
- task: DownloadSecureFile@1
name: publicKey
inputs:
secureFile: 'azure_rsa.pub'
- task: TerraformCLI@2
inputs:
command: 'init'
workingDirectory: '$(System.DefaultWorkingDirectory)/configuration/iaac/azure/kubernetes'
backendType: 'azurerm'
backendServiceArm: 'therealgavlar-azure-resource-manager'
ensureBackend: true
backendAzureRmResourceGroupName: 'therealgavlar-terraform-backend-resource-group'
backendAzureRmResourceGroupLocation: 'westeurope'
backendAzureRmStorageAccountName: 'trgavlar-storage-account'
backendAzureRmContainerName: 'therealgavlarstorageaccountcontainer'
backendAzureRmKey: 'kubernetes-dev.tfstate'
allowTelemetryCollection: false
- task: TerraformCLI@2
inputs:
command: 'apply'
workingDirectory: '$(System.DefaultWorkingDirectory)/configuration/iaac/azure/kubernetes'
environmentServiceName: 'therealgavlar-azure-resource-manager'
commandOptions: '-var client_id=$(client_id) -var client_secret=$(client_secret) -var ssh_public_key=$(publicKey.secureFilePath)'
allowTelemetryCollection: false
I look forward to your response!
Many thanks,
Gavin
Please provide the commands to start jenkins on windows as server showing Offline
Offline
This Jenkins instance appears to be offline.
Issue as seen on Windows when trying the kubectl diff command
C:\GitHub\devops-master-class\kubernetes\01-hello-world-rest-api>kubectl diff -f deployment1.yaml
error: failed to run "diff": executable file not found in %PATH%
Find solution in comments.
Hi! Can you please help me?
I am getting this error while trying to replicate what you do in the video
Error: Error building AzureRM Client: Authenticating using the Azure CLI is only supported as a User (not a Service Principal).
To authenticate to Azure using a Service Principal, you can use the separate 'Authenticate using a Service Principal'
auth method - instructions for which can be found here: https://www.terraform.io/docs/providers/azurerm/guides/service_principal_client_secret.html
Alternatively you can authenticate using the Azure CLI by using a User Account.
on main.tf line 6, in provider "azurerm":
6: provider "azurerm" {
Releasing state lock. This may take a few moments...
Hope you can help me!
Looking forward to your response!
Best regards!
When I run this java application provided by you with the command- docker run -p 5000:5000 in28min/hello-world-java:0.0.1.RELEASE
And also when i try to run the rest api by - docker run -d -p 5001:8080 in28min/hello-world-rest-api:0.0.1.RELEASE
For the other python and nodejs application they are running fine.
Container do get up and running but when i go to check the localhost port to check the application, I don't anything there.
Do I need some other dependencies to install like apache tomcat or anything else.?
I am using Macbook pro M1 chip.
Please help ..!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.