diff --git a/1.3-kubernetes-deployments/Picture-steps-CI.png b/1.3-kubernetes-deployments/Picture-steps-CI.png new file mode 100644 index 0000000..f8014d7 Binary files /dev/null and b/1.3-kubernetes-deployments/Picture-steps-CI.png differ diff --git a/1.3-kubernetes-deployments/README.md b/1.3-kubernetes-deployments/README.md new file mode 100644 index 0000000..7aa0210 --- /dev/null +++ b/1.3-kubernetes-deployments/README.md @@ -0,0 +1,13 @@ + + + +# FIWARE:WIRECLOUD DEPLOYMENT ON THE KUBERNETES +This repository folder provides deployment files of the wirecloud docker instances to build wirecloud docker images on the kubernetes cluster.This will help the users manage docker container services with kubernetes infrastructre. + +[![image](https://raw.githubusercontent.com/tigalab/kubernetes-deployments-docker-wirecloud/tigalab/1.3-kubernetes-deployments/fiqare-product.png)](https://www.tiga.com.tr/) + + +Kubernetes can be helpfull for such a CI/CD mechanism below. + +[![image](https://raw.githubusercontent.com/tigalab/kubernetes-deployments-docker-wirecloud/tigalab/1.3-kubernetes-deployments/Picture-steps-CI.png)](https://www.tiga.com.tr/) + diff --git a/1.3-kubernetes-deployments/fiqare-product.png b/1.3-kubernetes-deployments/fiqare-product.png new file mode 100644 index 0000000..2c89eae Binary files /dev/null and b/1.3-kubernetes-deployments/fiqare-product.png differ diff --git a/1.3-kubernetes-deployments/postgres-deployment/README.md b/1.3-kubernetes-deployments/postgres-deployment/README.md new file mode 100644 index 0000000..c46d63b --- /dev/null +++ b/1.3-kubernetes-deployments/postgres-deployment/README.md @@ -0,0 +1,54 @@ + + + + +# How to use Deployment files +This folder consists: +-deployments file +-service file +-persistent volume file +-persisten volume claim + +How to build the deployments: +***Make sure you have an installed kubernetes cluster node and kubectl tool to manage kubernetes deployments*** + + + + +edit volume file's #change this part + +- create volume with the following command + ``` +kubectl apply -f postgres-data-volume.yaml +``` + +- create persistent volume with the following command +``` +kubectl apply -f postgres-data-claim.yaml +``` + +edit the deployment file's #change this part +- create deployment with the following command: +``` +kubectl apply -f postgres-deployment.yaml +``` + +edit service file's #change this part +- create services with the following command: +``` +kubectl apply -f postgres-service.yaml +``` + + + + + + + + + + + + + + diff --git a/1.3-kubernetes-deployments/postgres-deployment/postgres-data-claim.yaml b/1.3-kubernetes-deployments/postgres-deployment/postgres-data-claim.yaml new file mode 100644 index 0000000..81560e5 --- /dev/null +++ b/1.3-kubernetes-deployments/postgres-deployment/postgres-data-claim.yaml @@ -0,0 +1,12 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: postgres-data-claim +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + diff --git a/1.3-kubernetes-deployments/postgres-deployment/postgres-data-volume.yaml b/1.3-kubernetes-deployments/postgres-deployment/postgres-data-volume.yaml new file mode 100644 index 0000000..357bcdf --- /dev/null +++ b/1.3-kubernetes-deployments/postgres-deployment/postgres-data-volume.yaml @@ -0,0 +1,15 @@ +kind: PersistentVolume +apiVersion: v1 +metadata: + name: postgres-data-volume + labels: + type: local +spec: + storageClassName: manual + capacity: + storage: 10Gi + accessModes: + - ReadWriteOnce + hostPath: + #change this + path: "/mnt/wirecloud/postgres/" diff --git a/1.3-kubernetes-deployments/postgres-deployment/postgres-deployment.yaml b/1.3-kubernetes-deployments/postgres-deployment/postgres-deployment.yaml new file mode 100644 index 0000000..5b2e2ce --- /dev/null +++ b/1.3-kubernetes-deployments/postgres-deployment/postgres-deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: postgres +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + labels: + app: postgres + spec: + containers: + - env: + - name: POSTGRES_PASSWORD + value: wirepass + image: postgres:latest + name: postgres + ports: + - containerPort: 5432 + resources: {} + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: postgres-data + restartPolicy: Always + volumes: + - name: postgres-data + persistentVolumeClaim: + claimName: postgres-data-claim +status: {} diff --git a/1.3-kubernetes-deployments/postgres-deployment/postgres-service.yaml b/1.3-kubernetes-deployments/postgres-deployment/postgres-service.yaml new file mode 100644 index 0000000..5e7ab6c --- /dev/null +++ b/1.3-kubernetes-deployments/postgres-deployment/postgres-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: postgres + labels: + app: postgres +spec: + type: NodePort + ports: + - port: 5432 + targetPort: 5432 + #change this according to you + nodePort: 30220 + selector: + app: postgres \ No newline at end of file diff --git a/1.3-kubernetes-deployments/wirecloud-deployment/README.md b/1.3-kubernetes-deployments/wirecloud-deployment/README.md new file mode 100644 index 0000000..f401007 --- /dev/null +++ b/1.3-kubernetes-deployments/wirecloud-deployment/README.md @@ -0,0 +1,44 @@ + + +# How to use Deployment files +This folder consists: +-deployments file +-service file +-persistent volume file +-persisten volume claim + +How to build the deployments: +***Make sure you have an installed kubernetes cluster node and kubectl tool to manage kubernetes deployments*** + + + + +edit volume file's #change this part +- create volume with the following command + ``` +kubectl apply -f wirecloud-static-volume.yaml +``` + +- create persistent volume with the following command +``` +kubectl apply -f wirecloud-static-persistentvolumeclaim.yaml +``` + +edit the deployment file's #change this part +- create deployment with the following command: +``` +kubectl apply -f wirecloud-deployment.yaml +``` + +edit service file's #change this part +- create services with the following command: +``` +kubectl apply -f wirecloud-service.yaml +``` + + + + + + + diff --git a/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-data-volume.yaml b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-data-volume.yaml new file mode 100644 index 0000000..17d40e2 --- /dev/null +++ b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-data-volume.yaml @@ -0,0 +1,15 @@ +kind: PersistentVolume +apiVersion: v1 +metadata: + name: wirecloud-data + labels: + type: local +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + hostPath: + #change this + path: "/mnt/wirecloud/wirecloud_data/" \ No newline at end of file diff --git a/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-deployment.yaml b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-deployment.yaml new file mode 100644 index 0000000..126a15e --- /dev/null +++ b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: wirecloud +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + labels: + app: wirecloud + spec: + containers: + - env: + - name: DB_HOST + #change this according to you + value: "192.168.1.123" + - name: "DB_PASSWORD" + #change this according to you + value: wirepass + - name: DB_PORT + #change this according to you + value: "30220" + - name: DEBUG + value: "True" +# - name: ELASTICSEARCH2_URL +# value: http://192.168.1.123:30920/ + - name: FORWARDED_ALLOW_IPS + value: '*' + - name: LOGLEVEL + value: INFO +# - name: MEMCACHED_LOCATION +# value: memcached:11211 + image: fiware/wirecloud:1.3 + name: wirecloud + ports: + - containerPort: 8000 + resources: {} + volumeMounts: + - mountPath: /opt/wirecloud_instance/data + name: wirecloud-data + - mountPath: /var/www/static + name: wirecloud-static + restartPolicy: Always + volumes: + - name: wirecloud-data + persistentVolumeClaim: + claimName: wirecloud-data + - name: wirecloud-static + persistentVolumeClaim: + claimName: wirecloud-static +status: {} diff --git a/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-service.yml b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-service.yml new file mode 100644 index 0000000..f08d84f --- /dev/null +++ b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-service.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: wirecloud + labels: + app: wirecloud +spec: + type: NodePort + ports: + - port: 8000 + targetPort: 8000 + #change this according to you + nodePort: 30230 + selector: + app: wirecloud \ No newline at end of file diff --git a/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-static-persistentvolumeclaim.yaml b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-static-persistentvolumeclaim.yaml new file mode 100644 index 0000000..27741e7 --- /dev/null +++ b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-static-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wirecloud-static +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +status: {} diff --git a/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-static-volume.yaml b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-static-volume.yaml new file mode 100644 index 0000000..8353470 --- /dev/null +++ b/1.3-kubernetes-deployments/wirecloud-deployment/wirecloud-static-volume.yaml @@ -0,0 +1,15 @@ +kind: PersistentVolume +apiVersion: v1 +metadata: + name: wirecloud-static + labels: + type: local +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + hostPath: + #change this according to you + path: "/mnt/wirecloud/wirecloud_static/" \ No newline at end of file diff --git a/README.md b/README.md index 79891b9..5767981 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ services: restart: always image: postgres environment: - - POSTGRES_PASSWORD=wirepass # Change this password! + - POSTGRES_PASSWORD=wirepass volumes: - ./postgres-data:/var/lib/postgresql/data