Git Product home page Git Product logo

gogs's Introduction

Install Gogs in Kubernetes

The following installation steps will create a working Git server in Kubernetes.

Installation

Use the script gogs.yaml to create all Kubernetes entities needed.

Run the script with:

$ kubectl apply -f gogs.yaml

namespace/gogs created
persistentvolumeclaim/gogs-pv-claim created
deployment.extensions/gogs created
service/gogs-svc created

Depending on your needs, you may want to modify:

  • size of the persistent volume (currently 2GB)
  • Gogs Docker image (currently gogs/gogs:0.13)
  • number of replicas
  • turn the Deployment into a StatefulSet or a DaemonSet

Access to Gogs

You may access Gogs in 2 ways:

  • via web interface that is similar with Github
  • via SSH using git command line

If you use Minikube then you should add the local address of Gogs to /etc/hosts with the following command:

echo -e "\n"$(minikube ip)" gogs.local" | sudo tee -a /etc/hosts

Access via web interface

In order to access the Gogs web interface you have the following options:

  • via an Ingress (uncomment the ingress section in gogs.yaml)
  • via an Istio gateway - run the script istio.yaml to create the Istio entities needed. For this option you will need to previously install Istio
$ kubectl apply -f istio.yaml

gateway.networking.istio.io/gogs-gateway created
virtualservice.networking.istio.io/gogs-vs created

Gogs Configuration via web interface

Access in your browser the link: http://gogs.local

Database Settings:

For simplicity choose SQLite3

Database Settings

Application General Settings:

  • Domain: gogs.local
  • SSH Port: 30022
  • HTTP Port: 3000
  • Application URL: http://gogs.local/

Application General Settings

Optional Settings:

Expand Admin Account Settings and create an admin user:

  • Username: your-user-name
  • Password: your-password
  • Email: your-email-address or a dummy address

Optional Settings

โ— Upload the public key to your Gogs user that will be useful for SSH access.

Access via SSH

Create the following entry into your ~/.ssh/config file:

Host gogs.local
    HostName gogs.local
    Port 30022
    User git

Test the SSH conection to Gogs:

$ ssh gogs.local

Warning: Permanently added the ECDSA host key for IP address '[192.168.99.100]:30022' to the list of known hosts.
PTY allocation request failed on channel 0
Hi there, You've successfully authenticated, but Gogs does not provide shell access.
If this is unexpected, please log in with password and setup Gogs under another user.
Connection to gogs.local closed.

More information about the Docker for Gogs on page https://github.com/gogs/gogs/tree/master/docker

Gogs for ARM64

If you have a Kubernetes cluster running on a Raspberry Pi 4 with 8GB RAM or a server in cloud running ARM64 processor then Gogs may be installed by using the deployment script gogs-arm64.yaml

gogs's People

Contributors

drabo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gogs's Issues

access lost after pod restart

Hi, i've used this and it worked (without namespace though) but then i wanted to test it more and restarted the pod via kubectl delete. All is fine from kube side, but i cannot access the port that NodePort is supposed to nat on my node.
I deleted further the deployment and service and had them recreated again from yaml but same result, gogs seems to be dead.
I also tried changing from Nodeport to external-ip and while deployment went ok i still wasn't able to reach intended http port.
Pod log is fine, no err and i do have another nginx pod running just fine so no idea where to look anymore.
Any idea why restarting the pod went downhill?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.