This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-HarborProjectsWithRepositoriesAndExportCsv { | |
param ( | |
[string]$HarborURL, # URL de votre instance Harbor (par exemple, https://harbor.mondomaine.com) | |
[string]$Username, # Nom d'utilisateur pour se connecter à Harbor | |
[string]$Password, # Mot de passe pour se connecter à Harbor | |
[string]$OutputFile = "HarborProjects.csv", # Chemin du fichier CSV de sortie | |
[int]$Page = 1, # Numéro de page (par défaut 1) | |
[int]$PageSize = 10, # Taille de la page (par défaut 10 projets par page) | |
[string]$Sort = "name", # Option de tri (par exemple, "name" ou "-name" pour tri inverse) | |
[string]$ProjectName = "" # Filtre par nom de projet (optionnel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-K8sPodImagesByNamespace { | |
param ( | |
[string]$KubeConfigPath = "$HOME/.kube/config", # Chemin vers le fichier kubeconfig | |
[string[]]$ExcludedNamespaces = @("kube-system", "kube-public", "kube-node-lease", "default") # Namespaces à exclure | |
) | |
# Vérifie si kubectl est accessible | |
if (-not (Get-Command kubectl -ErrorAction SilentlyContinue)) { | |
Write-Error "kubectl n'est pas installé ou n'est pas accessible dans le PATH." | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the resource parameters | |
$resourceGroupName = "YourResourceGroupName" | |
$aksClusterName = "YourAKSClusterName" | |
$expectedLocation = "eastus" # Replace with your expected location | |
$expectedNodeCount = 3 # Replace with your expected node count | |
$expectedKubernetesVersion = "1.25.0" # Replace with your expected Kubernetes version | |
# Import the Az module | |
Import-Module Az |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: app | |
namespace: myapp | |
spec: | |
containers: | |
- name: mypod | |
image: mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine | |
resources: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: azurefile | |
namespace: myapp | |
spec: | |
accessModes: | |
- ReadWriteMany | |
storageClassName: azurefile-csi | |
volumeName: azurefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
annotations: | |
pv.kubernetes.io/provisioned-by: file.csi.azure.com | |
name: azurefile | |
spec: | |
capacity: | |
storage: 5Gi | |
accessModes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: resources.azure.com/v1api20200601 | |
kind: ResourceGroup | |
metadata: | |
name: rg-app | |
namespace: myapp | |
spec: | |
location: eastus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_version = "~> 1.0" | |
required_providers { | |
azurerm = { | |
version = "~> 3.35" | |
} | |
} | |
} | |
provider "azurerm" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TERRAFORM_VERSION="0.12.20" | |
curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \ | |
&& curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS \ | |
&& curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import \ | |
&& curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig \ | |
&& gpg --verify terraform_${TERRAFORM_VERSION}_SHA256SUMS.sig terraform_${TERRAFORM_VERSION}_SHA256SUMS \ | |
&& shasum -a 256 -c terraform_${TERRAFORM_VERSION}_SHA256SUMS 2>&1 | grep "${TERRAFORM_VERSION}_linux_amd64.zip:\sOK" \ | |
&& unzip -o terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azuredevops_build_definition" "build-def1" { | |
name = "build-def-CI" | |
project_id = "${azuredevops_project.project.name}" | |
description = "It' definition created by Terraform" | |
repository { | |
name = "${azuredevops_project.project.name}" | |
type = "TfsGit" | |
branch = "master" | |
} |
NewerOlder