kubectl exec --stdin --tty [POD_NAME] -- /bin/bash
quarkus-operator-sdk 備忘録
- Go operator-sdk をインストールする時は v1.32.0 (See https://github.com/operator-framework/operator-sdk/issues/6645) (as of 2024/03/29)
-> https://github.com/tkobayas/operator-examples/tree/main/echo-operator
minikube delete minikube start minikube addons enable ingress mvn clean compile mvn quarkus:dev kubectl apply -f src/test/resources/cr-test-echo-resource.yaml kubectl get crd kubectl describe crd echoresources.example.example.com kubectl get echoresources
devじゃない場合
minikube delete minikube start minikube addons enable ingress kubectl apply -f ./samples/exposedapp/target/bundle/quarkus-operator-sdk-samples-exposedapp/manifests/exposedapps.halkyon.io-v1.crd.yml mvn clean package java -jar target/quarkus-app/quarkus-run.jar kubectl apply -f ./samples/exposedapp/src/main/resources/app.yml <quarkus> 2024-04-02 16:04:07,937 INFO [io.hal.ExposedAppReconciler] (ReconcilerExecutor-exposedapp-52) App hello-quarkus is not ready yet, rescheduling reconciliation after 1s のログを繰り返す。最終的に 2024-04-02 16:04:57,948 INFO [io.hal.ExposedAppReconciler] (ReconcilerExecutor-exposedapp-60) App hello-quarkus is exposed and ready to be used at https://192.168.49.2 kubectl get crd kubectl describe crd echoresources.example.example.com kubectl get echoresources
Github Action 備忘録
Windows でエラー
jobs: drools-build: ... strategy: matrix: os: [ubuntu-latest, windows-latest] ... steps: ... - name: Backward Compatibility Test run: | CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) echo "Current version: $CURRENT_VERSION"
Windows だけエラー
The term 'CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
shell: bash
をつければよい。(Windows のデフォルトは PowerShell)
Java Performance tips
Use benchmark!
String.replace("A", "B")
->String.replace('A', 'B')
:char
is fasterString.format("%s.%s", strA, strB)
->StringBuilder.append(strA).append(".").append(strB
) :format
is better for maintenance, butStringBuilder
would be faster for critical path- Avoid
sort
O(n log(n)) as possible - Be careful about Regex
- Avoid long method
logger.debug("value = " + value)
->logger("value = {}", value)
Kafka on Openshift 備忘録
oc exec -it my-cluster-kafka-0 -- bash
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe
bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic my-topic
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my-topic --from-beginning