Update deployment

This commit is contained in:
Adrien Reslinger 2024-10-23 14:52:55 +02:00
parent 974d8fb7c7
commit 427e1357a0
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
6 changed files with 41 additions and 43 deletions

View file

@ -1,5 +1,5 @@
--- ---
- name: calico setup - name: Diun setup
block: block:
# - name: Include vars # - name: Include vars
# ansible.builtin.include_vars: "diun-files.yaml" # ansible.builtin.include_vars: "diun-files.yaml"
@ -8,15 +8,13 @@
kubernetes.core.k8s: kubernetes.core.k8s:
state: present state: present
context: "{{ my_context }}" context: "{{ my_context }}"
merge_type: merge apply: true
resource_definition: "{{ lookup('template', item) | from_yaml }}" namespace: "duin"
resource_definition: "{{ lookup('template', item) | from_yaml_all }}"
with_items: with_items:
- diun-ServiceAccount.yml.j2 - diun-RBAC.yml.j2
- diun-ClusterRole.yml.j2
- diun-ClusterRoleBinding.yml.j2
- diun-ConfigMap.yml.j2 - diun-ConfigMap.yml.j2
- diun-Deployment.yml.j2 - diun-Deployment.yml.j2
tags: tags:
- diun - diun

View file

@ -1,14 +0,0 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: diun
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- list

View file

@ -1,13 +0,0 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: diun
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: diun
subjects:
- kind: ServiceAccount
name: diun
namespace: default

View file

@ -2,7 +2,6 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
namespace: default
name: diun name: diun
spec: spec:
replicas: 1 replicas: 1
@ -34,6 +33,8 @@ spec:
value: "20" value: "20"
- name: DIUN_WATCH_SCHEDULE - name: DIUN_WATCH_SCHEDULE
value: "0 */6 * * *" value: "0 */6 * * *"
- name: DIUN_WATCH_JITTER
value: "30s"
- name: DIUN_PROVIDERS_KUBERNETES - name: DIUN_PROVIDERS_KUBERNETES
value: "true" value: "true"
volumeMounts: volumeMounts:
@ -50,7 +51,7 @@ spec:
hostPath: hostPath:
path: "/data" path: "/data"
type: Directory type: Directory
- configMap: - name: config
configMap:
defaultMode: 420 defaultMode: 420
name: diun-conf name: diun-conf
name: config

View file

@ -0,0 +1,32 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: diun
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: diun
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: diun
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: diun
subjects:
- kind: ServiceAccount
name: diun
namespace: default

View file

@ -1,6 +0,0 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
name: diun