Code Monkey home page Code Monkey logo

azure-vm-cni's Introduction

Azure VM CNI

Enabling containers to use Azure Virtual Network capabilities with Azure CNI and Azure Virtual Machines.

๐Ÿ’ก The documentation implies that CNI is required for containers to use Virtual Network capabilities, however, after finishing this project I discovered that CNI was not required to use Service Endpoints from a Virtual Machine. Maybe it is already installed or something, did not investigate.

Azure deploy

Set the .auto.tfvars file:

cp config/template.tfvars .auto.tfvars

Create the infrastructure:

terraform init
terraform apply -auto-approve

Confirm that cloud-init has complete successfully.

Manually select the Service Endpoint Policy as it was having circular dependency issues.

Connect via SSH to the virtual machine.

Run the command to star the app container:

sudo docker run -p 8080:8080 \
    -e 'MSSQL_HOSTNAME=sqls-cni.database.windows.net' \
    -e 'MSSQL_PORT=1433' \
    -e 'MSSQL_USERNAME=dbadmin' \
    -e 'MSSQL_PASSWORD=P4ssw0rd!2023' \
    epomatti/azure-vm-cni-app:arm64

Teste the database connection:

curl <vm-ipaddress>:8080/query

Local development

Set the .env file.

Start the database:

docker run -p 1433:1433 -e ACCEPT_EULA=Y -e [email protected] mcr.microsoft.com/mssql/server:2022-latest

Run the application:

cd app

go run .

azure-vm-cni's People

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.