The task I carreid out ↓
Hyper-V, Ubuntu 20.04, k8s 1.23.6, Docker 20.10.14 Installation
Set up a K8s Cluster(Control Plane 1EA, Worker node 1EA)
kubectl apply nginx deployment, nginx service (for test gitlab on k8s)
nginx-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: my-nginx
labels:
run: my-nginx
spec:
type: NodePort
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
app: nginx
nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
- The nginx worked well. But gitlab has a problem.
gitlab-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitlab-deployment
labels:
app: gitlab
spec:
replicas: 1
selector:
matchLabels:
app: gitlab
template:
metadata:
labels:
app: gitlab
spec:
containers:
- name: gitlab
image: gitlab/gitlab-ee:latest
ports:
- containerPort: 9088
- containerPort: 10022
gitlab-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: gitlab-svc
labels:
app: gitlab
spec:
type: NodePort
ports:
- port: 9088
targetPort: 9088
name: http
- port : 10022
targetPort: 10022
name: ssh
selector:
app: gitlab
modify gitlab.rb file (etc/gitlab/gitlab.rb in k8s pod) . . . external_url 'http://gitlab.example.com:9088 . . gitlab_rails['gitlab_shell_ssh_port'] = 10022" . . .
Input url workernodeIP:NodePort(gitlabsvc) but can't access.. The port of the container in the pod does not open either.
I don't use helm, EKS, GKS, etc. After installing Kubernetes on my hyper-v virtual machine, I want to run gitlab on it. (Like running a gitlab image with a docker) I only want to run gitlab locally using Kubernetes and gitlab images......