deploy steps

This commit is contained in:
silas 2022-05-08 21:27:22 +01:00
parent b1a9fe27a2
commit 8a2e51ed4c
4 changed files with 76 additions and 17 deletions

View File

@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- name: Azure Login
uses: azure/login@89d153571fe9a34ed70fcf9f1d95ab8debea7a73
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
@ -33,9 +33,18 @@ jobs:
docker push ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/v3-liq:${{ github.sha }}
- name: Gets K8s context
uses: azure/aks-set-context@4e5aec273183a197b181314721843e047123d9fa
uses: azure/aks-set-context@v2.0
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
resource-group: ${{ env.RESOURCE_GROUP }}
cluster-name: ${{ env.CLUSTER_NAME }}
id: login
id: login
- uses: azure/k8s-bake@v2.2
with:
renderEngine: "kustomize"
kustomizationPath: "./aks/"
kubectl-version: "latest"
id: bake
- uses: Azure/k8s-deploy@v3.1
with:
manifests: ${{ steps.bake.outputs.manifestsBundle }}

60
aks/deploy-v3-liq.yml Normal file
View File

@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: v3-liq
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: v3-liq
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
minReadySeconds: 5
template:
metadata:
labels:
app: v3-liq
spec:
containers:
- name: v3-liq
image: ${{ secrets.AZURE_CONTAINER_REGISTRY }}.azurecr.io/PROJECT_ID/IMAGE:TAG
imagePullPolicy: Always
resources:
limits:
cpu: 1250m
memory: 6Gi
requests:
cpu: 1000m
memory: 4Gi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
env:
- name: NODE_OPTIONS
value: --max_old_space_size=4096
- name: CLUSTER
value: mainnet
- name: GROUP
value: mainnet.1
- name: INTERVAL
value: "3000"
- name: PRIVATE_KEY
valueFrom:
secretKeyRef:
name: v3-liq-aks
key: private-key
- name: ENDPOINT_URL
valueFrom:
secretKeyRef:
name: v3-liq-aks
key: endpoint-url
- name: WEBHOOK_URL
valueFrom:
secretKeyRef:
name: v3-liq-aks
key: webhook-url

4
aks/kustomization.yml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deploy-v3-liq.yml

View File

@ -1,17 +1,3 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources: