Skip to main content

Posts

Create a secret and add it to a Kubernetes pod

Recent posts

Run Octopus Deploy inside of a Docker container

Octopus Deploy is a Continuous Delivery tool (much like Azure DevOps and Jenkins) that allow us to deploy our artifacts and code to infrastructure. This allows us to not only automate our deployments, but to ship quickly to our customers and end-users. Today we're going to learn how to deploy an Octopus Deploy instance to Docker.

Prerequisites;
1. A machine running Docker
2. The ability to use Windows container

Before you begin, please ensure you switch to Windows containers if you are running Docker on your desktop.

The first thing we'll need to do is configure our .env configuration. This holds our variables that will be passed into our Docker Compose file. Simply name it ".env" and put it in the same directory as your Docker Compose file. Below is what mine looks like:

SA_PASSWORD=P@ssw0rd!
OCTOPUS_VERSION=2018.3.13
OCTOPUS_ADMIN_USERNAME=admin
OCTOPUS_ADMIN_PASSWORD=SecreTP@assw0rd

Once that's saved, I'll start configuring my Docker Compose file. We will n…

Creating Kubernetes resources with Terraform

There are a few different ways to set up Kubernetes deployments, pods, services, etc. Some of the key ways are with Kubernetes manifests or helm charts. Today we're going to see how to spin up Kubernetes resources using Terraform.

Prerequisites;
1. AKS (Azure Kubernetes) cluster, but you can use any Kubernetes cluster you like. You'll just need to change the provider and your authentication may be different. In either case, we simply need our .kubeconfig for Terraform to know where to deploy the resource.
2. AZ CLI downloaded and logged in.
3. An Azure account
4. An ACR (Azure Container Registry) or another container image registry.

The first thing you'll need to confirm is what Docker image you want to use for deployment and where that image is located. In my case, I have it in ACR (Azure Container Registry) so it can be accessed by my AKS cluster.


I'm going to use the latest Redis image that I pushed up to ACR. If you are not authenticated to your ACR, simply run az …

Dockerize your .NET Core Webapp and deploy with CI/CD

In this blog post we're going to;

1. Build a .NET Core web app
2. Confirm the web app works
3. Build a Docker image from that web app
4. Build an Azure Container Registry to store our image
4. Deploy our Docker image via CI/CD to Azure WebApps with Azure DevOps

Before building your Docker image, ensure you are using Linux containers if you are working on Windows 10. Open up the Docker application and select "Switch to Linux containers...." Pre-requisites; 1. Visual Studio (Community Edition is fine) 2. Visual Studio Code 3. An Azure subscription 4. An Azure DevOps Project
5. Docker installed on your desktop

Code for this project can be found at: https://github.com/AdminTurnedDevOps/TheLifeOfAnEngineerBlog/tree/master/DockerizeDotNetCoreApp
First let's open up a terminal (I'm using Windows Terminal, but you can use PowerShell) and run dotnet new to see our options. In the options, we're going to want webapp


Create a new directory for your webapp to go in. For e…

Using Azure DevOps and Terraform to deploy infrastructure

Terraform has been gaining more and more traction throughout 2019. With version 0.12, it gained even more traction. With it's bracket-based syntax and large library of providers (providers are what APIs you can hit. Azure, AWS, etc.), it provides a plethora of options for automating your infrastructure.

This example will be a very basic example of using Terraform, but if you would like something more sophisticated (building a certain piece of infrastructure, tfvars, Terraform variables, Terraform state, etc.) please feel free to reach out and ask.

Pre-requisites 1. An Azure DevOps account
2. A repo that's ready to commit your Terraform code and YAML pipeline to. I'm using Azure Repos.
3. The Terraform extension in Azure DevOps. For directions please visit: https://docs.microsoft.com/en-us/azure/devops/marketplace/install-extension?view=azure-devops&tabs=browser
4. An Azure DevOps project that you have access to.
5. A storage account to hold your Terraform state.


provider…

Create a Durable Azure Function with Visual Studio

First, let's talk about the difference between an Azure Function and a Durable Azure Function. The difference here is stateful vs stateless. A stateless platform does not hold your data. A stateful platform does hold your data.

To give a few examples, Docker containers are stateless. Once that container is gone, the data is gone. This is why (besides performance issues) it's frowned upon to put databases in containers (sure, you can mount volumes for the purpose of making it stateful, but that's off topic). However, LXC (Linux Containers) are stateful and hold your data.

Another example is your computers RAM and hard drive. RAM is stateless, meaning once you turn off your computer, everything held in RAM is gone. However your hard drive is stateful, as in once your computer gets turned off, your data stored in your hard drive still exists.

Now that we understand stateful vs stateless, let's talk about Azure Functions. Durable Azure Functions are "stateful". L…