echo "install haproxy and keepalived service"
apt install -y haproxy keepalived
echo "copy and move haproxy config"
cat /etc/haproxy/haproxy.cfg
cat <<EOT >> /etc/haproxy/haproxy.cfg
listen Stats-Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xue | |
OLD_CONFIG=$(docker service inspect service_name | jq .[].Spec.TaskTemplate.ContainerSpec.Configs[].ConfigName) | |
OLD_VERSION=${OLD_CONFIG: -2:-1} | |
NEW_VERSION=$((OLD_VERSION + 1)) | |
NEW_CONFIG=$(echo "$OLD_CONFIG" | sed "s/$OLD_VERSION/$NEW_VERSION/") | |
echo "NEW_CONFIG: $NEW_CONFIG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream backend { | |
server echo01:5678; | |
} | |
upstream test_backend { | |
server echo02:5678; | |
} | |
server { | |
server_name 192.168.0.100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
caddy: | |
image: docker.arvancloud.ir/caddy:2.8-alpine | |
restart: unless-stopped | |
command: caddy reverse-proxy --access-log --from https://git.domain.com:443 --to http://opengist:6157 { metrics /metrics } | |
ports: | |
- "80:80" | |
- "443:443" | |
- "443:443/udp" | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
# caddy: | |
# image: docker.arvancloud.ir/caddy:2.8-alpine | |
# restart: unless-stopped | |
# command: caddy reverse-proxy --access-log --from https://domain:443 --to http://jumper:6157 | |
# ports: | |
# - "80:80" | |
# - "443:443" | |
# - "443:443/udp" | |
# volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: CronJob | |
metadata: | |
name: minio-cleanup | |
namespace: devops-storage | |
spec: | |
schedule: "0 * * * *" | |
jobTemplate: | |
spec: | |
template: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
cadvisor: | |
image: gcr.io/cadvisor/cadvisor:v0.49.1 | |
container_name: cadvisor | |
command: --disable_metrics=disk,udp,percpu | |
restart: unless-stopped | |
privileged: true | |
ports: | |
- "9102:8080" | |
volumes: |
# create bucket
mc mb ALIAS/BUCKETNAME
# create user
mc admin user add ALIAS USERNAME SECRET-KEY
{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
caddy: | |
image: caddy:2.6.4 | |
restart: unless-stopped | |
command: caddy reverse-proxy --from https://hc.monkeyseemonkeydo.lv:443 --to http://web:8000 | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: | |
- caddy:/data |
NewerOlder