-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added helm configuration for selfcare/pnpg (#2)
* upgrated gitignore * aded selfcare helm chart deploy * added pipeline * Added documentations * fix pipelines * minor fix * minor fix * minor fix
- Loading branch information
1 parent
3f72f27
commit 94ed538
Showing
9 changed files
with
257 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Azure DevOps pipeline to release a new version and deploy to production. | ||
|
||
# Only manual activations are intended | ||
trigger: none | ||
pr: none | ||
|
||
resources: | ||
- repo: self | ||
|
||
parameters: | ||
- name: environment | ||
displayName: Target Environment | ||
type: string | ||
default: dev | ||
values: | ||
- DEV | ||
- UAT | ||
- PROD | ||
- name: version | ||
displayName: Version of the docker image | ||
type: string | ||
default: v1.0.0 | ||
|
||
variables: | ||
vmImageNameDefault: "ubuntu-latest" | ||
deployNamespace: "$(DEPLOY_NAMESPACE)" | ||
|
||
${{ if eq(parameters['environment'], 'DEV') }}: | ||
environment: "DEV" | ||
dockerRegistryServiceConnection: "$(DEV_CONTAINER_REGISTRY_SERVICE_CONN)" | ||
kubernetesServiceConnection: "$(DEV_KUBERNETES_SERVICE_CONN)" | ||
containerRegistry: "$(DEV_CONTAINER_REGISTRY_NAME)" | ||
selfHostedAgentPool: $(DEV_AGENT_POOL) | ||
${{ if eq(parameters['environment'], 'UAT') }}: | ||
environment: "UAT" | ||
dockerRegistryServiceConnection: "$(UAT_CONTAINER_REGISTRY_SERVICE_CONN)" | ||
kubernetesServiceConnection: "$(UAT_KUBERNETES_SERVICE_CONN)" | ||
containerRegistry: "$(UAT_CONTAINER_REGISTRY_NAME)" | ||
selfHostedAgentPool: $(UAT_AGENT_POOL) | ||
${{ if eq(parameters['environment'], 'PROD') }}: | ||
environment: "PROD" | ||
dockerRegistryServiceConnection: "$(PROD_CONTAINER_REGISTRY_SERVICE_CONN)" | ||
kubernetesServiceConnection: "$(PROD_KUBERNETES_SERVICE_CONN)" | ||
containerRegistry: "$(PROD_CONTAINER_REGISTRY_NAME)" | ||
selfHostedAgentPool: $(PROD_AGENT_POOL) | ||
|
||
pool: | ||
vmImage: "ubuntu-latest" | ||
|
||
stages: | ||
- stage: "Deploy" | ||
displayName: "Deploy_to_${{ parameters.environment }}" | ||
dependsOn: [] #"Publish_artifact_helm" | ||
condition: succeeded() | ||
jobs: | ||
- deployment: "Deploy_to_${{ parameters.environment }}" | ||
displayName: "Deploy_to_${{ parameters.environment }}" | ||
pool: | ||
name: $(selfHostedAgentPool) | ||
environment: "${{ parameters.environment }}" | ||
strategy: | ||
runOnce: | ||
deploy: | ||
steps: | ||
- download: none | ||
- task: Bash@3 | ||
displayName: Get POM version | ||
name: getpomversion | ||
condition: succeeded() | ||
inputs: | ||
targetType: "inline" | ||
script: | | ||
pwd | ||
printenv | ||
ls -la | ||
ls -la $(Pipeline.Workspace) | ||
ls -la $(System.DefaultWorkingDirectory) | ||
failOnStderr: true | ||
- task: HelmDeploy@0 | ||
displayName: Helm upgrade | ||
inputs: | ||
kubernetesServiceEndpoint: ${{ variables.kubernetesServiceConnection }} | ||
namespace: "$(deployNamespace)" | ||
command: upgrade | ||
chartType: filepath | ||
chartPath: $(System.DefaultWorkingDirectory)/helm | ||
chartName: $(K8S_IMAGE_REPOSITORY_NAME) | ||
releaseName: $(K8S_IMAGE_REPOSITORY_NAME) | ||
valueFile: "$(System.DefaultWorkingDirectory)/helm/values-${{ lower(variables.environment) }}.yaml" | ||
install: true | ||
waitForExecution: true | ||
arguments: "--timeout 2m0s" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/charts/** | ||
.DS_Store | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,36 @@ | ||
# devops-webapp-python | ||
# devops-app-status | ||
|
||
## Goal | ||
|
||
A simple http server that allow to test basic endpoint to verify that kubernetes and the namespace are reacheble: | ||
|
||
endpoints exposed: | ||
|
||
* `/` | ||
* `/status` | ||
* `/health` | ||
* `/healthz` | ||
|
||
## How to release (manually) | ||
|
||
go to the helm folder like `helm/selfcare/pnpg` | ||
|
||
### Init helm | ||
|
||
```sh | ||
helm dep update | ||
``` | ||
|
||
### Install helm package | ||
|
||
```sh | ||
helm upgrade -i -n <namespace> -f <values file name> <helm app name> \. | ||
|
||
helm upgrade -i -n idpay -f values-dev.yaml devops-java-springboot-color \. | ||
``` | ||
|
||
## Special thanks | ||
|
||
This project born from the fantastic tutorial created by the Biella python group. | ||
|
||
<https://github.com/PythonBiellaGroup/FastCash> | ||
|
||
## Goal | ||
|
||
Have a simple api that can be use inside the ci/cd of PagoPa and allow test of ours infra. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: microservice-chart | ||
repository: https://pagopa.github.io/aks-microservice-chart-blueprint | ||
version: 2.8.0 | ||
digest: sha256:379d9a7c312874dd1771386d92d8f597cb3fed497bb80dfde102513b582123d4 | ||
generated: "2023-02-20T15:50:38.149796+01:00" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v2 | ||
name: devops-app-status | ||
description: App that allow to expose a simple health checks endpoints | ||
type: application | ||
version: 1.0.0 | ||
appVersion: 1.0.0 | ||
dependencies: | ||
- name: microservice-chart | ||
version: 2.8.0 | ||
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
microservice-chart: | ||
namespace: "pnpg" | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
# | ||
# Deploy | ||
# | ||
deployment: | ||
create: true | ||
# forceRedeploy: true | ||
|
||
image: | ||
repository: ghcr.io/pagopa/devops-app-status | ||
tag: v1.0.0 | ||
pullPolicy: Always | ||
|
||
livenessProbe: | ||
httpGet: | ||
path: /status | ||
port: 8000 | ||
initialDelaySeconds: 60 | ||
failureThreshold: 6 | ||
periodSeconds: 10 | ||
|
||
readinessProbe: | ||
httpGet: | ||
path: /status | ||
port: 8000 | ||
initialDelaySeconds: 60 | ||
failureThreshold: 6 | ||
periodSeconds: 10 | ||
|
||
|
||
# | ||
# Network | ||
# | ||
service: | ||
create: true | ||
type: ClusterIP | ||
ports: | ||
- 8000 | ||
|
||
ingress: | ||
create: true | ||
host: "dev01.pnpg.internal.dev.selfcare.pagopa.it" | ||
path: /pnpg/status(/|$)(.*) | ||
rewriteTarget: /$2 | ||
servicePort: 8000 | ||
# proxyBodySize: 2m | ||
annotations: { | ||
nginx.ingress.kubernetes.io/satisfy: "any" | ||
} | ||
|
||
serviceAccount: | ||
create: false | ||
annotations: {} | ||
name: "" | ||
|
||
podAnnotations: {} | ||
|
||
podSecurityContext: | ||
seccompProfile: | ||
type: RuntimeDefault | ||
|
||
securityContext: | ||
allowPrivilegeEscalation: false | ||
|
||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "40m" | ||
limits: | ||
memory: "128Mi" | ||
cpu: "40m" | ||
|
||
autoscaling: | ||
enable: true | ||
minReplica: 1 | ||
maxReplica: 3 | ||
pollingInterval: 30 # seconds | ||
cooldownPeriod: 300 # seconds | ||
triggers: | ||
- type: cpu | ||
metadata: | ||
type: Utilization | ||
value: "60" | ||
|
||
# nodeSelector: {} | ||
|
||
# tolerations: [] | ||
|
||
# affinity: {} |
Empty file.
Empty file.