Skip to content

Instantly share code, notes, and snippets.

View jovemfelix's full-sized avatar

RENATO ALVES FELIX jovemfelix

View GitHub Profile

Get Credentials

HOST

❯ REDIS_HOSTS=$(oc -n iib-3scale-apim extract secret/backend-redis --keys=REDIS_STORAGE_SENTINEL_HOSTS --to=-)
# REDIS_STORAGE_SENTINEL_HOSTSecho $REDIS_HOSTS
redis://redis-storage-01.hm.example.com.br:26379,redis://redis-storage-02.hm.example.com.br:26379,redis://redis-storage-03.hm.example.com.br:26379
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<offline>false</offline>
<proxies>
<!-- ### configured http proxy ### -->
</proxies>
---
# https://access.redhat.com/solutions/3771241
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
namespace: curl
spec:
replicas: 1
selector:
$ oc -n openshift-ingress exec $(oc get pod -n openshift-ingress -l ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default -oname) -- haproxy -vv
Defaulted container "router" out of: router, logs
HA-Proxy version 2.2.19-7ea3822 2021/11/29 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2 2025.
Known bugs: http://www.haproxy.org/bugs/bugs-2.2.19.html
Running on: Linux 4.18.0-305.49.1.el8_4.x86_64 #1 SMP Wed May 11 09:47:48 EDT 2022 x86_64
Build options :
TARGET = linux-glibc
CPU = generic
$ oc get machinesets -n openshift-machine-api -o jsonpath='{"name"}{"\t"}{"REPLICAS"}{"\t"}{"CPU"}{"\t"}{"MEMORY"}{"\t"}{"DISK"}{"\n"}{range .items[*]}{"\n"}{.metadata.name}{"\t"}{.spec.replicas}{"\t"}{.spec.template.spec.providerSpec.value.numCPUs}{"\t"}{.spec.template.spec.providerSpec.value.memoryMiB}{"\t"}{.spec.template.spec.providerSpec.value.diskGiB}{end}{"\n"}'
NAME REPLICAS CPU MEMORY DISK
test-abc-a 8 8 16512 120
test-abc-b 2 8 16512 120
test-abc-c 15 8 16512 120
test-abc-d 5 8 16512 120

Requirements

  • be logged in and has RBAC to edit
  • Installation using default
  • Optional

View your configurations before

List your IngressController

$ export GRAFANA_NS=rfelix-grafana

$ oc project $GRAFANA_NS
$ oc get csv -n $GRAFANA_NS
APICAST_NS=rfelix-apicast-demo
ADMIN_NS=iib-3scale-apim

APICAST_NAME=demo-apicast-staging

ACCESS_TOKEN="676c89e4da74d32d211dbb5b12d18a1f4bc6ff796ef737f60a75219b45c91240"
BASE_URL=$(oc whoami --show-console | awk -F. '{sub($1 FS, ".")}1')
ADMIN_URL="3scale-admin${BASE_URL}"
APICAST_SECRET_NAME=apicast-secret

VARIABLES

export OADP_NS=velero
export DATA_NS=rfelix-w-1
export STORAGE_CN=ocs-storagecluster-cephfs

export CLOUD_S3_CREDENTIAL_NAME=cloud-credentials
export CLOUD_S3_CREDENTIAL_KEY=cloud
export CLOUD_S3_API_PROFILE=default

lua code

$ cat <<EOF > custom-body-size-env.lua
io.output("/opt/app-root/src/apicast.d/body_size.conf")
io.write("client_body_buffer_size    2m;\n", "client_max_body_size    2m;\n")
io.close()
EOF

secret with LUA