Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend developer #33

Open
wants to merge 45 commits into
base: angular
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
07fc4ac
Merge pull request #5 from wkrzywiec/angular
wkrzywiec Aug 26, 2019
5175aa1
README - project description
wkrzywiec Aug 27, 2019
7d11b64
README - services descriptions
wkrzywiec Aug 27, 2019
7686974
README - github
wkrzywiec Aug 27, 2019
8a1ef8c
Kanban gif
wkrzywiec Aug 28, 2019
be6a9ea
gif URL
wkrzywiec Aug 28, 2019
99d794d
Create new kanban
wkrzywiec Aug 28, 2019
372340f
remove kanban-postgres folder
wkrzywiec Aug 30, 2019
b2448f6
Add link to blog post
wkrzywiec Aug 31, 2019
eb44944
kanban-app Service test
wkrzywiec Sep 6, 2019
bb48a51
ITCase added to test classes
wkrzywiec Sep 7, 2019
350a122
change config for integration-test of KanbanService
wkrzywiec Sep 7, 2019
3d68e80
Merge branch 'master' of https://github.com/wkrzywiec/kanban-board
wkrzywiec Sep 7, 2019
4bf21ed
KanbanService unit test
wkrzywiec Sep 7, 2019
49ea281
jacoco-maven-plugin
wkrzywiec Sep 7, 2019
0894aa2
integration tests moved to separate folder
wkrzywiec Sep 9, 2019
29533a2
run integration-test with mvn install
wkrzywiec Sep 9, 2019
5d9070f
pom updated
wkrzywiec Sep 10, 2019
bc1f039
sonar exclusions packages
wkrzywiec Sep 15, 2019
6640309
#6 fix database env variables
wkrzywiec Nov 3, 2019
abca9a4
#6 jdbc.lob.non_contextual_creation
wkrzywiec Nov 4, 2019
57269ca
KANBAN_APP_URL added
wkrzywiec Mar 26, 2020
f14d37e
dependency versioning
wkrzywiec Mar 27, 2020
f004649
docker-compose networking
wkrzywiec Mar 30, 2020
9d10eed
add default context path
wkrzywiec Mar 31, 2020
641f0f6
Correct README
wkrzywiec Mar 31, 2020
cd33b2d
Merge pull request #9 from wkrzywiec/linkt-to-backend-as-env-variables
wkrzywiec Mar 31, 2020
eb2ac21
get db connectors from env variables
wkrzywiec Apr 5, 2020
8372c6f
Merge pull request #10 from wkrzywiec/linkt-to-backend-as-env-variables
wkrzywiec Apr 5, 2020
24de509
remove es5BrowserSupport option
wkrzywiec Apr 29, 2020
71c7dcd
Update README.md
ramazansakin Sep 16, 2020
efcf605
after adding new Kanban & Task, ui reload problem fixed
Sep 16, 2020
571e7fa
No need to add @Column annotation when its name is the same with tabl…
ramazansakin Sep 16, 2020
d5cbe1b
Merge pull request #20 from ramazansakin/master
wkrzywiec Sep 16, 2020
0a5fa34
Rename README.md to docker-compose-README.md
jkirkham-ratehub Jul 12, 2021
692b94d
Create ReadMe file for demo exercise
jkirkham-ratehub Jul 12, 2021
79f02bd
Update README.md
jkirkham-ratehub Jul 12, 2021
b14ca21
Update README.md
jkirkham-ratehub Jul 12, 2021
1def114
Update README.md
jkirkham-ratehub Jul 19, 2021
bb00002
Update README.md
jkirkham-ratehub Jul 19, 2021
6064d7c
Update README.md
jkirkham-ratehub Jul 22, 2021
c0e2af5
assessment done
Jul 26, 2021
23c790b
Update Solution.md
Saiprasanna-bit Jul 26, 2021
b5c3ae5
Update values.yaml
Saiprasanna-bit Jul 26, 2021
e39e8c1
Update .gitignore
Saiprasanna-bit Oct 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: docker login
env:
DOCKER_USER: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USER --password-stdin
- name: Build the kanban-app Docker image
run: cd kanban-app && docker build . --file Dockerfile --tag lakshmi1995/kanban-app:v${{ github.run_id }}
- name: Build the kanban-ui Docker image
run: cd kanban-ui && docker build . --file Dockerfile --tag lakshmi1995/kanban-ui:v${{ github.run_id }}
- name: Docker Push kanban-ui
run: docker push lakshmi1995/kanban-ui:v${{ github.run_id }}
- name: Docker Push kanban-app
run: docker push lakshmi1995/kanban-app:v${{ github.run_id }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
.idea
Welcome back to git
10 changes: 10 additions & 0 deletions Charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: postgresql
version: 0.11.1
description: Object-relational database management system (ORDBMS) with an emphasis
on extensibility and on standards-compliance.
engine: gotpl
home: https://www.postgresql.org/

keywords:
- postgresql
- postgres
187 changes: 187 additions & 0 deletions Charts/files/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#!/usr/bin/env bash
set -e

if [ "$1" = 'postgres' ]; then
[[ ${POD_NAME} =~ -([0-9]+)$ ]] || exit 1
ordinal=${BASH_REMATCH[1]}
if [ $STATEFUL_TYPE == "master" ]; then
node_id=$((${ordinal} + 1))
service=${MASTER_SERVICE}
else
node_id=$((${ordinal} + 100))
service=${POD_NAME}
fi

sed \
-e "s|^#cluster=.*$|cluster=default|" \
-e "s|^#node=.*$|node=${node_id}|" \
-e "s|^#node_name=.*$|node_name=${POD_NAME}|" \
-e "s|^#conninfo=.*$|conninfo='host=${service} dbname=repmgr user=repmgr password=${REPMGR_PASSWORD} application_name=repmgrd'|" \
-e "s|^#use_replication_slots=.*$|use_replication_slots=1|" \
/etc/repmgr.conf.tpl > /etc/repmgr.conf

if [ ! -s "${PGDATA}/PG_VERSION" ]; then
if [ ${STATEFUL_TYPE} == "master" ]; then
docker-entrypoint.sh "$@" --boot

sed -i \
-e "s|^listen_addresses = .*|listen_addresses = '*'|" \
-e "s|^#hot_standby = .*|hot_standby = on|" \
-e "s|^#wal_level = .*|wal_level = hot_standby|" \
-e "s|^#max_wal_senders = .*|max_wal_senders = 10|" \
-e "s|^#max_replication_slots = .*|max_replication_slots = 10|" \
-e "s|^#archive_mode = .*|archive_mode = on|" \
-e "s|^#archive_command = .*|archive_command = '/bin/true'|" \
-e "s|^#shared_preload_libraries = .*|shared_preload_libraries = 'repmgr_funcs'|" \
${PGDATA}/postgresql.conf

host_type="host"
options=""

if [ -f "/certs/server.key" ]; then
host_type="hostssl"

if [ -f "/certs/postgresql.key" ]; then
options="clientcert=1"
fi

# Server Certificate
cp -f /certs/{server,root}.* ${PGDATA}/
chown postgres:postgres ${PGDATA}/{root,server}.*
chmod -R 0600 ${PGDATA}/{root,server}.*

# Client Certificate
mkdir -p /home/postgres/.postgresql/
cp -f /certs/{postgresql,root}.* /home/postgres/.postgresql/
chown -R postgres:postgres /home/postgres
chmod -R 0600 /home/postgres/.postgresql/*

sed -i \
-e "s|^#ssl = .*|ssl = on|" \
-e "s|^#ssl_ciphers = .*|ssl_ciphers = 'HIGH'|" \
-e "s|^#ssl_cert_file = .*|ssl_cert_file = 'server.crt'|" \
-e "s|^#ssl_key_file = .*|ssl_key_file = 'server.key'|" \
-e "s|^#ssl_ca_file = .*|ssl_ca_file = 'root.crt'|" \
-e "s|^#ssl_crl_file = .*|ssl_crl_file = 'root.crl'|" \
${PGDATA}/postgresql.conf

sed -i \
-E "s|^host([ \\t]+all){3}.*|hostnossl all all all reject\n${host_type} all all all md5 ${options}|" \
${PGDATA}/pg_hba.conf
fi

cat >> ${PGDATA}/pg_hba.conf <<-EOF

# repmgr
${host_type} repmgr repmgr all md5 ${options}
${host_type} replication repmgr all md5 ${options}
EOF

gosu postgres pg_ctl start -w

gosu postgres psql <<-EOF
CREATE USER repmgr SUPERUSER LOGIN ENCRYPTED PASSWORD '${REPMGR_PASSWORD}';
CREATE DATABASE repmgr OWNER repmgr;
EOF

while ! gosu postgres pg_isready --host ${MASTER_SERVICE} --quiet
do
sleep 1
done

gosu postgres repmgr master register

gosu postgres psql -U repmgr -d repmgr <<-EOF
ALTER TABLE repmgr_default.repl_monitor SET UNLOGGED;
EOF
else
while ! gosu postgres pg_isready --host ${MASTER_SERVICE} --quiet
do
sleep 1
done

mkdir -p "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

if [ -f "/certs/root.crt" ]; then
# Client Certificate
mkdir -p /home/postgres/.postgresql/
cp -f /certs/{postgresql,root}.* /home/postgres/.postgresql/
chown -R postgres:postgres /home/postgres
chmod -R 0600 /home/postgres/.postgresql/*
fi

gosu postgres repmgr \
--dbname="host=${MASTER_SERVICE} dbname=repmgr user=repmgr password=${REPMGR_PASSWORD}" \
standby clone

if [ -f "/certs/server.crt" ]; then
# Server Certificate
cp -f /certs/{server,root}.* ${PGDATA}/
chown postgres:postgres ${PGDATA}/{root,server}.*
chmod -R 0600 ${PGDATA}/{root,server}.*
fi

gosu postgres pg_ctl -w start

while ! pg_isready --host 127.0.0.1 --quiet
do
sleep 1
done

gosu postgres repmgr standby register
fi

gosu postgres pg_ctl -w stop
exit 0
else
if [ -f "/certs/server.key" ]; then
# Server Certificate
cp -f /certs/{server,root}.* ${PGDATA}/
chown postgres:postgres ${PGDATA}/{root,server}.*
chmod -R 0600 ${PGDATA}/{root,server}.*
fi

if [ -f "/certs/root.crt" ]; then
# Client Certificate
mkdir -p /home/postgres/.postgresql/
cp -f /certs/{postgresql,root}.* /home/postgres/.postgresql/
chown -R postgres:postgres /home/postgres
chmod -R 0600 /home/postgres/.postgresql/*
fi
fi

exec docker-entrypoint.sh "$@" & pid=$!

while ! gosu postgres pg_isready --host ${service} --quiet
do
sleep 1
done

supervisorctl start repmgrd

wait ${pid}
exit 0
fi

if [ "$1" = 'repmgrd' ] && [ "$(id -u)" = '0' ]; then
exec gosu postgres "$@"
fi

if [ "$1" = 'cleanup' ]; then
if [ ${STATEFUL_TYPE} == "master" ]; then
while true
do
sleep 3600

if pg_isready --host 127.0.0.1 --quiet; then
gosu postgres repmgr --keep-history=1 cluster cleanup || true
fi
done
fi

exit 0
fi

exec "$@"
29 changes: 29 additions & 0 deletions Charts/files/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[supervisord]
nodaemon=true

[program:postgres]
autorestart=true
command=bash entrypoint.sh postgres
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0

[program:repmgrd]
autostart=false
autorestart=true
startretries=999
command=bash entrypoint.sh repmgrd --monitoring-history
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0

[program:cleanup]
autorestart=false
startsecs=0
command=bash entrypoint.sh cleanup
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
95 changes: 95 additions & 0 deletions Charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "postgresql.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "postgresql.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified master name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "postgresql.master.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.postgres.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{/*
Overridable deployment annotations
*/}}
{{- define "postgresql.deploymentAnnotations" }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- end -}}

{{/*
Return the appropriate apiVersion for networkpolicy.
*/}}
{{- define "postgresql.networkPolicy.apiVersion" -}}
{{- if and (ge .Capabilities.KubeVersion.Minor "4") (le .Capabilities.KubeVersion.Minor "6") -}}
"extensions/v1beta1"
{{- else if ge .Capabilities.KubeVersion.Minor "7" -}}
"networking.k8s.io/v1"
{{- end -}}
{{- end -}}

{{- define "postgresql.environment" }}
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: MASTER_SERVICE
value: {{ template "postgresql.master.fullname" . }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- $fullname := (include "postgresql.fullname" .) -}}
{{- range tuple "POSTGRES_DB" "POSTGRES_USER" "POSTGRES_PASSWORD" "POSTGRES_INITDB_ARGS" }}
- name: {{ . }}
valueFrom:
secretKeyRef:
name: {{ $fullname }}
key: {{ . }}
{{- end }}
- name: PGUSER
valueFrom:
secretKeyRef:
name: {{ $fullname }}
key: POSTGRES_USER
{{- end -}}

{{- define "postgresql.volumes" }}
- name: config-volume
configMap:
name: {{ template "postgresql.fullname" . }}
- name: secret-volume
secret:
secretName: {{ template "postgresql.fullname" . }}
{{- end -}}

{{- define "postgresql.volumeMounts" }}
- name: data
mountPath: /var/lib/postgresql/data
subPath: pgdata
- name: config-volume
mountPath: /etc/supervisor/conf.d/supervisord.conf
subPath: supervisord.conf
readOnly: true
- name: config-volume
mountPath: /usr/local/bin/entrypoint.sh
subPath: entrypoint.sh
{{- end }}
15 changes: 15 additions & 0 deletions Charts/templates/app-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.kanban_app.fullname }}
labels:
app.kubernetes.io/name: {{ .Values.kanban_app.fullname }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.kanban_app.serviceType }}
selector:
app: {{ .Values.kanban_app.fullname }}
ports:
- port: 8080
targetPort: 8080
17 changes: 17 additions & 0 deletions Charts/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "postgresql.fullname" . }}
labels:
app: {{ template "postgresql.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "postgresql.fullname" . }}-configmap
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
{{- range $key, $value := merge .Values.configs ((.Files.Glob "files/*").AsConfig | fromYaml) }}
{{ $key }}: |-
{{ $value | indent 4 }}
{{- end }}
Loading