Skip to content

Commit 307b202

Browse files
committed
Update to current multicloud gitops and create small chunk scenarios
1 parent d5f1e98 commit 307b202

557 files changed

Lines changed: 3057 additions & 221910 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ help:
1111
%:
1212
make -f common/Makefile $*
1313

14-
install: operator-deploy post-install ## installs the pattern, inits the vault and loads the secrets
15-
echo "Installed"
14+
.PHONY: install
15+
install: operator-deploy post-install ## installs the pattern and loads the secrets
16+
@echo "Installed"
1617

17-
post-install: ## Post-install tasks - vault init and load-secrets
18+
.PHONY: post-install
19+
post-install: ## Post-install tasks
1820
make load-secrets
19-
echo "Done"
21+
@echo "Done"
2022

23+
.PHONY: test
2124
test:
2225
@make -f common/Makefile PATTERN_OPTS="-f values-global.yaml -f values-hub.yaml" test

README.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
1-
# Multicluster Devsecops
1+
# Multicloud Gitops
22

33
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44

5+
[Live build status](https://validatedpatterns.io/ci/?pattern=mcgitops)
6+
57
## Start Here
68

79
If you've followed a link to this repository, but are not really sure what it contains
8-
or how to use it, head over to [Multicluster Devsecops](https://hybrid-cloud-patterns.io/devsecops/)
10+
or how to use it, head over to [Multicloud GitOps](https://validatedpatterns.io/patterns/multicloud-gitops/)
911
for additional context and installation instructions
1012

11-
## Cluster requirements
12-
13-
This pattern depends on having three clusters.
14-
15-
* Central Hub - where all the infrastructure components run.
16-
* Red Hat Advanced Cluster Management
17-
* Red Hat Advanced Cluster Security (Central)
18-
* Red Hat Quay Enterprise
19-
* Secrets management
20-
* Development - where CI/CD pipelines and testing run
21-
* Red Hat OpenShift Pipelines
22-
* Red Hat OpenShift GitOps
23-
* Red Hat Advanced Cluster Security (Secured)
24-
* Production - where the applications run
25-
26-
It can be modified to run everything in a single cluster. Components of `values-development.yaml` and `values-production.yaml` would need to be merged into `values-hub.yaml` where applicable. *Use caution*. In the future the pattern may be enhanced to combine into a single cluster.
13+
## Rationale
2714

28-
## Products/projects used
15+
The goal for this pattern is to:
2916

30-
* Red Hat OpenShift GitOps
31-
* Red Hat Advanced Cluster Management
32-
* Red Hat Advanced Cluster Security
33-
* Red Hat Open Data Foundation
34-
* Red Hat Quay
35-
* Red Hat OpenShift Pipelines
36-
* Hashicorp Vault (Community)
17+
* Use a GitOps approach to manage hybrid and multi-cloud deployments across both public and private clouds.
18+
* Enable cross-cluster governance and application lifecycle management.
19+
* Securely manage secrets across the deployment.

ansible.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[defaults]
2-
display_skipped_hosts=False
32
localhost_warning=False
43
retry_files_enabled=False
54
library=~/.ansible/plugins/modules:./ansible/plugins/modules:./common/ansible/plugins/modules:/usr/share/ansible/plugins/modules

ansible/site.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This is only needed for RHPDS
2+
- name: MultiCloud-GitOps RHPDS bootstrap
3+
hosts: localhost
4+
connection: local
5+
tasks:
6+
# We cannot use .package or .dnf modules because python3 that is used comes
7+
# from a virtualenv
8+
- name: Launch the installation
9+
ansible.builtin.command: ./pattern.sh make install
10+
args:
11+
chdir: "{{ lookup('env', 'PWD') }}"
12+
register: output
13+
changed_when: false
14+
15+
- name: Print output of installation
16+
ansible.builtin.debug:
17+
msg: "{{ output }}"

charts/all/config-demo/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
description: A Helm chart to build and deploy a use of remote configuration enabled by ACM and Vault
3+
keywords:
4+
- pattern
5+
name: config-demo
6+
version: 0.0.1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: config-demo-configmap
5+
labels:
6+
app.kubernetes.io/instance: config-demo
7+
data:
8+
"index.html": |-
9+
<!DOCTYPE html>
10+
<html lang="en">
11+
<head>
12+
<meta charset="utf-8">
13+
<title>Config Demo</title>
14+
</head>
15+
<body>
16+
<h1>
17+
Hub Cluster domain is '{{ .Values.global.hubClusterDomain }}' <br>
18+
Pod is running on Local Cluster Domain '{{ .Values.global.localClusterDomain }}' <br>
19+
</h1>
20+
<h2>
21+
The secret is <a href="/secret/secret">secret</a>
22+
</h2>
23+
</body>
24+
</html>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
application: config-demo
6+
name: config-demo
7+
spec:
8+
replicas: 2
9+
revisionHistoryLimit: 3
10+
selector:
11+
matchLabels:
12+
deploymentconfig: config-demo
13+
template:
14+
metadata:
15+
creationTimestamp: null
16+
labels:
17+
app: config-demo
18+
deploymentconfig: config-demo
19+
name: config-demo
20+
spec:
21+
containers:
22+
- name: apache
23+
image: registry.access.redhat.com/ubi8/httpd-24:1-226
24+
#imagePullPolicy: Always
25+
ports:
26+
- containerPort: 8080
27+
name: http
28+
protocol: TCP
29+
volumeMounts:
30+
- mountPath: /var/www/html
31+
name: config-demo-configmap
32+
- mountPath: /var/www/html/secret
33+
readOnly: true
34+
name: config-demo-secret
35+
resources: {}
36+
terminationMessagePath: /dev/termination-log
37+
terminationMessagePolicy: File
38+
livenessProbe:
39+
httpGet:
40+
path: /index.html
41+
port: 8080
42+
scheme: HTTP
43+
initialDelaySeconds: 5
44+
timeoutSeconds: 1
45+
periodSeconds: 10
46+
successThreshold: 1
47+
failureThreshold: 3
48+
readinessProbe:
49+
httpGet:
50+
path: /index.html
51+
port: 8080
52+
scheme: HTTP
53+
initialDelaySeconds: 5
54+
timeoutSeconds: 1
55+
periodSeconds: 10
56+
successThreshold: 1
57+
failureThreshold: 3
58+
volumes:
59+
- name: config-demo-configmap
60+
configMap:
61+
defaultMode: 438
62+
name: config-demo-configmap
63+
- name: config-demo-secret
64+
secret:
65+
secretName: config-demo-secret

charts/hub/external-secrets/templates/image-registry-credentials.yaml renamed to charts/all/config-demo/templates/config-demo-external-secret.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
apiVersion: "external-secrets.io/v1beta1"
33
kind: ExternalSecret
44
metadata:
5-
# This is the external image registry (e.g. quay.io/docker)
6-
name: image-registry-credentials
7-
namespace: devsecops-ci
5+
name: config-demo-secret
6+
namespace: config-demo
87
spec:
98
refreshInterval: 15s
109
secretStoreRef:
1110
name: {{ .Values.secretStore.name }}
1211
kind: {{ .Values.secretStore.kind }}
1312
target:
14-
name: image-registry-credentials
13+
name: config-demo-secret
1514
template:
15+
type: Opaque
1616
dataFrom:
1717
- extract:
18-
key: {{ .Values.imageregistrysecret.key }}
18+
key: {{ .Values.configdemosecret.key }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: image.openshift.io/v1
2+
kind: ImageStream
3+
metadata:
4+
name: config-demo
5+
spec:
6+
lookupPolicy:
7+
local: true
8+
tags:
9+
- name: registry.access.redhat.com/ubi8/httpd-24
10+
importPolicy: {}
11+
referencePolicy:
12+
type: Local

charts/region/stage/spring-petclinic-config/templates/app/route.yaml renamed to charts/all/config-demo/templates/config-demo-route.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ apiVersion: route.openshift.io/v1
22
kind: Route
33
metadata:
44
labels:
5-
app: spring-petclinic
6-
name: spring-petclinic
5+
app: config-demo
6+
name: config-demo
77
spec:
88
port:
99
targetPort: 8080-tcp
1010
to:
1111
kind: Service
12-
name: spring-petclinic
12+
name: config-demo
1313
weight: 100
14+
wildcardPolicy: None

0 commit comments

Comments
 (0)