Skip to content
Snippets Groups Projects
Commit 00d3bf80 authored by Alex ubuntu vm's avatar Alex ubuntu vm
Browse files

deployments: automated deployment generation files

parent 9ae6b9ea
No related branches found
No related tags found
1 merge request!2repo: added new directory where utils scripts will be
Showing
with 9970 additions and 9915 deletions
...@@ -14,7 +14,7 @@ spec: ...@@ -14,7 +14,7 @@ spec:
spec: spec:
containers: containers:
- name: l2sm-controller - name: l2sm-controller
image: alexdecb/l2sm-controller:2.2 image: alexdecb/l2sm-controller:2.3
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /onos/ui path: /onos/ui
...@@ -24,6 +24,7 @@ spec: ...@@ -24,6 +24,7 @@ spec:
ports: ports:
- containerPort: 6633 - containerPort: 6633
- containerPort: 8181 - containerPort: 8181
# imagePullPolicy: Always
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
......
This diff is collapsed.
...@@ -28,35 +28,20 @@ spec: ...@@ -28,35 +28,20 @@ spec:
done; done;
sleep 5; sleep 5;
containers: containers:
- image: alexdecb/l2sm-operator:2.3 - image: alexdecb/l2sm-operator:2.4
name: l2sm-opt-pod name: l2sm-opt-pod
env: env:
- name: CONTROLLER_IP - name: CONTROLLER_IP
value: l2sm-controller-service value: l2sm-controller-service
#imagePullPolicy: Always - name: DATABASE_IP
- name: mysql value: mysql-development-service
image: mysql:5.7 - name: MYSQL_USER
envFrom: value: l2sm
- secretRef: - name: MYSQL_PASSWORD
name: mysql-secret value: l2sm
ports: - name: MYSQL_DATABASE
- containerPort: 3306 value: l2sm
name: mysql # imagePullPolicy: Always
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
- name: initdb-volume
mountPath: /docker-entrypoint-initdb.d
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim
- name: initdb-volume
configMap:
name: mysql-schema
items:
- key: init.sql
path: init.sql
nodeSelector: nodeSelector:
dedicated: master dedicated: master
tolerations: tolerations:
...@@ -77,68 +62,5 @@ spec: ...@@ -77,68 +62,5 @@ spec:
targetPort: 8080 targetPort: 8080
selector: selector:
l2sm-component: l2sm-opt l2sm-component: l2sm-opt
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mysql-schema
data:
init.sql: |
CREATE DATABASE IF NOT EXISTS l2sm;
USE l2sm;
CREATE TABLE networks (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
type ENUM('vlink', 'vnet', 'ext-vnet') NOT NULL,
UNIQUE KEY unique_network_name (name, type)
);
CREATE TABLE switches (
id INT PRIMARY KEY AUTO_INCREMENT,
node_name VARCHAR(255) NOT NULL,
openflowId TEXT,
ip VARCHAR(15)
);
CREATE TABLE neds (
id INT PRIMARY KEY AUTO_INCREMENT,
node_name VARCHAR(255) NOT NULL,
provider VARCHAR(255) NOT NULL,
openflowId TEXT,
ip VARCHAR(15)
);
CREATE TABLE interfaces (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255),
pod VARCHAR(255),
switch_id INT,
ned_id INT,
network_id INT,
FOREIGN KEY (switch_id) REFERENCES switches(id),
FOREIGN KEY (ned_id) REFERENCES neds(id),
FOREIGN KEY (network_id) REFERENCES networks(id)
);
-- Define the one-to-many relationship between switches and interfaces
ALTER TABLE interfaces
ADD CONSTRAINT fk_switch_interface
FOREIGN KEY (switch_id)
REFERENCES switches(id);
-- Define the one-to-many relationship between neds and interfaces
ALTER TABLE interfaces
ADD CONSTRAINT fk_ned_interface
FOREIGN KEY (ned_id)
REFERENCES neds(id);
-- Define the many-to-one relationship between networks and interfaces
ALTER TABLE interfaces
ADD CONSTRAINT fk_network_interface
FOREIGN KEY (network_id)
REFERENCES networks(id);
...@@ -22,21 +22,22 @@ spec: ...@@ -22,21 +22,22 @@ spec:
- key: node-role.kubernetes.io/master - key: node-role.kubernetes.io/master
operator: Exists operator: Exists
effect: NoSchedule effect: NoSchedule
# initContainers: initContainers:
# - name: wait-for-l2sm-operator - name: wait-for-l2sm-operator
# image: curlimages/curl image: curlimages/curl
# args: args:
# - /bin/sh - /bin/sh
# - -c - -c
# - > - >
# set -x; set -x;
# while [ $(curl -sw '%{http_code}' "http://l2sm-operator-service:8080/healthz" -o /dev/null) -ne 200 ]; do while [ $(curl -sw '%{http_code}' "http://l2sm-operator-service:8080/healthz" -o /dev/null) -ne 200 ]; do
# sleep 15; sleep 15;
# done; done;
# sleep 5; sleep 5;
containers: containers:
- name: l2sm-switch - name: l2sm-switch
image: alexdecb/l2sm-switch:2.4 image: alexdecb/l2sm-switch:2.4
# imagePullPolicy: Always
#args: ["setup_switch.sh && sleep infinity"] #args: ["setup_switch.sh && sleep infinity"]
env: env:
- name: NODENAME - name: NODENAME
......
apiVersion: v1
kind: Pod
metadata:
name: poda
labels:
app: ping-pong
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "ptp1",
"ips": ["192.168.1.6/16"]
}]'
spec:
containers:
- name: router
command: ["/bin/ash", "-c", "trap : TERM INT; sleep infinity & wait"]
image: alpine:latest
securityContext:
capabilities:
add: ["NET_ADMIN"]
# Use this parameter if you want to place the pod in a specific node
#nodeName: workerk8s
apiVersion: v1
kind: Pod
metadata:
name: podb
labels:
app: ping-pong
annotations:
k8s.v1.cni.cncf.io/networks: '[
{ "name": "ptp1",
"ips": ["fe80::58d0:b8ff:fe42:debf/64"]
}]'
spec:
containers:
- name: router
command: ["/bin/ash", "-c", "trap : TERM INT; sleep infinity & wait"]
image: alpine:latest
securityContext:
capabilities:
add: ["NET_ADMIN"]
# Use this parameter if you want to place the pod in a specific node
#nodeName: workerk8s
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: veth1
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"name":"veth1",
"mtu": 1400,
"device":"veth1",
"ipam": {
"type":"static"
}
}'
\ No newline at end of file
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth1
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br1",
"mtu": 1400,
"device": "inter-veth1"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth2
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br2",
"mtu": 1400,
"device": "inter-veth2"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth3
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br3",
"mtu": 1400,
"device": "inter-veth3"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth4
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br4",
"mtu": 1400,
"device": "inter-veth4"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth5
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br5",
"mtu": 1400,
"device": "inter-veth5"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth6
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br6",
"mtu": 1400,
"device": "inter-veth6"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth7
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br7",
"mtu": 1400,
"device": "inter-veth7"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth8
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br8",
"mtu": 1400,
"device": "inter-veth8"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth9
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br9",
"mtu": 1400,
"device": "inter-veth9"
}'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: inter-veth10
spec:
config: '{
"cniVersion": "0.3.0",
"type": "bridge",
"bridge": "inter-br10",
"mtu": 1400,
"device": "inter-veth10"
}'
\ No newline at end of file
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: l2sm-networks.l2sm.k8s.local
spec:
group: l2sm.k8s.local
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
type:
type: string
config:
type: string
nullable: true
signature:
type: string
nullable: true
status:
type: object
properties:
connectedPods:
type: array
items:
type: string
scope: Namespaced
names:
plural: l2sm-networks
singular: l2sm-network
kind: L2SMNetwork
shortNames:
- l2sm-net
apiVersion: v1
kind: Pod
metadata:
name: ned
labels:
app: l2sm
spec:
hostNetwork: true
initContainers:
- name: wait-for-l2sm-operator
image: curlimages/curl
args:
- /bin/sh
- -c
- >
set -x;
while [ $(curl -sw '%{http_code}' "http://l2sm-operator-service:8080/healthz" -o /dev/null) -ne 200 ]; do
sleep 15;
done;
sleep 5;
containers:
- name: mycontainer
image: alexdecb/l2sm-switch:2.2
command: ["sleep", "infinity"]
securityContext:
capabilities:
add: ["NET_ADMIN"]
nodeSelector:
dedicated: master
\ No newline at end of file
This diff is collapsed.
#!/bin/bash
# Define the directory containing the YAML files
DIRECTORY="./deployments/custom-installation"
# Define the output file
OUTPUT_FILE="./deployments/l2sm-deployment.yaml"
# Start with an empty output file
> "$OUTPUT_FILE"
# Find all YAML files within the directory and all subdirectories,
# concatenate their contents into the output file and add '---' after each file's content
find "$DIRECTORY" -type f -name '*.yaml' | sort | while read file; do
cat "$file" >> "$OUTPUT_FILE"
echo "---" >> "$OUTPUT_FILE"
done
echo "All YAML files, including those within subdirectories, have been concatenated into $OUTPUT_FILE with delimiters."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment