k8s: update values

This commit is contained in:
openoms
2022-05-05 11:21:17 +01:00
parent 424ccafa58
commit 96f3dd801c
3 changed files with 132 additions and 14 deletions

View File

@@ -35,6 +35,7 @@
- [Secrets](#secrets)
- [create](#create)
- [Decode to view](#decode-to-view)
- [List](#list)
- [Edit](#edit)
- [Debug](#debug)
- [Troubleshooting](#troubleshooting)
@@ -439,6 +440,25 @@ kubectl get secret galoy-price-history-postgres-creds -o jsonpath='{.data.passwo
cat ~/test-secrets/galoy-price-history-postgres-creds/password
```
## List
```
$ kubectl -n test get secret
NAME TYPE DATA AGE
default-token-x5k8f kubernetes.io/service-account-token 3 22h
bitcoind-rpcpassword Opaque 1 22h
network Opaque 1 22h
lnd1-credentials Opaque 11 22h
lnd1-token-lklww kubernetes.io/service-account-token 3 20h
sh.helm.release.v1.lnd1.v1 helm.sh/release.v1 1 20h
lnd1-pass Opaque 1 20h
lnd1-pubkey Opaque 1 22h
galoy-price-history-postgres-creds Opaque 3 20h
gcs-sa-key Opaque 0 19h
galoy-mongodb Opaque 3 19h
dropbox-access-token Opaque 1 19h
lnd2-credentials Opaque 11 63s
```
## Edit
```
kubectl edit secrets
@@ -738,18 +758,36 @@ devDisableMongoBackup: true
helm install galoy -f galoyvalues.yaml galoy-repo/galoy
```
https://learnk8s.io/a/a-visual-guide-on-troubleshooting-kubernetes-deployments/troubleshooting-kubernetes.en_en.v2.pdf
# Galoy with bitcoin and lnd on mainnet
* [galoy.testnet.sh](galoy.testnet.sh)
# Configure with terraform
* https://github.com/GaloyMoney/charts/tree/main/dev
# install terraform
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install terraform
```
```
git clone https://github.com/openoms/charts
cd charts
git checkout -b mikrok8s
cd testnet
direnv allow
terraform init
make deploy-services
make deploy
helm uninstall lnd1 -n galoy-dev-bitcoin
helm uninstall bitcoind -n galoy-dev-bitcoin
helm uninstall monitoring -n galoy-dev-monitoring
helm uninstall cert-manager -n galoy-dev-ingress
helm uninstall opentelemetry-collector -n galoy-dev-otel
helm uninstall ingress-nginx -n galoy-dev-ingress

View File

@@ -66,6 +66,10 @@ bitcoind:
needFirebaseServiceAccount: false
twilio: false
devDisableMongoBackup: true
lnd1:
dns: lnd1.default.svc.cluster.local
lnd2:
dns: lnd1.default.svc.cluster.local
" | tee galoyvalues.yaml
helm install galoy -f galoyvalues.yaml galoy-repo/galoy

View File

@@ -50,7 +50,7 @@ lndmon:
enabled: false
" | tee tlndvalues.yaml
## install
helm install lnd1 -f tlndvalues.yaml --namespace test galoy-repo/lnd --create-namespace
helm install lnd1 -f tlndvalues.yaml --namespace test galoy-repo/lnd --create-namespace
## save seed and unlock password
mkdir -p ~/test-secrets/lnd
@@ -85,23 +85,99 @@ kubectl -n test create secret generic gcs-sa-key
# for galoy-pre-migration-backup-1
kubectl -n test create secret generic dropbox-access-token \
--from-literal=token=''
# kubectl create secret generic geetest-key
# --from-literal=key='dummy' \
# --from-literal=id='dummy'
# Error: secret "geetest-key" not found
kubectl -n test create secret generic geetest-key \
--from-literal=key='dummy' \
--from-literal=id='dummy'
# copy lnd1-credential and pubkey to lnd2
kubectl -n test get secret lnd1-credentials -o yaml | \
sed -r 's/lnd1/lnd2/g' | \
kubectl -n test apply -f -
kubectl -n test get secret lnd1-pubkey -o yaml | \
sed -r 's/lnd1/lnd2/g' | \
kubectl -n test apply -f -
# Error: secret "galoy-apollo-secret" not found
kubectl -n test create secret generic galoy-apollo-secret \
--from-literal=key='test' \
--from-literal=id='test'
# Error: secret "twilio-secret" not found
kubectl -n test create secret generic twilio-secret \
--from-literal=TWILIO_PHONE_NUMBER="" \
--from-literal=TWILIO_ACCOUNT_SID="" \
--from-literal=TWILIO_AUTH_TOKEN=""
cd
# galoy
# https://github.com/GaloyMoney/charts/blob/main/ci/testflight/galoy/testflight-values.yml
# https://github.com/GaloyMoney/charts/blob/main/dev/galoy/galoy-values.yml
# https://github.com/GaloyMoney/charts/blob/main/dev/galoy/main.tf#L196
echo "\
global:
network: testnet
galoy:
name: 'Testnet Wallet'
test_accounts:
- phone: '+59981730222'
code: '111111'
role: 'bankowner'
username: 'bankowner'
apollo:
playground: true
bitcoind:
port: 18332
lnd1:
dns: lnd1-0.test.svc.cluster.local
lnd2:
dns: lnd1-0.test.svc.cluster.local
jwtSecret: 'my_non_secured_secret'
needFirebaseServiceAccount: false
mongodb:
architecture: standalone
volumePermissions:
enabled: true
persistence:
enabled: false
replicaCount: 1
metrics:
enabled: false
initDbScripts: {}
redis:
volumePermissions:
enabled: true
replica:
replicaCount: 1
master:
persistence:
enabled: false
metrics:
enabled: false
mongodbaddress: 'galoy-mongodb'
cron: []
twilio: false
price:
service:
type: NodePort
devDisableMongoBackup: true
dealer_price:
host: dealer-price.test.svc.cluster.local
" | tee tgaloyvalues.yaml
helm install galoy -f tgaloyvalues.yaml -n test galoy-repo/galoy
@@ -123,14 +199,14 @@ if [ "$1" = off ]; then
helm uninstall lnd1 --wait=false
stop_terminated_pods
# delete galoy storage
for i in $(kubectl -n test get pvc | grep galoy | awk '{print $1}' ); do kubectl -n test delete pvc ${i}; done
# delete galoy storage
for i in $(kubectl -n test get pvc | grep galoy | awk '{print $1}' ); do kubectl -n test delete pvc ${i}; done
# in filesystem (skip lnd)
for i in $(sudo ls /var/snap/microk8s/common/default-storage/ | grep test | grep -v lnd ); do sudo rm -rf /var/snap/microk8s/common/default-storage/${i}; done
# in filesystem (skip lnd)
for i in $(sudo ls /var/snap/microk8s/common/default-storage/ | grep test | grep -v lnd ); do sudo rm -rf /var/snap/microk8s/common/default-storage/${i}; done
# delete the manually generated secrets
kubectl -n test delete secret galoy-mongodb
# delete the manually generated secrets
kubectl -n test delete secret galoy-mongodb
fi