From ac5cde686e6249d5cc56ae631a621b75412c4f59 Mon Sep 17 00:00:00 2001 From: hasitha1990 Date: Sun, 15 Nov 2020 19:20:15 +0100 Subject: [PATCH 01/21] fix redis pod --- resource/kompose/redis.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/resource/kompose/redis.yaml b/resource/kompose/redis.yaml index 9654dc3c..3e538e29 100644 --- a/resource/kompose/redis.yaml +++ b/resource/kompose/redis.yaml @@ -18,17 +18,20 @@ spec: annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: + securityContext: + runAsUser: 0 containers: - name: redis image: redis:4.0.7 imagePullPolicy: IfNotPresent - volumeMounts: - - name: redis-server - mountPath: "/data" + securityContext: + allowPrivilegeEscalation: false + runAsUser: 0 command: - redis-server - - "/data/redis.conf" + volumeMounts: + - mountPath: /config/redis-db + name: redis-server volumes: - name: redis-server - hostPath: - path: /config/redis-db + emptyDir: {} From 5bee768f6dbdbcdb958b76d07459c1f1aebf7150 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 21:37:31 +0100 Subject: [PATCH 02/21] add redis config file --- resource/kompose/kustomization.yaml | 4 ++++ resource/kompose/redis.yaml | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 resource/kompose/kustomization.yaml diff --git a/resource/kompose/kustomization.yaml b/resource/kompose/kustomization.yaml new file mode 100644 index 00000000..d687d4b0 --- /dev/null +++ b/resource/kompose/kustomization.yaml @@ -0,0 +1,4 @@ +configMapGenerator: +- name: redis-conf + files: + - /config/redis-db/redis.conf diff --git a/resource/kompose/redis.yaml b/resource/kompose/redis.yaml index 3e538e29..a5c02336 100644 --- a/resource/kompose/redis.yaml +++ b/resource/kompose/redis.yaml @@ -19,7 +19,7 @@ spec: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: securityContext: - runAsUser: 0 + runAsUser: 0 containers: - name: redis image: redis:4.0.7 @@ -27,11 +27,13 @@ spec: securityContext: allowPrivilegeEscalation: false runAsUser: 0 - command: - - redis-server volumeMounts: - mountPath: /config/redis-db name: redis-server volumes: - name: redis-server - emptyDir: {} + configMap: + name: redis-conf + items: + - key: redis-conf + path: data From 8155689bd24cc061ade8d3ebbce202ba2a5ec002 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 21:51:43 +0100 Subject: [PATCH 03/21] move kustomization file --- resource/kompose/kustomization.yaml => kustomization.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename resource/kompose/kustomization.yaml => kustomization.yaml (100%) diff --git a/resource/kompose/kustomization.yaml b/kustomization.yaml similarity index 100% rename from resource/kompose/kustomization.yaml rename to kustomization.yaml From fa646b543b749ff032322d6dc0c4de9c0dcd1642 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 21:57:25 +0100 Subject: [PATCH 04/21] move kustomization file --- kustomization.yaml => resource/kompose/kustomization.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename kustomization.yaml => resource/kompose/kustomization.yaml (100%) diff --git a/kustomization.yaml b/resource/kompose/kustomization.yaml similarity index 100% rename from kustomization.yaml rename to resource/kompose/kustomization.yaml From 89e88f7e79c8945ba8bd3de149040e80d07c3c2a Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 22:02:00 +0100 Subject: [PATCH 05/21] move kustomization file --- resource/kompose/kustomization.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 resource/kompose/kustomization.yaml diff --git a/resource/kompose/kustomization.yaml b/resource/kompose/kustomization.yaml deleted file mode 100644 index d687d4b0..00000000 --- a/resource/kompose/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -configMapGenerator: -- name: redis-conf - files: - - /config/redis-db/redis.conf From 849373ce53fc54ed68e83384bd5371fa7f24f148 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 22:04:37 +0100 Subject: [PATCH 06/21] move kustomization file --- config/kustomization.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 config/kustomization.yaml diff --git a/config/kustomization.yaml b/config/kustomization.yaml new file mode 100644 index 00000000..f2820002 --- /dev/null +++ b/config/kustomization.yaml @@ -0,0 +1,4 @@ +configMapGenerator: +- name: redis-conf + files: + - redis.conf From c491edb8ae521c0eddf51a04737f4bc022b22c05 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 22:05:18 +0100 Subject: [PATCH 07/21] move kustomization file --- config/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/kustomization.yaml b/config/kustomization.yaml index f2820002..f6f5e9d6 100644 --- a/config/kustomization.yaml +++ b/config/kustomization.yaml @@ -1,4 +1,4 @@ configMapGenerator: - name: redis-conf files: - - redis.conf + - redis-db/redis.conf From eb99216550dc967e4a0bd5379fc3e45652d619c2 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 15 Nov 2020 22:27:50 +0100 Subject: [PATCH 08/21] move kustomization file --- config/kustomization.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/kustomization.yaml b/config/kustomization.yaml index f6f5e9d6..d029ed0d 100644 --- a/config/kustomization.yaml +++ b/config/kustomization.yaml @@ -1,4 +1,6 @@ configMapGenerator: - name: redis-conf files: - - redis-db/redis.conf + - config/redis-db/redis.conf + resources: + - resource/kompose/redis.yaml From 4dde39418a4fe78a3dd26040c8eb9c059ccb6496 Mon Sep 17 00:00:00 2001 From: hasitha1990 Date: Mon, 16 Nov 2020 01:08:12 +0100 Subject: [PATCH 09/21] add reddis configurations --- config/kustomization.yaml | 6 ------ kustomization.yaml | 6 ++++++ resource/kompose/redis.yaml | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 config/kustomization.yaml create mode 100644 kustomization.yaml diff --git a/config/kustomization.yaml b/config/kustomization.yaml deleted file mode 100644 index d029ed0d..00000000 --- a/config/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -configMapGenerator: -- name: redis-conf - files: - - config/redis-db/redis.conf - resources: - - resource/kompose/redis.yaml diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 00000000..0bd32fcc --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,6 @@ +configMapGenerator: +- name: redis-server + files: + - config/redis-db/redis-config +resources: +- resource/kompose/redis.yaml diff --git a/resource/kompose/redis.yaml b/resource/kompose/redis.yaml index a5c02336..77865bfa 100644 --- a/resource/kompose/redis.yaml +++ b/resource/kompose/redis.yaml @@ -28,12 +28,12 @@ spec: allowPrivilegeEscalation: false runAsUser: 0 volumeMounts: - - mountPath: /config/redis-db - name: redis-server + - mountPath: /config/redis-db + name: redis-server volumes: - name: redis-server configMap: - name: redis-conf + name: redis-server items: - - key: redis-conf - path: data + - key: redis-config + path: redis.conf From 724e9aecf8cd649f6d922ab89eda0e38155dfd8f Mon Sep 17 00:00:00 2001 From: hasitha1990 Date: Mon, 16 Nov 2020 01:21:30 +0100 Subject: [PATCH 10/21] add reddis service start command to make file, migrate run-storage-init.sh to kubernetes --- Makefile | 4 ++++ run-storage-init.sh | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index a44227c7..b008e43a 100644 --- a/Makefile +++ b/Makefile @@ -145,3 +145,7 @@ start-dev-platform: start-elk-platform: kubectl apply -f ./resource/kompose-elk + +start-redis-service: + kubectl apply -k . + diff --git a/run-storage-init.sh b/run-storage-init.sh index d78c1dee..2e82e9c0 100755 --- a/run-storage-init.sh +++ b/run-storage-init.sh @@ -1,11 +1,14 @@ #!/bin/bash # Runs the initialization script for the Storage of the HOBBIT Platform. -VOS_CONTAINER_ID=$(docker ps -aqf "name=vos") -VOS_CONTAINER_NUMBER=$(docker ps -aqf "name=vos" | wc -l) -if [ "$VOS_CONTAINER_NUMBER" -eq "1" ]; then - docker exec -it $VOS_CONTAINER_ID bash ./storage-init.sh -else - echo "Can not determine vos container name..." - echo "Use docker ps to determine vos container name and execute the following command manually:" - echo "docker exec -it yourvoscontainername bash ./storage-init.sh" -fi +#VOS_CONTAINER_ID=$(docker ps -aqf "name=vos") +#VOS_CONTAINER_NUMBER=$(docker ps -aqf "name=vos" | wc -l) +#if [ "$VOS_CONTAINER_NUMBER" -eq "1" ]; then +# docker exec -it $VOS_CONTAINER_ID bash ./storage-init.sh +#else +# echo "Can not determine vos container name..." +# echo "Use docker ps to determine vos container name and execute the following command manually:" +# echo "docker exec -it yourvoscontainername bash ./storage-init.sh" +#fi +VOS_CONTAINER_ID=$(kubectl get pod -l app=vos -o jsonpath="{.items[0].metadata.name}") +echo $VOS_CONTAINER_ID; +kubectl exec -it $VOS_CONTAINER_ID -- bash -c "./storage-init.sh" From 3550fddbf23f7197cfa18c62a27b2d118e196304 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Mon, 16 Nov 2020 01:39:36 +0100 Subject: [PATCH 11/21] fid file config --- Makefile | 1 - resource/calico.yaml | 2 -- resource/kompose/storage-service.yaml | 1 - 3 files changed, 4 deletions(-) diff --git a/Makefile b/Makefile index b008e43a..5320d496 100644 --- a/Makefile +++ b/Makefile @@ -148,4 +148,3 @@ start-elk-platform: start-redis-service: kubectl apply -k . - diff --git a/resource/calico.yaml b/resource/calico.yaml index 99b33e8a..b209cdbf 100644 --- a/resource/calico.yaml +++ b/resource/calico.yaml @@ -3746,5 +3746,3 @@ metadata: --- # Source: calico/templates/configure-canal.yaml - - diff --git a/resource/kompose/storage-service.yaml b/resource/kompose/storage-service.yaml index edf162d2..297c8465 100644 --- a/resource/kompose/storage-service.yaml +++ b/resource/kompose/storage-service.yaml @@ -31,4 +31,3 @@ spec: value: "HobbitPlatform" - name: SPARQL_ENDPOINT_PASSWORD value: "Password" - From 65b5fdcff31435dc9f07b6c5932968f55c4d4665 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 22 Nov 2020 21:05:20 +0100 Subject: [PATCH 12/21] fix vos yaml --- kustomization.yaml | 4 ++++ resource/kompose/vos.yaml | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/kustomization.yaml b/kustomization.yaml index 0bd32fcc..12e11e82 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -2,5 +2,9 @@ configMapGenerator: - name: redis-server files: - config/redis-db/redis-config +- name: vos-server + files: + - config/db/vos-config resources: - resource/kompose/redis.yaml +- resource/kompose/vos.yaml diff --git a/resource/kompose/vos.yaml b/resource/kompose/vos.yaml index 392c9e77..3384ae6a 100644 --- a/resource/kompose/vos.yaml +++ b/resource/kompose/vos.yaml @@ -23,18 +23,21 @@ spec: image: hobbitproject/virtuoso_opensource:v07.20.3217 imagePullPolicy: IfNotPresent securityContext: - privileged: true - allowPrivilegeEscalation: true + allowPrivilegeEscalation: false + runAsUser: 0 ports: - name: http containerPort: 8890 volumeMounts: - - name: db - mountPath: "/opt/virtuoso-opensource/database" + - mountPath: /config/db + name: vos-server volumes: - - name: db - hostPath: - path: /config/db + - name: vos-server + configMap: + name: vos-server + items: + - key: vos-config + path: virtuoso.ini --- From 641255f476138ed47a316e798482a9f456bc9b4c Mon Sep 17 00:00:00 2001 From: hasitha1990 Date: Sun, 22 Nov 2020 21:35:53 +0100 Subject: [PATCH 13/21] fix vos pod --- kustomization.yaml | 8 +++++++- resource/kompose/vos.yaml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kustomization.yaml b/kustomization.yaml index 12e11e82..eb142b5c 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -4,7 +4,13 @@ configMapGenerator: - config/redis-db/redis-config - name: vos-server files: - - config/db/vos-config + - config/db/virtuoso-ini resources: +- resource/kompose/rabbit.yaml - resource/kompose/redis.yaml - resource/kompose/vos.yaml +- resource/kompose/storage-service.yaml +- resource/kompose/platform-controller.yaml +- resource/kompose/keycloak.yaml +- resource/kompose/gui.yaml +- resource/kompose/analysis.yaml diff --git a/resource/kompose/vos.yaml b/resource/kompose/vos.yaml index 3384ae6a..6b2cedc5 100644 --- a/resource/kompose/vos.yaml +++ b/resource/kompose/vos.yaml @@ -36,7 +36,7 @@ spec: configMap: name: vos-server items: - - key: vos-config + - key: virtuoso-ini path: virtuoso.ini --- From ec0c1b904629a1fef7978046b3e15fbeed8892c3 Mon Sep 17 00:00:00 2001 From: hasitha1990 Date: Sun, 22 Nov 2020 21:38:59 +0100 Subject: [PATCH 14/21] rename virtuoso config file --- config/db/virtuoso-ini | 260 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 config/db/virtuoso-ini diff --git a/config/db/virtuoso-ini b/config/db/virtuoso-ini new file mode 100644 index 00000000..71b4b320 --- /dev/null +++ b/config/db/virtuoso-ini @@ -0,0 +1,260 @@ +; +; virtuoso.ini +; +; Configuration file for the OpenLink Virtuoso VDBMS Server +; +; To learn more about this product, or any other product in our +; portfolio, please check out our web site at: +; +; http://virtuoso.openlinksw.com/ +; +; or contact us at: +; +; general.information@openlinksw.com +; +; If you have any technical questions, please contact our support +; staff at: +; +; technical.support@openlinksw.com +; + +; +; Database setup +; +[Database] +DatabaseFile = /opt/virtuoso-opensource/database/virtuoso.db +ErrorLogFile = /opt/virtuoso-opensource/database/virtuoso.log +LockFile = /opt/virtuoso-opensource/database/virtuoso.lck +TransactionFile = /opt/virtuoso-opensource/database/virtuoso.trx +xa_persistent_file = /opt/virtuoso-opensource/database/virtuoso.pxa +ErrorLogLevel = 7 +FileExtend = 200 +MaxCheckpointRemap = 2000 +Striping = 0 +TempStorage = TempDatabase + + +[TempDatabase] +DatabaseFile = /opt/virtuoso-opensource/database/virtuoso-temp.db +TransactionFile = /opt/virtuoso-opensource/database/virtuoso-temp.trx +MaxCheckpointRemap = 2000 +Striping = 0 + + +; +; Server parameters +; +[Parameters] +ServerPort = 1111 +LiteMode = 0 +DisableUnixSocket = 1 +DisableTcpSocket = 0 +;SSLServerPort = 2111 +;SSLCertificate = cert.pem +;SSLPrivateKey = pk.pem +;X509ClientVerify = 0 +;X509ClientVerifyDepth = 0 +;X509ClientVerifyCAFile = ca.pem +MaxClientConnections = 10 +CheckpointInterval = 60 +O_DIRECT = 0 +CaseMode = 2 +MaxStaticCursorRows = 5000 +CheckpointAuditTrail = 0 +AllowOSCalls = 0 +SchedulerInterval = 10 +DirsAllowed = ., /opt/virtuoso-opensource/vad +ThreadCleanupInterval = 0 +ThreadThreshold = 10 +ResourcesCleanupInterval = 0 +FreeTextBatchSize = 100000 +SingleCPU = 0 +VADInstallDir = /opt/virtuoso-opensource/vad/ +PrefixResultNames = 0 +RdfFreeTextRulesSize = 100 +IndexTreeMaps = 256 +MaxMemPoolSize = 200000000 +PrefixResultNames = 0 +MacSpotlight = 0 +IndexTreeMaps = 64 +MaxQueryMem = 2G ; memory allocated to query processor +VectorSize = 1000 ; initial parallel query vector (array of query operations) size +MaxVectorSize = 1000000 ; query vector size threshold. +AdjustVectorSize = 0 +ThreadsPerQuery = 4 +AsyncQueueMaxThreads = 10 +;; +;; When running with large data sets, one should configure the Virtuoso +;; process to use between 2/3 to 3/5 of free system memory and to stripe +;; storage on all available disks. +;; +;; Uncomment next two lines if there is 2 GB system memory free +;NumberOfBuffers = 170000 +;MaxDirtyBuffers = 130000 +;; Uncomment next two lines if there is 4 GB system memory free +;NumberOfBuffers = 340000 +; MaxDirtyBuffers = 250000 +;; Uncomment next two lines if there is 8 GB system memory free +;NumberOfBuffers = 680000 +;MaxDirtyBuffers = 500000 +;; Uncomment next two lines if there is 16 GB system memory free +;NumberOfBuffers = 1360000 +;MaxDirtyBuffers = 1000000 +;; Uncomment next two lines if there is 32 GB system memory free +;NumberOfBuffers = 2720000 +;MaxDirtyBuffers = 2000000 +;; Uncomment next two lines if there is 48 GB system memory free +;NumberOfBuffers = 4000000 +;MaxDirtyBuffers = 3000000 +;; Uncomment next two lines if there is 64 GB system memory free +;NumberOfBuffers = 5450000 +;MaxDirtyBuffers = 4000000 +;; +;; Note the default settings will take very little memory +;; but will not result in very good performance +;; +NumberOfBuffers = 10000 +MaxDirtyBuffers = 6000 + + +[HTTPServer] +ServerPort = 8890 +ServerRoot = /opt/virtuoso-opensource/vsp +MaxClientConnections = 10 +DavRoot = DAV +EnabledDavVSP = 0 +HTTPProxyEnabled = 0 +TempASPXDir = 0 +DefaultMailServer = localhost:25 +ServerThreads = 10 +MaxKeepAlives = 10 +KeepAliveTimeout = 10 +MaxCachedProxyConnections = 10 +ProxyConnectionCacheTimeout = 15 +HTTPThreadSize = 280000 +HttpPrintWarningsInOutput = 0 +Charset = UTF-8 +;HTTPLogFile = logs/http.log +MaintenancePage = atomic.html +EnabledGzipContent = 1 + + +[AutoRepair] +BadParentLinks = 0 + +[Client] +SQL_PREFETCH_ROWS = 100 +SQL_PREFETCH_BYTES = 16000 +SQL_QUERY_TIMEOUT = 0 +SQL_TXN_TIMEOUT = 0 +;SQL_NO_CHAR_C_ESCAPE = 1 +;SQL_UTF8_EXECS = 0 +;SQL_NO_SYSTEM_TABLES = 0 +;SQL_BINARY_TIMESTAMP = 1 +;SQL_ENCRYPTION_ON_PASSWORD = -1 + +[VDB] +ArrayOptimization = 0 +NumArrayParameters = 10 +VDBDisconnectTimeout = 1000 +KeepConnectionOnFixedThread = 0 + +[Replication] +ServerName = db-INSPIRO +ServerEnable = 1 +QueueMax = 50000 + + +; +; Striping setup +; +; These parameters have only effect when Striping is set to 1 in the +; [Database] section, in which case the DatabaseFile parameter is ignored. +; +; With striping, the database is spawned across multiple segments +; where each segment can have multiple stripes. +; +; Format of the lines below: +; Segment = , [, .. ] +; +; must be ordered from 1 up. +; +; The is the total size of the segment which is equally divided +; across all stripes forming the segment. Its specification can be in +; gigabytes (g), megabytes (m), kilobytes (k) or in database blocks +; (b, the default) +; +; Note that the segment size must be a multiple of the database page size +; which is currently 8k. Also, the segment size must be divisible by the +; number of stripe files forming the segment. +; +; The example below creates a 200 meg database striped on two segments +; with two stripes of 50 meg and one of 100 meg. +; +; You can always add more segments to the configuration, but once +; added, do not change the setup. +; +[Striping] +Segment1 = 100M, db-seg1-1.db, db-seg1-2.db +Segment2 = 100M, db-seg2-1.db +;... + +;[TempStriping] +;Segment1 = 100M, db-seg1-1.db, db-seg1-2.db +;Segment2 = 100M, db-seg2-1.db +;... + +;[Ucms] +;UcmPath = +;Ucm1 = +;Ucm2 = +;... + + +[Zero Config] +ServerName = virtuoso (INSPIRO) +;ServerDSN = ZDSN +;SSLServerName = +;SSLServerDSN = + + +[Mono] +;MONO_TRACE = Off +;MONO_PATH = +;MONO_ROOT = +;MONO_CFG_DIR = +;virtclr.dll = + + +[URIQA] +DynamicLocal = 0 +DefaultHost = localhost:8890 + + +[SPARQL] +;ExternalQuerySource = 1 +;ExternalXsltSource = 1 +;DefaultGraph = http://localhost:8890/dataspace +;ImmutableGraphs = http://localhost:8890/dataspace +ResultSetMaxRows = 10000 +MaxQueryCostEstimationTime = 400 ; in seconds +MaxQueryExecutionTime = 60 ; in seconds +DefaultQuery = select distinct ?Concept where {[] a ?Concept} LIMIT 100 +DeferInferenceRulesInit = 0 ; controls inference rules loading +;PingService = http://rpc.pingthesemanticweb.com/ + + +[Plugins] +LoadPath = /opt/virtuoso-opensource/hosting +;Load1 = plain, wikiv +;Load2 = plain, mediawiki +;Load3 = plain, creolewiki +;Load4 = plain, im +;Load5 = plain, wbxml2 +;Load6 = plain, hslookup +;Load7 = attach, libphp5.so +;Load8 = Hosting, hosting_php.so +;Load9 = Hosting,hosting_perl.so +;Load10 = Hosting,hosting_python.so +;Load11 = Hosting,hosting_ruby.so +;Load12 = msdtc,msdtc_sample From 505c8127c6e2ae7391429f9d3e33cb2098f4da44 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 22 Nov 2020 21:41:18 +0100 Subject: [PATCH 15/21] rename redis config file --- config/redis-db/.gitignore | 1 + config/redis-db/redis-conf | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 config/redis-db/redis-conf diff --git a/config/redis-db/.gitignore b/config/redis-db/.gitignore index a424d008..4c04b62f 100644 --- a/config/redis-db/.gitignore +++ b/config/redis-db/.gitignore @@ -3,3 +3,4 @@ # Except this file !.gitignore !redis.conf +!redis-conf diff --git a/config/redis-db/redis-conf b/config/redis-db/redis-conf new file mode 100644 index 00000000..43f44ed5 --- /dev/null +++ b/config/redis-db/redis-conf @@ -0,0 +1,5 @@ +appendonly yes +appendfsync always +save 60 100 +save 360 10 +save 3600 1 From 9626d45bd06e13dc71e912658d431e9e3e5c6b9f Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Sun, 22 Nov 2020 23:45:38 +0100 Subject: [PATCH 16/21] change makefile to start pods --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5320d496..2dcb978c 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,7 @@ assign-to-ippool: kubectl annotate namespace hobbit-service "cni.projectcalico.org/ipv4pools"='[“hobbit-service"]' start-platform: - kubectl apply -f ./resource/kompose + kubectl apply -k . start-dev-platform: kubectl apply -f ./resource/kompose-dev From ab92c9b50b4114840722e93dcd8bc7fcb272deb6 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Mon, 23 Nov 2020 01:06:03 +0100 Subject: [PATCH 17/21] fix vos pod in dev --- kustomization-dev.yaml | 16 ++++++++++ resource/kompose-dev/vos.yaml | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 kustomization-dev.yaml create mode 100644 resource/kompose-dev/vos.yaml diff --git a/kustomization-dev.yaml b/kustomization-dev.yaml new file mode 100644 index 00000000..5a07e49f --- /dev/null +++ b/kustomization-dev.yaml @@ -0,0 +1,16 @@ +configMapGenerator: +#- name: redis-server +# files: +# - config/redis-db/redis-config +- name: vos-server + files: + - config/db/virtuoso-ini +resources: +#- resource/kompose/rabbit.yaml +#- resource/kompose/redis.yaml +- resource/kompose-dev/vos.yaml +#- resource/kompose/storage-service.yaml +#- resource/kompose/platform-controller.yaml +#- resource/kompose/keycloak.yaml +#- resource/kompose/gui.yaml +#- resource/kompose/analysis.yaml diff --git a/resource/kompose-dev/vos.yaml b/resource/kompose-dev/vos.yaml new file mode 100644 index 00000000..6b2cedc5 --- /dev/null +++ b/resource/kompose-dev/vos.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vos + labels: + app: vos + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: vos + template: + metadata: + labels: + app: vos + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: vos + image: hobbitproject/virtuoso_opensource:v07.20.3217 + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + runAsUser: 0 + ports: + - name: http + containerPort: 8890 + volumeMounts: + - mountPath: /config/db + name: vos-server + volumes: + - name: vos-server + configMap: + name: vos-server + items: + - key: virtuoso-ini + path: virtuoso.ini + +--- + +apiVersion: v1 +kind: Service +metadata: + name: vos + labels: + app: vos + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + ports: + - name: http + port: 8890 + selector: + app: vos From a2b2e52561f18bcc1d7e4364882ccbc240fd99d4 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Mon, 23 Nov 2020 06:58:14 +0100 Subject: [PATCH 18/21] Revert "fix vos pod in dev" This reverts commit ab92c9b50b4114840722e93dcd8bc7fcb272deb6. --- kustomization-dev.yaml | 16 ---------- resource/kompose-dev/vos.yaml | 57 ----------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 kustomization-dev.yaml delete mode 100644 resource/kompose-dev/vos.yaml diff --git a/kustomization-dev.yaml b/kustomization-dev.yaml deleted file mode 100644 index 5a07e49f..00000000 --- a/kustomization-dev.yaml +++ /dev/null @@ -1,16 +0,0 @@ -configMapGenerator: -#- name: redis-server -# files: -# - config/redis-db/redis-config -- name: vos-server - files: - - config/db/virtuoso-ini -resources: -#- resource/kompose/rabbit.yaml -#- resource/kompose/redis.yaml -- resource/kompose-dev/vos.yaml -#- resource/kompose/storage-service.yaml -#- resource/kompose/platform-controller.yaml -#- resource/kompose/keycloak.yaml -#- resource/kompose/gui.yaml -#- resource/kompose/analysis.yaml diff --git a/resource/kompose-dev/vos.yaml b/resource/kompose-dev/vos.yaml deleted file mode 100644 index 6b2cedc5..00000000 --- a/resource/kompose-dev/vos.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vos - labels: - app: vos - annotations: - "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" -spec: - replicas: 1 - selector: - matchLabels: - app: vos - template: - metadata: - labels: - app: vos - annotations: - "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" - spec: - containers: - - name: vos - image: hobbitproject/virtuoso_opensource:v07.20.3217 - imagePullPolicy: IfNotPresent - securityContext: - allowPrivilegeEscalation: false - runAsUser: 0 - ports: - - name: http - containerPort: 8890 - volumeMounts: - - mountPath: /config/db - name: vos-server - volumes: - - name: vos-server - configMap: - name: vos-server - items: - - key: virtuoso-ini - path: virtuoso.ini - ---- - -apiVersion: v1 -kind: Service -metadata: - name: vos - labels: - app: vos - annotations: - "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" -spec: - ports: - - name: http - port: 8890 - selector: - app: vos From 2c4e75973fc11b395f68db0329f0be2db648d36d Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Mon, 23 Nov 2020 07:56:55 +0100 Subject: [PATCH 19/21] move redis, vos --- kustomization.yaml | 10 ++-------- resource/{kompose => }/redis.yaml | 0 resource/{kompose => }/vos.yaml | 0 3 files changed, 2 insertions(+), 8 deletions(-) rename resource/{kompose => }/redis.yaml (100%) rename resource/{kompose => }/vos.yaml (100%) diff --git a/kustomization.yaml b/kustomization.yaml index eb142b5c..fa963135 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -6,11 +6,5 @@ configMapGenerator: files: - config/db/virtuoso-ini resources: -- resource/kompose/rabbit.yaml -- resource/kompose/redis.yaml -- resource/kompose/vos.yaml -- resource/kompose/storage-service.yaml -- resource/kompose/platform-controller.yaml -- resource/kompose/keycloak.yaml -- resource/kompose/gui.yaml -- resource/kompose/analysis.yaml +- resource/redis.yaml +- resource/vos.yaml diff --git a/resource/kompose/redis.yaml b/resource/redis.yaml similarity index 100% rename from resource/kompose/redis.yaml rename to resource/redis.yaml diff --git a/resource/kompose/vos.yaml b/resource/vos.yaml similarity index 100% rename from resource/kompose/vos.yaml rename to resource/vos.yaml From adb6171d77c13aedc555b79d20d22c6408be4cd9 Mon Sep 17 00:00:00 2001 From: Hasitha Rajapakse Date: Mon, 23 Nov 2020 08:27:22 +0100 Subject: [PATCH 20/21] fix dev yaml files --- kustomization.yaml | 2 + resource/{kompose => }/keycloak.yaml | 0 resource/kompose-dev/analysis-deployment.yaml | 30 ---------- resource/kompose-dev/analysis.yaml | 27 +++++++++ resource/kompose-dev/gui-deployment.yaml | 44 --------------- resource/kompose-dev/gui-service.yaml | 16 ------ resource/kompose-dev/gui.yaml | 56 +++++++++++++++++++ ...keycloak-claim0-persistentvolumeclaim.yaml | 14 ----- resource/kompose-dev/keycloak-deployment.yaml | 37 ------------ resource/kompose-dev/keycloak-service.yaml | 16 ------ .../kompose-dev/node-exporter-deployment.yaml | 27 --------- resource/kompose-dev/node-exporter.yaml | 24 ++++++++ ...ntroller-claim0-persistentvolumeclaim.yaml | 14 ----- .../platform-controller-deployment.yaml | 54 ------------------ resource/kompose-dev/platform-controller.yaml | 54 ++++++++++++++++++ resource/kompose-dev/rabbit-deployment.yaml | 32 ----------- resource/kompose-dev/rabbit-service.yaml | 19 ------- .../redis-claim0-persistentvolumeclaim.yaml | 14 ----- resource/kompose-dev/redis-deployment.yaml | 39 ------------- resource/kompose-dev/redis-service.yaml | 15 ----- .../storage-service-deployment.yaml | 36 ------------ resource/kompose-dev/storage-service.yaml | 33 +++++++++++ .../vos-claim0-persistentvolumeclaim.yaml | 14 ----- resource/kompose-dev/vos-deployment.yaml | 37 ------------ resource/kompose-dev/vos-service.yaml | 15 ----- resource/{kompose => }/rabbit.yaml | 0 26 files changed, 196 insertions(+), 473 deletions(-) rename resource/{kompose => }/keycloak.yaml (100%) delete mode 100644 resource/kompose-dev/analysis-deployment.yaml create mode 100644 resource/kompose-dev/analysis.yaml delete mode 100644 resource/kompose-dev/gui-deployment.yaml delete mode 100644 resource/kompose-dev/gui-service.yaml create mode 100644 resource/kompose-dev/gui.yaml delete mode 100644 resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml delete mode 100644 resource/kompose-dev/keycloak-deployment.yaml delete mode 100644 resource/kompose-dev/keycloak-service.yaml delete mode 100644 resource/kompose-dev/node-exporter-deployment.yaml create mode 100644 resource/kompose-dev/node-exporter.yaml delete mode 100644 resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml delete mode 100644 resource/kompose-dev/platform-controller-deployment.yaml create mode 100644 resource/kompose-dev/platform-controller.yaml delete mode 100644 resource/kompose-dev/rabbit-deployment.yaml delete mode 100644 resource/kompose-dev/rabbit-service.yaml delete mode 100644 resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml delete mode 100644 resource/kompose-dev/redis-deployment.yaml delete mode 100644 resource/kompose-dev/redis-service.yaml delete mode 100644 resource/kompose-dev/storage-service-deployment.yaml create mode 100644 resource/kompose-dev/storage-service.yaml delete mode 100644 resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml delete mode 100644 resource/kompose-dev/vos-deployment.yaml delete mode 100644 resource/kompose-dev/vos-service.yaml rename resource/{kompose => }/rabbit.yaml (100%) diff --git a/kustomization.yaml b/kustomization.yaml index fa963135..71dce917 100644 --- a/kustomization.yaml +++ b/kustomization.yaml @@ -8,3 +8,5 @@ configMapGenerator: resources: - resource/redis.yaml - resource/vos.yaml +- resource/keycloak.yaml +- resource/rabbit.yaml diff --git a/resource/kompose/keycloak.yaml b/resource/keycloak.yaml similarity index 100% rename from resource/kompose/keycloak.yaml rename to resource/keycloak.yaml diff --git a/resource/kompose-dev/analysis-deployment.yaml b/resource/kompose-dev/analysis-deployment.yaml deleted file mode 100644 index cef15e3d..00000000 --- a/resource/kompose-dev/analysis-deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: analysis - name: analysis -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: analysis - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: analysis - spec: - containers: - - env: - - name: HOBBIT_RABBIT_HOST - value: rabbit - image: hobbitproject/hobbit-analysis-component:dev - imagePullPolicy: IfNotPresent - name: analysis - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/analysis.yaml b/resource/kompose-dev/analysis.yaml new file mode 100644 index 00000000..f85c4467 --- /dev/null +++ b/resource/kompose-dev/analysis.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: analysis + labels: + app: analysis + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: analysis + template: + metadata: + labels: + app: analysis + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: analysis + image: hobbitproject/hobbit-analysis-component:dev + imagePullPolicy: IfNotPresent + env: + - name: HOBBIT_RABBIT_HOST + value: "rabbit" diff --git a/resource/kompose-dev/gui-deployment.yaml b/resource/kompose-dev/gui-deployment.yaml deleted file mode 100644 index 3a5f9889..00000000 --- a/resource/kompose-dev/gui-deployment.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: gui - name: gui - namespace: hobbit -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: gui - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit: "true" - io.kompose.network/hobbit-core: "true" - io.kompose.service: gui - spec: - containers: - - env: - - name: CHECK_REALM_URL - value: "false" - - name: ELASTICSEARCH_HOST - value: elasticsearch - - name: ELASTICSEARCH_HTTP_PORT - value: "9200" - - name: HOBBIT_RABBIT_HOST - value: rabbit - - name: KEYCLOAK_AUTH_URL - value: http://localhost:8181/auth - - name: KEYCLOAK_DIRECT_URL - value: http://keycloak:8080/auth - image: hobbitproject/hobbit-gui:dev - imagePullPolicy: IfNotPresent - name: gui - ports: - - containerPort: 8080 - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/gui-service.yaml b/resource/kompose-dev/gui-service.yaml deleted file mode 100644 index 1cd543a0..00000000 --- a/resource/kompose-dev/gui-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: gui - name: gui - namespace: hobbit -spec: - ports: - - name: "8080" - port: 8080 - targetPort: 8080 - selector: - io.kompose.service: gui -status: - loadBalancer: {} diff --git a/resource/kompose-dev/gui.yaml b/resource/kompose-dev/gui.yaml new file mode 100644 index 00000000..43fefbcf --- /dev/null +++ b/resource/kompose-dev/gui.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gui + labels: + app: gui + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: gui + template: + metadata: + labels: + app: gui + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" + spec: + containers: + - name: gui + image: hobbitproject/hobbit-gui:dev + imagePullPolicy: IfNotPresent + env: + - name: HOBBIT_RABBIT_HOST + value: "rabbit" + - name: KEYCLOAK_AUTH_URL + value: "http://localhost:8181/auth" + - name: CHECK_REALM_URL + value: "false" + - name: KEYCLOAK_DIRECT_URL + value: "http://keycloak:8080/auth" + - name: ELASTICSEARCH_HOST + value: "elasticsearch" + - name: ELASTICSEARCH_HTTP_PORT + value: "9200" + ports: + - containerPort: 8080 + +--- + +apiVersion: v1 +kind: Service +metadata: + name: gui + labels: + app: gui + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" +spec: + ports: + - port: 8080 + protocol: TCP + selector: + app: gui diff --git a/resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 9234f4a1..00000000 --- a/resource/kompose-dev/keycloak-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: keycloak-claim0 - name: keycloak-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/keycloak-deployment.yaml b/resource/kompose-dev/keycloak-deployment.yaml deleted file mode 100644 index f0f75091..00000000 --- a/resource/kompose-dev/keycloak-deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: keycloak - name: keycloak - namespace: hobbit -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: keycloak - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit: "true" - io.kompose.service: keycloak - spec: - containers: - - image: hobbitproject/hobbit-keycloak:latest - imagePullPolicy: IfNotPresent - name: keycloak - ports: - - containerPort: 8080 - resources: {} - volumeMounts: - - mountPath: /opt/jboss/keycloak/standalone/data/db - name: keycloak-claim0 - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: keycloak-claim0 - persistentVolumeClaim: - claimName: keycloak-claim0 -status: {} diff --git a/resource/kompose-dev/keycloak-service.yaml b/resource/kompose-dev/keycloak-service.yaml deleted file mode 100644 index 0fd862e3..00000000 --- a/resource/kompose-dev/keycloak-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: keycloak - name: keycloak - namespace: hobbit -spec: - ports: - - name: "8181" - port: 8181 - targetPort: 8080 - selector: - io.kompose.service: keycloak -status: - loadBalancer: {} diff --git a/resource/kompose-dev/node-exporter-deployment.yaml b/resource/kompose-dev/node-exporter-deployment.yaml deleted file mode 100644 index 24ee8cc2..00000000 --- a/resource/kompose-dev/node-exporter-deployment.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: node-exporter - name: node-exporter -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: node-exporter - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: node-exporter - spec: - containers: - - image: prom/node-exporter - imagePullPolicy: IfNotPresent - name: node-exporter - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/node-exporter.yaml b/resource/kompose-dev/node-exporter.yaml new file mode 100644 index 00000000..2317ff75 --- /dev/null +++ b/resource/kompose-dev/node-exporter.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: node-exporter + labels: + app: node-exporter + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: node-exporter + template: + metadata: + labels: + app: node-exporter + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: node-exporter + image: prom/node-exporter + imagePullPolicy: IfNotPresent diff --git a/resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 80aeb30a..00000000 --- a/resource/kompose-dev/platform-controller-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: platform-controller-claim0 - name: platform-controller-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/platform-controller-deployment.yaml b/resource/kompose-dev/platform-controller-deployment.yaml deleted file mode 100644 index ac17e0e3..00000000 --- a/resource/kompose-dev/platform-controller-deployment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: platform-controller - name: platform-controller -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: platform-controller - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: platform-controller - spec: - containers: - - env: - - name: DEPLOY_ENV - value: testing - - name: GITLAB_EMAIL - - name: GITLAB_TOKEN - - name: GITLAB_USER - - name: HOBBIT_RABBIT_EXPERIMENTS_HOST - value: rabbit - - name: HOBBIT_RABBIT_HOST - value: rabbit - - name: HOBBIT_REDIS_HOST - value: redis - - name: LOGGING_GELF_ADDRESS - value: udp://localhost:12201 - - name: PROMETHEUS_HOST - value: prometheus - - name: PROMETHEUS_PORT - value: "9090" - - name: SWARM_NODE_NUMBER - value: "1" - image: hobbitproject/hobbit-platform-controller:dev - imagePullPolicy: IfNotPresent - name: platform-controller - resources: {} - volumeMounts: - - mountPath: /var/run/docker.sock - name: platform-controller-claim0 - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: platform-controller-claim0 - persistentVolumeClaim: - claimName: platform-controller-claim0 -status: {} diff --git a/resource/kompose-dev/platform-controller.yaml b/resource/kompose-dev/platform-controller.yaml new file mode 100644 index 00000000..213aef68 --- /dev/null +++ b/resource/kompose-dev/platform-controller.yaml @@ -0,0 +1,54 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: platform-controller + labels: + app: platform-controller + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: platform-controller + template: + metadata: + labels: + app: platform-controller + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: platform-controller + image: hobbitproject/hobbit-platform-controller:dev + imagePullPolicy: IfNotPresent + env: + - name: HOBBIT_RABBIT_HOST + value: "rabbit" + - name: HOBBIT_RABBIT_EXPERIMENTS_HOST + value: "rabbit" + - name: HOBBIT_REDIS_HOST + value: "redis" + - name: DEPLOY_ENV + value: "testing" + - name: GITLAB_USER + value: "${GITLAB_USER}" + - name: GITLAB_EMAIL + value: "${GITLAB_EMAIL}" + - name: GITLAB_TOKEN + value: "${GITLAB_TOKEN}" + - name: LOGGING_GELF_ADDRESS + value: "udp://localhost:12201" + - name: SWARM_NODE_NUMBER + value: "1" + - name: PROMETHEUS_HOST + value: "prometheus" + - name: PROMETHEUS_PORT + value: "9090" + volumeMounts: + - name: dockersock + mountPath: "/var/run/docker.sock" + volumes: + - name: dockersock + hostPath: + path: /var/run/docker.sock diff --git a/resource/kompose-dev/rabbit-deployment.yaml b/resource/kompose-dev/rabbit-deployment.yaml deleted file mode 100644 index fc807b22..00000000 --- a/resource/kompose-dev/rabbit-deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: rabbit - name: rabbit - namespace: hobbit -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: rabbit - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit: "true" - io.kompose.network/hobbit-core: "true" - io.kompose.service: rabbit - spec: - containers: - - image: rabbitmq:management - imagePullPolicy: IfNotPresent - name: rabbit - ports: - - containerPort: 15672 - - containerPort: 5672 - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/rabbit-service.yaml b/resource/kompose-dev/rabbit-service.yaml deleted file mode 100644 index d69898df..00000000 --- a/resource/kompose-dev/rabbit-service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: rabbit - name: rabbit - namespace: hobbit -spec: - ports: - - name: "8081" - port: 8081 - targetPort: 15672 - - name: "5672" - port: 5672 - targetPort: 5672 - selector: - io.kompose.service: rabbit -status: - loadBalancer: {} diff --git a/resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index d552d346..00000000 --- a/resource/kompose-dev/redis-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: redis-claim0 - name: redis-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/redis-deployment.yaml b/resource/kompose-dev/redis-deployment.yaml deleted file mode 100644 index c3eb0485..00000000 --- a/resource/kompose-dev/redis-deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: redis - name: redis -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: redis - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: redis - spec: - containers: - - args: - - redis-server - - /data/redis.conf - image: redis:4.0.7 - imagePullPolicy: IfNotPresent - name: redis - ports: - - containerPort: 6379 - resources: {} - volumeMounts: - - mountPath: /data - name: redis-claim0 - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: redis-claim0 - persistentVolumeClaim: - claimName: redis-claim0 -status: {} diff --git a/resource/kompose-dev/redis-service.yaml b/resource/kompose-dev/redis-service.yaml deleted file mode 100644 index 702eaab0..00000000 --- a/resource/kompose-dev/redis-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: redis - name: redis -spec: - ports: - - name: "6379" - port: 6379 - targetPort: 6379 - selector: - io.kompose.service: redis -status: - loadBalancer: {} diff --git a/resource/kompose-dev/storage-service-deployment.yaml b/resource/kompose-dev/storage-service-deployment.yaml deleted file mode 100644 index d5c060e0..00000000 --- a/resource/kompose-dev/storage-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: storage-service - name: storage-service -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: storage-service - strategy: {} - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: storage-service - spec: - containers: - - env: - - name: HOBBIT_RABBIT_HOST - value: rabbit - - name: SPARQL_ENDPOINT_PASSWORD - value: Password - - name: SPARQL_ENDPOINT_URL - value: http://vos:8890/sparql - - name: SPARQL_ENDPOINT_USERNAME - value: HobbitPlatform - image: hobbitproject/hobbit-storage-service:dev - imagePullPolicy: IfNotPresent - name: storage-service - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} diff --git a/resource/kompose-dev/storage-service.yaml b/resource/kompose-dev/storage-service.yaml new file mode 100644 index 00000000..3c44b82b --- /dev/null +++ b/resource/kompose-dev/storage-service.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: storage-service + labels: + app: storage-service + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" +spec: + replicas: 1 + selector: + matchLabels: + app: storage-service + template: + metadata: + labels: + app: storage-service + annotations: + "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" + spec: + containers: + - name: storage-service + image: hobbitproject/hobbit-storage-service:dev + imagePullPolicy: IfNotPresent + env: + - name: SPARQL_ENDPOINT_URL + value: "http://vos:8890/sparql" + - name: HOBBIT_RABBIT_HOST + value: "rabbit" + - name: SPARQL_ENDPOINT_USERNAME + value: "HobbitPlatform" + - name: SPARQL_ENDPOINT_PASSWORD + value: "Password" diff --git a/resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml b/resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 1b2e8325..00000000 --- a/resource/kompose-dev/vos-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: vos-claim0 - name: vos-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/resource/kompose-dev/vos-deployment.yaml b/resource/kompose-dev/vos-deployment.yaml deleted file mode 100644 index b1eed453..00000000 --- a/resource/kompose-dev/vos-deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.kompose.service: vos - name: vos -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: vos - strategy: - type: Recreate - template: - metadata: - labels: - io.kompose.network/hobbit-core: "true" - io.kompose.service: vos - spec: - containers: - - image: hobbitproject/virtuoso_opensource:v07.20.3217 - imagePullPolicy: IfNotPresent - name: vos - ports: - - containerPort: 8890 - resources: {} - volumeMounts: - - mountPath: /opt/virtuoso-opensource/database - name: vos-claim0 - hostname: vos - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: vos-claim0 - persistentVolumeClaim: - claimName: vos-claim0 -status: {} diff --git a/resource/kompose-dev/vos-service.yaml b/resource/kompose-dev/vos-service.yaml deleted file mode 100644 index 9311d032..00000000 --- a/resource/kompose-dev/vos-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - io.kompose.service: vos - name: vos -spec: - ports: - - name: "8890" - port: 8890 - targetPort: 8890 - selector: - io.kompose.service: vos -status: - loadBalancer: {} diff --git a/resource/kompose/rabbit.yaml b/resource/rabbit.yaml similarity index 100% rename from resource/kompose/rabbit.yaml rename to resource/rabbit.yaml From 5989ce4817185592752165d934a6bcb2034cce94 Mon Sep 17 00:00:00 2001 From: hasitha1990 Date: Mon, 30 Nov 2020 09:53:20 +0100 Subject: [PATCH 21/21] add network policy --- resource/hobbit-core-networkpolicy.yaml | 23 +++++++++++++++++++ resource/hobbit-networkpolicy.yaml | 22 ++++++++++++++++++ resource/keycloak.yaml | 2 ++ resource/kompose/gui.yaml | 4 ++++ .../kompose/hobbit-core-networkpolicy.yaml | 20 ---------------- resource/kompose/hobbit-networkpolicy.yaml | 19 --------------- resource/pools.yaml | 6 ++--- resource/rabbit.yaml | 4 ++++ resource/redis.yaml | 2 ++ resource/vos.yaml | 2 ++ 10 files changed, 62 insertions(+), 42 deletions(-) create mode 100644 resource/hobbit-core-networkpolicy.yaml create mode 100644 resource/hobbit-networkpolicy.yaml delete mode 100644 resource/kompose/hobbit-core-networkpolicy.yaml delete mode 100644 resource/kompose/hobbit-networkpolicy.yaml diff --git a/resource/hobbit-core-networkpolicy.yaml b/resource/hobbit-core-networkpolicy.yaml new file mode 100644 index 00000000..f0eafb36 --- /dev/null +++ b/resource/hobbit-core-networkpolicy.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + creationTimestamp: null + name: hobbit-core +spec: + policyTypes: + - Ingress + - Egress + ingress: + - from: + - podSelector: + matchLabels: + io.kompose.network/hobbit-core: hobbit-core + egress: + - to: + - podSelector: + matchLabels: + io.kompose.network/hobbit-core: hobbit-core + podSelector: + matchLabels: + io.kompose.network/hobbit-core: hobbit-core + diff --git a/resource/hobbit-networkpolicy.yaml b/resource/hobbit-networkpolicy.yaml new file mode 100644 index 00000000..75bd4ae5 --- /dev/null +++ b/resource/hobbit-networkpolicy.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + creationTimestamp: null + name: hobbit +spec: + policyTypes: + - Ingress + - Egress + ingress: + - from: + - podSelector: + matchLabels: + io.kompose.network/hobbit: hobbit + egress: + - to: + - podSelector: + matchLabels: + io.kompose.network/hobbit: hobbit + podSelector: + matchLabels: + io.kompose.network/hobbit: hobbit diff --git a/resource/keycloak.yaml b/resource/keycloak.yaml index 32618b41..d60ee052 100644 --- a/resource/keycloak.yaml +++ b/resource/keycloak.yaml @@ -4,6 +4,7 @@ metadata: name: keycloak labels: app: keycloak + io.kompose.network/hobbit: "true" annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\"]" spec: @@ -15,6 +16,7 @@ spec: metadata: labels: app: keycloak + io.kompose.network/hobbit: "true" annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\"]" spec: diff --git a/resource/kompose/gui.yaml b/resource/kompose/gui.yaml index ba6631b6..74daa007 100644 --- a/resource/kompose/gui.yaml +++ b/resource/kompose/gui.yaml @@ -4,6 +4,8 @@ metadata: name: gui labels: app: gui + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" spec: @@ -15,6 +17,8 @@ spec: metadata: labels: app: gui + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\",\"hobbit\"]" spec: diff --git a/resource/kompose/hobbit-core-networkpolicy.yaml b/resource/kompose/hobbit-core-networkpolicy.yaml deleted file mode 100644 index 5991b1e9..00000000 --- a/resource/kompose/hobbit-core-networkpolicy.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: hobbit-core - namespace: hobbit-core -spec: - policyTypes: - - Ingress - - Egress - ingress: - - from: - - ipBlock: - cidr: 172.16.101.0/24 - - podSelector: - matchLabels: - io.kompose.network/hobbit-core: "true" - podSelector: - matchLabels: - io.kompose.network/hobbit-core: "true" diff --git a/resource/kompose/hobbit-networkpolicy.yaml b/resource/kompose/hobbit-networkpolicy.yaml deleted file mode 100644 index c55528ee..00000000 --- a/resource/kompose/hobbit-networkpolicy.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: NetworkPolicy -metadata: - creationTimestamp: null - name: hobbit -spec: - policyTypes: - - Ingress - - Egress - ingress: - - from: - - ipBlock: - cidr: 172.16.100.0/24 - - podSelector: - matchLabels: - io.kompose.network/hobbit: "true" - podSelector: - matchLabels: - io.kompose.network/hobbit: "true" diff --git a/resource/pools.yaml b/resource/pools.yaml index 9360580d..690a06bf 100644 --- a/resource/pools.yaml +++ b/resource/pools.yaml @@ -1,4 +1,4 @@ -apiVersion: crd.projectcalico.org/v1 +apiVersion: projectcalico.org/v3 kind: IPPool metadata: name: hobbit @@ -11,7 +11,7 @@ spec: --- -apiVersion: crd.projectcalico.org/v1 +apiVersion: projectcalico.org/v3 kind: IPPool metadata: name: hobbit-core @@ -24,7 +24,7 @@ spec: --- -apiVersion: crd.projectcalico.org/v1 +apiVersion: projectcalico.org/v3 kind: IPPool metadata: name: hobbit-services diff --git a/resource/rabbit.yaml b/resource/rabbit.yaml index ddb81611..6f3252d2 100644 --- a/resource/rabbit.yaml +++ b/resource/rabbit.yaml @@ -4,6 +4,8 @@ metadata: name: rabbit labels: app: rabbit + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\",\"hobbit-core\"]" spec: @@ -15,6 +17,8 @@ spec: metadata: labels: app: rabbit + io.kompose.network/hobbit: hobbit + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit\",\"hobbit-core\"]" spec: diff --git a/resource/redis.yaml b/resource/redis.yaml index 77865bfa..8ca343dc 100644 --- a/resource/redis.yaml +++ b/resource/redis.yaml @@ -4,6 +4,7 @@ metadata: name: redis labels: app: redis + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: @@ -15,6 +16,7 @@ spec: metadata: labels: app: redis + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: diff --git a/resource/vos.yaml b/resource/vos.yaml index 6b2cedc5..1bdb1f96 100644 --- a/resource/vos.yaml +++ b/resource/vos.yaml @@ -4,6 +4,7 @@ metadata: name: vos labels: app: vos + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: @@ -15,6 +16,7 @@ spec: metadata: labels: app: vos + io.kompose.network/hobbit-core: hobbit-core annotations: "cni.projectcalico.org/ipv4pools": "[\"hobbit-core\"]" spec: