This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
module FastAttributes | |
TRUE_VALUES_ARRAY = [true, 1, '1', 't', 'T', 'true', 'TRUE', 'on', 'ON'].freeze | |
FALSE_VALUES_ARRAY = [false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF'].freeze | |
TRUE_VALUES = {true => nil, 1 => nil, '1' => nil, 't' => nil, 'T' => nil, 'true' => nil, 'TRUE' => nil, 'on' => nil, 'ON' => nil}.freeze | |
FALSE_VALUES = {false => nil, 0 => nil, '0' => nil, 'f' => nil, 'F' => nil, 'false' => nil, 'FALSE' => nil, 'off' => nil, 'OFF' => nil}.freeze | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "server_ip" { | |
default = "10.0.0.2" | |
} | |
variable "wlan_ssid" { | |
default = "free wifi hotspot" | |
} | |
variable "wlan_psk" { | |
default = "changeme" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "server_ip" { | |
default = "10.0.0.2" | |
} | |
variable "server_hostname" { | |
default = "node01" | |
} | |
# Ubuntu reference for hostnamectl: http://manpages.ubuntu.com/manpages/trusty/man1/hostnamectl.1.html | |
resource "null_resource" "set-hostname" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "server_ip" { | |
default = "10.0.0.2" | |
} | |
# Terraform documentation | |
# * Provisioner null_resource: https://www.terraform.io/docs/provisioners/null_resource.html | |
# * Provisioner Connections: https://www.terraform.io/docs/provisioners/null_resource.html | |
# Ubuntu issues: | |
# https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1652270 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1alpha1 | |
metadata: | |
name: miry-admin-binding | |
subjects: | |
- kind: User | |
name: [email protected] | |
roleRef: | |
kind: ClusterRole | |
name: cluster-admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: ClusterRole | |
apiVersion: rbac.authorization.k8s.io/v1alpha1 | |
metadata: | |
name: admin-role | |
rules: | |
- apiGroups: ["*"] | |
resources: ["*"] | |
verbs: ["*"] | |
--- | |
kind: ClusterRoleBinding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <<EOF > /etc/systemd/system/kubelet.service.d/10-kubeadm.conf | |
[Service] | |
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true" | |
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true" | |
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin" | |
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local" | |
Environment="KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt" | |
Environment="KUBELET_EXTRA_ARGS=--cgroup-driver=systemd" | |
ExecStart= | |
ExecStart=/usr/bin/kubelet \$KUBELET_KUBECONFIG_ARGS \$KUBELET_SYSTEM_PODS_ARGS \$KUBELET_NETWORK_ARGS \$KUBELET_DNS_ARGS \$KUBELET_AUTHZ_ARGS \$KUBELET_EXTRA_ARGS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
kind: ClusterRole | |
apiVersion: rbac.authorization.k8s.io/v1alpha1 | |
metadata: | |
name: kube-system-admin | |
rules: | |
- apiGroups: ["*"] | |
resources: ["*"] | |
verbs: ["*"] | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'optparse' | |
require 'yaml' | |
require 'base64' | |
options = { | |
config_path: File.join(ENV['HOME'], '.kube', 'config'), | |
write_dir: File.join(ENV['HOME'], '.kube') | |
} | |
OptionParser.new do |opts| |