mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-21 10:59:07 +00:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b168612a4 | ||
|
|
a772804dcd | ||
|
|
8a399fbbcf | ||
|
|
94049d6e8e | ||
|
|
c28cc58ac7 | ||
|
|
56a655bb90 | ||
|
|
b3d4a6b028 | ||
|
|
c7bd1f761a | ||
|
|
09c045455e | ||
|
|
52d651126e | ||
|
|
2f11b1e78f | ||
|
|
885e9b71bb | ||
|
|
ac26ad9f44 | ||
|
|
fbe00af6dc | ||
|
|
bfa9929b69 | ||
|
|
bada7000f6 |
@@ -142,45 +142,11 @@ jobs:
|
|||||||
docker system prune --volumes -a -f
|
docker system prune --volumes -a -f
|
||||||
docker system df
|
docker system df
|
||||||
|
|
||||||
k8s-setup:
|
k8s-deploy:
|
||||||
needs: [extract_environment]
|
needs: [extract_environment, semantic_release, build_ecr_image]
|
||||||
uses: ./.github/workflows/k8s-setup.yml
|
uses: ./.github/workflows/k8s-deploy.yml
|
||||||
with:
|
with:
|
||||||
cloud: azure
|
cloud: ${{ (needs.extract_environment.outputs.environment == 'prd' && 'azure' ) || 'oracle' }}
|
||||||
environment: ${{ needs.extract_environment.outputs.environment }}
|
environment: ${{ needs.extract_environment.outputs.environment }}
|
||||||
|
image: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
helmfile-deploy:
|
|
||||||
needs: [extract_environment, semantic_release, build_ecr_image, k8s-setup]
|
|
||||||
runs-on: [self-hosted, "prd-azure"]
|
|
||||||
environment: ${{ needs.extract_environment.outputs.environment }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Helm
|
|
||||||
uses: azure/setup-helm@v1
|
|
||||||
with:
|
|
||||||
version: 'v3.9.0'
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.8'
|
|
||||||
|
|
||||||
- name: Install Helmfile
|
|
||||||
run: |
|
|
||||||
wget https://github.com/helmfile/helmfile/releases/download/v0.148.0/helmfile_0.148.0_linux_amd64.tar.gz
|
|
||||||
tar -xzf helmfile_0.148.0_linux_amd64.tar.gz
|
|
||||||
mv helmfile /usr/local/bin/
|
|
||||||
helmfile --version
|
|
||||||
|
|
||||||
- name: Install Helm Diff Plugin
|
|
||||||
run: helm plugin install https://github.com/databus23/helm-diff || true
|
|
||||||
|
|
||||||
- name: Run Helmfile Apply
|
|
||||||
env:
|
|
||||||
ENV: ${{ needs.extract_environment.outputs.environment }}
|
|
||||||
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
|
||||||
run: helmfile -f deploy/helmfiles/${ENV}.yaml sync --set image.tag=$IMAGE_TAG
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name : K8s Setup kube config to deploy
|
name : K8s deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@@ -13,12 +13,24 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
default: "prd"
|
default: "prd"
|
||||||
type: string
|
type: string
|
||||||
|
image:
|
||||||
|
description: "Image Tag"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
azure:
|
azure:
|
||||||
if: inputs.cloud == 'azure'
|
if: inputs.cloud == 'azure'
|
||||||
runs-on: [self-hosted, "prd-azure"]
|
runs-on: [self-hosted, "prd-azure"]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: 'v3.9.0'
|
||||||
|
|
||||||
- name: Install Azure ClI
|
- name: Install Azure ClI
|
||||||
run: |
|
run: |
|
||||||
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
||||||
@@ -37,11 +49,44 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: 'v1.30.1'
|
version: 'v1.30.1'
|
||||||
|
|
||||||
oci:
|
- name: Set up Python
|
||||||
if: inputs.cloud == 'oci'
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install Helmfile
|
||||||
|
run: |
|
||||||
|
wget https://github.com/helmfile/helmfile/releases/download/v0.148.0/helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
tar -xzf helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
mv helmfile /usr/local/bin/
|
||||||
|
helmfile --version
|
||||||
|
|
||||||
|
- name: Install Helm Diff Plugin
|
||||||
|
run: helm plugin install https://github.com/databus23/helm-diff || true
|
||||||
|
|
||||||
|
- name: Run Helmfile Apply
|
||||||
|
env:
|
||||||
|
ENV: ${{ inputs.environment }}
|
||||||
|
IMAGE_TAG: ${{ inputs.image }}
|
||||||
|
run: helmfile -f deploy/helmfiles/${ENV}.yaml sync --set image.tag=$IMAGE_TAG
|
||||||
|
|
||||||
|
oracle:
|
||||||
|
if: inputs.cloud == 'oracle'
|
||||||
runs-on: [self-hosted, "prd-oracle"]
|
runs-on: [self-hosted, "prd-oracle"]
|
||||||
|
env:
|
||||||
|
HOME: /home/runner
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: 'v3.9.0'
|
||||||
|
|
||||||
- name: Install OCI CLI
|
- name: Install OCI CLI
|
||||||
|
env:
|
||||||
|
HOME: /home/runner
|
||||||
run: |
|
run: |
|
||||||
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" -- --accept-all-defaults
|
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" -- --accept-all-defaults
|
||||||
echo "$HOME/bin" >> $GITHUB_PATH
|
echo "$HOME/bin" >> $GITHUB_PATH
|
||||||
@@ -53,12 +98,26 @@ jobs:
|
|||||||
echo "${{ secrets.OCI_PRIVATE_KEY }}" > ~/.oci/oci_api_key.pem
|
echo "${{ secrets.OCI_PRIVATE_KEY }}" > ~/.oci/oci_api_key.pem
|
||||||
chmod 600 ~/.oci/oci_api_key.pem
|
chmod 600 ~/.oci/oci_api_key.pem
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install Helmfile
|
||||||
|
run: |
|
||||||
|
wget https://github.com/helmfile/helmfile/releases/download/v0.148.0/helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
tar -xzf helmfile_0.148.0_linux_amd64.tar.gz
|
||||||
|
sudo mv helmfile /usr/local/bin/
|
||||||
|
helmfile --version
|
||||||
|
|
||||||
|
- name: Install Helm Diff Plugin
|
||||||
|
run: helm plugin install https://github.com/databus23/helm-diff || true
|
||||||
|
|
||||||
- name: Authenticate with OKE cluster
|
- name: Authenticate with OKE cluster
|
||||||
env:
|
env:
|
||||||
ENV: ${{ inputs.environment }}
|
ENV: ${{ inputs.environment }}
|
||||||
STG_CLUSTER_ID: "ocid1.cluster.oc1.sa-saopaulo-1.aaaaaaaagh3jvln52a3ebm3dodx6emmhv5bmfs7i7sv2k4zkbcbrzcl6v37q"
|
STG_CLUSTER_ID: "ocid1.cluster.oc1.sa-saopaulo-1.aaaaaaaagh3jvln52a3ebm3dodx6emmhv5bmfs7i7sv2k4zkbcbrzcl6v37q"
|
||||||
PRD_CLUSTER_ID: "ocid1.cluster.oc1.sa-saopaulo-1.aaaaaaaanf3vptl6hc2tzd4enfd2hfpsht3wikxww5xejc3l7cwfm6l3sndq"
|
PRD_CLUSTER_ID: "ocid1.cluster.oc1.sa-saopaulo-1.aaaaaaaanf3vptl6hc2tzd4enfd2hfpsht3wikxww5xejc3l7cwfm6l3sndq"
|
||||||
HOME: /home/runner
|
|
||||||
run: |
|
run: |
|
||||||
if [ "$ENV" = "stg" ]; then
|
if [ "$ENV" = "stg" ]; then
|
||||||
CLUSTER_ID=$STG_CLUSTER_ID
|
CLUSTER_ID=$STG_CLUSTER_ID
|
||||||
@@ -71,7 +130,8 @@ jobs:
|
|||||||
|
|
||||||
oci ce cluster create-kubeconfig --cluster-id ${CLUSTER_ID} --file $HOME/.kube/config --region sa-saopaulo-1 --token-version 2.0.0 --kube-endpoint PRIVATE_ENDPOINT
|
oci ce cluster create-kubeconfig --cluster-id ${CLUSTER_ID} --file $HOME/.kube/config --region sa-saopaulo-1 --token-version 2.0.0 --kube-endpoint PRIVATE_ENDPOINT
|
||||||
|
|
||||||
- name: Setup kubectl
|
- name: Run Helmfile Apply
|
||||||
uses: azure/setup-kubectl@v1
|
env:
|
||||||
with:
|
ENV: ${{ inputs.environment }}
|
||||||
version: 'v1.30.1'
|
IMAGE_TAG: ${{ inputs.image }}
|
||||||
|
run: helmfile -f deploy/helmfiles/${ENV}.yaml sync --set image.tag=$IMAGE_TAG
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
maestro:
|
||||||
|
env: stg
|
||||||
|
duc_url: duc.stg.dadosfera.ai
|
||||||
|
pi_factory_url: pi-factory.stg.dadosfera.ai
|
||||||
|
in_factory_url: in-factory.stg.dadosfera.ai
|
||||||
|
tr_factory_url: in-factory.stg.dadosfera.ai
|
||||||
|
open_customer_id: b3e3dfe5-b992-4586-a73c-c0b0c00f615d
|
||||||
|
open_group_id: e3f98a2f-7748-4981-8505-7695c8ca8218
|
||||||
|
|
||||||
|
hostname: maestro.stg.dadosfera.ai
|
||||||
|
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: name
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- general
|
||||||
@@ -60,7 +60,7 @@ affinity:
|
|||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
nodeSelectorTerms:
|
nodeSelectorTerms:
|
||||||
- matchExpressions:
|
- matchExpressions:
|
||||||
- key: application
|
- key: applications
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- general
|
- general
|
||||||
|
|||||||
@@ -3,23 +3,8 @@ charts:
|
|||||||
chart: ../helm-chart
|
chart: ../helm-chart
|
||||||
values:
|
values:
|
||||||
- ../helm-chart/values.yaml
|
- ../helm-chart/values.yaml
|
||||||
set:
|
- ../helm-chart/values-stg.yaml
|
||||||
- name: maestro.duc_url
|
|
||||||
value: duc.stg.dadosfera.ai
|
|
||||||
- name: hostname
|
|
||||||
value: maestro.stg.dadosfera.ai
|
|
||||||
- name: maestro.pi_factory_url
|
|
||||||
value: pi-factory.stg.dadosfera.ai
|
|
||||||
- name: maestro.in_factory_url
|
|
||||||
value: in-factory.stg.dadosfera.ai
|
|
||||||
- name: maestro.tr_factory_url
|
|
||||||
value: in-factory.stg.dadosfera.ai
|
|
||||||
- name: maestro.open_customer_id
|
|
||||||
value: b3e3dfe5-b992-4586-a73c-c0b0c00f615d
|
|
||||||
- name: maestro.open_group_id
|
|
||||||
value: e3f98a2f-7748-4981-8505-7695c8ca8218
|
|
||||||
- name: replicaCount
|
|
||||||
value: 1
|
|
||||||
|
|
||||||
# Environment to test Network Policies
|
# Environment to test Network Policies
|
||||||
# - name: private-maestro
|
# - name: private-maestro
|
||||||
|
|||||||
Reference in New Issue
Block a user