Coder Social home page Coder Social logo

aks-workshop's Introduction

AKS Workshop

Welcome to the Azure Kubernetes Service Workshop.

In this workshop, you'll go through tasks to deploy a multicontainer application to Kubernetes on Azure Kubernetes Service (AKS).

Learning Objectives

  • Create an Azure Kubernetes Service cluster
  • Choose the best deployment options for your Pods
  • Expose Pods to internal and external network users
  • Configure the Azure Kubernetes Service ingress
  • Monitor the health of an Azure Kubernetes Service cluster
  • Scale your application in an Azure Kubernetes Service cluster
  • Create a continuous integration pipeline with GitHub Actions

Agenda

Day 1 Day 2 Day 3
Kubernetes Architecture and components Managing AKS Continous Integration with GitHub
Hands-on Lab: Deploying applications to AKS Hands-on Lab: Integration, Monitoring, Scaling Hands-on Lab: DevOps with GitHub Actions

Setup and Prerequisites

Please check the setup instructions and pre-requisites for Hands-on Labs.

Hands-on Labs

aks-workshop's People

Contributors

carlosalexei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aks-workshop's Issues

Cert-manager 0.14 is too old for current releases of AKS

When installing in the Kubernetes cluster I created for this lab, I get:

% kubectl apply --validate=false -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.14/deploy/manifests/00-crds.yaml
resource mapping not found for name: "certificaterequests.cert-manager.io" namespace: "" from "https://raw.githubusercontent.com/jetstack/cert-manager/release-0.14/deploy/manifests/00-crds.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
ensure CRDs are installed first

This is in a Kubernetes 1.22 cluster.

This issue can also be seen at https://docs.microsoft.com/en-us/answers/questions/898689/getting-error-while-installing-cert-manager.html, and the cause given is that cert-manager was using extention APIs that have since been deprecated and removed.

According to https://cert-manager.io/docs/installation/supported-releases/, cert-manager release 0.18 should be used for new installations, supporting Kubernetes version 1.19 through 1.24

As such, the CRDs should be installed using the following command:

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.2/cert-manager.crds.yaml

And installing cert-manager should be

helm install \
  cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --create-namespace \
  --version v1.8.2

The YAML that creates the ClusterIssuer will need updated in accordance with
https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer

The significant change is just to the apiVersion

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: "[email protected]"
    privateKeySecretRef:
      name: letsencrypt
    solvers:
    - http01:
        ingress:
          class: nginx

No other changes appear to be required.

Cheers,
Cameron

Certificate not getting issued.

Hi,

While trying to set up the certificate manager, the certificate is not getting generated and failing with an error message, Failed to wait for order resource "ratings-web-cert-xxxxxxxxxxx" to become ready: order is in "invalid" state. After trying the Describe command on the order till Challenges, the Challenges has got an error message, Accepting challenge authorization failed: acme: authorization error for frontend.xx-xxx-xxx-xxx.nip.io: 400 urn:ietf:params:acme:error:connection: xx-xxx-xxx-xxx: Fetching http://frontend.xx-xxx-xxx-xxx.nip.io/.well-known/acme-challenge/1NDm2l_DY4s0KaC25XVyYvU3rP2_Xm5XtSow95ZF9Uo: Timeout during connect (likely firewall problem).
Note : The firewall has been disabled and still the problem persists.

Thanks,
Shanthi

Could not load file or assembly '/HelloWorld.dll'

Building the container image works okay, but when running:

ckerr@Camerons-Air HelloWorld % docker run -it -p 8080:80 helloworld:latest
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly '/HelloWorld.dll'. The system cannot find the file specified.

File name: '/HelloWorld.dll'
^C

Here's a working version of the Dockerfile. I think the two significant changes are:

  • you should include the matching tag on the runtime container used
  • possibly the location of where you publish application to needs to be the same as when you build
# Define base image that includes dev tools
FROM mcr.microsoft.com/dotnet/sdk:6.0 as DevEnv

# Create a folder
WORKDIR /source

# Copy the project file
COPY *.csproj ./

# Restore dotnet libraries for the project
RUN dotnet restore

# Copy all application files
COPY . ./

# Compile project and create production binaries
RUN dotnet publish -c Release -o /app

# Download another images with aspnet runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0

WORKDIR /app

# Copy from the first image (DevEnv) binaries
COPY --from=DevEnv /app ./

# Define the process to be executed in the container
ENTRYPOINT [ "dotnet", "HelloWorld.dll" ]

Compare with https://docs.microsoft.com/en-nz/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-6.0

ckerr@Camerons-Air HelloWorld % docker version
Client:
 Version:           20.10.16
Server: Docker Desktop 4.9.1 (81317)
  Version:          20.10.16
ckerr@Camerons-Air HelloWorld % git log
commit 6e49b5600e1f2e54e12bb99fddc721f21669d4be (HEAD -> main, origin/main, origin/HEAD)
Author: Carlos A. Marquez <[email protected]>
Date:   Tue May 24 20:38:55 2022 -0700

    Update HelloWorld.csproj

    Update .NET version require by the project

No matches for kind ClusterIssuer

This step Task 6 - Deploy a ClusterIssuer resource is failing. Here is proof that the CRDs were installed earlier.

$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.2/cert-manager.crds.yaml
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io unchanged
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io unchanged
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io unchanged
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io unchanged
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io unchanged
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io unchanged

Despite that:

$ kubectl apply     --namespace ratingsapp     -f cluster-issuer.yaml
error: resource mapping not found for name: "letsencrypt" namespace: "" from "cluster-issuer.yaml": no matches for kind "ClusterIssuer" in version "apiextensions.k8s.io/v1"
ensure CRDs are installed first

Bash on Linux VM (not using cloud shell).

Task 7 / change .yaml upfront

Before successfully being able to perform task 7 it is necessary to change the "image:" parameter in the .yaml file to the own registry, otherwise the deployment fails.

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.