Sunday, December 8, 2019

2019-12-08 2 k3s

Play with k3s

OK, why do I keep getting sucked into rancher? Oy… Well, I really do like it, it makes things so theoretically easy. Maybe if I just get good at it it will become second nature. Anyway, here is their light weight kubernetes implementation. Let’s see what it does.
I guess i should run it on the rancher node.
Nope, not a good idea, rancher is dead. And of course it was made before I figured out how to keep docker from dying on reboot. Grr… fix that.
OK, I’ve lost rancher, oh well. This time I want to have rancher signed by the ipa cert that I’m using everywhere. How do I do this?

sudo -i
hostnamectl set-hostname $(hostname -f)
kinit denebeim
ipa service-add HTTP/$(hostname -f)
ipa service-add-host --hosts=$(hostname -f) HTTP/$(hostname -f)
mkdir -p /etc/pki/tls/{certs,private}
ipa-getcert request -r -w \
-f "/etc/pki/tls/certs/$(hostname -f)".crt \
-k "/etc/pki/tls/private/$(hostname -f)".key \
-N CN="$(hostname -f)" -D "$(hostname -f)" -K HTTP/"$(hostname -f)"

I cannot believe how many hours that took. the hostnamectl did not stick or I forgot to do it when I did the ipa-client-install. Normally that doesn’t do anything, however it screwed me over with the above. So kids, make sure the default returned from hostname is the fqdn, it matters.
Oh, this was the clue that showed me what to fix kinit -kt /etc/krb5.keytab

So, we finally start rancher with this:

docker run -d --restart=unless-stopped \
	-p 80:80 -p 443:443 \
	-v /etc/pki/tls/certs/$(hostname -f).crt:/etc/rancher/ssl/cert.pem \
	-v /etc/pki/tls/private/$(hostname -f).key:/etc/rancher/ssl/key.pem \
	rancher/rancher:latest \
  --no-cacerts

I want to use freeipa for logging in. I’ve been poking around, I got it working last time, but of course I didn’t write it down… huh, maybe I did. nope. this time, I’m going to write it down.

ldapmodify -x -D 'cn=Directory Manager' -y password <<EOF
dn: uid=ldap,cn=sysaccounts,cn=etc,dc=deepthot,dc=aa
changetype: add
objectclass: account
objectclass: simplesecurityobject
uid: ldap
userPassword: $PASSWORD
passwordExpirationTime: 20380119031407Z
nsIdleTimeout: 0

EOF

$PASSWORD doesn’t do what it should do, I thought <<EOF expanded, but it doesn’t seem to be working for me today.

This is something that works: ldapdelete -D 'uid=admin,cn=users,cn=accounts,dc=deepthot,dc=aa' -y password 'uid=ldap,cn=sysaccounts,cn=etc,dc=deepthot,dc=aa' that admin account is the root account.

This is what I set up in rancher:

Users General Group
Server: ipa.deepthot.aa:636 Object Class: person Search Base: dc=deepthot,dc=aa
TLS: Yes Login Attribute: uid Object Class: groupofnames
Server Connection Timeout: 5000 Username Attribute: displayName Name Attribute: cn
Search Attribute: uid|sn|display Search Attribute: cn
Status Attribute:
Disabled BitMask: 0

Hah, so I didn’t even get back to k3s at all, silly girl. I will write these up as blog entries though

No comments:

Post a Comment

How Simple Does It Have to Be Before It’s Mine?

 Hi, Joy here, I'm tired.  I'm too tired to polish this.  However bare with me, the text below is *trying* to be me.  It's not l...