https://github.com/zhangjingqiang/timecard
https://github.com/zhangjingqiang/timecard
ansible aws docker-compose elasticsearch filebeat gcp go kubernetes kustomize logstash mongodb postgres python rabbitmq react redis terraform
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zhangjingqiang/timecard
- Owner: zhangjingqiang
- Created: 2021-06-06T05:40:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-27T14:47:05.000Z (over 1 year ago)
- Last Synced: 2025-07-07T17:49:24.500Z (12 months ago)
- Topics: ansible, aws, docker-compose, elasticsearch, filebeat, gcp, go, kubernetes, kustomize, logstash, mongodb, postgres, python, rabbitmq, react, redis, terraform
- Language: HCL
- Homepage:
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Timecard
## Stack
- Kubernetes
- Kustomize
- AWS
- GCP
- Nginx
- Python
- Go
- React
- PostgreSQL
- Redis
- MongoDB
- RabbitMQ
- Elasticsearch
- Logstash
- Filebeat
- Docker
- Docker Compose
- Ansible
- Terraform
## Development
```
$ make run
$ make init_db
$ make exec_db
```
### Check data in Redis
```
$ docker exec -it timecard-redis-1 /bin/bash
# redis-cli -h 127.0.0.1 -p 6379 -a 12345
127.0.0.1:6379> KEYS *
127.0.0.1:6379> GET date
```
### Check data in MongoDB
```
$ docker exec -it timecard-mongodb-1 mongosh -u mongo -p 12345
test> show dbs
test> use timecard
switched to db timecard
timecard> show collections
timecard
timecard> db.timecard.find().pretty()
```
### Check data in Elasticsearch
```
$ docker exec -it timecard-elasticsearch-1 /bin/bash
$ curl -u elastic:12345 localhost:9200/timecard/_search
```
### Check data in RabbitMQ
```
$ docker exec -it timecard-rabbitmq-1 /bin/bash
# rabbitmqadmin list queues -u rabbitmquser -p 12345
# rabbitmqadmin get queue=timecard -u rabbitmquser -p 12345
```
## Kubernetes
```
$ kubectl create secret generic appkey --from-file [PATH_TO_DIRECTORY]
$ kubectl apply -k k8s/kustomize
```
## Logging
```
# Staging
$ kustomize build ./k8s/kustomize/logging/staging | kubectl apply -f -
# Production
$ kustomize build ./k8s/kustomize/logging/production | kubectl apply -f -
```
## Ansible
```
$ cd ansible
# Staging
$ ansible-playbook -i inventories/staging/hosts --extra-vars "foo=bar" --ask-vault-pass site.yml
# Production
$ ansible-playbook -i inventories/production/hosts --extra-vars "foo=bar" --ask-vault-pass site.yml
```
## Terraform
```
$ cd terraform/{aws|gcp}
# Staging
$ cd staging
$ terraform init
$ terraform plan
$ terraform apply
# Production
$ cd production
$ terraform init
$ terraform plan
$ terraform apply
```
## License
MIT