Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Database Service
- apiVersion: v1
- kind: Service
- metadata:
- name: database-billing-service
- spec:
- ports:
- - port: 5432
- ---
- # Database Endpoint
- apiVersion: v1
- kind: Endpoints
- metadata:
- name: database-billing-service
- subsets:
- - addresses:
- - ip: 192.168.9.199
- ports:
- - port: 5432
- ---
- # Influx Service
- apiVersion: v1
- kind: Service
- metadata:
- name: influx-billing-service
- spec:
- ports:
- - port: 80
- ---
- # Influx Endpoint
- apiVersion: v1
- kind: Endpoints
- metadata:
- name: influx-billing-service
- subsets:
- - addresses:
- - ip: 192.168.9.42
- ports:
- - port: 80
- ---
- # Keycloak Service
- apiVersion: v1
- kind: Service
- metadata:
- name: keycloak-billing-service
- spec:
- type: ExternalName
- externalName: auth.kc-service.com # it's a real domain
- ports:
- - port: 80
- ---
- # Billing API Env
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: billing-api-env
- data:
- NODE_ENV: development
- KYECLOAK_SERVER_URL: keycloak-billing-service.default.svc.cluster.local/auth
- # Other Keycloak env
- APP_PORT: "1234"
- APP_URL: localhost
- APP_NAME: "Billing Management API"
- INFLUX_HOST: influx-billing-service.default.svc.cluster.local
- # Other Influx env
- PROD_DB_HOSTNAME: database-billing-service.default.svc.cluster.local
- # Other DB env
- REDIS_HOST: localhost
- REDIS_PORT: "6379"
- ---
- # Billing Web Env
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: billing-web-env
- data:
- REACT_APP_BASENAME: "Billing Management"
- REACT_APP_API_HOST: "localhost:1234"
- REACT_APP_KC_AUTH_SERVER_URL: keycloak-billing-service.default.svc.cluster.local/auth
- ---
- # Billing Deployment
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: billing-management-deployment
- spec:
- replicas: 3
- selector:
- matchLabels:
- app: billing-management
- template:
- metadata:
- name: billing-management
- labels:
- app: billing-management
- spec:
- containers:
- - name: billing-redis
- image: "redis"
- ports:
- - containerPort: 6379
- - name: billing-api
- image: "my-image-bill-api"
- ports:
- - containerPort: 1234
- args:
- - sh
- - -c
- - npm install && npx sequelize db:migrate && npm start
- envFrom:
- - configMapRef:
- name: billing-api-env
- - name: billing-web
- image: "my-image-bill-web"
- ports:
- - containerPort: 80
- envFrom:
- - configMapRef:
- name: billing-web-env
- ---
- # Billing Service
- apiVersion: v1
- kind: Service
- metadata:
- name: billing-service
- spec:
- selector:
- app: billing-management
- ports:
- - name: billing-api
- port: 1234
- targetPort: 1234
- - name: billing-web
- port: 80
- targetPort: 80
- ---
- # Inggress
- apiVersion: networking.k8s.io/v1
- kind: Ingress
- metadata:
- name: billing-ingress
- annotations:
- nginx.ingress.kubernetes.io/ssl-redirect: "false"
- nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
- spec:
- rules:
- - host: api.meetaza.dev
- http:
- paths:
- - path: /v1/billing
- pathType: Exact
- backend:
- service:
- name: billing-service
- port:
- number: 1234
- - host: billing.meetaza.dev
- http:
- paths:
- - path: /
- pathType: Exact
- backend:
- service:
- name: billing-service
- port:
- number: 80
- ---
- # Additional Ingress ConfigMap
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: ingress-nginx-controller
- namespace: ingress-nginx
- data:
- # hsts: "false"
- # hsts-max-age: "0"
- ssl-redirect: "false"
- hsts: "true"
- hsts-include-subdomains: "true"
- hsts-max-age: "0"
- hsts-preload: "false"
- ---
- # CURL for Testing
- apiVersion: v1
- kind: Pod
- metadata:
- name: curl
- labels:
- name: curl
- spec:
- containers:
- - name: curl
- image: khannedy/nginx-curl
Add Comment
Please, Sign In to add comment