This repository was archived by the owner on Jan 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BC-6810 - seting up ansible and pipeline
- Loading branch information
Showing
7 changed files
with
263 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: App Deploy | ||
hosts: | ||
- develop | ||
connection: local | ||
roles: | ||
- sys | ||
- pre_deployment | ||
- doido-mongo | ||
- post_deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
galaxy_info: | ||
role_name: doido-mongo | ||
author: Schul-Cloud Verbund | ||
description: Ansible role for the deployment of an Mongo Operator who cann create MongoDBs and users and add then to kubernetes secrets | ||
company: Schul-Cloud Verbund | ||
license: license (AGPLv3) | ||
min_ansible_version: 2.8 | ||
galaxy_tags: [] | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- name: Service | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: svc.yml.j2 | ||
|
||
- name: Deployment | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: deployment.yml.j2 | ||
apply: yes | ||
|
||
- name: Ingress | ||
environment: | ||
K8S_AUTH_KUBECONFIG: "{{ ansible_env.HOME }}/.kube/config" | ||
kubernetes.core.k8s: | ||
namespace: "{{ NAMESPACE }}" | ||
template: ingress.yml.j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: doido-mongo-operator | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: doido-mongo | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/name: doido-mongo | ||
app.kubernetes.io/component: operator | ||
app.kubernetes.io/managed-by: ansible | ||
git.repo: {{ DOIDO_MONGO_REPO_NAME }} | ||
spec: | ||
replicas: {{ DOIDO_MONGO_REPLICAS|default(1, true) }} | ||
strategy: | ||
type: Recreate | ||
revisionHistoryLimit: 4 | ||
paused: false | ||
selector: | ||
matchLabels: | ||
app: doido-mongo | ||
template: | ||
metadata: | ||
labels: | ||
app: doido-mongo | ||
app.kubernetes.io/part-of: schulcloud-verbund | ||
app.kubernetes.io/name: doido-mongo | ||
app.kubernetes.io/component: operator | ||
app.kubernetes.io/managed-by: ansible | ||
git.repo: {{ DOIDO_MONGO_REPO_NAME }} | ||
annotations: | ||
configmapHash: "" | ||
spec: | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
fsGroup: 1000 | ||
runAsNonRoot: true | ||
containers: | ||
- name: doido-mongo-operator | ||
image: {{ DOIDO_MONGO_IMAGE_NAME }} | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
protocol: TCP | ||
resources: | ||
limits: | ||
cpu: {{ DOIDO_MONGO_CPU_LIMITS|default("1000m", true) }} | ||
memory: {{ DOIDO_MONGO_MEMORY_LIMITS|default("1Gi", true) }} | ||
requests: | ||
cpu: {{ DOIDO_MONGO_CPU_REQUESTS|default("100m", true) }} | ||
memory: {{ DOIDO_MONGO_MEMORY_REQUESTS|default("128Mi", true) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#jinja2: trim_blocks: "True", lstrip_blocks: "True" | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: doido-mongo-ingress | ||
namespace: {{ NAMESPACE }} | ||
annotations: | ||
nginx.ingress.kubernetes.io/ssl-redirect: "{{ TLS_ENABLED|default("false") }}" | ||
{% if CLUSTER_ISSUER is defined %} | ||
cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }} | ||
{% endif %} | ||
|
||
spec: | ||
ingressClassName: {{ INGRESS_CLASS }} | ||
{% if CLUSTER_ISSUER is defined or (TLS_ENABLED is defined and TLS_ENABLED|bool) %} | ||
tls: | ||
- hosts: | ||
- {{ DOMAIN }} | ||
{% if CLUSTER_ISSUER is defined %} | ||
secretName: {{ DOMAIN }}-tls | ||
{% endif %} | ||
{% endif %} | ||
rules: | ||
- host: {{ DOMAIN }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: doido-mongo-svc | ||
port: | ||
number: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: doido-mongo-svc | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: doido-mongo | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: doido-mongo |