Skip to content

Commit 399652a

Browse files
authored
Merge pull request #943 from lsst-it/IT-6041_rke2_rancher.ls
ranchers standardize and migration of base instance.
2 parents 89d8870 + 04cffea commit 399652a

File tree

73 files changed

+331
-9743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+331
-9743
lines changed

rancher.ls/external-secrets/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

rancher.ls/external-secrets/external-secrets.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

rancher.ls/external-secrets/fetch-credentials.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

rancher.ls/onepassword/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

rancher.ls/onepassword/onepassword-connect.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

rancher.ls/rke/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

rancher.ls/rke/Makefile

Lines changed: 0 additions & 1 deletion
This file was deleted.

rancher.ls/rke/cluster.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

rke2/rancher.dev/cert-manager/cert-manager.crds.yaml

Lines changed: 0 additions & 4711 deletions
This file was deleted.

rke2/rancher.dev/cert-manager/cert-manager.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/cert-manager/cert-manager.sh

rke2/rancher.dev/cert-manager/clusterissuer-letsencrypt.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ metadata:
66
namespace: cert-manager
77
spec:
88
acme:
9-
server: https://acme-v02.api.letsencrypt.org/directory
10-
privateKeySecretRef:
11-
name: letsencrypt
129
email: rubinobs-it-las@lsst.org
10+
privateKeySecretRef:
11+
name: letsencrypt
12+
server: https://acme-v02.api.letsencrypt.org/directory
1313
solvers:
14-
- selector:
15-
dnsZones:
16-
- dev.lsst.org
17-
dns01:
14+
- dns01:
1815
route53:
19-
region: us-east-1
20-
hostedZoneID: ZQGNOYQYRNW0C
2116
accessKeyIDSecretRef:
22-
name: route53
2317
key: AWS_ACCESS_KEY_ID
24-
secretAccessKeySecretRef:
2518
name: route53
19+
hostedZoneID: ZQGNOYQYRNW0C
20+
region: us-east-1
21+
secretAccessKeySecretRef:
2622
key: AWS_SECRET_ACCESS_KEY
23+
name: route53
24+
selector:
25+
dnsZones:
26+
- dev.lsst.org

rke2/rancher.dev/external-secrets/deploy-external.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/external-secrets/deploy-external.sh

rke2/rancher.dev/ingress-nginx/ingress-nginx.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/ingress-nginx/ingress-nginx.sh

rke2/rancher.dev/metallb/metallb.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

rke2/rancher.dev/metallb/metallb.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/metallb/metallb.sh

rke2/rancher.dev/onepassword/fetch-credentials.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ set -e
55
if ! env | grep OP_SESSION_ > /dev/null 2>&1; then
66
eval "$(op signin)"
77
fi
8+
89
ONEPASS_CREDS="$(op read "op://1pass connect/connect.dev.lsst.org Credentials File/1password-credentials.json")"
910

11+
# Base64 encode and remove newlines (works on both macOS and Linux)
12+
ENCODED_CREDS=$(echo "${ONEPASS_CREDS}" | base64 | tr -d '\n')
13+
1014
cat > secret-op-credentials.yaml <<END
1115
---
1216
apiVersion: v1
@@ -17,5 +21,5 @@ metadata:
1721
type: Opaque
1822
# The credentials end up being double base64 encoded...
1923
stringData:
20-
1password-credentials.json: $(echo "${ONEPASS_CREDS}" | base64 -w 0)
24+
1password-credentials.json: ${ENCODED_CREDS}
2125
END
Lines changed: 1 addition & 0 deletions

rke2/rancher.dev/rancher-backup/rancher-backup.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/rancher-backup/rancher-backup.sh

rke2/rancher.dev/rancher/rancher.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

rke2/rancher.dev/rancher/rancher.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/rancher/rancher.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
secret-aws.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/cert-manager/cert-manager.sh
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
apiVersion: cert-manager.io/v1
3+
kind: ClusterIssuer
4+
metadata:
5+
name: letsencrypt
6+
namespace: cert-manager
7+
spec:
8+
acme:
9+
email: rubinobs-it-las@lsst.org
10+
privateKeySecretRef:
11+
name: letsencrypt
12+
server: https://acme-v02.api.letsencrypt.org/directory
13+
solvers:
14+
- dns01:
15+
route53:
16+
accessKeyIDSecretRef:
17+
key: AWS_ACCESS_KEY_ID
18+
name: route53
19+
hostedZoneID: ZPIEHXTK3ZPMR
20+
region: us-east-1
21+
secretAccessKeySecretRef:
22+
key: AWS_SECRET_ACCESS_KEY
23+
name: route53
24+
selector:
25+
dnsZones:
26+
- ls.lsst.org
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/cert-manager/fetch-credentials.sh
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# shellcheck shell=sh
2+
export ITEM_NAME="it-dns-ls (aws)"
Lines changed: 1 addition & 0 deletions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: external-secrets.io/v1beta1
3+
kind: ClusterSecretStore
4+
metadata:
5+
name: onepassword
6+
spec:
7+
provider:
8+
onepassword:
9+
auth:
10+
secretRef:
11+
connectTokenSecretRef:
12+
key: token
13+
name: onepassword-connect-token
14+
namespace: external-secrets
15+
connectHost: https://connect.ls.lsst.org
16+
vaults:
17+
k8s-common: 3
18+
k8s-ls: 2
19+
rancher.ls: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/external-secrets/deploy-external.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/external-secrets/external-secrets.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/external-secrets/fetch-credentials.sh
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
apiVersion: fleet.cattle.io/v1alpha1
3+
kind: GitRepo
4+
metadata:
5+
name: rancher
6+
namespace: fleet-local
7+
spec:
8+
repo: https://github.com/lsst-it/k8s-cookbook
9+
branch: master
10+
keepResources: true
11+
paths:
12+
- fleet/s/ls/c/rancher/*
13+
targets:
14+
- name: rancher
15+
clusterName: local
16+
correctDrift:
17+
enabled: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/ingress-nginx/ingress-nginx.sh
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
controller:
2+
kind: DaemonSet
3+
allowSnippetAnnotations: true
4+
ingressClass: nginx
5+
ingressClassByName: true
6+
ingressClassResource:
7+
name: nginx
8+
enabled: true
9+
controllerValue: k8s.io/ingress-nginx
10+
service:
11+
annotations:
12+
metallb.universe.tf/address-pool: ingress
13+
rbac:
14+
create: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: metallb.io/v1beta1
3+
kind: IPAddressPool
4+
metadata:
5+
name: ingress
6+
namespace: metallb-system
7+
spec:
8+
addresses:
9+
- 139.229.135.35/32
10+
autoAssign: false
11+
---
12+
apiVersion: metallb.io/v1beta1
13+
kind: L2Advertisement
14+
metadata:
15+
name: ingress
16+
namespace: metallb-system
17+
spec:
18+
ipAddressPools:
19+
- ingress

rke2/rancher.ls/metallb/metallb.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/metallb/metallb.sh

rke2/rancher.ls/onepassword/README.md

Lines changed: 1 addition & 0 deletions

rancher.ls/onepassword/fetch-credentials.sh renamed to rke2/rancher.ls/onepassword/fetch-credentials.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ set -e
55
if ! env | grep OP_SESSION_ > /dev/null 2>&1; then
66
eval "$(op signin)"
77
fi
8+
89
ONEPASS_CREDS="$(op read "op://1pass connect/connect.ls.lsst.org Credentials File/1password-credentials.json")"
910

11+
# Base64 encode and remove newlines (works on both macOS and Linux)
12+
ENCODED_CREDS=$(echo "${ONEPASS_CREDS}" | base64 | tr -d '\n')
13+
1014
cat > secret-op-credentials.yaml <<END
1115
---
1216
apiVersion: v1
@@ -17,5 +21,5 @@ metadata:
1721
type: Opaque
1822
# The credentials end up being double base64 encoded...
1923
stringData:
20-
1password-credentials.json: $(echo "${ONEPASS_CREDS}" | base64 -w 0)
24+
1password-credentials.json: ${ENCODED_CREDS}
2125
END
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../template/onepassword/onepassword-connect.sh
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -xe
3+
4+
helm upgrade --install onepassword-connect connect \
5+
--repo https://1password.github.io/connect-helm-charts \
6+
--version 1.17.0 \
7+
--namespace onepassword-connect --create-namespace \
8+
-f values.yaml \
9+
--timeout 60s --wait

0 commit comments

Comments
 (0)