Companion repo to a course on Udemy.com
stephengrider / dockercasts Goto Github PK
View Code? Open in Web Editor NEWCompanion repo to a course on Udemy.com
Companion repo to a course on Udemy.com
Thank you Stepen for the great course. I really enjoyed it. I noticed one minor issue in pg setup.
The variable in complex/k8s/postgres-deployment.ym
should be
POSTGRES_PASSWORD
not PGPASSWORD
I think that is why in the demo the
Indexes I have seen
was not showing indexes.
Could you please add diagrams for lecture 06 ?
Folder 5 has an XML but its empty
I ran into an issue with the server deployment as part of section 15 in the course. All of the other components were working correctly except the server deployment, which would throw (as shown in kubectl logs -f deployements/server-deployments
):
khuynh@kmba:docker-and-kubernetes/complex-k8s ‹main*›$ kcl logs -f deployments/server-deployment
Found 6 pods, using pod/server-deployment-7bb8f4cf98-prk9d
> @ start /app
> node index.js
Listening
/app/node_modules/pg/lib/connection.js:441
throw new Error('Unknown authenticationOk message type' + util.inspect(msg))
^
Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 }
at Connection.parseR (/app/node_modules/pg/lib/connection.js:441:9)
at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:357:19)
at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:119:22)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at TCP.onread (net.js:639:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-10-03T22_06_17_783Z-debug.log
I think this could be related to the new version of PostgreSQL 14 on the latest tag?
khuynh@kmba:docker-and-kubernetes/complex-k8s ‹main*›$ kcl logs pod/postgres-deployment-fb4d66679-7wdrf
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....2021-10-03 20:47:07.573 UTC [49] LOG: starting PostgreSQL 14.0 (Debian 14.0-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-10-03 20:47:07.574 UTC [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-10-03 20:47:07.578 UTC [50] LOG: database system was shut down at 2021-10-03 20:47:07 UTC
2021-10-03 20:47:07.580 UTC [49] LOG: database system is ready to accept connections
The solution for me was to upgrade the version of pg
in my package.json
to "^8.7.1"
. I have an image w/ the updated pg client on dockerhub here: hkennyv/fib-server (anyone is welcome to use it).
Thanks for this in depth course, it's been really informative. Just had a stumble towards the end of the course, where after trying to deploy to Google Cloud via travisCI, when going to the IP address, it errors out and I get this message
TypeError: this.state.seenIndexes.map is not a function at t.value (Fib.js:39) at t.value (Fib.js:66)
Where the code in Fib.js in the client folder is like this
async fetchIndexes() { const seenIndexes = await axios.get('/api/values/all'); this.setState({ seenIndexes: seenIndexes.data });
It seems like the server isn't working, because it keeps returning "Hi"
The weird thing this was working locally when using kubectl, but now it's not
Has anyone encountered this issue before and know what the problem is?
This is the repo to what I've done so far https://github.com/andytan2624/multi-k8s
Thanks
In case you're wondering I use the latest version of everything up to date. As an example I wrote my code utilizing async/await, functional component against of class component. The code would be available in one of my repos. I cannot explain the reason causing the behaviour if a previous deployment allowed to use multi stage builds in one file - I had no issues with the previous project. This one is just doesn't want to copy files from the build/ directory and I don't know how to trace a reason. Logs didn't show any sign of an error.
**--from=0** this command says copy artifacts from <dir> to <dir>
FROM node:16.13.1-alpine
WORKDIR /app
COPY ["package*.json", "./"]
RUN npm install
COPY . .
RUN npm run build
FROM nginx:1.21.5-alpine
EXPOSE 3000
COPY --from=0 /app/build /usr/share/nginx/html
COPY ./nginx/default.conf ./etc/nginx/conf.d/default.conf
If you're interested, here is my repo.
Travis CI is a pain in the arse! But the more important I've got a relatively up to day course which in fact hasn't been updated.
There is no AWSElasticBeanstalkFullAccess any longer. Use AdministratorAccess-AWSElasticBeanstalk
If you're experiencing the following error
The request signature we calculated does not match the signature you provided. Check your key and signing method. (Aws::S3::Errors::SignatureDoesNotMatch)
You mustn't use secure: key. Write it as follows in the .travis.yml file:
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
MIND When you add your environment variables to Travis CI, there is an annotation you may overlook:
If your secret variable has special characters like &, escape them by adding \ in front of each special character. For example, ma&w!doc would be entered as ma&w!doc.
For example: Secret access key: aaAXtldqugatcfiVMsSNq/jmmdZebbEy74tz4mAp
In my key is used a forward slash - I needed to escape it with a backslash:
AWS_SECRET_KEY aaAXtldqugatcfiVMsSNq\/jmmdZebbEy74tz4mAp
Stephen might think users will deal with the issues on their own - Yes, we do! However I spent an hour on those errors digging the Internet. Please, save our time Stephen!
Well, I wonder why Stephen doesn't update changes in his courses.
If you want to get a proper behaviour, try this one
docker run -e CI=true <ContainerName> npm run test -- --coverage
you pass an environment variable to the container so that npm knows you want to exit once it's done.
The diagrams.xml file in the diagrams/05 folder is empty and the diagrams/06 folder doesn't contain a diagrams.xml file. Also the numbering of the following folders seems to be off, as the diagrams for section 6 are in diagrams/07.
Well, according to docs the mem_limit: 128m directive is available in v2 not in v3.
https://docs.docker.com/compose/compose-file/compose-file-v3/
Dunno if it's relevant at all...
If you use JetBrains IDE like GoLand or Webstorm, there is a schema mapping helping you to compose a file. If you selected docker-compose.yml schema and then switch version: from "3.9" to "2.4" it shows you the unavailable directive. It's really helpful in case you didn't know.
Avoid any unnecessary symbols in your primary commit before deploying. If your commit contains a replacement character � Travis will fail to deploy your project.
Thank-you for teaching this course, Stephen (and for what I've learned so far).
The feedback from travis-ci was a bit of a surprise, failing the .yaml file we provided. The job log did indicate tests passing locally.
I can't imagine we pushed a flawed .yaml, but does build config validation show that new conditions were added to travis since you published ch. 7?
root: deprecated key sudo (The key sudo
has no effect anymore.)"
root: missing os, using the default linux
root: missing language, using the default ruby
It would be useful to know why the job log shows that Ruby is not finding the gemfile. Thanks again.
05/diagrams.xml is missing content and it is empty.
Running a bunch locally as a development stage will get you to an error in a client
WebSocketClient.js:16 WebSocket connection to 'ws://localhost:3000/ws' failed:
Stephen had a slightly different error which he tackled with NGNIX config. It won't be your case.
Basically, add the environment variable to the client service in your docker-compose-dev.yml
environment:
- WDS_SOCKET_PORT=0
If you're going to run it, execute to commands, the first one would wipe out your all unnecessary containers and images.
docker system prune -a
docker-compose -f docker-compose-dev.yml up
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.