Skip to content

Instantly share code, notes, and snippets.

View stefanprodan's full-sized avatar
🎯
Hacking on @fluxcd and timoni.sh

Stefan Prodan stefanprodan

🎯
Hacking on @fluxcd and timoni.sh
View GitHub Profile
apiVersion: v1
items:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
creationTimestamp: "2023-04-13T13:12:31Z"
finalizers:
- finalizers.fluxcd.io
generation: 1
labels:
---
apiVersion: v1
kind: Service
metadata:
name: weave-gitops-external
namespace: flux-system
spec:
ports:
- name: http-web
port: 80

Can I automate container image updates in my fleet-repo?

Assuming an app repository with ./deploy/prod/kustomization.yaml:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - deployment.yaml
  - service.yaml

SMI Release

A release represents a Git tag in semver format, cut from the main branch of an SMI rrepository. Each API spec is adresable when refereced outside the SMI repo in the format: <smi-spec-repo>/blob/<semver>/apis/<kind>/<version>/<kind>.md e.g. https://github.com/servicemeshinterface/smi-spec/blob/v0.5.0/apis/traffic-split/v1alpha3/traffic-split.md

Changes to the spec are made by opening pull requests against the draft branch. Before a release, the desired changes, for the next version, are merged from draft into main.

SMI spec release steps:

  • Open a pull request from draft into main

Install the CLI:

brew tap fluxcd/tap
brew install gotk

# enable completion
. <(gotk completion zsh)

Bootstrap

Init:

gotk bootstrap github \
  --owner=gitopsrun \
  --repository=fleet-infra \
  --branch=main \
  --team=dev \

SOPS decryption for Kustomizations

Specification:

apiVersion: kustomize.toolkit.fluxcd.io/v1alpha1
kind: Kustomization
metadata:
  name: backend
spec:
apiVersion: wkp.weave.works/v1alpha1
kind: ProfileSync
metadata:
name: envoy-ingress
spec:
constraints:
kubernetes: ">=1.16.0"
wkp: ">=2.0.0"
dependsOn:
- monitoring # <- WKP profile that must be installed before envoy-ingress

GKE Istio add-on issues

Cluster spec:

gcloud beta container --project "dx-stefan" clusters create "istio-eu" --zone "europe-west3-a" \
--cluster-version "1.11.6-gke.6" --machine-type "n1-standard-2" --image-type "COS" \
--no-enable-basic-auth --disk-type "pd-standard" --disk-size "50" \
--num-nodes "1" --additional-zones "europe-west3-a","europe-west3-b" \
--no-enable-cloud-logging --enable-cloud-monitoring \
@stefanprodan
stefanprodan / certinfo.yaml
Last active October 1, 2018 06:33
OpenFaaS GKE
apiVersion: openfaas.com/v1alpha2
kind: Function
metadata:
name: certinfo
spec:
name: certinfo
image: stefanprodan/certinfo:latest
labels:
com.openfaas.scale.min: "2"
com.openfaas.scale.max: "12"