add hoylogo deployment to this repo
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6ae43134b9
commit
651cfe10ba
10 changed files with 392 additions and 0 deletions
88
.drone.yml
Normal file
88
.drone.yml
Normal file
|
@ -0,0 +1,88 @@
|
|||
kind: pipeline
|
||||
name: deploy
|
||||
steps:
|
||||
- name: kustomize build hoylogo (prod + staging)
|
||||
image: git.ar21.de/aaron/kustomize-ci
|
||||
commands:
|
||||
- cd /deployment-repo
|
||||
- git clone https://git.ar21.de/aaron/k8s-deployments.git .
|
||||
- cd /deployment-repo/hoylogo/overlays/prod
|
||||
- kustomize build -o /deployment-repo/hoylogo/prod/hoylogo.yaml
|
||||
- cd /deployment-repo/hoylogo/overlays/staging
|
||||
- kustomize build -o /deployment-repo/hoylogo/staging/hoylogo.yaml
|
||||
volumes:
|
||||
- name: deployment-repo
|
||||
path: /deployment-repo
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- name: kustomize build hoylogo (staging)
|
||||
image: git.ar21.de/aaron/kustomize-ci
|
||||
commands:
|
||||
- cd /deployment-repo
|
||||
- git clone https://git.ar21.de/aaron/k8s-deployments.git .
|
||||
- cd /staging-repo
|
||||
- git clone -b $DRONE_BRANCH https://git.ar21.de/aaron/k8s-deployments.git .
|
||||
- cd /staging-repo/hoylogo/overlays/staging
|
||||
- kustomize build -o /deployment-repo/hoylogo/staging/hoylogo.yaml
|
||||
volumes:
|
||||
- name: deployment-repo
|
||||
path: /deployment-repo
|
||||
- name: staging-repo
|
||||
path: /staging-repo
|
||||
when:
|
||||
branch:
|
||||
exclude:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- name: kustomize push hoylogo changes (prod + staging)
|
||||
image: appleboy/drone-git-push
|
||||
settings:
|
||||
branch: main
|
||||
remote: ssh://git@git.ar21.de:2222/aaron/k8s-deployments.git
|
||||
path: /deployment-repo
|
||||
force: false
|
||||
commit: true
|
||||
commit_message: "KUSTOMIZE BUILD: rebuild hoylogo deployment with kustomize ${DRONE_BUILD_NUMBER} (done automagically via Drone pipeline) [CI SKIP]"
|
||||
ssh_key:
|
||||
from_secret: GITEA_SSH_KEY
|
||||
volumes:
|
||||
- name: deployment-repo
|
||||
path: /deployment-repo
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- name: kustomize push hoylogo changes (staging)
|
||||
image: appleboy/drone-git-push
|
||||
settings:
|
||||
branch: main
|
||||
remote: ssh://git@git.ar21.de:2222/aaron/k8s-deployments.git
|
||||
path: /deployment-repo
|
||||
force: false
|
||||
commit: true
|
||||
commit_message: "KUSTOMIZE BUILD STAGING: rebuild hoylogo deployment with kustomize ${DRONE_BUILD_NUMBER} [CI SKIP]"
|
||||
ssh_key:
|
||||
from_secret: GITEA_SSH_KEY
|
||||
volumes:
|
||||
- name: deployment-repo
|
||||
path: /deployment-repo
|
||||
when:
|
||||
branch:
|
||||
exclude:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
volumes:
|
||||
- name: deployment-repo
|
||||
temp: {}
|
||||
- name: staging-repo
|
||||
temp: {}
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
|
@ -68,3 +68,43 @@ spec:
|
|||
- CreateNamespace=true
|
||||
automated:
|
||||
prune: false
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: hoylogo
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://git.ar21.de/aaron/k8s-deployments.git
|
||||
targetRevision: HEAD
|
||||
path: hoylogo/prod
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: hoylogo
|
||||
syncPolicy:
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
automated:
|
||||
prune: true
|
||||
---
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: hoylogo-staging
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://git.ar21.de/aaron/k8s-deployments.git
|
||||
targetRevision: HEAD
|
||||
path: hoylogo/staging
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: hoylogo-staging
|
||||
syncPolicy:
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
automated:
|
||||
prune: true
|
||||
|
|
71
hoylogo/base/hoylogo.yaml
Normal file
71
hoylogo/base/hoylogo.yaml
Normal file
|
@ -0,0 +1,71 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: hoylogo
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: hoylogo-deployment
|
||||
namespace: hoylogo
|
||||
labels:
|
||||
app: hoylogo
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: hoylogo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: hoylogo
|
||||
spec:
|
||||
containers:
|
||||
- name: hoylogo
|
||||
image: git.ar21.de/aaron/hoylogo:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 4
|
||||
periodSeconds: 3
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hoylogo-service
|
||||
namespace: hoylogo
|
||||
spec:
|
||||
selector:
|
||||
app: hoylogo
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: hoylogo-ingress
|
||||
namespace: hoylogo
|
||||
annotations:
|
||||
kubernetes.io/tls-acme: "true"
|
||||
spec:
|
||||
rules:
|
||||
- host: "hoylogo.de"
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: hoylogo-service
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- hoylogo.de
|
||||
secretName: hoylogo-tls-key
|
4
hoylogo/base/kustomization.yaml
Normal file
4
hoylogo/base/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- hoylogo.yaml
|
20
hoylogo/overlays/prod/kustomization.yaml
Normal file
20
hoylogo/overlays/prod/kustomization.yaml
Normal file
|
@ -0,0 +1,20 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ../../base
|
||||
images:
|
||||
- name: git.ar21.de/aaron/hoylogo
|
||||
newName: git.ar21.de/aaron/hoylogo
|
||||
newTag: "21"
|
||||
namespace: hoylogo
|
||||
patches:
|
||||
- patch: |-
|
||||
- op: replace
|
||||
path: /spec/rules/0/host
|
||||
value: "hoylogo-prod.apps.yolokube.de"
|
||||
- op: replace
|
||||
path: /spec/tls/0/hosts/0
|
||||
value: "hoylogo-prod.apps.yolokube.de"
|
||||
target:
|
||||
kind: Ingress
|
||||
name: hoylogo-ingress
|
27
hoylogo/overlays/staging/kustomization.yaml
Normal file
27
hoylogo/overlays/staging/kustomization.yaml
Normal file
|
@ -0,0 +1,27 @@
|
|||
resources:
|
||||
- ../../base
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
images:
|
||||
- name: git.ar21.de/aaron/hoylogo
|
||||
newName: git.ar21.de/aaron/hoylogo
|
||||
newTag: staging-20
|
||||
namespace: hoylogo-staging
|
||||
patches:
|
||||
- patch: |-
|
||||
- op: replace
|
||||
path: /spec/rules/0/host
|
||||
value: "staging.hoylogo.de"
|
||||
- op: replace
|
||||
path: /spec/tls/0/hosts/0
|
||||
value: "staging.hoylogo.de"
|
||||
target:
|
||||
kind: Ingress
|
||||
name: hoylogo-ingress
|
||||
- patch: |-
|
||||
- op: replace
|
||||
path: /spec/replicas
|
||||
value: 1
|
||||
target:
|
||||
kind: Deployment
|
||||
name: hoylogo-deployment
|
0
hoylogo/prod/.gitkeep
Normal file
0
hoylogo/prod/.gitkeep
Normal file
71
hoylogo/prod/hoylogo.yaml
Normal file
71
hoylogo/prod/hoylogo.yaml
Normal file
|
@ -0,0 +1,71 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: hoylogo
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hoylogo-service
|
||||
namespace: hoylogo
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: hoylogo
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: hoylogo
|
||||
name: hoylogo-deployment
|
||||
namespace: hoylogo
|
||||
spec:
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: hoylogo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: hoylogo
|
||||
spec:
|
||||
containers:
|
||||
- image: git.ar21.de/aaron/hoylogo:21
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 4
|
||||
periodSeconds: 3
|
||||
name: hoylogo
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/tls-acme: "true"
|
||||
name: hoylogo-ingress
|
||||
namespace: hoylogo
|
||||
spec:
|
||||
rules:
|
||||
- host: hoylogo-prod.apps.yolokube.de
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: hoylogo-service
|
||||
port:
|
||||
number: 80
|
||||
path: /
|
||||
pathType: Prefix
|
||||
tls:
|
||||
- hosts:
|
||||
- hoylogo-prod.apps.yolokube.de
|
||||
secretName: hoylogo-tls-key
|
0
hoylogo/staging/.gitkeep
Normal file
0
hoylogo/staging/.gitkeep
Normal file
71
hoylogo/staging/hoylogo.yaml
Normal file
71
hoylogo/staging/hoylogo.yaml
Normal file
|
@ -0,0 +1,71 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: hoylogo-staging
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: hoylogo-service
|
||||
namespace: hoylogo-staging
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app: hoylogo
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: hoylogo
|
||||
name: hoylogo-deployment
|
||||
namespace: hoylogo-staging
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: hoylogo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: hoylogo
|
||||
spec:
|
||||
containers:
|
||||
- image: git.ar21.de/aaron/hoylogo:staging-20
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 4
|
||||
periodSeconds: 3
|
||||
name: hoylogo
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/tls-acme: "true"
|
||||
name: hoylogo-ingress
|
||||
namespace: hoylogo-staging
|
||||
spec:
|
||||
rules:
|
||||
- host: staging.hoylogo.de
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: hoylogo-service
|
||||
port:
|
||||
number: 80
|
||||
path: /
|
||||
pathType: Prefix
|
||||
tls:
|
||||
- hosts:
|
||||
- staging.hoylogo.de
|
||||
secretName: hoylogo-tls-key
|
Loading…
Reference in a new issue