Skip to content

Instantly share code, notes, and snippets.

@BruceZu
Created December 28, 2016 19:44
Show Gist options
  • Select an option

  • Save BruceZu/71a80acd2b416c20030e6ef247148d7e to your computer and use it in GitHub Desktop.

Select an option

Save BruceZu/71a80acd2b416c20030e6ef247148d7e to your computer and use it in GitHub Desktop.
bugzilla
bugzilla
select image
how to deploy the image
how to vaidate it after deployment
@BruceZu
Copy link
Author

BruceZu commented Dec 28, 2016

1 Select image:
reference the discuss
(if need try dev version later need translate the command of docker-compose to kubectl)
klawren/docker-bugzilla image
version: default is latest
This image has a TODO

- Enable SSL support.
- Enable memcached

2 How to deploy on docker image on k8s reference
need resolve:
1 what is the equipment option in k8s command kubectl run or kubectl create with docker run command the option --privileged
or how to carryout this function in k8s as that in docker.
ways:
issues 391 and 6530
k8s document
also find some case after search from github see link
case1 case2
? cannot it be specified on deployment. only limited to pod?
? is this must option?
2 ports : which one? 2 or 3
in docker it is
<host port >: <container port>
see link

with a yaml file
kubectl create -f bugzilla.yaml

[root@k8s-09 ~]# cat bugzilla.yaml
apiVersion: v1
kind: Pod
metadata:
  name: bugzilla
  labels:
    name: bugzilla
spec:
  containers:
  - name: bugzilla
    image: dklawren/docker-bugzilla
    ports:
    - containerPort: 80
    - containerPort: 22
    - containerPort: 5900
    securityContext:
      privileged: true

# kubectl expose pod bugzilla --type=NodePort

check svc port

ports:
  - name: port-1
    nodePort: 30399
    port: 80
    protocol: TCP
    targetPort: 80
  - name: port-2
    nodePort: 30899
    port: 22
    protocol: TCP
    targetPort: 22
  - name: port-3
    nodePort: 31196
    port: 5900
    protocol: TCP
    targetPort: 5900

3 validate
see logs

# kubectl logs bugzilla

2016-12-28 19:34:55,892 CRIT Supervisor running as root (no user in config file)
2016-12-28 19:34:55,895 INFO supervisord started with pid 1
2016-12-28 19:34:56,898 INFO spawned: 'postfix' with pid 30
2016-12-28 19:34:56,901 INFO spawned: 'httpd' with pid 31
2016-12-28 19:34:56,902 INFO spawnerr: can't find command '/usr/sbin/sshd'
2016-12-28 19:34:56,904 INFO spawned: 'memcached' with pid 32
2016-12-28 19:34:56,907 INFO spawned: 'mysqld' with pid 33
2016-12-28 19:34:56,983 DEBG fd 14 closed, stopped monitoring <POutputDispatcher at 32727696 for <Subprocess at 32676536 with name httpd in state STARTING> (stderr)>
2016-12-28 19:34:56,984 INFO success: postfix entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2016-12-28 19:34:57,253 DEBG 'mysqld' stdout output:
161228 19:34:57 mysqld_safe Logging to '/var/lib/mysql/mysql-error.log'.
2016-12-28 19:34:57,282 DEBG 'mysqld' stdout output:
161228 19:34:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-12-28 19:34:57,301 DEBG fd 6 closed, stopped monitoring <POutputDispatcher at 32677256 for <Subprocess at 32677040 with name postfix in state RUNNING> (stdout)>
2016-12-28 19:34:57,302 DEBG fd 9 closed, stopped monitoring <POutputDispatcher at 32677616 for <Subprocess at 32677040 with name postfix in state RUNNING> (stderr)>
2016-12-28 19:34:57,302 INFO exited: postfix (exit status 0; expected)
2016-12-28 19:34:57,302 DEBG received SIGCLD indicating a child quit
2016-12-28 19:34:58,302 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-28 19:34:58,303 INFO spawnerr: can't find command '/usr/sbin/sshd'
2016-12-28 19:34:58,303 INFO success: memcached entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-28 19:34:58,303 INFO success: mysqld entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-12-28 19:35:00,307 INFO spawnerr: can't find command '/usr/sbin/sshd'
2016-12-28 19:35:03,311 INFO spawnerr: can't find command '/usr/sbin/sshd'
2016-12-28 19:35:03,312 INFO gave up: sshd entered FATAL state, too many start retries too quickly
[root@k8s-09 ~]#

login the container to
[root@bugzilla /]# curl http://localhost/bugzilla/

http://10.145.101.61:30399/bugzilla/ the home page works
the home page works and I can login with username is [email protected] and the password is password.

Seems the sshd can not work.

I login the container and test
[root@bugzilla /]# ssh bugzilla@localhost -p 22
ssh: connect to host localhost port 22: Connection refused

later I find the

TODO
Enable SSL support.

kube-dns issue related error

Bugzilla can not update

The remote file http://updates.bugzilla.org/bugzilla-update.xml cannot be downloaded (reason: 500 Can't connect to updates.bugzilla.org:80).

Try to install SSL ( see link ) failed with

Looking up www.cpan.org
Unable to locate remote host www.cpan.org.
Alert!: Unable to connect to remote host.
[root@bugzilla bugzilla]# ping www.cpan.org
ping: unknown host www.cpan.org

I get in the container and from the dockerfile I know it is CentOS 7

search default.svc.cluster.local svc.cluster.local cluster.local huaweilab.com
nameserver 10.96.0.10
options ndots:5

Add a DNS server

[root@bugzilla /]# cat /etc/resolv.conf
search default.svc.cluster.local svc.cluster.local cluster.local huaweilab.com
nameserver 10.96.0.10
nameserver 8.8.8.8
options ndots:5
[root@bugzilla /]

Retry try to install SSL. Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment