Code Monkey home page Code Monkey logo

dockercasts's Introduction

DockerCasts

Companion repo to a course on Udemy.com

dockercasts's People

Contributors

stephengrider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockercasts's Issues

postgres password variable name is in correct

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.

complex k8s - server deployment throwing Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 }

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).

Error when trying deploying app to Google Cloud Kubernetes

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

Dockerfile in client - important nuance! If you see an nginx web page instead of React App

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.

86 Automated Deployments

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!

81 A Touch More Travis Setup

Well, I wonder why Stephen doesn't update changes in his courses.

  1. It must be said Travis requires your a banking card credentials.
  2. Travis gives you 10000 points. Running one job costs you around 54 points or 80 points if it counts only those jobs which are passed. I don't know.
  3. Travis assumes all your projects are relevant for an inspection. There is no need to add a project. The difference is if you created a Travis account, it imported all your GitHub's repos and then you create a new one. I had to wait for five minutes to get an update on Travis which is quite long. It will however react on those repos including .travis.yml file.
  4. The main point of my message is you won't get exit code (0) in Travis. It's no longer relevant. Your tests will hang for 10 minutes than Travis will interrupt the process throwing an error.

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.

Diagrams for Section 5 are missing

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.

mem_limit in docker-compose.yml

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.

Ch 7: "No Gemfile found skipping bundle install" and other errors

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.

WebSocketClient.js:16 WebSocket connection to 'ws://localhost:3000/ws' failed:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.