Code Monkey home page Code Monkey logo

amaaks's Introduction

Prototyping DO NOT USE

Requirements

Azure Ubuntu 18.04 VM

Creation of VM Offer

  • Create an Ubuntu VM and log in
  • Download the setup script
wget https://raw.githubusercontent.com/code4clouds/amaaks/main/vmoffer-setup.sh
cat ./vmoffer-setup.sh | base64 -w 0 # to use for script for VM custom extension script (optional)
sudo chmod +x ./vmoffer-setup.sh
 ./vmofffer-setup.sh
  • Create a Harbor repository entry
  • Seed Harbor using the replication feature by using your repository entry
  • Make sure the replica reposity is maked as public in Harbor
  • Generalize
  • Create an image for internal deployments or VM Offer (if targeting the Azure Marketplace) by generalizing the VM
sudo waagent -deprovision+user --force
sudo waagent -force -deprovision+user && export HISTSIZE=0 && sync
logout
  • Deallocate the VM
 az vm deallocate --resource-group amaaks --name amaaks
 az vm generalize --resource-group amaaks --name amaaks
 az image create --resource-group amaaks --name amaaks --source amaaks
  • Create Snapshot
  • Add the image to the image gallery
  • Add the image gallery to the IAM of the resource group.
  • Reference the new image in the mainTemplate.json. The sample below is for a publicly hidden VM Offer Live in the Azure Marketplace.
        {
            "name": "[parameters('virtualMachineName')]",
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2020-06-01",
            "location": "[parameters('location')]",
            "plan": {
                "name": "<planId>",
                "publisher": "<publisherid>",
                "product": "amaaks"
            },
            "dependsOn": [
                "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"
            ],
            "properties": {
                "hardwareProfile": {
                    "vmSize": "[parameters('virtualMachineSize')]"
                },
                "storageProfile": {
                    "imageReference": {
                        "publisher": "<publisherId>",
                        "offer": "amaaks",
                        "sku": "<planId>",
                        "version": "latest"
                    },
                    "osDisk": {
                        "createOption": "fromImage",
                        "managedDisk": {
                            "storageAccountType": "[parameters('osDiskType')]"
                        }
                    }
                },
  • Deploy the teamplate
./template-deploy.sh
  • Or Deploy as a manage app
./ama-deploy/sh <your email>

Plain Ubuntu Image VM

 base64 -w 0 vmoffer-fullscript.sh > vmoffer-fullscript.sh.b64

Add the out put to the template under "vm-script"

Testing

Clicking on the button below, will create the Managed Application definition to a Resource Group in your Azure subscription.

Deploy to Azure

./ama-deploy.sh <your_azure_email>

The output will container the K8s kubeconf copy it to a file (e.g. kubeconfig.b64) then decode it and move it to your home directory.

 cat kubeconfig.b64 | base64 --decode > ~/.kube/config

amaaks's People

Contributors

code4clouds 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.