dickchesterwood / k8s-fleetman Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
apiVersion: apps/v1
kind: Deployment
metadata:
name: queue
spec:
selector:
matchLabels:
app: queue
replicas: 1
template: # template for the pods
metadata:
labels:
app: queue
spec:
containers:
- name: queue
image: richardchesterwood/k8s-fleetman-queue:release1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: position-simulator
spec:
selector:
matchLabels:
app: position-simulator
replicas: 1
template: # template for the pods
metadata:
labels:
app: position-simulator
spec:
containers:
- name: position-simulator
image: richardchesterwood/k8s-fleetman-position-simulator:release1
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
apiVersion: v1
kind: Service
metadata:
name: fleetman-queue
spec:
# This defines which pods are going to be represented by this Service
# The service becomes a network endpoint for either other services
# or maybe external users to connect to (eg browser)
selector:
app: queue
ports:
- name: http
port: 8161
nodePort: 30010
- name: endpoint
port: 61616
type: NodePort
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/fleetman-queue NodePort 10.103.242.100 <none> 8161:30010/TCP,61616:31522/TCP 3m53s
Pods are running without a problem. I log in the position-simulator pod and ping the fleetman-queue. The correct ip is returned. So probably something is wrong in the spring boot code.
Can we use MovingMarker.js again?
standalone - run alone, always development. Needs no other external dependency.
local-microservice - run locally but as a microservice architecture
production-microservice - the full stack as deployed to live hardware with k8s
Api Gateway Key on Restarting when ever try to connect to api gateway using 30020 how to fix this
I suspect it's a rounding problem due to the imprecise string format used in the simulator.
When applying services.yaml and workload.yaml cloning from _course_files/Chapter 11 Microservices/
I get the following errors :
$ kubectl get all
Unable to connect to the server: unexpected EOF
Unable to connect to the server: read tcp 192.168.99.1:7842->192.168.99.100:8443: wsarecv: An existing connection was forcibly closed by the remote host.
Unable to connect to the server: dial tcp 192.168.99.100:8443: connectex: No connection could be made because the target machine actively refused it.
Unable to connect to the server: net/http: TLS handshake timeout
Unable to connect to the server: net/http: TLS handshake timeout
Unable to connect to the server: net/http: TLS handshake timeout
Unable to connect to the server: net/http: TLS handshake timeout
..and submitting the command once more after a while : ...
$ kubectl get all
Unable to connect to the server: dial tcp 192.168.99.100:8443: connectex: No connection could be made because the target machine actively refused it.
It's been an open issue for too long, multiple problems with this section suggest a total re-record from scratch.
I think we can get rid of Kops now - it's become a tedious pain to work in kops, whilst eks is reasonably straightforward except for the CSI driver. We can provide a script for this.
This the biggest challenge. How do we "publish" the API endpoint?
This will mean having test data sent to a local queue.
Pick up point: why the warning about unused data in "speed"?
Not sure if this should be presentation, API gateway or the simulator!
I think the simulator is probably best....
Fix this once the system is running in local mode
Hello Richard! I am enjoying your udemy course. It's the best introducing the key concepts instead of delving into kubelets and what not.
I arrived on ch. 11 deploying the complete set but Chromium (I am on Ubuntu) is not showing the data.
(Apologies if this is not the right place)
Below is some information about my setup.
Minikube version: v1.30.1
The console logs show websocket connection established.
Below is the output of kubectl get all
NAME READY STATUS RESTARTS AGE
pod/api-gateway-5bf5cfc887-8sc8h 1/1 Running 0 10m
pod/position-simulator-56686f95f8-bwm5d 1/1 Running 0 10m
pod/position-tracker-f5bfcf944-wlprt 1/1 Running 0 10m
pod/queue-5877c4c669-487sj 1/1 Running 0 10m
pod/webapp-586c6c87cd-m9db9 1/1 Running 0 10m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/fleetman-api-gateway ClusterIP 10.101.68.20 <none> 8080/TCP 10m
service/fleetman-queue NodePort 10.104.40.70 <none> 8161:30010/TCP,61616:31517/TCP 10m
service/fleetman-webapp NodePort 10.111.225.253 <none> 80:30080/TCP 10m
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 23h
service/position-tracker ClusterIP 10.109.151.103 <none> 8080/TCP 10m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/api-gateway 1/1 1 1 10m
deployment.apps/position-simulator 1/1 1 1 10m
deployment.apps/position-tracker 1/1 1 1 10m
deployment.apps/queue 1/1 1 1 10m
deployment.apps/webapp 1/1 1 1 10m
NAME DESIRED CURRENT READY AGE
replicaset.apps/api-gateway-5bf5cfc887 1 1 1 10m
replicaset.apps/position-simulator-56686f95f8 1 1 1 10m
replicaset.apps/position-tracker-f5bfcf944 1 1 1 10m
replicaset.apps/queue-5877c4c669 1 1 1 10m
replicaset.apps/webapp-586c6c87cd 1 1 1 10m
Below is my yaml file
piVersion: apps/v1
kind: Deployment
metadata:
name: queue
spec:
selector:
matchLabels:
app: queue
replicas: 1
template:
metadata:
labels:
app: queue
spec:
containers:
- name: queue
image: richardchesterwood/k8s-fleetman-queue:release1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: position-simulator
spec:
selector:
matchLabels:
app: position-simulator
replicas: 1
template:
metadata:
labels:
app: position-simulator
spec:
containers:
- name: position-simulator
image: richardchesterwood/k8s-fleetman-position-simulator:release1
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: position-tracker
spec:
selector:
matchLabels:
app: position-tracker
replicas: 1
template:
metadata:
labels:
app: position-tracker
spec:
containers:
- name: position-tracker
image: richardchesterwood/k8s-fleetman-position-tracker:release1
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-gateway
spec:
selector:
matchLabels:
app: api-gateway
replicas: 1
template:
metadata:
labels:
app: api-gateway
spec:
containers:
- name: api-gateway
image: richardchesterwood/k8s-fleetman-api-gateway:release1
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
spec:
selector:
matchLabels:
app: webapp
replicas: 1
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: webapp
image: richardchesterwood/k8s-fleetman-webapp-angular:release1
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
---
apiVersion: v1
kind: Service
metadata:
name: fleetman-webapp
spec:
selector:
app: webapp
ports:
- name: http
port: 80
nodePort: 30080
type: NodePort
---
apiVersion: v1
kind: Service
metadata:
name: fleetman-queue
spec:
selector:
app: queue
ports:
- name: http
port: 8161
nodePort: 30010
- name: endpoint
port: 61616
type: NodePort
---
apiVersion: v1
kind: Service
metadata:
name: position-tracker
spec:
selector:
app: position-tracker
ports:
- name: http
port: 8080
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
name: fleetman-api-gateway
spec:
selector:
app: api-gateway
ports:
- name: http
port: 8080
type: ClusterIP
When I deployed the fleetman-webapp pod to my cluster, it gives Back-off starting error.
and I logged the pod, the message is :
host not found in upstream "fleetman-api-gateway.default.svc.cluster.local" in /etc/nginx/nginx.conf:23
nginx: [emerg] host not found in upstream "fleetman-api-gateway.default.svc.cluster.local" in /etc/nginx/nginx.conf:23
Would you please help me in solving this issue?
Example microservices on minikube is taking too much of CPU. I have 16GB Ram 4 Core
(base) k8s-tutorial cmd $ cat /proc/cpuinfo | grep "model name"
model name : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
model name : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
model name : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
model name : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
issuing top command says 200+% usage by kube
20 0 3916932 92980 46828 S 207.3 0.6 3:17.59 VBoxHeadless
Is there a way to limit the cpu usage, so that we can get the application running on minikube on laptop?
We've assumed that the amd64 images would work on the new M1 platform, albeit slowly under emualtion. However we've had a report that the webapp doesn't run:
k8 io_setup() failed (38: Function not implemented)
To work around this, I've made a trial version of a multi arch image:
docker buildx create --use --name build --node build --driver-opt network=host
docker buildx build --platform linux/arm64,linux/amd64 --push -t richardchesterwood/trial-webapp:2 .
I'm waiting on the customer to report back if this works. I'm not at all clear if the other images need similar treatment.
I've been taking the Manning live video course and am to the point of putting it all together in chapter 11. Until this point everything in the course has worked just fine. I'm running the latest version of minikube on MacOs Catalina.
The queue deployed fine.
The position simulator also deployed fine and I saw messages increasing in the queue.
The position tracker deployed fine and I saw messages start to decrease. Then pods from all components began to crash and restart.
I finished deploying the rest of the components with the same behavior... pods constantly crashing and restarting.
The logs were a bit difficult to get at because of the restart of pods from deployments. Ones I could see were inconclusive as to a problem.
I checked out the release1 tag for this repository and used your deployment descriptors, which FYI use replica sets instead of deployments. I deleted everything and started clean with your yaml files. Applying them resulted in the same crashing behavior. Given that I'm wondering if there are compatibility issues going on.
There's no real need for a SpringBootMVC front end. It's a legacy from the original Spring Boot training course.
As it's a single page application, it should suit Angular's model quite well.
When you apply -4 file I get this.
resource mapping not found for name: "fleetman-driver-monitoring" namespace: "" from "4-application-full-stack.yaml": no matches for kind "ServiceEntry" in version "networking.istio.io/v1alpha3"
ensure CRDs are installed first
I looked at the yaml i found the host is not right I guess, i looked at case 23 it does not correlate with issue I am having.
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: fleetman-driver-monitoring
spec:
hosts:
Requirement from customer...
Got the following error, while trying to access position tracker on port 30020. Tried all arm64 releases, nothing seems to work!
Command used for mapping the port:
kubectl port-forward svc/fleetman-position-tracker 30020:8080
workloads.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: queue
spec:
replicas: 1
selector:
matchLabels:
app: queue
template:
metadata:
labels:
app: queue
spec:
containers:
- name: fleetman-queue-container
image: richardchesterwood/k8s-fleetman-queue:release1-arm64
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: position-simulator
spec:
replicas: 1
selector:
matchLabels:
app: position-simulator
template:
metadata:
labels:
app: position-simulator
spec:
containers:
- name: position-simulator-container
image: richardchesterwood/k8s-fleetman-position-simulator:release1-arm64
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: position-tracker
spec:
replicas: 1
selector:
matchLabels:
app: position-tracker
template:
metadata:
labels:
app: position-tracker
spec:
containers:
- name: position-tracker-container
image: richardchesterwood/k8s-fleetman-position-tracker:release1-arm64
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
services.yaml
apiVersion: v1
kind: Service
metadata:
name: fleetman-queue
spec:
selector:
app: queue
ports:
- name: http
port: 8161
nodePort: 30010
- name: endpoint-for-messages
port: 61616
type: NodePort
---
apiVersion: v1
kind: Service
metadata:
name: fleetman-position-tracker
spec:
selector:
app: position-tracker
ports:
- name: rest-endpoint
port: 8080
nodePort: 30020
type: NodePort
Environment details:
Usually, we avoid any references to IP addresses and ports anywhere in the code.
The exception is for the webapp, which as far as I can tell has no way of magically working out the IP/Domain and Port of the API gateway. Remember the webapp is Angular and therefore 100% client side.
The way I'm implementing this is: (there may be a better way, will learn about this over time)
This keeps things simple.
(there must be a better way!)
The file you show yourself creating that documents the things to install like eksctl, but especially including the one with the custom IAM policy, is not attached to the course or here in this project.
A circa 10 year old laptop really struggles to run this system. It's not surprising, but it would be worth softening the simulation.
Idea - allow a config param to reduce the number of vehicles.
We use the queue ui early in the course. It isn't important, but it's strange that the port isn't accessible on Mac. I think a problem with the service yaml?
Pickup on this Friday 19 May.
Edge doesn't even "see" the ip address of docker-machine
My deployments:
application not working properly
This would be an awesome project to add distributed tracing to with OpenTracing and Jaeger. Maybe you can do a course on it in the future! I can spin up a PR if you'd like! I'll talk through how it works in the PR.
yay!
It may be needed for older browsers - leaving it out for now...
Hi, i'm on your k8s course
Have some problem when check queue via browser, it's just dont show any activity
My YAML files:
apiVersion: apps/v1
kind: Deployment
metadata:
name: queue
spec:
replicas: 1
selector:
matchLabels:
app: queue
template:
metadata:
labels:
app: queue
spec:
containers:
- name: queue
image: richardchesterwood/k8s-fleetman-queue:release1
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
apiVersion: v1
kind: Service
metadata:
name: webapp-service
spec:
selector:
app: webapp
ports:
type: NodePort
apiVersion: v1
kind: Service
metadata:
name: queue
spec:
selector:
app: queue
ports:
- name: admin
port: 8161
- name: endpoint
port: 61616
type: NodePort
Position simulator logs:
. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v1.4.0.RELEASE)
2020-02-03 13:42:42.890 INFO 1 --- [ main] c.v.s.PositionsimulatorApplication : Starting PositionsimulatorApplication v0.0.1-SNAPSHOT on position-simulator-7d555dc46-9ddsg with PID 1 (/webapp.jar started by root in /)
2020-02-03 13:42:42.903 INFO 1 --- [ main] c.v.s.PositionsimulatorApplication : The following profiles are active: production-microservice
2020-02-03 13:42:43.071 INFO 1 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@443b7951: startup date [Mon Feb 03 13:42:43 UTC 2020]; root of context hierarchy
2020-02-03 13:42:44.926 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2020-02-03 13:42:44.934 INFO 1 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2020-02-03 13:42:44.950 INFO 1 --- [ main] c.v.s.PositionsimulatorApplication : Started PositionsimulatorApplication in 2.788 seconds (JVM running for 4.043)
2020-02-03 13:42:44.951 INFO 1 --- [ main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@443b7951: startup date [Mon Feb 03 13:42:43 UTC 2020]; root of context hierarchy
2020-02-03 13:42:44.954 INFO 1 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647
2020-02-03 13:42:44.959 INFO 1 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2020-02-03 13:42:46.183 WARN 1 --- [ool-1-thread-31] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.184 WARN 1 --- [ool-1-thread-27] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.189 WARN 1 --- [ool-1-thread-10] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.194 WARN 1 --- [ool-1-thread-11] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.194 WARN 1 --- [ool-1-thread-37] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.194 WARN 1 --- [ool-1-thread-14] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [pool-1-thread-1] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-34] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-15] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-25] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-30] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-19] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-20] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-26] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.195 WARN 1 --- [ool-1-thread-38] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.201 WARN 1 --- [ool-1-thread-18] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.202 WARN 1 --- [ool-1-thread-23] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
2020-02-03 13:42:46.202 WARN 1 --- [ool-1-thread-21] c.v.simulator.journey.Journey : Queue unavailable - backing off 5000ms before retry
...and so on.
P.S
One thing, when i'm trying to find your images on DockerHub search can't find nothing. But docker pull
works fine.
P.P.S Can this application work in Brave browser?
I am using EKS (which is now using k8s 1.17). When I got to the Helm video the "fix" for Tiller did not work. Reading the Helm docs, I figured out the solution .. need to install Tiller using: helm init --service-account tiller
With that added, your fix script worked perfectly. I should note I installed the latest Helm 2.x version as opposed to the 3.x version:
$ helm version
Client: &version.Version{SemVer:"v2.16.10", GitCommit:"bceca24a91639f045f22ab0f41e47589a932cf5e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.10", GitCommit:"bceca24a91639f045f22ab0f41e47589a932cf5e", GitTreeState:"clean"}
And reinstate the dev warning
It's a bit disconcerting when reports start coming in but the map remains blank.
Better centre: top of Woodvale Road, 53.374129, -1.511625
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.