axelrodvl / booking

Full-stack booking service with FE and BE on Kubernetes
0 stars 0 forks source link

The most common kubectl commands

Connecting to PostgreSQL using Port-Forwarding

This guide provides step-by-step instructions on how to connect to PostgreSQL using port-forwarding. Port-forwarding allows you to access a PostgreSQL database running on a remote server from your local machine.

Steps

  1. Open a terminal or command prompt on your local machine.

  2. Set up port-forwarding to forward traffic from a local port to the PostgreSQL database port on the remote server. Use the following command:

    kubectl port-forward --namespace default svc/postgresql 5432:5432 &

  3. Open your PostgreSQL client (e.g., DBeaver) on your local machine.

  4. Configure the PostgreSQL client connection with the following details:

    Host: localhost or 127.0.0.1 Port: 5432 Database: "booking" User: "postgres" Password: "postgres"

  5. Click "Connect" or a similar button to establish the connection to the PostgreSQL database.

  6. You should now be connected to the PostgreSQL database running on the remote server through port-forwarding.

Booking service from scratch

Technologies

User Story As I want To do

Как администратор Я хочу доступ на чтение бронирований клиента Чтобы просматривать бронирования и отменять их при необходи

Booking

  1. fe-client -> booking-service
    1. BookingRequest
      • property
      • dateFrom
      • dateTo
      • cardId
  2. booking-service
    • property-service.isAvailable(propertyId)
    • guest-service.getGuest(token.guestId)
    • property-service.setUnavailable(property, dateFrom, dateTo)
    • guest-service.addBooking(property, dateFrom, dateTo, totalPrice, BookingStatus.RESERVED)
    • payment-service.chargeCard(cardId, amount)
    • guest-service.setBookingStatus(booking, BookingStatus.PAID)