init
This commit is contained in:
118
README.md
Normal file
118
README.md
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
```shell
|
||||||
|
kind create cluster --config management.yaml
|
||||||
|
kind create cluster --config staging.yaml
|
||||||
|
kind create cluster --config production.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kctx kind-management
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
export GIT_TOKEN=<TOKEN>
|
||||||
|
export GIT_REPO=https://github.com/Mathod95/courses/courses_002/autopilot
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
argocd-autopilot repo bootstrap
|
||||||
|
or
|
||||||
|
argocd-autopilot repo bootstrap --recover
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
INFO argocd initialized. password: <PASSWORD>
|
||||||
|
INFO run:
|
||||||
|
|
||||||
|
kubectl port-forward -n argocd svc/argocd-server 8080:80
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kns argocd
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
❯ argocd login --core
|
||||||
|
Context 'kubernetes' updated
|
||||||
|
|
||||||
|
❯ argocd cluster list
|
||||||
|
SERVER NAME VERSION STATUS MESSAGE PROJECT
|
||||||
|
https://kubernetes.default.svc in-cluster 1.32 Successful
|
||||||
|
|
||||||
|
❯ argocd cluster add
|
||||||
|
CURRENT NAME CLUSTER SERVER
|
||||||
|
* kind-management kind-management https://127.0.0.1:41469
|
||||||
|
kind-production kind-production https://127.0.0.1:44821
|
||||||
|
kind-staging kind-staging https://127.0.0.1:40971
|
||||||
|
|
||||||
|
❯ argocd cluster add kind-production --project production
|
||||||
|
WARNING: This will create a service account `argocd-manager` on the cluster referenced by context `kind-production` with full cluster level privileges. Do you want to continue [y/N]? y
|
||||||
|
{"level":"info","msg":"ServiceAccount \"argocd-manager\" created in namespace \"kube-system\"","time":"2025-05-11T17:49:02+02:00"}
|
||||||
|
{"level":"info","msg":"ClusterRole \"argocd-manager-role\" created","time":"2025-05-11T17:49:02+02:00"}
|
||||||
|
{"level":"info","msg":"ClusterRoleBinding \"argocd-manager-role-binding\" created","time":"2025-05-11T17:49:02+02:00"}
|
||||||
|
{"level":"info","msg":"Created bearer token secret for ServiceAccount \"argocd-manager\"","time":"2025-05-11T17:49:02+02:00"}
|
||||||
|
Cluster 'https://127.0.0.1:44821' added
|
||||||
|
|
||||||
|
❯ argocd cluster add kind-staging --project staging
|
||||||
|
WARNING: This will create a service account `argocd-manager` on the cluster referenced by context `kind-staging` with full cluster level privileges. Do you want to continue [y/N]? y
|
||||||
|
{"level":"info","msg":"ServiceAccount \"argocd-manager\" created in namespace \"kube-system\"","time":"2025-05-11T17:49:10+02:00"}
|
||||||
|
{"level":"info","msg":"ClusterRole \"argocd-manager-role\" created","time":"2025-05-11T17:49:10+02:00"}
|
||||||
|
{"level":"info","msg":"ClusterRoleBinding \"argocd-manager-role-binding\" created","time":"2025-05-11T17:49:10+02:00"}
|
||||||
|
{"level":"info","msg":"Created bearer token secret for ServiceAccount \"argocd-manager\"","time":"2025-05-11T17:49:10+02:00"}
|
||||||
|
Cluster 'https://127.0.0.1:40971' added
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
argocd-autopilot project create production --dest-server
|
||||||
|
argocd-autopilot project create staging --dest-server
|
||||||
|
argocd-autopilot project create management --dest-server in-cluster --project management --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
argocd-autopilot app create hello-world --app github.com/Mathod95/courses/courses_002/apps/examples -p production --wait-timeout 2m
|
||||||
|
argocd-autopilot app create hello-world --app github.com/Mathod95/courses/courses_002/apps/examples --p staging --wait-timeout 2m
|
||||||
|
|
||||||
|
argocd-autopilot app create uptime-kuma --app github.com/Mathod95/courses/courses_002/apps/uptimekuma -p production --wait-timeout 2m
|
||||||
|
argocd-autopilot app create uptime-kuma --app github.com/Mathod95/courses/courses_002/apps/uptimekuma -p staging --wait-timeout 2m
|
||||||
|
|
||||||
|
argocd-autopilot app create uptime-kuma --app github.com/Mathod95/courses/courses_002/apps/uptimekuma --project staging --namespace uptimekuma --wait-timeout 2m
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
❯ argocd cluster list
|
||||||
|
aSERVER NAME VERSION STATUS MESSAGE PROJECT
|
||||||
|
https://192.168.1.23:6445 kind-staging 1.32 Successful staging
|
||||||
|
https://192.168.1.23:6444 kind-production 1.32 Successful production
|
||||||
|
https://kubernetes.default.svc in-cluster 1.32 Successful
|
||||||
|
|
||||||
|
❯ argocd proj list
|
||||||
|
NAME DESCRIPTION DESTINATIONS SOURCES CLUSTER-RESOURCE-WHITELIST NAMESPACE-RESOURCE-BLACKLIST SIGNATURE-KEYS ORPHANED-RESOURCES DESTINATION-SERVICE-ACCOUNTS
|
||||||
|
default *,* * */* <none> <none> disabled <none>
|
||||||
|
production production project *,* * */* <none> <none> disabled <none>
|
||||||
|
staging staging project *,* * */* <none> <none> disabled <none>
|
||||||
|
|
||||||
|
❯ argocd cluster list
|
||||||
|
SERVER NAME VERSION STATUS MESSAGE PROJECT
|
||||||
|
https://192.168.1.23:6445 kind-staging 1.32 Successful staging
|
||||||
|
https://192.168.1.23:6444 kind-production 1.32 Successful production
|
||||||
|
https://kubernetes.default.svc in-cluster 1.32 Successful
|
||||||
|
|
||||||
|
❯ argocd proj list
|
||||||
|
NAME DESCRIPTION DESTINATIONS SOURCES CLUSTER-RESOURCE-WHITELIST NAMESPACE-RESOURCE-BLACKLIST SIGNATURE-KEYS ORPHANED-RESOURCES DESTINATION-SERVICE-ACCOUNTS
|
||||||
|
default *,* * */* <none> <none> disabled <none>
|
||||||
|
production production project https://192.168.1.23:6444,* * */* <none> <none> disabled <none>
|
||||||
|
staging staging project https://192.168.1.23:6445,* * */* <none> <none> disabled <none>
|
||||||
|
|
||||||
|
❯ argocd-autopilot app create hello-world --app github.com/Mathod95/courses/courses_002/apps/examples -p production --wait-timeout 2m
|
||||||
|
INFO cloning git repository: https://github.com/Mathod95/courses.git
|
||||||
|
Enumerating objects: 41, done.
|
||||||
|
Counting objects: 100% (41/41), done.
|
||||||
|
Compressing objects: 100% (33/33), done.
|
||||||
|
Total 41 (delta 6), reused 34 (delta 4), pack-reused 0 (from 0)
|
||||||
|
INFO using revision: "", installation path: "/courses_002/autopilot"
|
||||||
|
INFO cloning repo: 'https://github.com/Mathod95/courses.git', to infer app type from path 'courses_002/apps/examples'
|
||||||
|
Enumerating objects: 41, done.
|
||||||
|
Counting objects: 100% (41/41), done.
|
||||||
|
Compressing objects: 100% (33/33), done.
|
||||||
|
Total 41 (delta 6), reused 34 (delta 4), pack-reused 0 (from 0)
|
||||||
|
INFO inferred application type: kustomize
|
||||||
|
FATAL cluster 'https://192.168.1.23:6444' is not configured yet, you need to create a project that uses this cluster first
|
||||||
6
draft/apps/examples/README.md
Normal file
6
draft/apps/examples/README.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# demo-app
|
||||||
|
### Installation:
|
||||||
|
To install this application using the `argocd-autopilot`, assuming you already have gone through the [bootstrap process](https://argocd-autopilot.readthedocs.io/en/latest/Getting-Started/), run the following:
|
||||||
|
```bash
|
||||||
|
argocd-autopilot app create hello-world --app github.com/Mathod95/courses/courses_002/apps/examples -p production
|
||||||
|
```
|
||||||
19
draft/apps/examples/deployment.yaml
Normal file
19
draft/apps/examples/deployment.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: simple-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: trivial-go-web-app
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: trivial-go-web-app
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: webserver-simple
|
||||||
|
image: docker.io/kostiscodefresh/simple-web-app:3d9b390
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
5
draft/apps/examples/kustomization.yaml
Normal file
5
draft/apps/examples/kustomization.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./deployment.yaml
|
||||||
|
- ./service.yaml
|
||||||
11
draft/apps/examples/service.yaml
Normal file
11
draft/apps/examples/service.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: simple-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: trivial-go-web-app
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 8080
|
||||||
6
draft/apps/uptimekuma/README.md
Normal file
6
draft/apps/uptimekuma/README.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# demo-app
|
||||||
|
### Installation:
|
||||||
|
To install this application using the `argocd-autopilot`, assuming you already have gone through the [bootstrap process](https://argocd-autopilot.readthedocs.io/en/latest/Getting-Started/), run the following:
|
||||||
|
```bash
|
||||||
|
argocd-autopilot app create uptimekuma --app github.com/Mathod95/courses/courses_002/apps/uptimekuma -p production
|
||||||
|
```
|
||||||
26
draft/apps/uptimekuma/deployment.yaml
Normal file
26
draft/apps/uptimekuma/deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: uptime-kuma
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: uptime-kuma
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: uptime-kuma
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: uptime-kuma
|
||||||
|
image: louislam/uptime-kuma:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 3001
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /app/data
|
||||||
|
name: uptime-kuma-data
|
||||||
|
volumes:
|
||||||
|
- name: uptime-kuma-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: uptime-kuma-pvc
|
||||||
7
draft/apps/uptimekuma/kustomization.yaml
Normal file
7
draft/apps/uptimekuma/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ./deployment.yaml
|
||||||
|
- ./service.yaml
|
||||||
|
- ./persistent_volume.yaml
|
||||||
|
- ./persistent_volume_claim.yaml
|
||||||
11
draft/apps/uptimekuma/persistent_volume.yaml
Normal file
11
draft/apps/uptimekuma/persistent_volume.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: uptime-kuma-pv
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 5Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/data/uptime-kuma
|
||||||
10
draft/apps/uptimekuma/persistent_volume_claim.yaml
Normal file
10
draft/apps/uptimekuma/persistent_volume_claim.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: uptime-kuma-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
11
draft/apps/uptimekuma/service.yaml
Normal file
11
draft/apps/uptimekuma/service.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: uptime-kuma
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: uptime-kuma
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 3001
|
||||||
27
draft/autopilot/apps/README.md
Normal file
27
draft/autopilot/apps/README.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Apps
|
||||||
|
This directory contains all of the applications you installed by using:
|
||||||
|
```bash
|
||||||
|
argocd-autopilot app create <APP_NAME> --app <APP_SPECIFIER> -p <PROJECT_NAME>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Application Types
|
||||||
|
> If you don't specify the application `--type` argocd-autopilot will try to clone the source repository and infer the application type [automatically](https://argoproj.github.io/argo-cd/user-guide/tool_detection/#tool-detection)
|
||||||
|
|
||||||
|
* ### Directory application
|
||||||
|
Such an application references a specific directory at a given repo URL, path and revision. It will be persisted in the GitOps Repository as a single file at `apps/<APP_NAME>/<PROJECT_NAME>/config.json`.
|
||||||
|
#### Example:
|
||||||
|
```bash
|
||||||
|
argocd-autopilot app create dir-example --app github.com/argoproj-labs/argocd-autopilot/examples/demo-dir/ -p <PROJECT_NAME> --type dir
|
||||||
|
```
|
||||||
|
|
||||||
|
* ### Kustomize application
|
||||||
|
A Kustomize application will have <u>exactly one</u>: `apps/<APP_NAME>/base/kustomization.yaml` file, and one or more `apps/<APP_NAME>/overlays/<PROJECT_NAME>/` folders.
|
||||||
|
|
||||||
|
The `apps/<APP_NAME>/base/kustomization.yaml` file is created the first time you create the application. The `apps/<APP_NAME>/overlays/<PROJECT_NAME>/` folder is created for each project you install this application on. So all overlays of the same application are using the same base `kustomization.yaml`.
|
||||||
|
#### Example:
|
||||||
|
Try running the following command:
|
||||||
|
```bash
|
||||||
|
argocd-autopilot app create hello-world --app github.com/argoproj-labs/argocd-autopilot/examples/demo-app/ -p <PROJECT_NAME> --type kustomize
|
||||||
|
```
|
||||||
|
|
||||||
|
###### * If you did not create a project yet take a look at: [creating a project](https://argocd-autopilot.readthedocs.io/en/stable/Getting-Started/#add-a-project-and-an-application).
|
||||||
4
draft/autopilot/apps/hello-world/base/kustomization.yaml
Normal file
4
draft/autopilot/apps/hello-world/base/kustomization.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- github.com/Mathod95/courses/courses_002/apps/examples
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"appName": "hello-world",
|
||||||
|
"userGivenName": "hello-world",
|
||||||
|
"destNamespace": "default",
|
||||||
|
"destServer": "https://192.168.1.23:6444",
|
||||||
|
"srcPath": "courses_002/autopilot/apps/hello-world/overlays/production",
|
||||||
|
"srcRepoURL": "https://github.com/Mathod95/courses.git",
|
||||||
|
"srcTargetRevision": "",
|
||||||
|
"labels": null,
|
||||||
|
"annotations": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"appName": "hello-world",
|
||||||
|
"userGivenName": "hello-world",
|
||||||
|
"destNamespace": "default",
|
||||||
|
"destServer": "https://192.168.1.23:6445",
|
||||||
|
"srcPath": "courses_002/autopilot/apps/hello-world/overlays/staging",
|
||||||
|
"srcRepoURL": "https://github.com/Mathod95/courses.git",
|
||||||
|
"srcTargetRevision": "",
|
||||||
|
"labels": null,
|
||||||
|
"annotations": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
4
draft/autopilot/apps/uptime-kuma/base/kustomization.yaml
Normal file
4
draft/autopilot/apps/uptime-kuma/base/kustomization.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- github.com/Mathod95/courses/courses_002/apps/uptimekuma
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"appName": "uptime-kuma",
|
||||||
|
"userGivenName": "uptime-kuma",
|
||||||
|
"destNamespace": "default",
|
||||||
|
"destServer": "https://kubernetes.default.svc",
|
||||||
|
"srcPath": "courses_002/autopilot/apps/uptime-kuma/overlays/management",
|
||||||
|
"srcRepoURL": "https://github.com/Mathod95/courses.git",
|
||||||
|
"srcTargetRevision": "",
|
||||||
|
"labels": null,
|
||||||
|
"annotations": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
38
draft/autopilot/bootstrap/argo-cd.yaml
Normal file
38
draft/autopilot/bootstrap/argo-cd.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: argocd-autopilot
|
||||||
|
app.kubernetes.io/name: argo-cd
|
||||||
|
name: argo-cd
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
namespace: argocd
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
ignoreDifferences:
|
||||||
|
- group: argoproj.io
|
||||||
|
jsonPointers:
|
||||||
|
- /status
|
||||||
|
kind: Application
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
path: courses_002/autopilot/bootstrap/argo-cd
|
||||||
|
repoURL: https://github.com/Mathod95/courses.git
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
allowEmpty: true
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- allowEmpty=true
|
||||||
|
status:
|
||||||
|
health: {}
|
||||||
|
summary: {}
|
||||||
|
sync:
|
||||||
|
comparedTo:
|
||||||
|
destination: {}
|
||||||
|
source:
|
||||||
|
repoURL: ""
|
||||||
|
status: ""
|
||||||
17
draft/autopilot/bootstrap/argo-cd/kustomization.yaml
Normal file
17
draft/autopilot/bootstrap/argo-cd/kustomization.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
configMapGenerator:
|
||||||
|
- behavior: merge
|
||||||
|
literals:
|
||||||
|
- |
|
||||||
|
repository.credentials=- passwordSecret:
|
||||||
|
key: git_token
|
||||||
|
name: autopilot-secret
|
||||||
|
url: https://github.com/
|
||||||
|
usernameSecret:
|
||||||
|
key: git_username
|
||||||
|
name: autopilot-secret
|
||||||
|
name: argocd-cm
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: argocd
|
||||||
|
resources:
|
||||||
|
- github.com/argoproj-labs/argocd-autopilot/manifests/base?ref=v0.4.19
|
||||||
47
draft/autopilot/bootstrap/cluster-resources.yaml
Normal file
47
draft/autopilot/bootstrap/cluster-resources.yaml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: ApplicationSet
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "0"
|
||||||
|
creationTimestamp: null
|
||||||
|
name: cluster-resources
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
generators:
|
||||||
|
- git:
|
||||||
|
files:
|
||||||
|
- path: courses_002/autopilot/bootstrap/cluster-resources/*.json
|
||||||
|
repoURL: https://github.com/Mathod95/courses.git
|
||||||
|
requeueAfterSeconds: 20
|
||||||
|
revision: ""
|
||||||
|
template:
|
||||||
|
metadata: {}
|
||||||
|
spec:
|
||||||
|
destination: {}
|
||||||
|
project: ""
|
||||||
|
syncPolicy:
|
||||||
|
preserveResourcesOnDeletion: true
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: argocd-autopilot
|
||||||
|
app.kubernetes.io/name: cluster-resources-{{name}}
|
||||||
|
name: cluster-resources-{{name}}
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
server: '{{server}}'
|
||||||
|
ignoreDifferences:
|
||||||
|
- group: argoproj.io
|
||||||
|
jsonPointers:
|
||||||
|
- /status
|
||||||
|
kind: Application
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
path: courses_002/autopilot/bootstrap/cluster-resources/{{name}}
|
||||||
|
repoURL: https://github.com/Mathod95/courses.git
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
allowEmpty: true
|
||||||
|
selfHeal: true
|
||||||
|
status: {}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"name":"in-cluster","server":"https://kubernetes.default.svc"}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Cluster Resources
|
||||||
|
This directory contains all cluster resources that should be applied to cluster: `in-cluster`.
|
||||||
|
For example `Namespace` resources that are shared by multiple applications on the same namespace.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-options: Prune=false
|
||||||
|
creationTimestamp: null
|
||||||
|
name: argocd
|
||||||
|
spec: {}
|
||||||
|
status: {}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"name":"kind-production","server":"https://192.168.1.23:6444"}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Cluster Resources
|
||||||
|
This directory contains all cluster resources that should be applied to cluster: `https://192.168.1.23:6444`.
|
||||||
|
For example `Namespace` resources that are shared by multiple applications on the same namespace.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"name":"kind-staging","server":"https://192.168.1.23:6445"}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Cluster Resources
|
||||||
|
This directory contains all cluster resources that should be applied to cluster: `https://192.168.1.23:6445`.
|
||||||
|
For example `Namespace` resources that are shared by multiple applications on the same namespace.
|
||||||
40
draft/autopilot/bootstrap/root.yaml
Normal file
40
draft/autopilot/bootstrap/root.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/managed-by: argocd-autopilot
|
||||||
|
app.kubernetes.io/name: root
|
||||||
|
name: root
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
namespace: argocd
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
ignoreDifferences:
|
||||||
|
- group: argoproj.io
|
||||||
|
jsonPointers:
|
||||||
|
- /status
|
||||||
|
kind: Application
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
path: courses_002/autopilot/projects
|
||||||
|
repoURL: https://github.com/Mathod95/courses.git
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
allowEmpty: true
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- allowEmpty=true
|
||||||
|
status:
|
||||||
|
health: {}
|
||||||
|
summary: {}
|
||||||
|
sync:
|
||||||
|
comparedTo:
|
||||||
|
destination: {}
|
||||||
|
source:
|
||||||
|
repoURL: ""
|
||||||
|
status: ""
|
||||||
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: {}
|
||||||
7
kind/development.yaml
Normal file
7
kind/development.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
kind: Cluster
|
||||||
|
name: development
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
|
- role: worker
|
||||||
|
- role: worker
|
||||||
7
kind/management.yaml
Normal file
7
kind/management.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
kind: Cluster
|
||||||
|
name: management
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
|
- role: worker
|
||||||
|
- role: worker
|
||||||
8
kind/production.yaml
Normal file
8
kind/production.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
kind: Cluster
|
||||||
|
name: production
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
|
- role: control-plane
|
||||||
|
- role: worker
|
||||||
|
- role: worker
|
||||||
Reference in New Issue
Block a user