Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vfarcic committed Dec 4, 2020
0 parents commit 6bacf0e
Show file tree
Hide file tree
Showing 17 changed files with 460 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/env
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Argo CD Sample Repo

Used in [The DevOps Toolkit: Catalog, Patterns, And Blueprints](https://www.devopstoolkitseries.com/posts/catalog/) course and book
16 changes: 16 additions & 0 deletions apps-manual.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: production
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
repoURL: https://github.com/vfarcic/argocd-production.git
targetRevision: HEAD
path: helm
destination:
server: https://kubernetes.default.svc
namespace: production
23 changes: 23 additions & 0 deletions apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: production
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
repoURL: https://github.com/vfarcic/argocd-production.git
targetRevision: HEAD
path: helm
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true

68 changes: 68 additions & 0 deletions argocd/apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---

apiVersion: v1
kind: Namespace
metadata:
name: production

---

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: production
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
description: Production project
sourceRepos:
- '*'
destinations:
- namespace: production
server: https://kubernetes.default.svc
- namespace: argocd
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: ''
kind: Namespace
namespaceResourceBlacklist:
- group: ''
kind: ResourceQuota
- group: ''
kind: LimitRange
- group: ''
kind: NetworkPolicy
namespaceResourceWhitelist:
- group: 'apps'
kind: Deployment
- group: 'apps'
kind: StatefulSet
- group: 'extensions/v1beta1'
kind: Ingress
- group: 'v1'
kind: Service

---

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: production
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
repoURL: https://github.com/vfarcic/argocd-production.git
targetRevision: HEAD
path: helm
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
selfHeal: true
prune: true

33 changes: 33 additions & 0 deletions argocd/codefresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "1.0"
kind: pipeline
metadata:
name: devops-catalog/argocd-production
description: Argo CD production environment app
project: devops-catalog
spec:
triggers:
- type: git
provider: github
name: main
repo: vfarcic/argocd-production
events:
- push
branchRegex: /master/gi
modifiedFilesGlob: "argocd/**"
verified: true
contexts: []
steps:
main_clone:
title: Cloning main repository
type: git-clone
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
revision: '${{CF_REVISION}}'
git: devops-catalog
apply_env:
title: Applying production environment
image: codefresh/kubectl
commands:
- kubectl config use-context my-cluster
- kubectl apply --filename argocd/apps.yaml
stages: []

40 changes: 40 additions & 0 deletions codefresh/create-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---

apiVersion: v1
kind: Namespace
metadata:
name: codefresh

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: codefresh
rules:
- apiGroups: [ "*"]
resources: ["*"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: codefresh
namespace: codefresh

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: codefresh
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: codefresh
subjects:
- kind: ServiceAccount
name: codefresh
namespace: codefresh
4 changes: 4 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Production environment
name: devops-toolkit
version: "0.1.0"
27 changes: 27 additions & 0 deletions helm/templates/devops-paradox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: devops-paradox
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
path: helm
repoURL: https://github.com/vfarcic/devops-paradox.git
targetRevision: HEAD
helm:
values: |
image:
tag: latest
ingress:
host: devopsparadox.com
version: v3
destination:
namespace: production
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
28 changes: 28 additions & 0 deletions helm/templates/devops-toolkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: devops-toolkit
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
path: helm
repoURL: https://github.com/vfarcic/devops-toolkit.git
targetRevision: HEAD
helm:
values: |
image:
tag: latest
ingress:
host: devopstoolkitseries.com
version: v3
destination:
namespace: production
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true

22 changes: 22 additions & 0 deletions orig/apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: production
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
repoURL: https://github.com/vfarcic/argocd-production.git
targetRevision: HEAD
path: helm
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
23 changes: 23 additions & 0 deletions orig/argo-rollouts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argo-rollouts
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: production
source:
path: charts/argo-rollouts
repoURL: https://github.com/argoproj/argo-helm
targetRevision: HEAD
destination:
namespace: argo-rollouts
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true

33 changes: 33 additions & 0 deletions orig/argocd-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "1.0"
kind: pipeline
metadata:
name: CF_PROJECT/argocd-production
description: Argo CD production environment app
project: CF_PROJECT
spec:
triggers:
- type: git
provider: github
name: main
repo: GH_ORG/argocd-production
events:
- push
branchRegex: /master/gi
modifiedFilesGlob: "argocd/**"
verified: true
contexts: []
steps:
main_clone:
title: Cloning main repository
type: git-clone
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
revision: '${{CF_REVISION}}'
git: CF_GIT_CONTEXT
apply_env:
title: Applying production environment
image: codefresh/kubectl
commands:
- kubectl config use-context CF_CLUSTER
- kubectl apply --filename argocd/apps.yaml
stages: []

40 changes: 40 additions & 0 deletions orig/create-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---

apiVersion: v1
kind: Namespace
metadata:
name: codefresh

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: codefresh
rules:
- apiGroups: [ "*"]
resources: ["*"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: codefresh
namespace: codefresh

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: codefresh
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: codefresh
subjects:
- kind: ServiceAccount
name: codefresh
namespace: codefresh
Loading

0 comments on commit 6bacf0e

Please sign in to comment.