Skip to content

Instantly share code, notes, and snippets.

View HoussemDellai's full-sized avatar

Houssem Dellai HoussemDellai

View GitHub Profile
@HoussemDellai
HoussemDellai / get_terraform_provider_versions.txt
Last active August 24, 2023 22:41
Get Terraform providers versions in Powershell
ForEach($provider in [array]@("terraform", "azurerm", "azuread", "http", "time", "helm", "kubernetes", "azapi"))
{
if ($provider -eq "terraform")
{
$endpoint=$("https://api.github.com/repos/hashicorp/terraform/releases/latest")
}
elseif ($provider -eq "azapi")
{
$endpoint=$("https://api.github.com/repos/Azure/terraform-provider-$provider/releases/latest")
}
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
namespace: osba
spec:
selector:
matchLabels:
app: app
var host = Configuration.GetValue<string>("host");
var database = Configuration.GetValue<string>("database");
var port = Configuration.GetValue<string>("port");
var username = Configuration.GetValue<string>("username");
var password = Configuration.GetValue<string>("password");
var connectionString =
$"Server={host},{port};Database={database};User={username};Password={password};";
services.AddDbContext<ProductsContext>(options =>
@HoussemDellai
HoussemDellai / sql-binding.yaml
Created January 5, 2020 11:36
ServiceBinding to bin to an Azure SQL instance
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceBinding
metadata:
name: my-sql-binding
namespace: osba
spec:
instanceRef:
name: my-sql-instance
secretName: my-sql-secret
@HoussemDellai
HoussemDellai / sql-instance.yaml
Created January 5, 2020 10:49
ServiceInstance to create a SQL Azure server and database using Service Catalog
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
name: my-sql-instance
namespace: osba
spec:
clusterServiceClassExternalName: azure-sql-12-0
clusterServicePlanExternalName: basic
parameters:
location: eastus
@HoussemDellai
HoussemDellai / selenium-k8s-deploy-svc.yaml
Created December 30, 2019 19:27
Selenium deployments and service to create a Grid
# src: https://github.com/kubernetes/examples/tree/master/staging/selenium
apiVersion: apps/v1
kind: Deployment
metadata:
name: selenium-hub
labels:
app: selenium-hub
spec:
replicas: 1
selector:
version: "3"
services:
selenium-hub:
image: selenium/hub:3.141.59-yttrium
container_name: selenium-hub
ports:
- "4444:4444"
expose:
- 4444
chrome:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"hostingPlanName": {
"type": "string",
"minLength": 1
},
"skuName": {
"type": "string",
@HoussemDellai
HoussemDellai / web-deployment.yaml
Last active November 14, 2018 19:24
sample mvc-deployment.azure.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: mvc-deployment-helm
namespace: {{ .Values.namespace }}
replicas: {{ .Values.web.image.replicaCount }}
spec:
containers:
- name: mvc
image: {{ .Values.web.image.dockerHubId }}/{{ .Values.web.image.name }}:{{ .Values.web.image.tag }}
@HoussemDellai
HoussemDellai / values.yaml
Created November 14, 2018 19:10
Sample values.yaml
namespace: helm-namespace
buildId: 1
web:
image:
dockerHubId: houssemdocker
name: products-store-mvc
tag: v2.848
replicaCount: 1
port: 80
sql: