apiVersion: v1 kind: Namespace metadata: name: zos-web --- apiVersion: v1 kind: Secret metadata: name: tso-credentials namespace: zos-web type: Opaque stringData: ZOS_HOST: "192.168.2.243" ZOS_PORT: "23" ZOS_USERID: "IBMUSER" ZOS_PASSWORD: "allard" ZOS_PROC: "DBSPROC9" ZOS_ACCT: "ACCT#" ZOS_SIZE: "2048000" --- apiVersion: apps/v1 kind: Deployment metadata: name: zos-backend namespace: zos-web spec: replicas: 1 selector: matchLabels: app: zos-backend template: metadata: labels: app: zos-backend spec: containers: - name: zos-backend image: allardkrings/zos-backend:latest imagePullPolicy: Always ports: - containerPort: 8000 envFrom: - secretRef: name: tso-credentials resources: requests: memory: "256Mi" cpu: "250m" limits: memory: "512Mi" cpu: "500m" livenessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 30 periodSeconds: 15 readinessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 30 periodSeconds: 10 --- apiVersion: v1 kind: Service metadata: name: zos-backend namespace: zos-web spec: selector: app: zos-backend ports: - protocol: TCP port: 8000 targetPort: 8000 --- apiVersion: apps/v1 kind: Deployment metadata: name: zos-frontend namespace: zos-web spec: replicas: 1 selector: matchLabels: app: zos-frontend template: metadata: labels: app: zos-frontend spec: containers: - name: zos-frontend image: allardkrings/zos-frontend:latest imagePullPolicy: Always ports: - containerPort: 80 resources: requests: memory: "64Mi" cpu: "50m" limits: memory: "128Mi" cpu: "100m" --- apiVersion: v1 kind: Service metadata: name: zos-frontend namespace: zos-web spec: selector: app: zos-frontend ports: - protocol: TCP port: 80 targetPort: 80 --- apiVersion: traefik.io/v1alpha1 kind: Middleware metadata: name: strip-api-prefix namespace: zos-web spec: stripPrefix: prefixes: - /api --- apiVersion: traefik.io/v1alpha1 kind: Middleware metadata: name: redirect-to-https namespace: zos-web spec: redirectScheme: scheme: https permanent: true --- apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: name: zos-http namespace: zos-web spec: entryPoints: - web routes: - match: Host(`zos-dev.allarddcs.nl`) kind: Rule middlewares: - name: redirect-to-https services: - name: zos-frontend port: 80 --- apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: name: zos-https namespace: zos-web spec: entryPoints: - websecure routes: - match: Host(`zos-dev.allarddcs.nl`) && PathPrefix(`/api`) kind: Rule middlewares: - name: strip-api-prefix services: - name: zos-backend port: 8000 - match: Host(`zos-dev.allarddcs.nl`) kind: Rule services: - name: zos-frontend port: 80 tls: certResolver: letsencrypt