generated from phoenix-oss/tenant-tpl
Compare commits
41 commits
b345dbbd90
...
18f2ab51d1
Author | SHA1 | Date | |
---|---|---|---|
18f2ab51d1 | |||
afb0db1f15 | |||
57de4fd2e6 | |||
2f8a63eb74 | |||
8a1dcefe44 | |||
9fc1f8acc3 | |||
69d3c9bbad | |||
3edc01b5f6 | |||
39da3e0cf7 | |||
1ec6b25b76 | |||
67e8e5c0da | |||
160759dbd2 | |||
95c0ab6451 | |||
1ce69cf11c | |||
46c7522fc0 | |||
fe10a49592 | |||
14589c1319 | |||
a8f9431e05 | |||
f6894ece74 | |||
6b7d7987b5 | |||
|
521eb0b8cc | ||
7998d9e9a3 | |||
42c3daf081 | |||
9147a76b4f | |||
2e0fb83385 | |||
2eed2ca5cc | |||
5cb9088078 | |||
47716185a0 | |||
26244b5df8 | |||
241d06efd4 | |||
745243103e | |||
5e984efce5 | |||
6c434aba0f | |||
298fdc6296 | |||
2b363b60e6 | |||
0b8d38cc84 | |||
38bd40b2ec | |||
d73a595bef | |||
d21846d35a | |||
add151c934 | |||
3f1180edae |
17 changed files with 343 additions and 6 deletions
14
container/debug/alpine.yaml
Normal file
14
container/debug/alpine.yaml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: alpine-test
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: alpine
|
||||||
|
image: alpine:latest
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "while true; do sleep 3600; done"]
|
||||||
|
stdin: true
|
||||||
|
tty: true
|
||||||
|
restartPolicy: Never
|
18
container/ks-debug.yaml
Normal file
18
container/ks-debug.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app debug
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./container/debug
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: tenant-repos
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
|
@ -6,3 +6,9 @@ resources:
|
||||||
- echo-server/ks.yaml
|
- echo-server/ks.yaml
|
||||||
- ubuntu-vm-1/ks.yaml
|
- ubuntu-vm-1/ks.yaml
|
||||||
- ubuntu-vm-2/ks.yaml
|
- ubuntu-vm-2/ks.yaml
|
||||||
|
- ubuntu-vm-3/ks.yaml
|
||||||
|
- container/ks-debug.yaml
|
||||||
|
- templates/image-server/ks-nginx.yaml
|
||||||
|
- templates/image-server/ks-pvc.yaml
|
||||||
|
- templates/image-server/ks-route.yaml
|
||||||
|
- templates/windowsserver/ks-flavor.yaml
|
9
repos/helm/bitnami.yaml
Normal file
9
repos/helm/bitnami.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: bitnami
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
type: oci
|
||||||
|
interval: 60m
|
||||||
|
url: oci://registry-1.docker.io/bitnamicharts
|
|
@ -4,9 +4,8 @@ apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
kind: HelmRepository
|
kind: HelmRepository
|
||||||
metadata:
|
metadata:
|
||||||
name: bjw-s
|
name: bjw-s
|
||||||
namespace: ${TENANT_NAMESPACE}-ns
|
namespace: ${TENANT_NAMESPACE}
|
||||||
spec:
|
spec:
|
||||||
type: oci
|
|
||||||
interval: 5m
|
interval: 5m
|
||||||
url: oci://ghcr.io/bjw-s/helm
|
url: https://bjw-s-labs.github.io/helm-charts
|
||||||
|
|
||||||
|
|
18
templates/image-server/ks-nginx.yaml
Normal file
18
templates/image-server/ks-nginx.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app nginx
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./templates/image-server/nginx
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: tenant-repos
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
19
templates/image-server/ks-pvc.yaml
Normal file
19
templates/image-server/ks-pvc.yaml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app pvc
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./templates/image-server/pvc
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: tenant-repos
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
targetNamespace: ${TENANT_NAMESPACE}
|
||||||
|
timeout: 5m
|
18
templates/image-server/ks-route.yaml
Normal file
18
templates/image-server/ks-route.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app route
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./templates/image-server/route
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: tenant-repos
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
31
templates/image-server/nginx/helmrelease.yaml
Normal file
31
templates/image-server/nginx/helmrelease.yaml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
serviceAccountName: ${TECHNICAL_ACCOUNT}
|
||||||
|
interval: 10m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: nginx
|
||||||
|
version: 19.1.1
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: bitnami
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
values:
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
ports:
|
||||||
|
http: 8080
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
hostname: nginx.${TENANT_DOMAIN}.apps.ai-2.kvant.cloud
|
||||||
|
extraVolumes:
|
||||||
|
- name: ${TENANT_NAMESPACE}-image-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: ${TENANT_NAMESPACE}-image-storage
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: ${TENANT_NAMESPACE}-image-storage
|
||||||
|
mountPath: /app
|
12
templates/image-server/pvc/image-storage.yaml
Normal file
12
templates/image-server/pvc/image-storage.yaml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: ${TENANT_NAMESPACE}-image-storage
|
||||||
|
annotations:
|
||||||
|
helm.sh/resource-policy: keep
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 120Gi
|
14
templates/image-server/route/http.yaml
Normal file
14
templates/image-server/route/http.yaml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
apiVersion: route.openshift.io/v1
|
||||||
|
kind: Route
|
||||||
|
metadata:
|
||||||
|
name: nginx
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
to:
|
||||||
|
kind: Service
|
||||||
|
name: nginx
|
||||||
|
port:
|
||||||
|
targetPort: 8080
|
||||||
|
tls:
|
||||||
|
termination: edge
|
||||||
|
insecureEdgeTerminationPolicy: Allow
|
95
templates/windowsserver/flavor/small.yaml
Normal file
95
templates/windowsserver/flavor/small.yaml
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
apiVersion: template.openshift.io/v1
|
||||||
|
kind: Template
|
||||||
|
metadata:
|
||||||
|
name: windows-server-2022-small
|
||||||
|
namespace: '${TENANT_NAMESPACE}'
|
||||||
|
labels:
|
||||||
|
template.kubevirt.io/type: 'vm'
|
||||||
|
os.template.kubevirt.io/win2k22: 'true'
|
||||||
|
workload.template.kubevirt.io/server: 'true'
|
||||||
|
annotations:
|
||||||
|
name.os.template.kubevirt.io/win2k22: Windows Server 2022
|
||||||
|
description: Windows Server 2022 VM template (Small)
|
||||||
|
openshift.io/display-name: Windows Server 2022
|
||||||
|
iconClass: icon-windows
|
||||||
|
objects:
|
||||||
|
- apiVersion: kubevirt.io/v1
|
||||||
|
kind: VirtualMachine
|
||||||
|
metadata:
|
||||||
|
name: windows-server-demo
|
||||||
|
annotations:
|
||||||
|
description: Windows Server 2022 VM Demo
|
||||||
|
labels:
|
||||||
|
app: windows-server-demo
|
||||||
|
vm.kubevirt.io/template: 'windows-server-2022-template'
|
||||||
|
os.template.kubevirt.io/win2k22: 'true'
|
||||||
|
spec:
|
||||||
|
running: false
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
vm.kubevirt.io/flavor: small
|
||||||
|
vm.kubevirt.io/os: win2k22
|
||||||
|
vm.kubevirt.io/workload: server
|
||||||
|
labels:
|
||||||
|
kubevirt.io/domain: windows-server-demo
|
||||||
|
kubevirt.io/size: small
|
||||||
|
spec:
|
||||||
|
domain:
|
||||||
|
cpu:
|
||||||
|
cores: 2
|
||||||
|
sockets: 1
|
||||||
|
threads: 1
|
||||||
|
devices:
|
||||||
|
disks:
|
||||||
|
- disk:
|
||||||
|
bus: virtio
|
||||||
|
name: rootdisk
|
||||||
|
interfaces:
|
||||||
|
- masquerade: {}
|
||||||
|
model: virtio
|
||||||
|
name: default
|
||||||
|
networkInterfaceMultiqueue: true
|
||||||
|
rng: {}
|
||||||
|
features:
|
||||||
|
acpi: {}
|
||||||
|
smm:
|
||||||
|
enabled: true
|
||||||
|
firmware:
|
||||||
|
bootloader:
|
||||||
|
efi: {}
|
||||||
|
memory:
|
||||||
|
guest: 4Gi
|
||||||
|
hostname: windows-server-demo
|
||||||
|
networks:
|
||||||
|
- name: default
|
||||||
|
pod: {}
|
||||||
|
terminationGracePeriodSeconds: 180
|
||||||
|
volumes:
|
||||||
|
- name: rootdisk
|
||||||
|
dataVolume:
|
||||||
|
name: windows-server-datavolume-small
|
||||||
|
- apiVersion: cdi.kubevirt.io/v1beta1
|
||||||
|
kind: DataVolume
|
||||||
|
metadata:
|
||||||
|
name: windows-server-datavolume-small
|
||||||
|
namespace: '${TENANT_NAMESPACE}'
|
||||||
|
spec:
|
||||||
|
source:
|
||||||
|
http:
|
||||||
|
url: http://nginx.demo.pub.ai-2.kvant.cloud.apps.ai-2.kvant.cloud/win2022.qcow2
|
||||||
|
pvc:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: '${PVC_SIZE}'
|
||||||
|
parameters:
|
||||||
|
#- name: IMAGE_URL
|
||||||
|
# description: Public or internal HTTP(S) URL to a sysprepped Windows .qcow2 image
|
||||||
|
# required: true
|
||||||
|
# value: https://nginx.demo.pub.ai-2.kvant.cloud.apps.ai-2.kvant.cloud/win2022.qcow2
|
||||||
|
- name: PVC_SIZE
|
||||||
|
description: Size of the root disk PVC
|
||||||
|
required: true
|
||||||
|
value: 120Gi
|
18
templates/windowsserver/ks-flavor.yaml
Normal file
18
templates/windowsserver/ks-flavor.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app flavor
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./templates/windowsserver/flavor
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: tenant-repos
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
|
@ -33,7 +33,7 @@ spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: containerdisk
|
- name: containerdisk
|
||||||
containerDisk:
|
containerDisk:
|
||||||
image: quay.io/containerdisks/ubuntu:22.04
|
image: quay.io/containerdisks/ubuntu:24.04
|
||||||
- name: cloudinitdisk
|
- name: cloudinitdisk
|
||||||
cloudInitNoCloud:
|
cloudInitNoCloud:
|
||||||
userData: |
|
userData: |
|
||||||
|
|
|
@ -33,7 +33,7 @@ spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: containerdisk
|
- name: containerdisk
|
||||||
containerDisk:
|
containerDisk:
|
||||||
image: quay.io/containerdisks/ubuntu:22.04
|
image: quay.io/containerdisks/ubuntu:24.04
|
||||||
- name: cloudinitdisk
|
- name: cloudinitdisk
|
||||||
cloudInitNoCloud:
|
cloudInitNoCloud:
|
||||||
userData: |
|
userData: |
|
||||||
|
|
18
ubuntu-vm-3/ks.yaml
Normal file
18
ubuntu-vm-3/ks.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: &app ubuntu-vm-3
|
||||||
|
namespace: ${TENANT_NAMESPACE}
|
||||||
|
spec:
|
||||||
|
commonMetadata:
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: *app
|
||||||
|
path: ./ubuntu-vm-3/ubuntu
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: tenant-repos
|
||||||
|
wait: false
|
||||||
|
interval: 30m
|
||||||
|
retryInterval: 1m
|
||||||
|
timeout: 5m
|
48
ubuntu-vm-3/ubuntu/ubuntu-vm.yaml
Normal file
48
ubuntu-vm-3/ubuntu/ubuntu-vm.yaml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
apiVersion: kubevirt.io/v1
|
||||||
|
kind: VirtualMachine
|
||||||
|
metadata:
|
||||||
|
name: ubuntu-vm-3
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
running: true
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
kubevirt.io/domain: ubuntu-vm-3
|
||||||
|
spec:
|
||||||
|
domain:
|
||||||
|
cpu:
|
||||||
|
cores: 1
|
||||||
|
devices:
|
||||||
|
disks:
|
||||||
|
- disk:
|
||||||
|
bus: virtio
|
||||||
|
name: containerdisk
|
||||||
|
- disk:
|
||||||
|
bus: virtio
|
||||||
|
name: cloudinitdisk
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 2Gi
|
||||||
|
cpu: 1
|
||||||
|
limits:
|
||||||
|
memory: 2Gi
|
||||||
|
cpu: 1
|
||||||
|
memory:
|
||||||
|
guest: 2Gi
|
||||||
|
volumes:
|
||||||
|
- name: containerdisk
|
||||||
|
containerDisk:
|
||||||
|
image: quay.io/containerdisks/ubuntu:24.04
|
||||||
|
- name: cloudinitdisk
|
||||||
|
cloudInitNoCloud:
|
||||||
|
userData: |
|
||||||
|
#cloud-config
|
||||||
|
hostname: ubuntu-vm-3
|
||||||
|
ssh_pwauth: True
|
||||||
|
users:
|
||||||
|
- name: ubuntu
|
||||||
|
ssh-authorized-keys:
|
||||||
|
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPqlhZW/pPLK8zENt3o6tgl0QVinhGAF1sHvajqq3UvI ubuntu
|
||||||
|
sudo: ['ALL=(ALL) NOPASSWD:ALL']
|
||||||
|
shell: /bin/bash
|
Loading…
Add table
Add a link
Reference in a new issue