Skip to content

Commit f4f36b3

Browse files
committed
OSDOCS#9762: Applications for GitOps on MicroShift
1 parent 4723ee3 commit f4f36b3

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

microshift_running_apps/microshift-gitops.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ By using the GitOps with Argo CD agent with {microshift-short}, you can utilize
1919
* The Git repository contains a declarative description of the infrastructure you need in your specified environment and contains an automated process to make your environment match the described state.
2020
* You can also use the Git repository as an audit trail of changes so that you can create processes based on Git flows such as review and approval for merging pull requests that implement configuration changes.
2121

22+
include::modules/microshift-gitops-adding-apps.adoc[leveloffset=+1]
23+
24+
[id="additional-resourcess{context}"]
25+
.Additional resources
26+
27+
* xref:../microshift_install/microshift-install-rpm.adoc#microshift-installing-rpms-for-gitops_microshift-install-rpm[Installing the GitOps Argo CD manifests from an RPM package]
28+
2229
[id="microshift-gitops-cannot-do_{context}"]
2330
== Limitations of using the GitOps agent with {microshift-short}
2431
GitOps with Argo CD for {microshift-short} has the following differences from the Red Hat OpenShift GitOps Operator:
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift_running_apps/microshift-gitops.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-gitops-adding-apps_{context}"]
7+
= Creating GitOps applications on {microshift-short}
8+
9+
You can create a custom YAML configuration to deploy and manage applications in your {microshift-short} service. To install the necessary packages to run GitOps applications, follow the documentation in "Installing the GitOps Argo CD manifests from an RPM package".
10+
11+
.Prerequisites
12+
13+
* You installed the `microshift-gitops` packages and the Argo CD pods are running in the `openshift-gitops` namespace.
14+
15+
.Procedure
16+
17+
. Create a YAML file and add your customized configurations for the application:
18+
+
19+
.Example YAML for a `cert-manager` application
20+
[source,yaml]
21+
----
22+
kind: AppProject
23+
apiVersion: argoproj.io/v1alpha1
24+
metadata:
25+
name: default
26+
namespace: openshift-gitops
27+
spec:
28+
clusterResourceWhitelist:
29+
- group: '*'
30+
kind: '*'
31+
destinations:
32+
- namespace: '*'
33+
server: '*'
34+
sourceRepos:
35+
- '*'
36+
---
37+
apiVersion: argoproj.io/v1alpha1
38+
kind: Application
39+
metadata:
40+
name: cert-manager
41+
namespace: openshift-gitops
42+
spec:
43+
destination:
44+
namespace: cert-manager
45+
server: https://kubernetes.default.svc
46+
project: default
47+
source:
48+
path: cert-manager
49+
repoURL: https://github.com/anandf/microshift-install
50+
syncPolicy:
51+
automated: {}
52+
syncOptions:
53+
- CreateNamespace=true
54+
- ServerSideApply=true
55+
----
56+
+
57+
.Example YAML for a `spring-petclinic` application
58+
[source,yaml]
59+
----
60+
kind: AppProject
61+
apiVersion: argoproj.io/v1alpha1
62+
metadata:
63+
name: default
64+
namespace: openshift-gitops
65+
spec:
66+
clusterResourceWhitelist:
67+
- group: '*'
68+
kind: '*'
69+
destinations:
70+
- namespace: '*'
71+
server: '*'
72+
sourceRepos:
73+
- '*'
74+
---
75+
kind: Application
76+
apiVersion: argoproj.io/v1alpha1
77+
metadata:
78+
name: spring-petclinic
79+
namespace: openshift-gitops
80+
spec:
81+
destination:
82+
namespace: spring-petclinic
83+
server: https://kubernetes.default.svc
84+
project: default
85+
source:
86+
directory:
87+
recurse: true
88+
path: app
89+
repoURL: https://github.com/siamaksade/openshift-gitops-getting-started
90+
syncPolicy:
91+
automated: {}
92+
syncOptions:
93+
- CreateNamespace=true
94+
- ServerSideApply=true
95+
----
96+
97+
. To deploy the applications defined in the YAML file, run the following command:
98+
+
99+
[source,terminal]
100+
----
101+
$ oc apply -f <filename>.yaml
102+
----
103+
104+
.Verification
105+
106+
* To verify your application is deployed and synced, run the following command:
107+
+
108+
[source,terminal]
109+
----
110+
$ oc get applications -A
111+
----
112+
It might take a few minutes for the application to show the `Healthy` status.
113+
+
114+
.Example output
115+
[source,terminal]
116+
----
117+
NAMESPACE NAME SYNC STATUS HEALTH STATUS
118+
openshift-gitops cert-manager Synced Healthy
119+
openshift-gitops spring-petclinic Synced Healthy
120+
----

0 commit comments

Comments
 (0)