Browse Source

boilerplate

pull/1/head
Nicolas Massé 3 years ago
parent
commit
c7076f1e2f
  1. 2
      .gitignore
  2. 42
      README.md
  3. 33
      infrastructure.yaml.sample
  4. 5
      infrastructure/Chart.yaml
  5. 5
      infrastructure/templates/_helpers.tpl

2
.gitignore

@ -0,0 +1,2 @@
infrastructure.yaml

42
README.md

@ -1,5 +1,43 @@
# gitops
GitOps artefacts
# GitOps Artefacts for the MAD Roadshow France 2023
## Pre-requisites
* Install the OpenShift GitOps operator.
* Fix the ArgoCD ingress route in order to use the router default TLS certificate.
```sh
oc patch argocd openshift-gitops -n openshift-gitops -p '{"spec":{"server":{"insecure":true,"route":{"enabled": true,"tls":{"termination":"edge","insecureEdgeTerminationPolicy":"Redirect"}}}}}' --type=merge
```
* Get the Webhook URL of your OpenShift Gitops installation
```sh
oc get route -n openshift-gitops openshift-gitops-server -o jsonpath='https://{.spec.host}/api/webhook'
```
* Add a webhook to your GitHub/GitLab repo
* Payload URL: *url above*
* Content-Type: Application/json
* Create the required namespaces.
```sh
oc new-project fruits-dev
```
* Label the `fruits-dev` namespace with argocd annotations
```sh
oc label namespace fruits-dev argocd.argoproj.io/managed-by=openshift-gitops
```
* Give admin access rights on the **fruits-dev** namespace to the **OpenShift Gitops** operator.
```sh
oc adm policy add-role-to-user admin -n fruits-dev system:serviceaccount:openshift-gitops:openshift-gitops-argocd-application-controller
```
## Deploy Postgres CrunchyDB

33
infrastructure.yaml.sample

@ -0,0 +1,33 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mad-roadshow-france-2023
namespace: openshift-gitops
spec:
destination:
name: ''
server: 'https://kubernetes.default.svc'
source:
path: infrastructure
repoURL: 'https://github.com/MAD-Roadshow-France-2023/gitops.git'
targetRevision: main
helm:
parameters:
- name: masterKey
value: my-secret-value
- name: openshift-dns-zone
value: apps.ocp.tld
project: default
syncPolicy:
automated:
prune: true
selfHeal: false
ignoreDifferences:
- jqPathExpressions:
- .spec.template.spec.containers[].image
group: apps.openshift.io
kind: DeploymentConfig
- jqPathExpressions:
- .spec.tags[].generation
group: image.openshift.io
kind: ImageStream

5
infrastructure/Chart.yaml

@ -0,0 +1,5 @@
apiVersion: v2
name: infrastructure
type: application
version: 0.0.1
appVersion: "0.0.1"

5
infrastructure/templates/_helpers.tpl

@ -0,0 +1,5 @@
{{/* vim: set filetype=mustache: */}}
{{- define "acs-admin-password" -}}
{{- trunc 16 (sha256sum (cat .Values.masterKey "acs-admin-password")) -}}
{{- end -}}
Loading…
Cancel
Save