Skip to content

Commit

Permalink
feat!: OpenShift 4.6
Browse files Browse the repository at this point in the history
- using AMQ Streams
- ACM Multi Cluster Hub status conditonal check fix
- Examples updated to OpenShift 4.6
  • Loading branch information
kameshsampath committed Feb 15, 2021
1 parent a9dc58a commit 50cf82e
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 83 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on:
push:
branches:
- "master"

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
# Checkout and test
- uses: actions/checkout@v2

# Create a release, or update the release PR
- uses: GoogleCloudPlatform/release-please-action@v2.7.0
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
bump-minor-pre-major: true
12 changes: 5 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# Ansible role for RedHat Developers Workshop
# Ansible role for OpenShift Operators

Ansible to configure https://try.openshift.com[OpenShift] cluster for Red Hat Developer Workshops and Demos.

The role can also be used to install and configure:

- [*] Red Hat OpenShift Serverless both Serving and Eventing
- [*] Red Hat OpenShift Pipelines
- [*] https://www.openshift.com/learn/topics/pipelines[Red Hat OpenShift Pipelines]
- [*] https://argoproj.github.io/argo-cd/[Argo CD]
- [*] Red Hat OpenShift Service Mesh
- [*] https://www.openshift.com/learn/topics/service-mesh[Red Hat OpenShift Service Mesh]
- [*] https://strimzi.io[Strimzi Kafka]
- [*] https://www.redhat.com/en/resources/amq-streams-datasheet[Red Hat AMQ Streams]
- [*] https://www.redhat.com/en/technologies/management/advanced-cluster-management[Red Hat Advanced Cluster Management for Kubernetes]
- [ ] https://skupper.io[Skupper]
- [*] https://camel.apache.org/docs/#camel-k[Apache Camel-K]
- [*] https://www.eclipse.org/che/[Eclipse Che]
- [*] https://www.redhat.com/en/technologies/jboss-middleware/codeready-workspaces[Red Hat Code Ready Workspaces]
== Requirements

Expand Down
10 changes: 5 additions & 5 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
ocp_bin_dir: "{{ ansible_env.HOME }}/openshift/bin"
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: False
remove_kube_admin: False
# Users
Expand All @@ -16,7 +16,7 @@ users:
# Serverless(Knative)
deploy_serverless: False
undeploy_serverless: False
serverless_subcription_channel: "4.5"
serverless_subcription_channel: "4.6"
knative_serving_cr: serverless/cr/serving.yaml
knative_eventing_cr: serverless/cr/eventing.yaml
# Pipelines
Expand All @@ -28,20 +28,20 @@ undeploy_argocd: False
argocd_namespace: argocd
argocd_cr: argocd/cr.yaml
argocd_release_channel: alpha
#Strimzi Kafka
#AMQ Streams(Strimzi Kafka)
deploy_kafka: False
undeploy_kafka: False
kakfa_cluster_name: my-cluster
kakfa_cluster_namespace: kafka
strimzi_kafka_cr: kafka/cr.yaml
amq_streams_cr: kafka/cr.yaml
knative_eventing_kafka_cr: kafka/eventing/cr.yaml
# Apache Camel-k
deploy_camel_k: False
undeploy_camel_k: False
# Red Hat Servicemesh
deploy_servicemesh: False
undeploy_servicemesh: False
servicemesh_es_channel: 4.5
servicemesh_es_channel: 4.6
servicemesh_cr: servicemesh/cr.yaml
servicemesh_members:
create: False
Expand Down
2 changes: 1 addition & 1 deletion examples/acm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: False
deploy_acm: True
users:
Expand Down
2 changes: 1 addition & 1 deletion examples/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: True
deploy_serverless: True
users:
Expand Down
6 changes: 3 additions & 3 deletions examples/serverless_kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
connection: local

vars:
ocp_version: 4.5.6
download_clients: True
ocp_version: 4.6.1
download_clients: False
deploy_serverless: True
deploy_kafka: True
users:
create: True
create: False
start: 0
end: 0

Expand Down
2 changes: 1 addition & 1 deletion examples/serverless_kafka_kamel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: True
deploy_serverless: True
deploy_kafka: True
Expand Down
2 changes: 1 addition & 1 deletion examples/serverless_kafka_with_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: False
deploy_serverless: True
deploy_kafka: True
Expand Down
2 changes: 1 addition & 1 deletion examples/serverless_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: False
deploy_serverless: True
deploy_kafka: False
Expand Down
2 changes: 1 addition & 1 deletion examples/serverless_pipelines_argocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: False
deploy_serverless: True
deploy_kafka: False
Expand Down
2 changes: 1 addition & 1 deletion examples/servicemesh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
connection: local

vars:
ocp_version: 4.5.6
ocp_version: 4.6
download_clients: False
deploy_servicemesh: True
users:
Expand Down
33 changes: 22 additions & 11 deletions files/kafka/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,34 @@ metadata:
name: my-cluster
namespace: kafka
spec:
entityOperator:
topicOperator: {}
userOperator: {}
kafka:
version: 2.5.0
replicas: 3
listeners:
plain: {}
tls: {}
config:
inter.broker.protocol.version: '2.6'
log.message.format.version: '2.6'
offsets.topic.replication.factor: 3
transaction.state.log.replication.factor: 3
transaction.state.log.min.isr: 2
log.message.format.version: '2.5'
transaction.state.log.replication.factor: 3
listeners:
- name: plain
port: 9092
tls: false
type: internal
- name: tls
port: 9093
tls: true
type: internal
- name: external
port: 9094
tls: false
type: loadbalancer
replicas: 3
storage:
type: ephemeral
version: 2.6.0
zookeeper:
replicas: 3
storage:
type: ephemeral
entityOperator:
topicOperator: {}
userOperator: {}
type: ephemeral
4 changes: 2 additions & 2 deletions tasks/deploy_acm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
namespace: "{{ acm_namespace }}"
name: "{{ acm_cr.metadata.name }}"
register: acm_status
retries: 30
retries: 60
delay: 10
until: acm_status.resources and acm_status.resources[0].status.phase == 'Running'
until: acm_status.resources and acm_status.resources[0].status is defined and acm_status.resources[0].status.phase == 'Running'
16 changes: 8 additions & 8 deletions tasks/deploy_kafka.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
---
- name: "Install Operator::Strimzi Kafka"
- name: "Install Operator::AMQ Streams"
community.kubernetes.k8s:
state: present
definition: "{{ lookup('template','kafka/subscription.yaml.j2') | from_yaml }}"
wait: yes

- name: "Install Strimzi::Kafka"
- name: "Install Red Hat::AMQ Streams"
include_tasks: utils/wait_for_operator_and_sub.yml
vars:
subscription_name: strimzi-kafka-operator
subscription_name: amq-streams-operator

- name: "Create Kafka Namespace"
community.kubernetes.k8s:
state: present
kind: Namespace
name: "{{ kakfa_cluster_namespace }}"

- name: "Create Strimzi Kafka cluster::{{ kakfa_cluster_name }}"
- name: "Create Kafka cluster::{{ kakfa_cluster_name }}"
community.kubernetes.k8s:
state: present
definition: "{{ item | from_yaml }}"
wait: yes
wait_timeout: 180
wait_timeout: 600
wait_sleep: 10
wait_condition:
type: Ready
no_log: True
register: strimzi_kafka_status
no_log: False
register: amq_streams_status
with_file:
- "{{ strimzi_kafka_cr }}"
- "{{ amq_streams_cr }}"
15 changes: 6 additions & 9 deletions tasks/download_clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,25 @@
- name: Set Linux Downloadables
set_fact:
download_files:
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux-{{ ocp_version }}.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-linux-{{ ocp_version }}.tar.gz"
# - "https://mirror.openshift.com/pub/openshift-v4/clients/odo/latest/odo-linux-amd64.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-{ {ocp_version }}/openshift-client-linux.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-{ {ocp_version }}/openshift-install-linux.tar.gz"
when: ansible_os_family == "RedHat" or ansible_os_family == "CentOS" or ansible_os_family == "Debian"
tags:
- download

- name: Set macOS Downloadables
set_fact:
download_files:
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-mac-{{ ocp_version }}.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-install-mac-{{ ocp_version }}.tar.gz"
# - "https://mirror.openshift.com/pub/openshift-v4/clients/odo/latest/odo-darwin-amd64.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-{ {ocp_version }}/openshift-client-mac.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-{ {ocp_version }}/openshift-install-mac.tar.gz"
when: ansible_os_family == "Darwin"
tags:
- download

- name: Set Windows Downloadables
set_fact:
download_files:
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-windows-{{ ocp_version }}.zip"
# - "https://mirror.openshift.com/pub/openshift-v4/clients/odo/latest/odo-windows-amd64.exe.tar.gz"
- "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-{ {ocp_version }}/openshift-client-windows.zip"
when: ansible_os_family == "Windows"
tags:
- download
Expand All @@ -43,7 +40,7 @@
get_url:
url: "{{ item }}"
dest: "/tmp/openshift/{{ item|basename }}"
checksum: "sha256:https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/sha256sum.txt"
checksum: "sha256:https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-{{ ocp_version }}/sha256sum.txt"
force: no
loop: "{{ download_files }}"
register: ocp_clients_download
Expand Down
32 changes: 4 additions & 28 deletions tasks/undeploy_kafka.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: "Create Strimzi Kafka cluster::{{ kakfa_cluster_name }}"
- name: "Delete Kafka cluster::{{ kakfa_cluster_name }}"
community.kubernetes.k8s:
state: absent
definition: "{{ item | from_yaml }}"
Expand All @@ -10,35 +10,11 @@
type: Ready
status: False
no_log: True
register: strimzi_kafka_status
register: amq_streams_status
with_file:
- "{{ strimzi_kafka_cr }}"
- "{{ amq_streams_cr }}"

- name: "Delete Knative Eventing KafkaSource"
community.kubernetes.k8s:
state: absent
definition: "{{ item | from_yaml }}"
wait: yes
wait_timeout: 180
wait_sleep: 10
wait_condition:
type: Ready
state: False
no_log: True
register: kn_eventing_kafka_status
with_file:
- "{{ knative_eventing_kafka_cr }}"
when: undeploy_serverless

# Knative Eventing Kafka Sources
- name: "UnInstall Operator::Knative Eventing KafkaSource"
community.kubernetes.k8s:
state: absent
definition: "{{ lookup('template','kafka/eventing/subscription.yaml.j2') | from_yaml }}"
wait: yes
when: undeploy_serverless

- name: "Uninstall Operator::Strimzi Kafka"
- name: "Uninstall Operator::AMQ Streams"
community.kubernetes.k8s:
state: absent
definition: "{{ lookup('template','kafka/subscription.yaml.j2') | from_yaml }}"
Expand Down
6 changes: 3 additions & 3 deletions templates/kafka/subscription.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: strimzi-kafka-operator
name: amq-streams-operator
namespace: openshift-operators
spec:
channel: stable
source: community-operators
name: strimzi-kafka-operator
source: redhat-operators
name: amq-streams
sourceNamespace: openshift-marketplace
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0

0 comments on commit 50cf82e

Please sign in to comment.