generated from onedr0p/cluster-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change config * feat: remove extra args * fix: bootstrap
- Loading branch information
1 parent
ca36e03
commit b8f1c1c
Showing
15 changed files
with
289 additions
and
128 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
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
--- | ||
- name: Version Check | ||
block: | ||
- name: Get deployed k3s version | ||
ansible.builtin.command: k3s --version | ||
register: k3s_version | ||
changed_when: false | ||
failed_when: false | ||
|
||
- name: Extract k3s version | ||
ansible.builtin.set_fact: | ||
current_k3s_version: "{{ k3s_version.stdout | regex_replace('(?im)k3s version (?P<version>[a-z0-9\\.\\+]+).*\n.*', '\\g<version>') }}" | ||
|
||
- name: Check if upgrades are allowed | ||
ansible.builtin.assert: | ||
that: ["k3s_release_version is version(current_k3s_version, '>=')"] | ||
fail_msg: "Unable to upgrade k3s because the deployed version is higher than the one specified in the configuration" |
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 was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
ansible/pi/playbooks/templates/custom-kube-vip-daemonset.yaml.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,72 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: kube-vip | ||
namespace: kube-system | ||
labels: | ||
app.kubernetes.io/name: kube-vip | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: kube-vip | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: kube-vip | ||
spec: | ||
containers: | ||
- name: kube-vip | ||
image: ghcr.io/kube-vip/kube-vip:v0.7.2 | ||
imagePullPolicy: IfNotPresent | ||
args: ["manager"] | ||
env: | ||
- name: address | ||
value: "{{ k3s_registration_address }}" | ||
- name: vip_arp | ||
value: "true" | ||
- name: lb_enable | ||
value: "true" | ||
- name: port | ||
value: "6443" | ||
- name: vip_cidr | ||
value: "32" | ||
- name: cp_enable | ||
value: "true" | ||
- name: cp_namespace | ||
value: kube-system | ||
- name: vip_ddns | ||
value: "false" | ||
- name: svc_enable | ||
value: "false" | ||
- name: vip_leaderelection | ||
value: "true" | ||
- name: vip_leaseduration | ||
value: "15" | ||
- name: vip_renewdeadline | ||
value: "10" | ||
- name: vip_retryperiod | ||
value: "2" | ||
- name: prometheus_server | ||
value: :2112 | ||
securityContext: | ||
capabilities: | ||
add: ["NET_ADMIN", "NET_RAW", "SYS_TIME"] | ||
hostAliases: | ||
- hostnames: | ||
- kubernetes | ||
ip: 127.0.0.1 | ||
hostNetwork: true | ||
serviceAccountName: kube-vip | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: node-role.kubernetes.io/control-plane | ||
operator: Exists | ||
tolerations: | ||
- effect: NoSchedule | ||
operator: Exists | ||
- effect: NoExecute | ||
operator: Exists |
42 changes: 42 additions & 0 deletions
42
ansible/pi/playbooks/templates/custom-kube-vip-rbac.yaml.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,42 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kube-vip | ||
namespace: kube-system | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
annotations: | ||
rbac.authorization.kubernetes.io/autoupdate: "true" | ||
name: system:kube-vip-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["services/status"] | ||
verbs: ["update"] | ||
- apiGroups: [""] | ||
resources: ["services", "endpoints"] | ||
verbs: ["list","get","watch", "update"] | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
verbs: ["list","get","watch", "update", "patch"] | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] | ||
verbs: ["list", "get", "watch", "update", "create"] | ||
- apiGroups: ["discovery.k8s.io"] | ||
resources: ["endpointslices"] | ||
verbs: ["list","get","watch", "update"] | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: system:kube-vip-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:kube-vip-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kube-vip | ||
namespace: kube-system |
59 changes: 0 additions & 59 deletions
59
ansible/pi/playbooks/templates/kube-vip-static-pod.yaml.j2
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.