init
This commit is contained in:
21
draft/autopilot/projects/README.md
Normal file
21
draft/autopilot/projects/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Projects
|
||||
This directory contains all of your `argocd-autopilot` projects. Projects provide a way to logically group applications and easily control things such as defaults and restrictions.
|
||||
|
||||
### Creating a new project
|
||||
To create a new project run:
|
||||
```bash
|
||||
export GIT_TOKEN=<YOUR_TOKEN>
|
||||
export GIT_REPO=<REPO_URL>
|
||||
|
||||
argocd-autopilot project create <PROJECT_NAME>
|
||||
```
|
||||
|
||||
### Creating a new project on different cluster
|
||||
You can create a project that deploys applications to a different cluster, instead of the cluster where Argo-CD is installed. To do that run:
|
||||
```bash
|
||||
export GIT_TOKEN=<YOUR_TOKEN>
|
||||
export GIT_REPO=<REPO_URL>
|
||||
|
||||
argocd-autopilot project create <PROJECT_NAME> --dest-kube-context <CONTEXT_NAME>
|
||||
```
|
||||
Now all applications in this project that do not explicitly specify a different `--dest-server` will be created on the project's destination server.
|
||||
93
draft/autopilot/projects/management.yaml
Normal file
93
draft/autopilot/projects/management.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: AppProject
|
||||
metadata:
|
||||
annotations:
|
||||
argocd-autopilot.argoproj-labs.io/default-dest-server: https://kubernetes.default.svc
|
||||
argocd.argoproj.io/sync-options: PruneLast=true
|
||||
argocd.argoproj.io/sync-wave: "-2"
|
||||
creationTimestamp: null
|
||||
name: management
|
||||
namespace: argocd
|
||||
spec:
|
||||
clusterResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
description: management project
|
||||
destinations:
|
||||
- namespace: '*'
|
||||
server: '*'
|
||||
namespaceResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
sourceRepos:
|
||||
- '*'
|
||||
status: {}
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
creationTimestamp: null
|
||||
name: management
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
files:
|
||||
- path: courses_002/autopilot/apps/**/management/config.json
|
||||
repoURL: https://github.com/Mathod95/courses.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
- git:
|
||||
files:
|
||||
- path: courses_002/autopilot/apps/**/management/config_dir.json
|
||||
repoURL: https://github.com/Mathod95/courses.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
source:
|
||||
directory:
|
||||
exclude: '{{ exclude }}'
|
||||
include: '{{ include }}'
|
||||
jsonnet: {}
|
||||
recurse: true
|
||||
repoURL: ""
|
||||
syncPolicy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/managed-by: argocd-autopilot
|
||||
app.kubernetes.io/name: '{{ appName }}'
|
||||
name: management-{{ userGivenName }}
|
||||
namespace: argocd
|
||||
spec:
|
||||
destination:
|
||||
namespace: '{{ destNamespace }}'
|
||||
server: '{{ destServer }}'
|
||||
ignoreDifferences:
|
||||
- group: argoproj.io
|
||||
jsonPointers:
|
||||
- /status
|
||||
kind: Application
|
||||
project: management
|
||||
source:
|
||||
path: '{{ srcPath }}'
|
||||
repoURL: '{{ srcRepoURL }}'
|
||||
targetRevision: '{{ srcTargetRevision }}'
|
||||
syncPolicy:
|
||||
automated:
|
||||
allowEmpty: true
|
||||
prune: true
|
||||
selfHeal: true
|
||||
status: {}
|
||||
93
draft/autopilot/projects/production.yaml
Normal file
93
draft/autopilot/projects/production.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: AppProject
|
||||
metadata:
|
||||
annotations:
|
||||
argocd-autopilot.argoproj-labs.io/default-dest-server: https://192.168.1.23:6444
|
||||
argocd.argoproj.io/sync-options: PruneLast=true
|
||||
argocd.argoproj.io/sync-wave: "-2"
|
||||
creationTimestamp: null
|
||||
name: production
|
||||
namespace: argocd
|
||||
spec:
|
||||
clusterResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
description: production project
|
||||
destinations:
|
||||
- namespace: '*'
|
||||
server: '*'
|
||||
namespaceResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
sourceRepos:
|
||||
- '*'
|
||||
status: {}
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
creationTimestamp: null
|
||||
name: production
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
files:
|
||||
- path: courses_002/autopilot/apps/**/production/config.json
|
||||
repoURL: https://github.com/Mathod95/courses.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
- git:
|
||||
files:
|
||||
- path: courses_002/autopilot/apps/**/production/config_dir.json
|
||||
repoURL: https://github.com/Mathod95/courses.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
source:
|
||||
directory:
|
||||
exclude: '{{ exclude }}'
|
||||
include: '{{ include }}'
|
||||
jsonnet: {}
|
||||
recurse: true
|
||||
repoURL: ""
|
||||
syncPolicy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/managed-by: argocd-autopilot
|
||||
app.kubernetes.io/name: '{{ appName }}'
|
||||
name: production-{{ userGivenName }}
|
||||
namespace: argocd
|
||||
spec:
|
||||
destination:
|
||||
namespace: '{{ destNamespace }}'
|
||||
server: '{{ destServer }}'
|
||||
ignoreDifferences:
|
||||
- group: argoproj.io
|
||||
jsonPointers:
|
||||
- /status
|
||||
kind: Application
|
||||
project: production
|
||||
source:
|
||||
path: '{{ srcPath }}'
|
||||
repoURL: '{{ srcRepoURL }}'
|
||||
targetRevision: '{{ srcTargetRevision }}'
|
||||
syncPolicy:
|
||||
automated:
|
||||
allowEmpty: true
|
||||
prune: true
|
||||
selfHeal: true
|
||||
status: {}
|
||||
93
draft/autopilot/projects/staging.yaml
Normal file
93
draft/autopilot/projects/staging.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: AppProject
|
||||
metadata:
|
||||
annotations:
|
||||
argocd-autopilot.argoproj-labs.io/default-dest-server: https://192.168.1.23:6445
|
||||
argocd.argoproj.io/sync-options: PruneLast=true
|
||||
argocd.argoproj.io/sync-wave: "-2"
|
||||
creationTimestamp: null
|
||||
name: staging
|
||||
namespace: argocd
|
||||
spec:
|
||||
clusterResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
description: staging project
|
||||
destinations:
|
||||
- namespace: '*'
|
||||
server: '*'
|
||||
namespaceResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
sourceRepos:
|
||||
- '*'
|
||||
status: {}
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
creationTimestamp: null
|
||||
name: staging
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
files:
|
||||
- path: courses_002/autopilot/apps/**/staging/config.json
|
||||
repoURL: https://github.com/Mathod95/courses.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
- git:
|
||||
files:
|
||||
- path: courses_002/autopilot/apps/**/staging/config_dir.json
|
||||
repoURL: https://github.com/Mathod95/courses.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
source:
|
||||
directory:
|
||||
exclude: '{{ exclude }}'
|
||||
include: '{{ include }}'
|
||||
jsonnet: {}
|
||||
recurse: true
|
||||
repoURL: ""
|
||||
syncPolicy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/managed-by: argocd-autopilot
|
||||
app.kubernetes.io/name: '{{ appName }}'
|
||||
name: staging-{{ userGivenName }}
|
||||
namespace: argocd
|
||||
spec:
|
||||
destination:
|
||||
namespace: '{{ destNamespace }}'
|
||||
server: '{{ destServer }}'
|
||||
ignoreDifferences:
|
||||
- group: argoproj.io
|
||||
jsonPointers:
|
||||
- /status
|
||||
kind: Application
|
||||
project: staging
|
||||
source:
|
||||
path: '{{ srcPath }}'
|
||||
repoURL: '{{ srcRepoURL }}'
|
||||
targetRevision: '{{ srcTargetRevision }}'
|
||||
syncPolicy:
|
||||
automated:
|
||||
allowEmpty: true
|
||||
prune: true
|
||||
selfHeal: true
|
||||
status: {}
|
||||
Reference in New Issue
Block a user