-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add azure ACI example --------- Co-authored-by: Łukasz Biały <[email protected]>
- Loading branch information
Showing
10 changed files
with
128 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
### Scala an JVM | ||
*.class | ||
*.log | ||
.bsp | ||
.scala-build | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
kubeconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import besom.* | ||
import besom.api.azurenative | ||
|
||
@main def main = Pulumi.run { | ||
val resourceGroup = azurenative.resources.ResourceGroup("resourceGroup") | ||
|
||
val imageName = "mcr.microsoft.com/azuredocs/aci-helloworld" | ||
|
||
val containerGroup = azurenative.containerinstance.ContainerGroup( | ||
name = "containerGroup", | ||
azurenative.containerinstance.ContainerGroupArgs( | ||
resourceGroupName = resourceGroup.name, | ||
osType = azurenative.containerinstance.enums.OperatingSystemTypes.Linux, | ||
containers = List( | ||
azurenative.containerinstance.inputs.ContainerArgs( | ||
name = "hello-world", | ||
image = imageName, | ||
ports = List(azurenative.containerinstance.inputs.ContainerPortArgs(port = 80)), | ||
resources = azurenative.containerinstance.inputs.ResourceRequirementsArgs( | ||
requests = azurenative.containerinstance.inputs.ResourceRequestsArgs( | ||
cpu = 1.0, | ||
memoryInGB = 1.5 | ||
) | ||
) | ||
) | ||
), | ||
ipAddress = azurenative.containerinstance.inputs.IpAddressArgs( | ||
ports = List( | ||
azurenative.containerinstance.inputs.PortArgs( | ||
port = 80, | ||
protocol = azurenative.containerinstance.enums.ContainerGroupNetworkProtocol.TCP | ||
) | ||
), | ||
`type` = azurenative.containerinstance.enums.ContainerGroupIpAddressType.Public | ||
), | ||
restartPolicy = azurenative.containerinstance.enums.ContainerGroupRestartPolicy.Always | ||
) | ||
) | ||
|
||
Stack(containerGroup).exports( | ||
// TODO uncomment when bug https://github.com/VirtusLab/besom/issues/432 will be fixed | ||
containerIPv4Address = containerGroup.ipAddress.ip | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: azure-aci | ||
description: Azure ACI example | ||
runtime: scala |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Azure Container Instances on Linux | ||
|
||
Starting point for building web application hosted in Azure Container Instances. | ||
|
||
## Deploying the App | ||
|
||
To deploy your infrastructure, follow the below steps. | ||
|
||
### Prerequisites | ||
|
||
1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/) | ||
2. [Configure Azure Credentials](https://www.pulumi.com/docs/intro/cloud-providers/azure/setup/) | ||
|
||
## Running the App | ||
|
||
1. Create a new stack: | ||
|
||
``` | ||
$ pulumi stack init dev | ||
``` | ||
|
||
2. Set the Azure region location to use: | ||
|
||
``` | ||
$ pulumi config set azure-native:location westus2 | ||
``` | ||
|
||
3. Stand up the cluster by invoking pulumi | ||
```bash | ||
$ pulumi up | ||
``` | ||
|
||
4. From there, feel free to experiment. Simply making edits and running `pulumi up` will incrementally update your | ||
stack. | ||
|
||
5. Once you've finished experimenting, tear down your stack's resources by destroying and removing it: | ||
|
||
```bash | ||
$ pulumi destroy --yes | ||
$ pulumi stack rm --yes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//> using scala "3.3.1" | ||
//> using options -Werror -Wunused:all -Wvalue-discard -Wnonunit-statement | ||
//> using plugin "org.virtuslab::besom-compiler-plugin:0.4.0-SNAPSHOT" | ||
|
||
//> using dep "org.virtuslab::besom-core:0.4.0-SNAPSHOT" | ||
//> using dep "org.virtuslab::besom-azure-native:2.56.0-core.0.4-SNAPSHOT" | ||
|
||
//> using repository sonatype:snapshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters