Skip to content

Instantly share code, notes, and snippets.

View michalpenka's full-sized avatar

Michal Pěnka michalpenka

View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: svc-helloworld
namespace: helloworld
spec:
ports:
- port: 80
selector:
app: app-helloworld
kubectl -n helloworld get deployments
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-helloworld
namespace: helloworld
spec:
replicas: 2
selector:
matchLabels:
app: app-helloworld
kubectl get namespaces
kubectl apply -f namespace.yml
apiVersion: v1
kind: Namespace
metadata:
name: helloworld
@michalpenka
michalpenka / 01-04-azure-pipelines.yml
Last active March 18, 2020 14:07
Azure DevOps build pipeline
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
resources:
- repo: self
@michalpenka
michalpenka / 01-03-dockerfile
Last active March 18, 2020 14:07
Dockerfile for ASP.NET Core application (ARM64v8)
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-arm64v8 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY *.csproj ./
RUN dotnet restore
COPY . ./
@michalpenka
michalpenka / 01-02-git-push-azdo
Last active March 18, 2020 14:06
Clone repository, move existing code to git-managed directory, add .gitignore and finally stage, commit and push the code to remote
cd source/repos
git clone https://YOUR_USER@dev.azure.com/YOUR_ORGANIZATION/HelloWorld/_git/HelloWorld helloworld_git
mv -v helloworld/* helloworld_git/
rm -r helloworld
cd helloworld_git
dotnet new gitignore
@michalpenka
michalpenka / 01-01-create-aspnetcoreapp
Last active March 18, 2020 14:06
Create ASP.NET project from command line
mkdir source\repos
cd source\repos
dotnet new helloworld -o aspnetcoreapp
cd helloworld
dotnet run