Skip to content

Commit

Permalink
Update configs
Browse files Browse the repository at this point in the history
Closes #13
  • Loading branch information
edwardtheharris committed Jul 26, 2024
1 parent b42e0ab commit acb0bd8
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 15 deletions.
21 changes: 6 additions & 15 deletions roles/kv/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,9 @@
group: root
mode: ug+rw,o-rwx
- name: Deploy the manifest
ansible.builtin.shell:
cmd: |-
source /root/.bashrc
kube-vip
kube-vip manifest pod \
--interface "{{ kv_interface }}" \
--address "{{ kv_aa }}" \
--controlplane \
--services \
--arp \
--leaderElection | tee /etc/kubernetes/manifests/kube-vip.yaml
register: kv_manifest
- name: Output kube-vip
ansible.builtin.debug:
var: kv_manifest
ansible.builtin.template:
src: kube-vip.yaml
dest: /etc/kubernetes/manifests/kube-vip.yaml
owner: kube
group: kube
mode: ug+rw,g-rwx
69 changes: 69 additions & 0 deletions roles/kv/templates/kube-vip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
name: kube-vip
namespace: kube-system
spec:
containers:
- args:
- manager
env:
- name: vip_arp
value: "true"
- name: port
value: "6443"
- name: vip_nodename
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: vip_interface
value: {{ kv_interface }}
- name: vip_cidr
value: "24"
- name: dns_mode
value: first
- name: cp_enable
value: "true"
- name: cp_namespace
value: kube-system
- name: svc_enable
value: "true"
- name: svc_leasename
value: plndr-svcs-lock
- name: vip_leaderelection
value: "true"
- name: vip_leasename
value: plndr-cp-lock
- name: vip_leaseduration
value: "5"
- name: vip_renewdeadline
value: "3"
- name: vip_retryperiod
value: "1"
- name: address
value: {{ kv_aa }}
- name: prometheus_server
value: :2112
image: ghcr.io/kube-vip/kube-vip:v0.8.2
imagePullPolicy: IfNotPresent
name: kube-vip
resources: {}
securityContext:
capabilities:
add:
- NET_ADMIN
- NET_RAW
volumeMounts:
- mountPath: /etc/kubernetes/admin.conf
name: kubeconfig
hostAliases:
- hostnames:
- kubernetes
ip: 127.0.0.1
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
name: kubeconfig
status: {}
7 changes: 7 additions & 0 deletions roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
owner: root
group: root
mode: u+rwx,go-rwx
- name: Template hosts file
ansible.builtin.template:
src: hosts
dest: /etc/hosts
owner: root
group: root
mode: u+rw,go+r
###
# ```{rubric} Show and record output
# ```
Expand Down
6 changes: 6 additions & 0 deletions roles/reset/templates/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Static table lookup for hostnames.
# See hosts(5) for details.

{% for host in hosts_file %}
{{ host.addr }} {{ host.name }}
{% endfor %}

0 comments on commit acb0bd8

Please sign in to comment.