Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions to run on Kubernetes in the READMEs #919

Merged
merged 13 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,59 +42,23 @@ function installPrerequisites()
application="${1}"

echo "Installing Strimzi operator"
kubectl apply -f charts/strimzi-on-kubernetes.yaml
kubectl apply -f charts/strimzi-on-kubernetes.yaml --wait --timeout=10m0s

seconds=120
seconds=300
now=$(date +%s)
end=$(($seconds + $now))

echo "Looping for 2 minutes until the 'kafka' CRD is available "
echo "Looping for 5 minutes until the 'kafka' CRD is available "
while [ $now -lt $end ]; do
# It takes a while for the kafka CRD to be ready
sleep 5
echo "Trying to create my-cluster"
kubectl apply -f - <<EOF
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: my-cluster
spec:
kafka:
replicas: 3
listeners:
- name: plain
port: 9092
type: internal
tls: false
storage:
type: ephemeral
zookeeper:
replicas: 3
storage:
type: ephemeral
entityOperator:
topicOperator: {}
EOF
echo "Create a Strimzi instance and testing topic"
kubectl apply -f ./charts/kafka-on-kubernetes.yaml --wait --timeout=10m0s
break
if [ "$?" = "0" ]; then
break
fi
now=$(date +%s)
done

echo "Creating testing topic"
kubectl apply -f - <<EOF
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: testing
labels:
strimzi.io/cluster: my-cluster
spec:
partitions: 3
replicas: 3
EOF

# Wait for the pods to come up
seconds=900
now=$(date +%s)
end=$(($seconds + $now))
Expand Down Expand Up @@ -124,11 +88,6 @@ EOF
# 1 - application name
emmartins marked this conversation as resolved.
Show resolved Hide resolved
function cleanPrerequisites()
{
# TODO There are a few topics created that need cleaning up

kubectl delete kafka my-cluster
kubectl delete subscription amq-streams-subscription
kubectl delete operatorgroup amq-streams-operator-group
kubectl delete deployment amq-streams-cluster-operator-v2.5.0-1
kubectl delete kafkatopic testing
kubectl delete -f ./charts/kafka-on-kubernetes.yaml --wait --timeout=10m0s
kubectl delete -f charts/strimzi-on-kubernetes.yaml --wait --timeout=10m0s
}
6 changes: 5 additions & 1 deletion batch-processing/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
5 changes: 4 additions & 1 deletion bmt/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
endif::[]

ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
//*************************************************
// Product Release content only
//*************************************************
Expand Down
6 changes: 5 additions & 1 deletion cmt/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
5 changes: 4 additions & 1 deletion ee-security/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,7 @@ ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]

ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion ejb-remote/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
4 changes: 4 additions & 0 deletions ejb-timer/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]

=== Using Timer Service within a cluster

Expand Down
5 changes: 4 additions & 1 deletion helloworld-mdb/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]

ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]


== Clustering
Expand Down
6 changes: 5 additions & 1 deletion helloworld-singleton/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion helloworld-ws/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion helloworld/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
4 changes: 4 additions & 0 deletions hibernate/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@ ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
4 changes: 4 additions & 0 deletions jaxrs-client/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion jaxrs-jwt/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,8 @@ ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]

include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion jaxws-ejb/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion jaxws-retail/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
5 changes: 4 additions & 1 deletion jsonp/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
6 changes: 5 additions & 1 deletion kitchensink/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,8 @@ include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+2]
ifndef::ProductRelease,EAPXPRelease[]
include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1]
endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
4 changes: 4 additions & 0 deletions logging/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,7 @@ include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc
endif::[]

include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
8 changes: 6 additions & 2 deletions micrometer/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ The `micrometer` quickstart demonstrates the use of the Micrometer library in {p
:archiveType: war
:archiveName: {artifactId}
:restoreScriptName: restore-configuration.cli
:helm-install-prerequisites: ../micrometer/helm-install-prerequisites.adoc
:helm-install-prerequisites-openshift: ../micrometer/helm-install-prerequisites-openshift.adoc
:helm-install-prerequisites-kubernetes: ../micrometer/helm-install-prerequisites-kubernetes.adoc

== What is it?

Expand Down Expand Up @@ -272,7 +273,10 @@ endif::[]
include::../shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc[leveloffset=+1]
// OpenShift
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]

ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]
== Conclusion

Micrometer provides a de facto standard way of capturing and publishing metrics to the monitoring solution of your choice. {productName} provides a convenient, out-of-the-box integration of Micrometer to make it easier to capture those metrics and monitor your application's health and performance. For more information on Micrometer, please refer to the project's https://micrometer.io[website].
35 changes: 35 additions & 0 deletions micrometer/helm-install-prerequisites-common.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ifdef::prereq-openshift[]
:prereq-cloud-platform: OpenShift
:prereq-cloud-cli: oc
:prereq-suffix: openshift
endif::[]
ifdef::prereq-kubernetes[]
:prereq-cloud-platform: Kubernetes
:prereq-cloud-cli: kubectl
:prereq-suffix: kubernetes
endif::[]



=== Install OpenTelemetry Collector on OpenShift

The functionality of this quickstart depends on a running instance of the https://opentelemetry.io/docs/collector/[OpenTelemetry Collector].

To deploy and configure the OpenTelemetry Collector, you will need to apply a set of configurations to your {prereq-cloud-platform} cluster:

[source,options="nowrap",subs="+attributes"]
----
include::charts/opentelemetry-collector-openshift.yaml[]
----

To make things simpler, you can find these commands in `charts/opentelemetry-collector-openshift.yaml`, and to apply them run the following command in your terminal:

[source,options="nowrap",subs="+attributes"]
----
$ {prereq-cloud-cli} apply -f charts/opentelemetry-collector-{prereq-suffix}.yaml
----

[NOTE]
====
When done with the quickstart, the `{prereq-cloud-cli} delete -f charts/opentelemetry-collector-{prereq-suffix}.yaml` command may be used to revert the applied changes.
====
2 changes: 2 additions & 0 deletions micrometer/helm-install-prerequisites-kubernetes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:prereq-kubernetes: true
include::./helm-install-prerequisites-common.adoc[]
2 changes: 2 additions & 0 deletions micrometer/helm-install-prerequisites-openshift.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:prereq-openshift: true
include::./helm-install-prerequisites-common.adoc[]
22 changes: 0 additions & 22 deletions micrometer/helm-install-prerequisites.adoc

This file was deleted.

4 changes: 4 additions & 0 deletions microprofile-config/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ include::../shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc[level

// Openshift
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
//Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]

== Conclusion

Expand Down
4 changes: 4 additions & 0 deletions microprofile-fault-tolerance/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,10 @@ include::../shared-doc/build-and-run-the-quickstart-with-bootable-jar.adoc[level

// OpenShift
include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1]
ifndef::ProductRelease,EAPXPRelease[]
// Kubernetes
include::../shared-doc/build-and-run-the-quickstart-with-kubernetes.adoc[leveloffset=+1]
endif::[]

== Conclusion

Expand Down
Loading
Loading