Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Added gitlab example #170

Merged
merged 1 commit into from
Sep 11, 2017
Merged

Added gitlab example #170

merged 1 commit into from
Sep 11, 2017

Conversation

surajnarwade
Copy link
Collaborator

Added working gitlab example for kedge.

containers:
- image: sameersbn/gitlab:8.16.3
volumeMounts:
- name: db
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data or gitData might be better name here

value: "false"
volumes:
- name: db
emptyDir: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will lose data if the container is moved to another node.
emptyDir dir shouldn't be used here.

emptyDir: {}
services:
- name: gitlab
type: NodePort
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather use LoadBalancer here.

- port: 5432
volumes:
- name: db
emptyDir: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will lose data if the container is moved to another node.
emptyDir dir shouldn't be used here.

- port: 6379
volumes:
- name: db
emptyDir: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will lose data if the container is moved to another node.
emptyDir dir shouldn't be used here.

containers:
- image: redis:3.2.4
volumeMounts:
- name: db
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redisData might be better name

containers:
- image: sameersbn/postgresql:9.5-3
volumeMounts:
- name: db
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postresqlData might be better name

- name: db
mountPath: /var/lib/postgresql
env:
- name: DB_USER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variables like DB_USER, DB_PASS and DB_NAME are shared with gitlab container.
It might be better to use ConfigMap for those.


### Example Reference

https://github.com/lwolf/kubernetes-gitlab/tree/master/gitlab
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link tag [ ]( )

@@ -0,0 +1,105 @@
name: gitlab
containers:
- image: sameersbn/gitlab:8.16.3
Copy link
Member

@surajssd surajssd Jul 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is valid indentation, but we can get rid of two extra spaces like the following:

containers:
- image: sameersbn/gitlab:8.16.3
  volumeMounts:
  - name: db
    mountPath: /home/git/data
  env:
  - name: DEBUG
    value: "false"
  - name: DB_TYPE
    value: postgres

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer indentations as @surajnarwade did it.

@surajssd
Copy link
Member

@kadel we also decided to segregate the examples directory based on features and on real world examples, so how are we doing that?

Because this is adding to that mix, where all the examples are feature based?

@kadel
Copy link
Member

kadel commented Jul 24, 2017

@kadel we also decided to segregate the examples directory based on features and on real world examples, so how are we doing that?

Because this is adding to that mix, where all the examples are feature based?

That is separate issue and we should take care of it in another PR

@surajssd
Copy link
Member

surajssd commented Aug 2, 2017

ping @surajnarwade

@surajnarwade
Copy link
Collaborator Author

@surajssd @kadel updated PR with suggested changes

@cdrage
Copy link
Collaborator

cdrage commented Aug 2, 2017

Hey @surajnarwade I previously pointed you towards the official GitLab Kubernetes artifacts before you added this example. Why not use those instead? https://gitlab.com/charts/charts.gitlab.io/tree/master/charts

@surajnarwade
Copy link
Collaborator Author

@cdrage, same example we have used for kompose. so I picked this one

@cdrage
Copy link
Collaborator

cdrage commented Aug 8, 2017

@surajnarwade I know, but https://gitlab.com/charts/charts.gitlab.io/tree/master/charts is the official one and would gather more adoption. Yes, the one on Kompose needs to be updated too...

@surajssd
Copy link
Member

surajssd commented Aug 8, 2017

@cdrage 👍
Yeah we should follow what is happening in the community!

@pradeepto
Copy link
Member

@surajnarwade What is the status on this? No update in 13 days.

@surajnarwade surajnarwade force-pushed the examples branch 2 times, most recently from 1ac07ff to 49489a7 Compare August 24, 2017 07:23
@surajnarwade
Copy link
Collaborator Author

@pradeepto updated with new official gitlab example :)

@surajnarwade
Copy link
Collaborator Author

@surajssd @kadel @containscafeine example updated as per official configs,Please review :)

app: gitlab
replicas: 1
containers:
- name: gitlab
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you adjust indentation to 2 spaces in this section, similar to the way you have done in section of services ?

### Generating artifacts

```
$ kedge generate -f gitlab.yml -f redis.yml -f postgres.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also give

kedge create -f .

dot being current directory so it will take all the YAML files

secretKeyRef:
name: gitlab
key: redis-password
ports:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can reduce the file size, by removing the ports section, from under pods.

so added following changes

diff --git a/examples/gitlab/gitlab.yml b/examples/gitlab/gitlab.yml
index 4164541..fe798e6 100644
--- a/examples/gitlab/gitlab.yml
+++ b/examples/gitlab/gitlab.yml
@@ -46,17 +46,10 @@ containers:
             secretKeyRef:
               name: gitlab
               key: redis-password
-        ports:
-        - name: ssh
-          containerPort: 22
-        - name: http
-          containerPort: 80
-        - name: https
-          containerPort: 443
         livenessProbe:
           httpGet:
             path: /help
-            port: http
+            port: 80
           # This pod takes a very long time to start up. Be cautious when
           # lowering this value to avoid Pod death during startup.
           initialDelaySeconds: 200
@@ -67,7 +60,7 @@ containers:
         readinessProbe:
           httpGet:
             path: /help
-            port: http
+            port: 80
           initialDelaySeconds: 30
           timeoutSeconds: 1
           periodSeconds: 10
@@ -94,13 +87,13 @@ services:
   ports:
   - name: ssh
     port: 22
-    targetPort: ssh
+    targetPort: 22
   - name: http
     port: 80
-    targetPort: http
+    targetPort: 80
   - name: https
     port: 443
-    targetPort: https
+    targetPort: 443
 
 volumeClaims:
 - name: gitlab-data
diff --git a/examples/gitlab/postgres.yml b/examples/gitlab/postgres.yml
index 7e20906..b4ff9ee 100644
--- a/examples/gitlab/postgres.yml
+++ b/examples/gitlab/postgres.yml
@@ -22,9 +22,6 @@ containers:
               key: postgres-password
         - name: POD_IP
           valueFrom: { fieldRef: { fieldPath: status.podIP } }
-        ports:
-        - name: postgresql
-          containerPort: 5432
         livenessProbe:
           exec:
             command:
@@ -60,7 +57,7 @@ services:
   ports:
   - name: postgresql
     port: 5432
-    targetPort: postgresql
+    targetPort: 5432
 
 volumeClaims:
 - name: data
diff --git a/examples/gitlab/redis.yml b/examples/gitlab/redis.yml
index ac9a87c..4465f15 100644
--- a/examples/gitlab/redis.yml
+++ b/examples/gitlab/redis.yml
@@ -11,9 +11,6 @@ containers:
             secretKeyRef:
               name: redis
               key: redis-password
-        ports:
-        - name: redis
-          containerPort: 6379
         livenessProbe:
           exec:
             command:
@@ -43,7 +40,7 @@ services:
   ports:
   - name: redis
     port: 6379
-    targetPort: redis
+    targetPort: 6379
 
 volumeClaims:
 - name: redis-data

@surajssd
Copy link
Member

Apart from those minor changes, the example worked for me!

@surajnarwade
Copy link
Collaborator Author

@surajssd @kadel updated with changes :) good to go

Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

livenessProbe:
httpGet:
path: /help
port: http
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

port needs to change to 80

readinessProbe:
httpGet:
path: /help
port: http
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here port needs to be 80

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like it was shown in the diff here: #170 (comment)

Added working gitlab example for kedge.
Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! WFM now!

@surajssd surajssd merged commit ff2ca09 into kedgeproject:master Sep 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants