- Set environment variables
CLUSTER_NAME="rosa-hcp-rcs"
PREFIX_NAME="hcp-rcs"
REGION="us-east-1"
VERSION="4.14.9"
USER=rcarrata
--- | |
apiVersion: tekton.dev/v1beta1 | |
kind: Task | |
metadata: | |
name: buildah-userns | |
labels: | |
app.kubernetes.io/version: "0.1" | |
annotations: | |
tekton.dev/pipelines.minVersion: "0.12.1" | |
tekton.dev/tags: image-build |
ARG BASE_IMG=registry.access.redhat.com/ubi8/ubi | |
FROM $BASE_IMG AS buildah-runner | |
RUN useradd buildah; echo buildah:10000:5000 > /etc/subuid; echo buildah:10000:5000 > /etc/subgid; | |
# https://github.com/containers/buildah/blob/main/docs/tutorials/05-openshift-rootless-build.md | |
# https://github.com/containers/buildah/blob/master/contrib/buildahimage/stable/Dockerfile | |
# https://github.com/containers/buildah/issues/1011 | |
# https://github.com/containers/buildah/issues/3053 |
apiVersion: v1 | |
kind: List | |
items: | |
- apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: pr-cleanup | |
namespace: ghe | |
spec: | |
concurrencyPolicy: Replace |
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
networking: | |
apiServerAddress: "10.0.111.66" | |
apiServerPort: 8443 | |
kubeadmConfigPatchesJSON6902: | |
- group: kubeadm.k8s.io | |
version: v1beta2 | |
kind: ClusterConfiguration | |
patch: | |
#!/bin/bash | |
set -xe | |
curl -OL https://github.com/openshift/openshift-cns-testdrive/raw/ocp4-dev/support/machineset-cli | |
curl -OL https://raw.githubusercontent.com/openshift/openshift-cns-testdrive/ocp4-dev/support/machineset-generator.sh | |
chmod +x machineset-generator.sh | |
chmod +x machineset-cli | |
bash /home/lab-user/machineset-generator.sh 1 infra 0 | oc create -f - | |
export MACHINESET=$(oc get machineset -n openshift-machine-api -l machine.openshift.io/cluster-api-machine-role=infra -o jsonpath='{.items[0].metadata.name}') | |
oc patch machineset $MACHINESET -n openshift-machine-api --type='json' -p='[{"op": "add", "path": "/spec/template/spec/metadata/labels", "value":{"node-role.kubernetes.io/worker":"", "node-role.kubernetes.io/infra":""} }]' |
--- | |
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: etcd-backup | |
spec: | |
schedule: "0 0 * * *" | |
jobTemplate: | |
spec: | |
template: |
### Create file called machine-config-daemon-force in /run ### | |
ssh [email protected] sudo touch /run/machine-config-daemon-force | |
### Edit node annotations ### | |
oc edit node <node-name> | |
### Check Annotations, change like below sample ### | |
machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
machineconfiguration.openshift.io/reason: "" |
Example 1 | |
=============================== | |
Maps are a way to create variables that are lookup tables. An example will show this best. Let's extract our AMIs into a map and add support for the us-west-2 region as well: | |
variable "amis" { | |
type = "map" | |
default = { | |
"us-east-1" = "ami-b374d5a5" | |
"us-west-2" = "ami-4b32be2b" | |
} |
# The goal: create a list of maps of subnet mappings so we don't have to statically hard-code them in aws_lb | |
# https://www.terraform.io/docs/providers/aws/r/lb.html#subnet_mapping | |
locals { | |
# These represent dynamic data we fetch from somewhere, such as subnet IDs and EIPs from a VPC module | |
subnet_ids = ["subnet-1", "subnet-2", "subnet-3"] | |
eips = ["eip-1", "eip-2", "eip-3"] | |
} | |
# Here's the hack! The null_resource has a map called triggers that we can set to arbitrary values. | |
# We can also use count to create a list of null_resources. By accessing the triggers map inside of |