diff --git a/devops/README.md b/devops/README.md index 12bfeb78..5823b949 100644 --- a/devops/README.md +++ b/devops/README.md @@ -28,13 +28,12 @@ The current proxy implementation is Caddy. Read more about Caddy [here](https:// Deploy the Loki Logstack using the following command: ```bash -helm template bcwallet ./devops/charts/loki-logstack -f ./devops/charts/loki-logstack/values_test.yaml \ ---set-string namespace=ca7123-test \ +helm install bcwallet ./devops/charts/loki-logstack -f ./devops/charts/loki-logstack/values_dev.yaml \ +--set-string namespace=ca7123-dev \ --set-string minio_access_key=$MINIO_ACCESS_KEY \ --set-string minio_secret_key=$MINIO_SECRET_KEY \ --set-string proxyUserName=$PROXY_USER_NAME \ ---set-string proxyPassword=$(htpasswd -nbB $PROXY_USER_NAME $PROXY_PASSWORD| awk -F: '{ print $2 }'|tr -d '[:space:]'|base64)| \ -oc apply -n ca7123-test -f - +--set-string proxyPassword=$(htpasswd -nbB $PROXY_USER_NAME $PROXY_PASSWORD| awk -F: '{ print $2 }'|tr -d '[:space:]'|base64) ``` The parameters passed in via the `--set-string` argument for this command are as follows: @@ -47,6 +46,10 @@ The parameters passed in via the `--set-string` argument for this command are as | minio_access_key | The access key associated with Minio | | minio_secret_key | The secret key associated with Minio | +**Pro Tip 🤓** + +- Use `openssl rand -hex 8` to generate a random password. The number `8` can be changed to any number to generate a password of that length. i.e `MINIO_SECRET_KEY=$(openssl rand -hex 16)` will generate a 16 character password. + Once deployed there will be several pods running, depending on your replication count, that can be verified with the following command: ```console @@ -98,5 +101,5 @@ Get and updated timestamp: Send a sample log with the updated timestamp: ```bash -curl -v -H "Content-Type: application/json" -H "Authorization: Basic Base64-Encoded-USERNAME:PASSWORD" -X POST "https://bcwallet-logstack-proxy-ca7123-test.apps.silver.devops.gov.bc.ca/loki/api/v1/push" --data-raw '{"streams":[{"stream":{"job":"react-native-logs","level":"debug","application":"bc wallet","version":"1.0.1-444","system":"iOS v16.7.4","session_id":"463217"},"values":[["1713486470448000000","{\"message\":\"Successfully connected to WebSocket wss://aries-mediator-agent.vonx.io\"}"]]}]}' +curl -v -H "Content-Type: application/json" -H "Authorization: Basic Base64-Encoded-USERNAME:PASSWORD" -X POST "https://bcwallet-logstack-proxy-caZZZZ-dev.apps.silver.devops.gov.bc.ca/loki/api/v1/push" --data-raw '{"streams":[{"stream":{"job":"react-native-logs","level":"debug","application":"bc wallet","version":"1.0.1-444","system":"iOS v16.7.4","session_id":"463217"},"values":[["1734028898448000000","{\"message\":\"Successfully connected to WebSocket wss://aries-mediator-agent.blah.gov.bc.ca\"}"]]}]}' ``` diff --git a/devops/charts/loki-logstack/templates/configmap.yaml b/devops/charts/loki-logstack/templates/configmap.yaml index 3a0d099d..5fd74ddf 100644 --- a/devops/charts/loki-logstack/templates/configmap.yaml +++ b/devops/charts/loki-logstack/templates/configmap.yaml @@ -24,7 +24,7 @@ data: bind_port: 7946 abort_if_cluster_join_fails: true join_members: - - bcwallet-logstack-loki-memberlist.ca7f8f-test.svc.cluster.local:7946 + - bcwallet-logstack-loki-memberlist.{{ $.Values.namespace }}.svc.cluster.local:7946 ingester: lifecycler: diff --git a/devops/charts/loki-logstack/values_dev.yaml b/devops/charts/loki-logstack/values_dev.yaml index 3053e14e..5ba030d9 100644 --- a/devops/charts/loki-logstack/values_dev.yaml +++ b/devops/charts/loki-logstack/values_dev.yaml @@ -65,10 +65,10 @@ resources: memory: 32Mi minio: requests: - memory: 34Mi + memory: 128Mi cpu: 20m limits: - memory: 64Mi + memory: 128Mi cpu: 40m services: