GithubHelp home page GithubHelp logo

vermacodes / one-click-aks Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 1.0 26.14 MB

One click AKS Deployment & Then Destroy.

HCL 5.03% Shell 15.56% Go 21.74% HTML 0.12% CSS 0.07% TypeScript 57.31% Dockerfile 0.05% JavaScript 0.11%

one-click-aks's Issues

Application Gateway Ingress Controller addon is not supported with Azure CNI Overlay


│ Error: creating Kubernetes Cluster (Subscription: "da846304-0089-48e0-bfa7-65f68a3eb74f"
│ Resource Group Name: "default-vmej-rg"
│ Kubernetes Cluster Name: "default-vmej-aks"): managedclusters.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="AddonInvalid" Message="Application Gateway Ingress Controller addon is not supported with Azure CNI Overlay" Target="networkProfile.networkPluginMode"

│ with azurerm_kubernetes_cluster.this[0],
│ on kubernetes_main.tf line 34, in resource "azurerm_kubernetes_cluster" "this":
│ 34: resource "azurerm_kubernetes_cluster" "this" {


[2023-11-03T22:03:46+0000]: ERROR - Terraform Apply Failed

image

Adding deployment is creating defunct deployments or workspaces.

Right now, we are still using legacy add/delete workspace APIs.

  • UI adds workspace and on success adds deployment.
  • UI deletes workspace and on success deletes deployment.

Plan is to move all this as a single API operation from UI to be handled by server itself. That will give better control over rollbacks.

Enforce Workspace Naming.

Workspace Names are inherited by resources. It then impacts the naming requirements of the resources. For example, you can add a workspace with name My_Loved_Workspace. But, when creating a log analytics workspace in that workspace, LAW will be named My_Loved_Workspace-law.

This will fail because workspace names cant have underscore ( _ )

This is also a potential issue with resources like keyvault where length of the name matters too.

Potential Fix would be to enforce workspace naming restrictions.

Azure Regions - Populate List Automatically.

Right now user can go to settings and update his preferred region. This is the region where they will be deploying stuff primarily. We can pre-populate this field with all the available regions by getting data from this AZ CLI command.

az account list-locations

Websocket broken connection error

Sometimes WebSocket connection is broken, make sure user is displayed the appropriate message and steps to reconnect. (repro steps needed)

make vm size editable

There are many ways to achieve this.

  • Ability to edit the VM Size.
  • Making it part of preference.

Immediate user feedback on Action.

Clicking on 'Plan' (or any other action button) is not giving appropriate user feedback instantly causing confusion. As the buttons are disabled only after server action status changes, User can send multiple operations causing issue.

Ensure that the buttons are disable immediately. (optimistic update) and user is given feedback.

use web sockets for logs. Checkout socket.io

something like this on server side would be needed.

package main

import (
	"fmt"
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/googollee/go-socket.io"
)

func main() {
	// Start a HTTP server using gin
	r := gin.Default()
	r.GET("/ping", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "pong",
		})
	})
	go func() {
		if err := r.Run(":8080"); err != nil {
			fmt.Println(err)
		}
	}()

	// Start a socket.io server
	server, err := socketio.NewServer(nil)
	if err != nil {
		fmt.Println(err)
	}
	server.OnConnect("/", func(s socketio.Conn) error {
		s.SetContext("")
		fmt.Println("connected:", s.ID())
		return nil
	})
	server.OnEvent("/", "notice", func(s socketio.Conn, msg string) {
		fmt.Println("notice:", msg)
		s.Emit("reply", "have "+msg)
	})
	server.OnEvent("/chat", "msg", func(s socketio.Conn, msg string) string {
		s.SetContext(msg)
		return "recv " + msg
	})
	server.OnEvent("/", "bye", func(s socketio.Conn) string {
		last := s.Context().(string)
		s.Emit("bye", last)
		s.Close()
		return last
	})
	server.OnError("/", func(s socketio.Conn, e error) {
		fmt.Println("meet error:", e)
	})
	server.OnDisconnect("/", func(s socketio.Conn, reason string) {
		fmt.Println("closed", reason)
	})

	go func() {
		http.Handle("/socket.io/", server)
		if err := http.ListenAndServe(":8000", nil); err != nil {
			fmt.Println(err)
		}
	}()

	// Wait indefinitely
	select {}
}

Manage Defaults

I've created a TypeScript type called TfvarAddonsType, and I want to use default values for this type at multiple places throughout my code. Here's how I'm going to do it:

  1. Defining Default Values:

    First, I'll define default values for the TfvarAddonsType. I'll create a constant object with these default values:

    const defaultTfvarAddons: TfvarAddonsType = {
      appGateway: false,
      microsoftDefender: false,
      virtualNode: false,
      httpApplicationRouting: false,
    };
  2. Using Default Values:

    I can now use the defaultTfvarAddons object as a starting point wherever I need to create an instance of TfvarAddonsType with default values. For example:

    const someComponentConfig: TfvarAddonsType = { ...defaultTfvarAddons };
    
    // If needed, I can also modify specific properties
    someComponentConfig.appGateway = true;
  3. Reusing Default Values:

    To maintain consistency and make it easy to update defaults in the future, I'll reuse the defaultTfvarAddons object throughout my code whenever I need to initialize an object of type TfvarAddonsType with default values.

Here's the complete example:

const defaultTfvarAddons: TfvarAddonsType = {
  appGateway: false,
  microsoftDefender: false,
  virtualNode: false,
  httpApplicationRouting: false,
};

// Example usage
const someComponentConfig: TfvarAddonsType = { ...defaultTfvarAddons };
// I can modify specific properties as needed
someComponentConfig.appGateway = true;

// Reusing default values in other parts of my code
const anotherComponentConfig: TfvarAddonsType = { ...defaultTfvarAddons };

This approach allows me to maintain and apply default values consistently throughout my code.

Break Terraform State Lock

If you know terraform, you know that it often crashes. And when it does, the lock on state file is often not removed. It's too much work to go to your storage account and break the lock. Add a button on UI to do that which just does that.

May be add another API in storage account service which does exactly that.

Subnets should be part of VirtualNetwork

To be able to provide feature to add multiple virutal network, we need to fix the vnet and subnets relationship. I propose that subnets should be part of a specific vnet. so instead of

    "virtualNetworks": [
        {
            "addressSpace": [
                "10.1.0.0/16"
            ]
        }
    ],
    "subnets": [
        {
            "addressPrefixes": [
                "10.1.1.0/24"
            ],
            "name": "AzureFirewallSubnet"
        },
        {
            "addressPrefixes": [
                "10.1.2.0/24"
            ],
            "name": "JumpServerSubnet"
        },
        {
            "addressPrefixes": [
                "10.1.3.0/24"
            ],
            "name": "KubernetesSubnet"
        },
        {
            "addressPrefixes": [
                "10.1.4.0/24"
            ],
            "name": "AppGatewaySubnet"
        },
        {
            "addressPrefixes": [
                "10.1.5.0/24"
            ],
            "name": "AROMasterSubnet"
        },
        {
            "addressPrefixes": [
                "10.1.6.0/24"
            ],
            "name": "AROWorkerSubnet"
        },
        {
            "addressPrefixes": [
                "10.1.7.0/24"
            ],
            "name": "KubernetesVirtualNodeSubnet"
        }
    ],

it should be

    "virtualNetworks": [
        {
            "addressSpace": [
                "10.1.0.0/16"
            ],
            "subnets": [
                {
                    "addressPrefixes": [
                        "10.1.1.0/24"
                    ],
                    "name": "AzureFirewallSubnet"
                },
                {
                    "addressPrefixes": [
                        "10.1.2.0/24"
                    ],
                    "name": "JumpServerSubnet"
                },
                {
                    "addressPrefixes": [
                        "10.1.3.0/24"
                    ],
                    "name": "KubernetesSubnet"
                },
                {
                    "addressPrefixes": [
                        "10.1.4.0/24"
                    ],
                    "name": "AppGatewaySubnet"
                },
                {
                    "addressPrefixes": [
                        "10.1.5.0/24"
                    ],
                    "name": "AROMasterSubnet"
                },
                {
                    "addressPrefixes": [
                        "10.1.6.0/24"
                    ],
                    "name": "AROWorkerSubnet"
                },
                {
                    "addressPrefixes": [
                        "10.1.7.0/24"
                    ],
                    "name": "KubernetesVirtualNodeSubnet"
                }
            ],
        }
    ]

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.