feat(portfolio): add staging environment
This commit is contained in:
parent
0dda9f282d
commit
13ea8de355
11 changed files with 339 additions and 0 deletions
22
apps/portfolio/base/deployment.yaml
Normal file
22
apps/portfolio/base/deployment.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: portfolio
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: portfolio
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
app: portfolio
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.int.nc.landry.land/portfolio-site
|
||||
name: portfolio-site
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
restartPolicy: Always
|
||||
6
apps/portfolio/base/kustomization.yaml
Normal file
6
apps/portfolio/base/kustomization.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ./deployment.yaml
|
||||
- ./service.yaml
|
||||
13
apps/portfolio/base/service.yaml
Normal file
13
apps/portfolio/base/service.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
name: syncthing
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: http
|
||||
selector:
|
||||
app: syncthing
|
||||
11
apps/portfolio/overlays/prod-sites/config.json.disabled
Normal file
11
apps/portfolio/overlays/prod-sites/config.json.disabled
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"appName": "portfolio",
|
||||
"userGivenName": "portfolio",
|
||||
"destNamespace": "staging-sites",
|
||||
"destServer": "https://kubernetes.default.svc",
|
||||
"srcPath": "apps/portfolio/overlays/staging-sites",
|
||||
"srcRepoURL": "ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.git",
|
||||
"srcTargetRevision": "",
|
||||
"labels": null,
|
||||
"annotations": null
|
||||
}
|
||||
31
apps/portfolio/overlays/prod-sites/ingress.yaml
Normal file
31
apps/portfolio/overlays/prod-sites/ingress.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: portfolio
|
||||
labels:
|
||||
app.kubernetes.io/name: portfolio
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-issuer
|
||||
nginx.ingress.kubernetes.io/whitelist-source-range: 192.168.1.1/16
|
||||
|
||||
gethomepage.dev/enabled: "true"
|
||||
gethomepage.dev/name: Portfolio
|
||||
gethomepage.dev/group: Sites
|
||||
gethomepage.dev/href: https://portfolio-test.int.nc.landry.land
|
||||
# gethomepage.dev/description:
|
||||
# gethomepage.dev/icon: syncthing
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- "portfolio-test.int.nc.landry.land"
|
||||
rules:
|
||||
- host: "portfolio-test.int.nc.landry.land"
|
||||
http:
|
||||
paths:
|
||||
- path: "/"
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: portfolio
|
||||
port:
|
||||
name: http
|
||||
9
apps/portfolio/overlays/prod-sites/kustomization.yaml
Normal file
9
apps/portfolio/overlays/prod-sites/kustomization.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../../base
|
||||
- ./ingress.yaml
|
||||
images:
|
||||
- name: registry.int.nc.landry.land/portfolio-site
|
||||
newTag: latest
|
||||
11
apps/portfolio/overlays/staging-sites/config.json
Normal file
11
apps/portfolio/overlays/staging-sites/config.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"appName": "portfolio",
|
||||
"userGivenName": "portfolio",
|
||||
"destNamespace": "staging-sites",
|
||||
"destServer": "https://kubernetes.default.svc",
|
||||
"srcPath": "apps/portfolio/overlays/staging-sites",
|
||||
"srcRepoURL": "ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.git",
|
||||
"srcTargetRevision": "",
|
||||
"labels": null,
|
||||
"annotations": null
|
||||
}
|
||||
31
apps/portfolio/overlays/staging-sites/ingress.yaml
Normal file
31
apps/portfolio/overlays/staging-sites/ingress.yaml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: portfolio
|
||||
labels:
|
||||
app.kubernetes.io/name: portfolio
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-issuer
|
||||
nginx.ingress.kubernetes.io/whitelist-source-range: 192.168.1.1/16
|
||||
|
||||
gethomepage.dev/enabled: "true"
|
||||
gethomepage.dev/name: Portfolio
|
||||
gethomepage.dev/group: Sites
|
||||
gethomepage.dev/href: https://portfolio-test.int.nc.landry.land
|
||||
# gethomepage.dev/description:
|
||||
# gethomepage.dev/icon: syncthing
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- "portfolio-test.int.nc.landry.land"
|
||||
rules:
|
||||
- host: "portfolio-test.int.nc.landry.land"
|
||||
http:
|
||||
paths:
|
||||
- path: "/"
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: portfolio
|
||||
port:
|
||||
name: http
|
||||
9
apps/portfolio/overlays/staging-sites/kustomization.yaml
Normal file
9
apps/portfolio/overlays/staging-sites/kustomization.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../../base
|
||||
- ./ingress.yaml
|
||||
images:
|
||||
- name: registry.int.nc.landry.land/portfolio-site
|
||||
newTag: staging
|
||||
98
projects/prod-sites.yaml
Normal file
98
projects/prod-sites.yaml
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
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: prod-sites
|
||||
namespace: argocd
|
||||
spec:
|
||||
clusterResourceWhitelist:
|
||||
- group: "*"
|
||||
kind: "*"
|
||||
description: prod version of static sites
|
||||
destinations:
|
||||
- namespace: "prod-sites"
|
||||
server: "*"
|
||||
namespaceResourceWhitelist:
|
||||
- group: "*"
|
||||
kind: "*"
|
||||
sourceRepos:
|
||||
- "*"
|
||||
status: {}
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
creationTimestamp: null
|
||||
name: prod-sites
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
files:
|
||||
- path: apps/**/prod-sites/config.json
|
||||
repoURL: ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
- git:
|
||||
files:
|
||||
- path: apps/**/prod-sites/config_dir.json
|
||||
repoURL: ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.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: prod-sites-{{ userGivenName }}
|
||||
namespace: argocd
|
||||
spec:
|
||||
destination:
|
||||
namespace: "{{ destNamespace }}"
|
||||
server: "{{ destServer }}"
|
||||
ignoreDifferences:
|
||||
- group: argoproj.io
|
||||
jsonPointers:
|
||||
- /status
|
||||
kind: Application
|
||||
project: prod-sites
|
||||
source:
|
||||
path: "{{ srcPath }}"
|
||||
repoURL: "{{ srcRepoURL }}"
|
||||
targetRevision: "{{ srcTargetRevision }}"
|
||||
syncPolicy:
|
||||
automated:
|
||||
allowEmpty: true
|
||||
prune: true
|
||||
selfHeal: true
|
||||
status: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: prod-sites
|
||||
98
projects/staging-sites.yaml
Normal file
98
projects/staging-sites.yaml
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
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: staging-sites
|
||||
namespace: argocd
|
||||
spec:
|
||||
clusterResourceWhitelist:
|
||||
- group: "*"
|
||||
kind: "*"
|
||||
description: staging version of static sites
|
||||
destinations:
|
||||
- namespace: "staging-sites"
|
||||
server: "*"
|
||||
namespaceResourceWhitelist:
|
||||
- group: "*"
|
||||
kind: "*"
|
||||
sourceRepos:
|
||||
- "*"
|
||||
status: {}
|
||||
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "0"
|
||||
creationTimestamp: null
|
||||
name: staging-sites
|
||||
namespace: argocd
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
files:
|
||||
- path: apps/**/staging-sites/config.json
|
||||
repoURL: ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.git
|
||||
requeueAfterSeconds: 20
|
||||
revision: ""
|
||||
template:
|
||||
metadata: {}
|
||||
spec:
|
||||
destination: {}
|
||||
project: ""
|
||||
- git:
|
||||
files:
|
||||
- path: apps/**/staging-sites/config_dir.json
|
||||
repoURL: ssh://git@gitea-ssh.gitops.svc.cluster.local:2222/davad/argo.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-sites-{{ userGivenName }}
|
||||
namespace: argocd
|
||||
spec:
|
||||
destination:
|
||||
namespace: "{{ destNamespace }}"
|
||||
server: "{{ destServer }}"
|
||||
ignoreDifferences:
|
||||
- group: argoproj.io
|
||||
jsonPointers:
|
||||
- /status
|
||||
kind: Application
|
||||
project: staging-sites
|
||||
source:
|
||||
path: "{{ srcPath }}"
|
||||
repoURL: "{{ srcRepoURL }}"
|
||||
targetRevision: "{{ srcTargetRevision }}"
|
||||
syncPolicy:
|
||||
automated:
|
||||
allowEmpty: true
|
||||
prune: true
|
||||
selfHeal: true
|
||||
status: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: staging-sites
|
||||
Loading…
Add table
Add a link
Reference in a new issue