Open nav9 opened 3 years ago
I'm posting the updated yaml
files in apps/v1
format:
AuthAPI:
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-api
labels:
app: microservice-app-example
spec:
replicas: 1
selector:
matchLabels:
any-name: auth-api
template:
metadata:
labels:
app: microservice-app-example
any-name: auth-api
spec:
containers:
- env:
- name: AUTH_API_PORT
value: "8081"
- name: JWT_SECRET
value: myfancysecret
- name: USERS_API_ADDRESS
value: http://users-api:8083
- name: ZIPKIN_URL
value: http://zipkin:9411/api/v2/spans
image: auth-api
name: auth-api
ports:
- containerPort: 8081
imagePullPolicy: Never
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-app-example
name: auth-api
spec:
ports:
- targetPort: 8081
port: 8081
selector:
any-name: auth-api
Frontend:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: microservice-app-example
name: frontend
spec:
replicas: 1
selector:
matchLabels:
any-name: frontend
template:
metadata:
labels:
app: microservice-app-example
any-name: frontend
spec:
containers:
- env:
- name: AUTH_API_ADDRESS
value: http://auth-api:8081
- name: PORT
value: "8080"
- name: TODOS_API_ADDRESS
value: http://todos-api:8082
- name: ZIPKIN_URL
value: http://zipkin:9411/api/v2/spans
image: frontend
name: frontend
ports:
- containerPort: 8080
imagePullPolicy: Never
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-app-example
name: frontend
spec:
ports:
- port: 8080
selector:
service: frontend
# type: LoadBalancer
Log message processor:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: microservice-app-example
name: log-message-processor
spec:
replicas: 1
selector:
matchLabels:
any-name: log-message-processor
template:
metadata:
labels:
app: microservice-app-example
any-name: log-message-processor
spec:
containers:
- env:
- name: REDIS_HOST
value: redis-queue
- name: REDIS_PORT
value: "6379"
- name: REDIS_CHANNEL
value: log_channel
- name: ZIPKIN_URL
value: http://zipkin:9411/api/v1/spans
image: log-message-processor
name: log-message-processor
imagePullPolicy: Never
restartPolicy: Always
Redis queue:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: microservice-app-example
name: redis-queue
spec:
replicas: 1
selector:
matchLabels:
any-name: redis-queue
template:
metadata:
labels:
app: microservice-app-example
any-name: redis-queue
spec:
containers:
- env:
image: redis
name: redis-queue
ports:
- containerPort: 6379
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-app-example
name: redis-queue
spec:
ports:
- port: 6379
selector:
any-name: redis-queue
Todo's API:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: microservice-app-example
name: todos-api
spec:
replicas: 1
selector:
matchLabels:
any-name: todos-api
template:
metadata:
labels:
app: microservice-app-example
any-name: todos-api
spec:
containers:
- env:
- name: JWT_SECRET
value: myfancysecret
- name: TODO_API_PORT
value: "8082"
- name: REDIS_HOST
value: redis-queue
- name: REDIS_PORT
value: "6379"
- name: REDIS_CHANNEL
value: log_channel
- name: ZIPKIN_URL
value: http://zipkin:9411/api/v2/spans
image: todos-api
name: todos-api
ports:
- containerPort: 8082
imagePullPolicy: Never
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-app-example
name: todos-api
spec:
ports:
- port: 8082
selector:
any-name: todos-api
Users API:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: microservice-app-example
name: users-api
spec:
replicas: 1
selector:
matchLabels:
any-name: users-api
template:
metadata:
labels:
app: microservice-app-example
any-name: users-api
spec:
containers:
- env:
- name: JWT_SECRET
value: myfancysecret
- name: SERVER_PORT
value: "8083"
- name: SPRING_ZIPKIN_BASE_URL
value: http://zipkin:9411
image: users-api
name: users-api
ports:
- containerPort: 8083
imagePullPolicy: Never
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-app-example
name: users-api
spec:
ports:
- port: 8083
selector:
any-name: users-api
Zipkin:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: microservice-app-example
name: zipkin
spec:
replicas: 1
selector:
matchLabels:
any-name: zipkin
template:
metadata:
labels:
app: microservice-app-example
any-name: zipkin
spec:
containers:
- env:
image: openzipkin/zipkin
name: zipkin
ports:
- containerPort: 9411
- containerPort: 9410
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
labels:
app: microservice-app-example
name: zipkin
spec:
ports:
- port: 9411
selector:
any-name: zipkin
# type: LoadBalancer
When I run
$ kubectl create -R -f k8s/
, I get the output:The yaml files need to be updated to
apps/v1
format, as mentioned here: https://stackoverflow.com/questions/58481850/no-matches-for-kind-deployment-in-version-extensions-v1beta1