Skip to content

Instantly share code, notes, and snippets.

View voor's full-sized avatar
🐢
it's pronounced turtle cuddle

Robert Van Voorhees voor

🐢
it's pronounced turtle cuddle
View GitHub Profile
@voor
voor / gist:3f7d07078ac975db808300dc44f9c5ab
Created December 15, 2023 15:13
#Take a Certificate issued by cert-manager and turn it into a full chain, this is often times necessary if your certificate was signed by an Intermediary CA that is not trusted by all of your systems (i.e., you need to add in the Intermediary signed by the Root CA into the serving application)
---
apiVersion: v1
stringData:
ca.pem: |
-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
#! variables that need to be externally configurable
#! are specified in a data values schema file
#! This file is just here to show how the values are merged together.
#@ load("@ytt:data", "data")
#@ load("@ytt:yaml", "yaml")
tap_values: #@ yaml.encode(data.values)
@voor
voor / package-format.yaml
Last active January 25, 2023 21:23
Simple downward to get a package version for Carvel kapp-controller
---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
name: simple-app
namespace: common-install
spec:
serviceAccountName: common-sa
packageRef:
refName: simple.app.example.com
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
---
apiVersion: sso.apps.tanzu.vmware.com/v1alpha1
kind: ClientRegistration
metadata:
name: boats-appsso
namespace: boats
spec:
#@ load("@ytt:data", "data")
#@ load("@ytt:yaml", "yaml")
#@ load("@ytt:overlay", "overlay")
#@ def supervisor_svc_external_dns():
#@ return "kubectl.phantom.{}".format(data.values.cluster_domain)
#@ end
#@ def management_overlay():
@voor
voor / structstuff.yaml
Created May 21, 2022 11:14
Some hackery to make it easier to define things you want to iterate over.
#@ load("@ytt:struct", "struct")
#@ load("@ytt:yaml", "yaml")
#@ def stuff():
crd:
- group: cert-manager.io
kind: ClusterIssuer
version: v1
- group: secretgen.carvel.dev
@voor
voor / build.sh
Last active June 16, 2022 15:05
Build script for handling imgpkg with helm, ytt, and even Package Repositories.
#!/usr/bin/env bash
set -eu -o pipefail
USAGE="Usage: $0 PACKAGE ACTION REPO # ACTION should be test or deploy"
if [ "$#" == "0" ]; then
echo "$USAGE"
exit 1
fi
#@ load("@ytt:data", "data")
apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
name: #@ "flux-source-controller.create.army.mil.{}".format(data.values.bundle.tag)
namespace: flux-source-controller
spec:
refName: flux-source-controller.create.army.mil
#@ tag = "{}".format(data.values.bundle.tag)
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.subset({"kind": "Deployment"}), expects="1+"
---
spec:
template:
spec:
containers:
#@overlay/match by=overlay.subset({"name": "manager"}), expects="1+"
@voor
voor / original.yaml
Created October 21, 2021 01:03
Overlaying to a Package
apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
name: scp-toolkit.tanzu.vmware.com.0.3.0
namespace: scp-toolkit
spec:
refName: scp-toolkit.tanzu.vmware.com
version: 0.3.0
releaseNotes: |
* Updated support for authentication to private registries to use new method introduced by kapp-controller v0.24.0 and secretgen-controller v0.5.0, see [Authenticating to Private Registries](https://carvel.dev/kapp-controller/docs/latest/private-registry-auth/).