Coder Social home page Coder Social logo

epomatti / az-vm-suse-docker Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 65 KB

SUSE Linux Enterprise Server with Docker Compose running on Azure VM

License: MIT License

HCL 85.23% Shell 14.77%
azure compose docker docker-compose linux sles sles12 sles15 suse terraform

az-vm-suse-docker's Introduction

Azure VM: SLES + Docker + Azure Artifacts

SUSE Linux Enterprise Server deployment with Docker Compose on Azure VMs.

Deployment

Generate the temporary keys to be used:

ssh-keygen -f modules/suse/id_rsa

Create the .auto.tfvars file from the template:

# Choose your distro
cp templates/suse(15|12).auto.tfvars .auto.tfvars

Create the resources:

terraform init
terraform apply -auto-approve

Connect to the virtual machine:

ssh -i modules/suse/id_rsa suseadmin@<<PUBLIC-IP>>

Check cloud-init:

cloud-init status

Azure Artifacts

Azure DevOps setup

Create an Artifact Feed of type Universal Packages in an ADO project.

๐Ÿ’ก For practical implementation of this project, it is possible to select all members. However, implement minimal privilege in production.

You must give Contributor permissions for the pipeline to publish packages. Check the Pipelines permissions sections for more information.

Now create a pipeline on ADO using azure-pipeline.yaml as a template. Add the variables projectName and feedName accordingly.

Run the pipeline and confirm that the artifact has been generated.

VM access to ADO

Add the VM System-Assigned identity to Azure DevOps.

When logged into the VM, login with the VM Managed Identity:

az login --identity --allow-no-subscriptions

The Azure DevOps Extension for the CLI is already installed via userdata.

It is necessary to run additional commands to allow a Managed Identity to connect to Azure DevOps. Follow the documentation to implemented that.

CNI

To enable containers with advanced features, such as service endpoints, you need the CNI.

More information on how to deploy the plugin and the project on GitHub.

Crontab (SUSE 12)

Following tutorial 1 and tutorial 2, install Nginx.

This was tested on SUSE 12 only

Prepare the installation:

sudo zypper addrepo -G -t yum -c 'http://nginx.org/packages/sles/12' nginx
wget http://nginx.org/keys/nginx_signing.key
sudo rpm --import nginx_signing.key

Install Nginx:

sudo zypper install nginx

Commands to control Nginx:

sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl stop nginx
sudo systemctl status nginx

Instead of enabling the service directly, let's configure a crontab.

Create a file named /opt/start-nginx.sh:

echo "Starting NGINX"
sudo systemctl start nginx
echo "Completed starting NGINX"

Add the required permissions:

chmod +x /opt/start-nginx.sh

Edit the crontab:

crontab -e

Set the script path:

@reboot /opt/start-nginx.sh

Crontab logs can be view with the journal:

journalctl --no-hostname --output=short-precise | grep -i cron

Clean-up

terraform destroy -auto-approve

az-vm-suse-docker's People

Contributors

epomatti avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.