resource "azurerm_resource_group" "dtm-dev" {
name = "dtm-dev"
location = "West Europe"
}
resource "azurerm_virtual_network" "dtm-dev" {
name = "dtm-dev"
location = azurerm_resource_group.dtm-dev.location
resource_group_name = azurerm_resource_group.dtm-dev.name
address_space = ["10.1.0.0/16"]
}
VM
LB
Resource Group
Master
Node
Node
apiVersion: apps/v1
kind: Deployment
metadata:
name: notifications-gateway
labels:
app: notifications-gateway
spec:
replicas: 1
selector:
matchLabels:
app: notifications-gateway
strategy:
type: RollingUpdate
.....
Node
Deployment
ReplikaSet
POD
node
node
node
LB
LB
VPN Gateway
node
node
node
service
pod
secret
node
node
node
LB
LB
VPN Gateway
app
fluentD
elastic
kibana
app
fluentD
logging
logging
query logs
app
prometheus
grafana
query metrics
app
svc
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/path: '/actuator/prometheus'
prometheus.io/port: '8081'
prometheus.io/scheme: 'http'
labels:
app: notifications-gateway
name: notifications-gateway
spec:
....
scrape metrics
app
app
svc
scrape metrics
grafana
board
puller
node
sealed controller
node
argoCD
sealed secret
kind: Secret
metadata:
name: rabbitmq
namespace: rabbitmq
data:
password: dmVylY3JldA==
username: cmFml0
kind: SealedSecret
metadata:
name: rabbitmq
namespace: rabbitmq
spec:
encryptedData:
password: AgBd6Kf...
username: AgA0KuM7...
template:
metadata:
name: rabbitmq
...
secret
node
Vault
init
app
secrets
node
apiVersion: apps/v1
kind: Deployment
metadata:
name: notifications-gateway
labels:
app: notifications-gateway
spec:
template:
metadata:
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/agent-inject-secret-smsapi: kube-dev/data/smsapi
vault.hashicorp.com/agent-inject-secret-application.properties: kube-dev/data/rabbitmq
vault.hashicorp.com/agent-inject-template-application.properties: |
{{- with secret "kube-dev/data/rabbitmq" -}}
spring.rabbitmq.username={{ .Data.data.username }}
spring.rabbitmq.password={{ .Data.data.password }}{{ "\n" }}
{{- end -}}
{{- with secret "kube-dev/data/smsapi" -}}
notifications.sms.provider.token={{ .Data.data.token }}
{{- end -}}
vault.hashicorp.com/role: internal-app
Vault configuration:
node
node
argoCD
cofig map
jenkins
jenkins pod
node
jenkins
seed-job
node
jenkins
worker
app