GitLab CE on Kubernetes - error executing run on gitlab/ssh - docker

I'm pulling my hair attempting to fix this error when installing GitLab CE through Helm on Kubernetes (helm install --namespace gitlab-ce --values gitlab-ce-values.yml --name gitlab-ce --set externalUrl=http://gitlab.local/ stable/gitlab-ce
Error executing action 'run' on resource 'ruby_block[directory resource: /gitlab-data/ssh]'
I have found one reply here with the following reply DJ Mountney:
one of your directories in /home/share/projects/repos is likely missing the execute bit for everyone. that means, that even though git owns /home/share/projects/repos it can't easily get there due to parent permissions.
You likely have to run a sudo chmod +x on /home/share (assuming that's the directory missing the execute flag)
This seemed to solve that person's issue, however, I have the correct flags set all the way from root, so this is not my issue.
I don't even know where to start. I've been at this for twelve hours and have gotten absolutely nowhere.
Can someone help me to proceed with installing GitLab on Docker (Kubernetes)?
UPDATE:I believe I've found a hint toward the issue. I was running Minikube through Virtualbox, which doesn't support advanced features on its mounted (shared) folders.
I have been trying to instead run minikube using xhyve, but now I can't access the Internet as Virtualbox has handled this previously. I'll keep at it.

I have used https://github.com/surajnarwade/opencompose-examples/tree/master/output-gitlab to get gitlab on kubernetes, I hope, that will help you.

Related

Minikube restarts forever

I have an issue. I typed the minikube start command and it stuck. What should I do? Is deleting minikube the only solution?
Restarting existing docker container for "minikube"
You have provided too little information to conclusively solve your problem. But one way is to actually delete the minikube and restart. You can see this similar question. Make sure that you have proper privileges to run docker containers.
Generally, this problem occurs quite often on Ubuntu. You can find very extensive thread on github.
In addition to the Restarting existing docker container for "minikube", you should also get some other information (like specific error). If they are insufficient, you can always open an issue on github.
In the thread above you can find a couple of potential solutions. Here is one of them:
When I run minikube --start --driver=docker --alsologtostderr, I get the same error message with "no such file or directory".
Edit: I was able to fix this by changing to .deb docker instead of snap docker.
Per https://kubernetes.io/docs/tasks/tools/install-minikube/:
"If you're using the none driver in Debian or a derivative, use the .deb packages for Docker rather than the snap package, which does not work with Minikube. You can download .deb packages from Docker."
I did $ snap remove docker, then followed these instructions:
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
Maybe the error messages could be amended to tell this to the user?
You can try sudo minikube delete to delete the container first,
then minikube start and see if the issue is fixed or not.

pgAdmin on OpenShift using RedHat base image

I am trying to create an image for OpenShift v4 using RedHat universal base image(registry.access.redhat.com/ubi8/ubi). Unfortunately this image comes with some limitations at least for me, i.e. missing wget and on top I have corporate proxy messing up with the SSL certificates so I am creating builds from dockerfile and running them directly in OpenShift.
So far my Dockerfile looks like:
FROM registry.access.redhat.com/ubi8/ubi
RUN \
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm && \
dnf install -y postgresql13-server
CMD [ "systemctl start postgresql-13" ]
This ends-up with "Error: GPG check FAILED". I need some help how to create the proper Dockerfile using an image from RedHat and the rpm package for Docker. Any other ideas are pretty welcome.
Thanks in advance!
"Error: GPG check FAILED" is telling you that your system is not trusting that repo. You need to import it's key as rpm --import https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-AARCH64 or whichever key is right for your version
You don't want to start a postgres server with a systemd, that's actually against the container philosophy of running a single process inside container. Also, you can't have a proper pid 1 inside openshift without messing with SCCs, since the main idea of openshift restrictions is to run unprivileged containers, so getting systemd might be impossible in your environment.
Look at the existing postgres dockerfiles out there to gain inspiration, i.e. very popular bitnami postgres image. Notice that there is entrypoint.sh, which checks if database is already initialized, and creates it if it's not. Then in actually launces as postgres "-D" "$POSTGRESQL_DATA_DIR" "--config-file=$POSTGRESQL_CONF_FILE" "--external_pid_file=$POSTGRESQL_PID_FILE" "--hba_file=$POSTGRESQL_PGHBA_FILE"
Unless you really need a postgres 13 built upon rhel 8 UBI, i suggest you to look at official redhat docker images, here is the link if you want to build them yourself - https://github.com/sclorg/postgresql-container . As you can see - building a proper postgresql is quite a task, and without working all the quirks and knowing everything beforehand - you may end up with improperly configured or corrupted database.
You may also have postgres helm charts, templates or even operators configured in you cluster, and deploying a database can be as easy as couple of clicks.
TL,DR: Do not reinvent the wheel and do not create custom database images unless you have to. And if you have to - draw inspiration from existing Dockerfiles from reputable vendors.

Run e2e test with simulation of k8s

we want to create e2e test (integration test ) for our applications on k8s and we want to use
minikube but it seems that there is no proper (maintained or official ) docker file for minikube. at least
I didn’t find any…In addition I see k3s and not sure which is better to run e2e test on k8s ?
I found this docker file but when I build it it fails with errors
https://aspenmesh.io/2018/01/building-istio-with-minikube-in-a-container-and-jenkins/
e - –no-install-recommends error
any idea ?
Currently there's no official way to run minikube from within a container. Here's a two months old quote from one of minikube's contributors:
It is on the roadmap. For now, it is VM based.
If you decide to go with using a VM image containing minikube, there are some guides how to do it out there. Here's one called "Using Minikube as part of your CI/CD flow
".
Alternatively, there's a project called MicroK8S backed by Canonical. In a Kubernetes Podcast ep. 39 from February, Dan Lorenc mentions this:
MicroK8s is really exciting. That's based on some new features of recent Ubuntu distributions to let you run a Kubernetes environment in an isolated fashion without using a virtual machine. So if you happen to be on one of those Ubuntu distributions and can take advantage of those features, then I would definitely recommend MicroK8s.
I don't think he's referring to running minikube in a container though, but I am not fully sure: I'd enter a Ubuntu container, try to install microk8s as a package, then see what happens.
That said, unless there's a compelling reason you want to run kubernetes from within a container and you are ready to spend the time going the possible rabbit hole – I think these days running minikube, k3s or microk8s from within a VM should be the safest bet if you want to get up and running with a CI/CD pipeline relatively quickly.
As to the problem you encountered when building image from this particular Dockerfile...
I found this docker file but when I build it it fails with errors
https://aspenmesh.io/2018/01/building-istio-with-minikube-in-a-container-and-jenkins/
e - –no-install-recommends error
any idea ?
notice that:
--no-install-recommends install
and
–no-install-recommends install
are two completely different strings. So that the error you get:
E: Invalid operation –no-install-recommends
is the result you've copied content of your Dockerfile from here and you should have rather copied it from github (you can even click raw button there to be 100% sure you copy totally plain text without any additional formatting, changed encoding etc.)

Jenkins Docker throwing exception and starting offline

I'm trying to get Jenkins up and running in Docker. I'm using the official repo and pulling the latest tag.
docker run -u 498 --name awsjenkins -p 8080:8080 -p 50000:50000 -v /mnt/jenkins:/var/jenkins_home jenkins
It starts okay, but it's throwing an error:
Apr 26, 2017 9:14:27 PM hudson.model.UpdateCenter updateDefaultSite
WARNING: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail.
java.io.IOException: Server returned HTTP response code: 503 for URL: http://updates.jenkins-ci.org/update-center.json?id=default&version=2.46.2
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at hudson.model.DownloadService.loadJSON(DownloadService.java:172)
at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:190)
at hudson.model.UpdateCenter.updateDefaultSite(UpdateCenter.java:2197)
at jenkins.install.SetupWizard.init(SetupWizard.java:174)
at jenkins.install.InstallState$3.initializeState(InstallState.java:105)
at jenkins.model.Jenkins.setInstallState(Jenkins.java:1061)
at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:96)
at jenkins.model.Jenkins.<init>(Jenkins.java:951)
at hudson.model.Hudson.<init>(Hudson.java:86)
at hudson.model.Hudson.<init>(Hudson.java:82)
at hudson.WebAppMain$3.run(WebAppMain.java:231)
A curl -L to that URL from the host machine returns a 301, so I don't think it's a firewall issue...
I am running this on Amazon, but I don't think that would cause any issues. I even opened up the security groups completely just for kicks, but I'm still getting this error. Also, I can access Jenkins. But when I do, it tells me that Jenkins is running offline.
Any thoughts on this?
Well, hopefully this helps someone else out... Thanks to Andy's comment, I was able to figure it out.
There's a few things going on here.
The official Dockerfile defaults to using 1000 for both the uid and gid. But really, 1000 is typically occupied by a candidate in the host OS. Personally, I think it should be changed to something a bit more obscure. Just my $.02...
When overriding the uid, it doesn't actually create the group. In Jenkins official documentation on Docker Hub, it says:
Ensure that /your/home is accessible by the jenkins user in container (jenkins user - uid 1000) or use -u some_other_user parameter with docker run.
The fix is pretty simple - pull the Dockerfile, modify it to work with your local user and uid/gid (there are several ways to do this), and build/run it.

Repair/Uninstall Mesos after cleanup

The mesos server ran out of disk space and so we were doing a cleanup by removing some of the old docker containers. But now the marathon won't start and digging deeper shows nor does zookeeper. The docker log says that it cannot load some containers.
But what we noticed was that zookeeper get started then stops. So we had at look at the zookeeper folder and the the conf was missing. This was also removed on the other master server as well which we had not touched. I presume this is to do with the link between the masters. Now the slave has this conf folder but it has the default folder and files and I noticed that this is a symlink that points to the /etc/alternatives/zookeeper-conf folder.
Running the dockerfile to recreate the missing cointainer says:
Error response from daemon: Cannot start container d13b8aa28d383a3ca54b39ce74f5a81d80030a2ad0dde52966293ced9ef26663: [8] System error: exec: "mesos-master": executable file not found in $PATH
It doesn't recognise the Restart command either.
Is there a quick way to repair this to get it working as it used to? I am using Mesos 0.23 on Ubuntu 14.04
How do I uninstall Mesos?
Any help is appreciated as I am fairly new to this and so only have a basic understanding of how all this works.
re "how to uninstall Mesos", my way is
configure --prefix="your_install_path"
make
make uninstall

Resources