Skip to content

Commit

Permalink
feat: add images
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsm-dev committed Feb 22, 2023
1 parent e9f15b3 commit cae422a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 deletions.
Binary file added .github/assets/k9s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/security.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ or
docker logs --tail 1000 crypto-miner
```

Click [here](https://github.com/lpmatos/docker-crypto-miner/pkgs/container/docker-crypto-miner/versions) to see available image tags.
Click [here](https://github.com/ci-monk/docker-crypto-miner/pkgs/container/docker-crypto-miner/versions) to see available image tags.

## ➤ Kubernetes <a name = "kubernetes"></a>

<div align="center">

<img alt="gif-about" src=".github/assets/k9s.png" width="450"/>

</div>

## ➤ Concepts <a name = "concepts"></a>

Expand Down Expand Up @@ -116,7 +124,7 @@ The cpulimit is a tool that allow us to limit CPU usage per process. It gives us

<div align="center">

<img alt="gif-about" src="https://documents.trendmicro.com/images/TEx/articles/Docker%20Infection%20Chain-01.jpg" width="450"/>
<img alt="gif-about" src=".github/assets/security.jpg" width="450"/>

</div>

Expand Down
7 changes: 6 additions & 1 deletion infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ Kubernetes is an open-source container orchestration platform designed to automa
Helm is a tool that streamlines installing and managing Kubernetes applications. Think of it like Apt/Yum/Homebrew for K8S.

```bash
docker build -t xmrig:main .
kind load docker-image xmrig:main
helm upgrade -i xmrig . --create-namespace -n xmrig -f values.yaml
kubectl get ns
kubectl get pod -n xmrig
k9s
```

### Kind
Expand All @@ -30,5 +35,5 @@ Kind is a tool for running local Kubernetes clusters using Docker container “n

```bash
kind create cluster --config kind.yaml
kind delete cluster --config kind.yaml
kind delete cluster
```
10 changes: 5 additions & 5 deletions infra/kubernetes/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 3

image:
repository: ghcr.io/ci-monk/docker-xmrig-miner
repository: xmrig
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "main"
Expand Down Expand Up @@ -33,11 +33,11 @@ resources:
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
limits:
cpu: 2000m
memory: 2Gi
requests:
cpu: 100m
memory: 1Gi
memory: 252Mi
requests:
cpu: 10m
memory: 128Mi

autoscaling:
enabled: false
Expand Down
45 changes: 20 additions & 25 deletions src/xmrig/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,30 +117,25 @@ Welcome() {

echo "$HEADER" && Welcome

#!/bin/bash
if [ -f /.dockerenv ]; then
Status "✨ Config miner"

sed -i "s/MINING_POOL/$MINING_POOL/g" "$XMRIG_CONFIG_FILE"
sed -i "s/MINING_COIN/$MINING_COIN/g" "$XMRIG_CONFIG_FILE"
sed -i "s/WALLET_ADDRESS/$WALLET_ADDRESS/g" "$XMRIG_CONFIG_FILE"
sed -i "s/WORKER_NAME/$WORKER_NAME/g" "$XMRIG_CONFIG_FILE"
sed -i "s/REFERRAL_CODE/$REFERRAL_CODE/g" "$XMRIG_CONFIG_FILE"

if [[ "$MINING_AUTO_CONFIG" == "true" ]]; then
Status "✨ Starting miner with config"
xmrig -c "$XMRIG_CONFIG_FILE" $@ & sleep 3
else
Status "✨ Starting miner with cli params"
xmrig -o "$MINING_POOL" -a rx -k -u "$MINING_COIN:$WALLET_ADDRESS.$WORKER_NAME#$REFERRAL_CODE" -p x & sleep 3
fi

if [[ "$CPU_LIMIT_ENABLE" == "true" ]]; then
Status "✨ Enable CPU Limit"
cpulimit -l $CPU_LIMIT -p $(pidof xmrig) -z
else
Status "✨ Disable CPU Limit"
fi
Status "✨ Config miner"

sed -i "s/MINING_POOL/$MINING_POOL/g" "$XMRIG_CONFIG_FILE"
sed -i "s/MINING_COIN/$MINING_COIN/g" "$XMRIG_CONFIG_FILE"
sed -i "s/WALLET_ADDRESS/$WALLET_ADDRESS/g" "$XMRIG_CONFIG_FILE"
sed -i "s/WORKER_NAME/$WORKER_NAME/g" "$XMRIG_CONFIG_FILE"
sed -i "s/REFERRAL_CODE/$REFERRAL_CODE/g" "$XMRIG_CONFIG_FILE"

if [[ "$MINING_AUTO_CONFIG" == "true" ]]; then
Status "✨ Starting miner with config"
xmrig -c "$XMRIG_CONFIG_FILE" $@ & sleep 3
else
Status "✨ Starting miner with cli params"
xmrig -o "$MINING_POOL" -a rx -k -u "$MINING_COIN:$WALLET_ADDRESS.$WORKER_NAME#$REFERRAL_CODE" -p x & sleep 3
fi

if [[ "$CPU_LIMIT_ENABLE" == "true" ]]; then
Status "✨ Enable CPU Limit"
cpulimit -l $CPU_LIMIT -p $(pidof xmrig) -z
else
Status "I'm living in real world!";
Status "Disable CPU Limit"
fi

0 comments on commit cae422a

Please sign in to comment.