chore/test-local-dev-builds (#2)
tested initial dev deployment to local k3d Reviewed-on: https://codeberg.org/headshed/infctl-cli/pulls/2 Co-authored-by: jon brookes <jon@headshed.dev> Co-committed-by: jon brookes <jon@headshed.dev>
This commit is contained in:
parent
506142ccd7
commit
e64666340a
35 changed files with 2625 additions and 334 deletions
4
k8s-manifests/ctl-metallb/kustomization.yaml
Normal file
4
k8s-manifests/ctl-metallb/kustomization.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
namespace: metallb-system
|
||||
|
||||
resources:
|
||||
- github.com/metallb/metallb/config/native?ref=v0.14.9
|
||||
5
k8s-manifests/ctl-redis/kustomization.yaml
Normal file
5
k8s-manifests/ctl-redis/kustomization.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- redis-configmap.yaml
|
||||
- redis.yaml
|
||||
2291
k8s-manifests/ctl-redis/redis-configmap.yaml
Normal file
2291
k8s-manifests/ctl-redis/redis-configmap.yaml
Normal file
File diff suppressed because it is too large
Load diff
90
k8s-manifests/ctl-redis/redis.yaml
Normal file
90
k8s-manifests/ctl-redis/redis.yaml
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: redis
|
||||
spec:
|
||||
serviceName: redis
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
initContainers:
|
||||
- name: config
|
||||
image: redis:7.0.10-alpine
|
||||
command: [ "sh", "-c" ]
|
||||
args:
|
||||
- |
|
||||
cp /tmp/redis/redis.conf /etc/redis/redis.conf
|
||||
|
||||
echo "setting up standalone redis..."
|
||||
MASTER_FDQN=`hostname -f | sed -e 's/redis-[0-9]\./redis-0./'`
|
||||
|
||||
# Inject the password from the mounted secret
|
||||
echo "masterauth $REDIS_PASSWORD" >> /etc/redis/redis.conf
|
||||
echo "requirepass $REDIS_PASSWORD" >> /etc/redis/redis.conf
|
||||
|
||||
if [ "$(hostname)" = "redis-0" ]; then
|
||||
echo "this is redis-0, not updating config..."
|
||||
else
|
||||
echo "updating redis.conf..."
|
||||
echo "replicaof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
|
||||
fi
|
||||
env:
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: redis-auth
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: redis-config
|
||||
mountPath: /etc/redis/
|
||||
- name: config
|
||||
mountPath: /tmp/redis/
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7.0.10-alpine
|
||||
command: ["redis-server"]
|
||||
args: ["/etc/redis/redis.conf"]
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: redis
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: redis-config
|
||||
mountPath: /etc/redis/
|
||||
volumes:
|
||||
- name: redis-config
|
||||
emptyDir: {}
|
||||
- name: config
|
||||
configMap:
|
||||
name: redis-config
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: "local-storage"
|
||||
resources:
|
||||
requests:
|
||||
storage: 64Mi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: redis
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
name: redis
|
||||
selector:
|
||||
app: redis
|
||||
28
k8s-manifests/ctl/local-storage.yml
Normal file
28
k8s-manifests/ctl/local-storage.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: local-storage
|
||||
provisioner: kubernetes.io/no-provisioner
|
||||
volumeBindingMode: WaitForFirstConsumer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: local-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: local-storage
|
||||
local:
|
||||
path: /mnt/data
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- k3d-mycluster-server-0
|
||||
Loading…
Add table
Add a link
Reference in a new issue