If you are using a LDAP/AD authentication backend with Rancher whose certificate is signed by a different CA then that of the MySQL server, then this guide will not work for you!
- The certificate or CA cert of the MySQL server (PEM encoded)
#cloud-config | |
hostname: rancher-os-test-1 | |
ssh_authorized_keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6O3b1N5/6NHZ3ekT4QhM4H+Em//3/VwoSZYZN2i6JNiTMmL17HYl4JMi7+Wl40/XEyn2ReMo0/NThDaUse4Js5hf8MsqL66ckTzgdmMInfs+85t0K+AKcGhuOvbrOHiDlcLEdU2sGNOn1VdNJXQWMQeo4WWkTEl+kHdmuWzkOmDlWEp7rxIP4LKGUdQTPNH3sasZSGg8SmkkT916cYN8bc5eNbcMh9TcAVmL34nV1Q4Foda0WXcSOHQvw0NPE95FG9I0GQordCmBqlL733hVQDcMchUo5PkzTvHkx7FfgW/uw17IRK+8E1YLRarhnoLvh/7yWr6fNVttZfPf8OWab jbruder@JBRUDER-M-9AS6 | |
rancher: | |
services: | |
ros-install: | |
image: ubuntu | |
stdin_open: true | |
tty: true |
#cloud-config | |
rancher: | |
services: | |
rancher-server: | |
image: rancher/enterprise:v1.5.4 | |
restart: unless-stopped | |
command: | |
- --db-host | |
- REPLACE_WITH_DB_HOST | |
- --db-user |
Generate CPU load to trigger alarms: | |
> $ dd if=/dev/urandom bs=1M count=200096 | gzip -9 |gzip -9 | gzip -9 >/dev/null |
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: hello-world | |
spec: | |
replicas: 3 | |
selector: | |
app: hello-world | |
template: | |
metadata: |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-world-service | |
spec: | |
#type: LoadBalancer | |
#type: NodePort | |
ports: | |
- port: 8090 | |
targetPort: 80 |
If you are using a LDAP/AD authentication backend with Rancher whose certificate is signed by a different CA then that of the MySQL server, then this guide will not work for you!
#!/bin/bash | |
KUBECONFIG=./kube_config_rancher-cluster.yml | |
kubectl --kubeconfig $KUBECONFIG exec -n cattle-system $(kubectl --kubeconfig $KUBECONFIG get pods -n cattle-system -o json | jq -r '.items[] | select(.spec.containers[].name=="cattle-server") | .metadata.name') -- loglevel --set debug | |
kubectl --kubeconfig $KUBECONFIG logs -n cattle-system -f $(kubectl --kubeconfig $KUBECONFIG get pods -n cattle-system -o json | jq -r '.items[] | select(.spec.containers[].name="cattle-server") | .metadata.name') |
#cloud-config | |
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease). | |
hostname: myhost | |
# Authorize SSH keys for the `rancher` sudoer user | |
ssh_authorized_keys: | |
- ssh-rsa AAA...ZZZ example1@rancher | |
#!/bin/sh | |
# | |
# script for filesystem usage analysis | |
# | |
echo FS:; read FS; | |
MNT=`cat /proc/mounts | grep -vE -w "nfs|auto.direct" | grep $FS[[:space:]] | wc -l`; | |
if [[ $MNT == 1 ]]; then | |
echo; |
#cloud-config | |
ssh_authorized_keys: | |
# Additional SSH key authorized for the 'rancher' user account. | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA61LSHA7iU+82Z2qypYLx2gB9uHydUOoDON30ceAKl5dSgzShtF5XS5sqABYBMowDcvdkNyUDdt1Druv82iu/scATLFmxTQ8R2XIL33dMO6IpBg0d3WQcU5Xqeor9s5LTpln7F0V+9vaYG/nXqQtnz4PEnZGA+f9ddHuvcDajqKLNTDyriL87E6HAfjNU+1ShI2Qv8Zqhq8rYW0zkn2C+4vVKpgzq8B91R7hSXZwUTU9+bIq3uqTfe/t9/5hFNZEUo/ezV25DFvWDmvKcXt1QRoLxL/NI7h00fEJY7QVh2eevtiA9BdthI2LHx2tm2LoMYHQVZUVljm033xh2UIS | |
rancher: | |
# Customize sysctl parameters. | |
sysctl: | |
vm.max_map_count: 262144 |