As gogs.io is offering a docker image, i thought it must be straight forward to install it on top of google container engine with kubernetes.
After fiddling around a few hours i got two configuration-files now, as i have seen them in an issue thread here:
The files in the issue thread are using a ReplicationController instead of a pod.. and the service is also not using a LoadBalancer as type - i couldn't get it work this way neither, so i changed it to a Pod and a Service including LoadBalancer like in the wordpress tutorial of google
gogs.yml:
apiVersion: v1
kind: Pod
metadata:
name: gogs
labels:
name: gogs
spec:
containers:
- name: gogs
image: gogs/gogs
ports:
- containerPort: 3000
- containerPort: 22
volumeMounts:
- mountPath: /data
name: data
- name: postgres
image: postgres
ports:
- containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres
env:
- name: POSTGRES_USER
value: "gogs"
- name: POSTGRES_PASSWORD
value: "gogs"
volumes:
- name: data
gcePersistentDisk:
# This disk must already exist.
pdName: gogs-stage-data-disk
fsType: ext4
- name: postgres
gcePersistentDisk:
# This disk must already exist.
pdName: gogs-stage-postgres-disk
fsType: ext4
gogs-service.yml:
apiVersion: v1
kind: Service
metadata:
labels:
name: gogs-frontend
name: gogs-frontend
spec:
type: LoadBalancer
ports:
# The port that this service should serve on.
- port: 80
targetPort: 3000
protocol: TCP
selector:
name: gogs
Then i followed basically the steps like in this tutorial to include external disks for the data and db directories.
Create a new project, set compute zone (gcloud config set..)
Create a new cluster
gcloud container clusters create gogs-stage --num-nodes 1
Create new persistent disks
gcloud compute disks create --size 200GB gogs-stage-data-disk
gcloud compute disks create --size 200GB gogs-stage-postgres-disk
Create pod
kubectl create -f gogs.yml
Create the service
kubectl create -f gogs-service.yml
Now at the point of creating the pod, it never turns from "Pending" to "Ready" also when i wait for several minutes - i check with kubectl get pod gogs
What is wrong with my setup? And how could i check it? I can login with ssh.. when i look there into the /var/log/messages, i can see some docker errors in the end of the file saying:
aufs au_opts_verify:1570:docker[4711]: dir perm1 breaks the protection by the permission bits on the lower branch
But only with that, i couldn't find anything pointing me in the right direction so far. Any help very appreciated :)