- packer
- vagrant
- virtualbox
packer build k3os.jsonvagrant up
| # Links | |
| https://kubernetes.io/docs/tasks/tools/install-kubectl/ | |
| https://k3d.io | |
| #!/bin/sh | |
| k3d_version=v3.0.0 | |
| cluster_name=theranchcast | |
| agent_count=3 | |
| cluster_api_port=6550 |
sbin/generate-instance-list.sh -n mak3r-rancher-training-k3s > instance-ids.jsonsbin/ssh-connect.sh -i 0 -k ~/.ssh/mak3r-private.pem -s| # -*- coding: utf-8 -*- | |
| # | |
| # Copyright ©2018-2019 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0. | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| DOMAIN=$(echo "https://[[HOST_SUBDOMAIN]]-443-[[KATACODA_HOST]].environments.katacoda.com" | sed -e 's/https:\/\///g') | |
| currentVersion="v2.2.0" | |
| # Download | |
| curl -O -J -L "https://releases.rancher.com/cli2/$currentVersion/rancher-linux-amd64-$currentVersion.tar.gz" | |
| # Untar | |
| tar -xvzf ./"rancher-linux-amd64-$currentVersion.tar.gz" | |
| # Copy |
| #!/bin/sh | |
| # Run this from withing the GKE Cloud Shell Logged in as the GKE Cluster Creator | |
| # Service Account | |
| serviceaccount="admin-user" | |
| kubectl -n kube-system create serviceaccount $serviceaccount | |
| # Cluster Role Binding |
| #!/bin/bash | |
| # Usage: ./get_kubeconfig_custom_cluster_rancher2.sh cluster_name | |
| # Needs to be run on the server running `rancher/rancher` container | |
| # Check if jq exists | |
| command -v jq >/dev/null 2>&1 || { echo "jq is not installed. Exiting." >&2; exit 1; } | |
| # Check if clustername is given | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 [clustername]" |
| #!/bin/bash | |
| echo "This will generate a new kube config for accessing your RKE-created kubernetes cluster. This script MUST be run on a Kubernetes node." | |
| echo "Please enter the IP of one of your control plane hosts, followed by [ENTER]:" | |
| read cphost | |
| openssl genrsa -out kube-admin.key 2048 | |
| openssl req -new -sha256 -key kube-admin.key -subj "/O=system:masters/CN=kube-admin" -out kube-admin.csr | |
| sudo openssl x509 -req -in kube-admin.csr -CA /etc/kubernetes/ssl/kube-ca.pem -CAcreateserial -CAkey /etc/kubernetes/ssl/kube-ca-key.pem -out kube-admin.crt -days 365 -sha256 | |
| sudo rm -f /etc/kubernetes/ssl/kube-ca.srl |
Generate the kubeconfig file for your cluster using the Kubeconfig File button in the Cluster view of your cluster.
Save the generated file as $HOME/.kube/config and run kubectl get nodes to verify it works.