Configure nginx ingress and routing
This commit is contained in:
parent
391683831f
commit
4d30f79900
@ -6,7 +6,7 @@ WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm ci && npm run build
|
||||
RUN npm ci && npm run build -- --configuration=production
|
||||
|
||||
# Stage 2
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import {environment} from '../../environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class RestService {
|
||||
private currentLocation = 'http://' + environment.location + ':' + environment.port + '/api/v1/resources/';
|
||||
private currentLocation = environment.location + '/api/v1/resources/';
|
||||
|
||||
constructor(
|
||||
private logger: NGXLogger,
|
||||
|
||||
@ -2,7 +2,6 @@ import {NgxLoggerLevel} from 'ngx-logger';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
location: 'xway',
|
||||
port: 5004,
|
||||
location: '/xway',
|
||||
log_level: NgxLoggerLevel.WARN,
|
||||
};
|
||||
|
||||
@ -6,8 +6,7 @@ import {NgxLoggerLevel} from 'ngx-logger';
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
location: 'xway',
|
||||
port: 5004,
|
||||
location: 'http://xway:5004',
|
||||
log_level: NgxLoggerLevel.DEBUG,
|
||||
};
|
||||
|
||||
|
||||
@ -2,11 +2,26 @@ apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: dse2021-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
nginx.ingress.kubernetes.io/add-base-url: "true"
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
||||
nginx.ingress.kubernetes.io/service-upstream: "true"
|
||||
spec:
|
||||
rules:
|
||||
- host:
|
||||
http:
|
||||
- http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: controlcenter
|
||||
servicePort: 80
|
||||
- path: /(.+)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: controlcenter
|
||||
port:
|
||||
number: 80
|
||||
- path: /xway/(.+)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: xway
|
||||
port:
|
||||
number: 5004
|
||||
|
||||
@ -5,12 +5,10 @@ metadata:
|
||||
labels:
|
||||
app: controlcenter
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: controlcenter
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- name: "80"
|
||||
port: 80
|
||||
targetPort: 80
|
||||
status:
|
||||
loadBalancer: {}
|
||||
|
||||
@ -5,6 +5,7 @@ metadata:
|
||||
labels:
|
||||
app: xway
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: xway
|
||||
ports:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user