Skip to content

Commit

Permalink
first pass at osc migration
Browse files Browse the repository at this point in the history
Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira committed Apr 2, 2023
1 parent 02c39e5 commit c851c2c
Show file tree
Hide file tree
Showing 1,134 changed files with 79,532 additions and 58 deletions.
60 changes: 60 additions & 0 deletions .prow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
presubmits:
- name: kustomize-build
decorate: true
max_concurrency: 1
skip_if_only_changed: "^docs/|\\.md$|^(OWNERS|LICENSE)$|^\\."
skip_report: false
context: aicoe-ci/prow/kustomize-build
spec:
containers:
- image: quay.io/operate-first/opf-toolbox:latest
command:
- "test-kustomize-build"
resources:
requests:
memory: "256Mi"
cpu: "1500m"
limits:
memory: "500Mi"
cpu: "2"

- name: kubeval-validation
decorate: true
max_concurrency: 1
skip_if_only_changed: "^docs/|\\.md$|^(OWNERS|LICENSE)$|^\\."
skip_report: false
context: aicoe-ci/prow/kubeval-validation
decoration_config:
timeout: 60m
spec:
containers:
- image: quay.io/operate-first/opf-toolbox:latest
command:
- "test-kubeval-validation"
resources:
requests:
memory: "4Gi"
cpu: "1500m"
limits:
memory: "4Gi"
cpu: "2"

- name: pre-commit
decorate: true
skip_report: false
always_run: true
context: aicoe-ci/prow/pre-commit
spec:
containers:
- image: quay.io/thoth-station/thoth-precommit-py38:v0.15.0
command:
- "pre-commit"
- "run"
- "--all-files"
resources:
requests:
memory: "500Mi"
cpu: "4"
limits:
memory: "2Gi"
cpu: "4"
24 changes: 24 additions & 0 deletions acme-operator/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: openshift-acme
spec:
selector:
matchLabels:
app: openshift-acme
replicas: 1
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: openshift-acme
spec:
serviceAccountName: openshift-acme
containers:
- name: openshift-acme
image: quay.io/tnozicka/openshift-acme:controller
imagePullPolicy: Always
args:
- --exposer-image=quay.io/tnozicka/openshift-acme:exposer
- --loglevel=4
5 changes: 5 additions & 0 deletions acme-operator/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- serviceaccount.yaml
6 changes: 6 additions & 0 deletions acme-operator/base/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: openshift-acme
labels:
app: openshift-acme
12 changes: 12 additions & 0 deletions acme-operator/overlays/osc/osc-cl1/issuer-letsencrypt-live.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: letsencrypt-live
annotations:
acme.openshift.io/priority: "100"
argocd.argoproj.io/compare-options: IgnoreExtraneous
labels:
managed-by: "openshift-acme"
type: "CertIssuer"
data:
"cert-issuer.types.acme.openshift.io": '{"type":"ACME","acmeCertIssuer":{"directoryUrl":"https://acme-v02.api.letsencrypt.org/directory"}}'
6 changes: 6 additions & 0 deletions acme-operator/overlays/osc/osc-cl1/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../base
- issuer-letsencrypt-live.yaml
namespace: acme-operator
12 changes: 12 additions & 0 deletions acme-operator/overlays/osc/osc-cl2/issuer-letsencrypt-live.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: letsencrypt-live
annotations:
acme.openshift.io/priority: "100"
argocd.argoproj.io/compare-options: IgnoreExtraneous
labels:
managed-by: "openshift-acme"
type: "CertIssuer"
data:
"cert-issuer.types.acme.openshift.io": '{"type":"ACME","acmeCertIssuer":{"directoryUrl":"https://acme-v02.api.letsencrypt.org/directory"}}'
6 changes: 6 additions & 0 deletions acme-operator/overlays/osc/osc-cl2/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../base
- issuer-letsencrypt-live.yaml
namespace: acme-operator
13 changes: 13 additions & 0 deletions argocd/cluster-resources/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../cluster-scope/base/apiextensions.k8s.io/customresourcedefinitions/appprojects.argoproj.io
- ../../cluster-scope/base/apiextensions.k8s.io/customresourcedefinitions/applications.argoproj.io
- ../../cluster-scope/base/apiextensions.k8s.io/customresourcedefinitions/applicationsets.argoproj.io
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterrolebindings/argocd-server
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterrolebindings/argocd-application-controller
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterrolebindings/argocd-manager
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterroles/argocd-application-controller
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterroles/argocd-server
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterroles/argocd-proj-apps-aggregate-to-admin
- ../../cluster-scope/base/rbac.authorization.k8s.io/clusterroles/argocd-events-create-aggregate-to-admin
13 changes: 0 additions & 13 deletions argocd/overlays/app-of-apps/osc-cl1/osc-app-of-apps.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions argocd/overlays/app-of-apps/osc-cl2/osc-app-of-apps.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions argocd/overlays/app-of-apps/osc-cl3/osc-app-of-apps.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions argocd/overlays/osc-cl3/alerts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: argocd-alerts
spec:
groups:
- name: argocd-alerts
rules:
- alert: ArgoAppSyncFailed
expr: argocd_app_sync_total{phase!="Succeeded"} == 1 # Triggered when argocd-application is not succeeded
for: 1m
labels:
severity: warning
annotations:
summary: "'{{ $labels.name }}' Application has sync phase as '{{ $labels.phase }}'"
description: >
For the last minute, ArgoCD applications sync status is not succeeded.
The `argocd_app_sync_total` metric is the counter for application sync history.
- alert: ArgoAppMissing
expr: absent(argocd_app_info) # Triggered when argocd-application info is not found
for: 15m
labels:
severity: critical
annotations:
summary: "[ArgoCD] No reported applications"
description: >
ArgoCD has not reported any applications data for the past 15 minutes which
means that it must be down or not functioning properly.
- name: argocd-app-alerts
rules:
- alert: ArgoCDAppOutOfSync
expr: argocd_app_info{sync_status="OutOfSync"} # Triggered when argocd-application is `OutofSync`
for: 1m
labels:
severity: warning
annotations:
summary: "'{{ $labels.name }}' Application has sync status as '{{ $labels.sync_status }}'"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-of-apps-osc-cl1
spec:
destination:
namespace: openshift-gitops
name: osc-cl1
project: osc-infra
source:
path: argocd/overlays/osc-cl3/applications/envs/osc/osc-cl1
# repoURL: https://github.com/os-climate/ops-argocd.git
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
syncPolicy:
syncOptions:
- Validate=false
- ApplyOutOfSyncOnly=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-of-apps-osc-cl2
spec:
destination:
namespace: openshift-gitops
name: osc-cl2
project: osc-infra
source:
path: argocd/overlays/osc-cl3/applications/envs/osc/osc-cl2
# repoURL: https://github.com/os-climate/ops-argocd.git
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
syncPolicy:
syncOptions:
- Validate=false
- ApplyOutOfSyncOnly=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-of-apps-osc-cl3
spec:
destination:
namespace: openshift-gitops
name: in-cluster
project: osc-infra
source:
path: argocd/overlays/osc-cl3/applications/envs/osc/osc-cl3
# repoURL: https://github.com/os-climate/ops-argocd.git
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
syncPolicy:
syncOptions:
- Validate=false
- ApplyOutOfSyncOnly=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: openshift-gitops
resources:
- app-of-apps-osc-cl1.yaml
- app-of-apps-osc-cl2.yaml
- app-of-apps-osc-cl3.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: openshift-gitops
nameSuffix: -osc-cl1
resources:
- osc-app-of-apps.yaml
- os-climate
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: acme-operator
spec:
destination:
name: osc-cl1
namespace: acme-operator
project: os-climate
source:
path: acme-operator/overlays/osc/osc-cl1
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
ignoreDifferences:
- group: ""
jsonPointers:
- /data/cert-issuer.types.acme.openshift.io
kind: ConfigMap
name: letsencrypt-live
namespace: acme-operator
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
# syncOptions:
# - Validate=false
# - ApplyOutOfSyncOnly=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cloudbeaver
spec:
destination:
name: osc-cl1
namespace: odh-trino
project: os-climate
source:
path: cloudbeaver/overlays/osc/osc-cl1
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
# syncOptions:
# - Validate=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cluster-resources
spec:
destination:
name: osc-cl1
namespace: open-cluster-management-agent
project: os-climate
source:
path: cluster-scope/overlays/osc/osc-cl1
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
# syncOptions:
# - Validate=false
# - ApplyOutOfSyncOnly=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: das
spec:
destination:
name: osc-cl1
namespace: odh-trino
project: os-climate
source:
path: das/overlays/osc-cl1
repoURL: https://github.com/Gregory-Pereira/ops-argocd.git
targetRevision: setup-argocd-and-vault
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
# syncOptions:
# - Validate=false
Loading

0 comments on commit c851c2c

Please sign in to comment.