Add k8s configuration scripts

WEW SOURCE CONTROL
This commit is contained in:
Salt 2021-02-28 23:33:31 -06:00
parent 3498092ae9
commit 54ebc8f329
7 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,6 @@
# vim:ft=ansible:
all:
hosts:
localhost:
ansible_connection: local
ansible_become: no

7
k8s.sh Executable file
View File

@ -0,0 +1,7 @@
#! /bin/sh
ansible-playbook playbooks/pik8s.yml \
-i inventory-localhost \
-l localhost \
--tags k8s

View File

@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC5zCCAc+gAwIBAgIBADANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwprdWJl
cm5ldGVzMB4XDTIxMDIxOTAxMTMyNVoXDTMxMDIxNzAxMTMyNVowFTETMBEGA1UE
AxMKa3ViZXJuZXRlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN9r
fEaETyWkO49xZIyw37JNcgbwixDN+cLvnKtKqCW7u573PU0cJ+7KBuefewM6Uf+6
Xjn/AO+vm8c1iSz41bWXcS2902SkmjWCi4H4XlxhJgSYmVJrRxL44yfrh/kNOU8T
WFtABhX2pc8HZLduvhx2CUoZSp+O3uITY3qiHaeoaoAF1eR99SCU8MAYYvRx21IO
oRK98vFAi9M2gN5/rteUXxkREdabpqDZHFgQfNUwQ7OfNMjZcOxOjY5FZc3ZYdz8
MuboYvAtbhXfwe6dADiZHoryuMypIpMO+6sf/NFQLRr6RozT01Tn6AeSryGG1Ycl
KmKVvvnolZy4oSbVtusCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgKkMA8GA1UdEwEB
/wQFMAMBAf8wHQYDVR0OBBYEFD5eBd3k5DosRSoQG9FawHPy3hKnMA0GCSqGSIb3
DQEBCwUAA4IBAQBWDw0Qn1EGV+ouigIQp8Te28dXA8tIO4jR5NawqTQPcLMU1QQV
/jjs5E5lpiHLECZ2vPFTSdUdmhHKbUiLwSHOn2IEI8pb43Lk8US+uiEy4K7wleu9
SgSAVmAW7fN6w8DyYFvwqLdCiYi84CmI6BTymaYzyA3NQ2FigPjBgV4QBw8VJqG5
bDh5Jfu/nDnxcibKt9x0BDTxS3d3OLzAnyjj5Ie9RBEYoku4Y8oHxMyWkFjeyTiT
kP07hN7Uf1Ui2+FEpcWai/WOLX3etqoT/SjLRiNWF4N4ZZPLGjpMsO+OnoqCi9Zu
vdr+IpCJrQjSuwwNiJHEphvkLtOuNOgkihky
-----END CERTIFICATE-----

View File

@ -0,0 +1 @@
/home/salt/.kube/client.crt

View File

@ -0,0 +1 @@
/home/salt/.kube/client.key

View File

@ -0,0 +1 @@
/home/salt/.kube/config

View File

@ -19,3 +19,34 @@
- name: install openshift
pip: name=openshift state=latest
tags: [ k8s, packages, pip ]
- hosts: localhost
gather_facts: no
vars:
k8s_path: "{{ playbook_dir }}/files/k8s/desu.local"
module_defaults:
group/k8s:
api_version: v1
host: "https://192.168.102.1:6443"
ca_cert: "{{ k8s_path }}/ca.crt"
kubeconfig: "{{ k8s_path }}/kubeconfig"
client_cert: "{{ k8s_path }}/client.crt"
client_key: "{{ k8s_path }}/client.key"
tasks:
- name: assure nfs pv
k8s:
definition:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-nfs
spec:
capacity:
storage: 1.5Ti
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
path: /srv/nfs/k8s
server: pi-storage-1.desu.ltd
readOnly: false
tags: [ k8s, manifest, no-pull ]