Skip to content

Instantly share code, notes, and snippets.

View iamNoah1's full-sized avatar
🐡

Noah Ispas iamNoah1

🐡
View GitHub Profile
@iamNoah1
iamNoah1 / BookReading.cs
Created July 7, 2022 05:31
Entity Class for BookReading API
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
namespace BookReadingProject
{
public class BookReading : IEquatable<BookReading>
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
@iamNoah1
iamNoah1 / BookReadingController.cs
Last active August 3, 2022 06:46
Controller Class for BookReading API
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using MongoDB.Driver;
@iamNoah1
iamNoah1 / BookReadingDBManager.cs
Created July 1, 2022 09:52
DB Manager for BookReading API
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Security.Authentication;
using System.Threading.Tasks;
namespace BookReadingProject
{
public class BookReadingDBManager
{
@iamNoah1
iamNoah1 / apply-ngic-services.sh
Created April 13, 2022 12:22
Apply Kubernetes Manifests for exposing service1 and service2 using nginx on aks
kubectl apply -f https://raw.githubusercontent.com/iamNoah1/aks-nginx-ingress/main/service1.yaml
kubectl apply -f https://raw.githubusercontent.com/iamNoah1/aks-nginx-ingress/main/service2.yaml
@iamNoah1
iamNoah1 / service1-nginx.yaml
Last active April 13, 2022 13:53
service1-nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: service1
name: service1
spec:
replicas: 1
selector:
@iamNoah1
iamNoah1 / install-nginx-with-helm.sh
Created February 4, 2022 16:30
install-nginx-with-helm.sh
helm upgrade --install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx --create-namespace -f nginx-values.yaml
@iamNoah1
iamNoah1 / nginx-values.yaml
Created February 4, 2022 14:54
nginx-values.yaml
controller:
service:
loadBalancerIP: <public IP>
annotations:
"service.beta.kubernetes.io/azure-load-balancer-resource-group": "k8srg"
@iamNoah1
iamNoah1 / create-network-nginx.sh
Created February 4, 2022 10:39
create-network-nginx.sh
az network vnet create --name k8sVnet --resource-group k8srg --location eastus --address-prefix "10.1.0.0/16"
az network vnet subnet create --name k8sSubnet --resource-group k8srg --vnet-name k8sVnet --address-prefix "10.1.0.0/22"
az network public-ip create --resource-group k8srg -n nginx-public-ip --allocation-method Static --location eastus --sku standard
@iamNoah1
iamNoah1 / apply-tric-services.sh
Created June 17, 2021 08:46
Apply Kubernetes Manifests for exposing service1 and service2 using traefik on aks
kubectl apply -f https://raw.githubusercontent.com/iamNoah1/aks-traefik-ingress/main/service1.yml
kubectl apply -f https://raw.githubusercontent.com/iamNoah1/aks-traefik-ingress/main/service2.yml
@iamNoah1
iamNoah1 / service1.yaml
Created June 10, 2021 14:13
Kubernetes Manifest for exposing service 1 using Traefik on aks
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: service1
name: service1
spec:
replicas: 1
selector: