Skip to content

Instantly share code, notes, and snippets.

View michelleN's full-sized avatar

Michelle Dhanani michelleN

View GitHub Profile
@michelleN
michelleN / gist:d8c5e45c0beb27e7e1fe
Last active December 23, 2015 21:47
deis workflow testing and test setup and comments
Following directions at https://github.com/deis/workflow/blob/acd46da6e7785ea23050e8dd01eaee30c63dd1bc/docs/src/installing-deis/installing-the-deis-platform.md
1. Get a Kubernetes cluster (Note: kubernetes vagrant guide is not perfect.)
2. Use helm to install deis using the deis/charts
3. Grab the latest deis client BUTTT remove or replace the old one if you haven't already.
4. Set DEIS_WORKFLOW_SERVICE_HOST env variable to the router endpoint.... ex. deis.example.com (example.com comes from the deis-router manifest in the deis/charts.
If you're using vagrant, need to add a line to your /etc/hosts file that looks like this: [ip] example.com deis.example.com. The ip comes from the deis-router pod description, specifically the Node IP line.
5. run `make test-integration`
If you get weird failures like: `./apps_test.go:38: undefined: SatisfyAll` then go a go get -u on gomega. This will fetch and update gomega... so run `go get -u github.com/onsi/gomega`
@michelleN
michelleN / dm-testing.md
Last active February 1, 2016 16:42
DM Testing Workflow

Workflow for testing image changes:

  1. Make local changes

  2. Run make info to see what PROJECT you’re pointing to (and other env variables). Set as needed.

  3. To use gcr, run gcloud auth login to generate access token which you can see at gcloud auth print-access-token

  4. Run docker login -e michelle@deis.com -u _token -p “$(gcloud auth print-access-token)” https://gcr.io (This will let you push images to gcr.)

@michelleN
michelleN / kubernetes-charts-cache.yaml
Last active May 6, 2016 20:15
example of cache file
This is what a cache file will look like:
Under the name-version key, we'll specificy a url to actually download the chart,
a created timestamp, a removed boolean field, and a dump of the Chart.yaml file which includes the keywords.
You can use the keywords and the name fields for the search command.
Cache files are currently located under HELM_HOME/cache and named in the repoName-cache.yaml format.
FYI: The directory structure under helm home will change so that the directory is safe for people who are migrating
from the old helm tool. The new structure will look like this HELM_HOME/repository/cache/ (I'm moving all of
the stuff in HELM_HOME currently under a directory called `repository`.)
----------------------------------
helm [helm-update*]$ brew
Example usage:
brew (info|home|options) [FORMULA...]
brew install FORMULA...
brew uninstall FORMULA...
brew search [TEXT|/PATTERN/]
brew list [FORMULA...]
brew update
brew upgrade [FORMULA...]
@michelleN
michelleN / draft-dev.md
Last active August 15, 2017 16:41
developing against draft

When dev'ing local with minkube: In one terminal window:

$ helm init
$ tiller_deploy=$(kubectl get po -n kube-system -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' | grep "tiller")
$ kubectl port-forward $tiller_deploy 44134:44134 -n kube-system

In another terminal window:

@michelleN
michelleN / remote-dev.txt
Last active April 4, 2018 21:55
thoughts on remote work
Thoughts on working from home vs office and what to look for in a new job and younger in the industry for Matt Farina's friend
I've had experience working in 4 different offices as an engineer and I've also had a year and a half of experience working as a remove developer in a different state than everyone on my team. Currently, my whole team is remote.
On being at an office:
- At most of my jobs, I've had planned lunches with technical presentations. Because I was at a point where I took every second to learn as much as I could (especially starting out), I really enjoyed those learning opportunities.
- It was also nice to be able to grab coffee with co-workers or have impromptu meetings with folks higher up in the ladder than me or folks in a different part of the business. I also liked being able to build relationships in person. This will always be important in your career but it was especially fruitful for me early on. I learned a lot and people gave me particular opportunities because they knew my str
Ryan is someone at a company who is using Kubernetes and Azure. Have some legacy stuff but transitioning most services on to AKS.
Questions he asked:
- Should I check in draft artifacts (charts, Dockerfile, draft.toml)?
Personally, I check in the Dockerfile, draft.toml, and the charts so that developers have access to it if they need it. We can in the future make the location of the charts within the git repository configurable so that if we want to hide it somewhere else we should be able to.
- Do I use draft in my CI/CD pipeline?
-- No. You should only be re-building the docker image and pushing it the container registry and then using that image with a production chart for your app which lives in a chart repository for your org.
-- You _can_ use it in your CI for testing though. That makes sense.
- What kind of patterns do I follow to be able to use generic charts? Chart for every type of app? Generic chart for all web apps? How do I use values files?
https://github.com/open-policy-agent/gatekeeper/blob/master/chart/gatekeeper-operator/generate_helm_template.sh
@michelleN
michelleN / hung-termination.md
Created April 24, 2020 20:44
namespace stuck in termination stage

Sometimes caused by apiservices running that no longer have backends. Confirm via kubectl:

$ k api-resources
error: unable to retrieve the complete list of server APIs: tap.linkerd.io/v1alpha1: the server is currently unable to handle the request

Solution is to delete relevant apiservice that no longer has backends: helm/helm#6361 (comment)

@michelleN
michelleN / printstruct
Created August 24, 2021 14:16
print go struct
func prettyPrint(i interface{}) string {
s, _ := json.MarshalIndent(i, "", "\t")
return string(s)
}
https://stackoverflow.com/questions/24512112/how-to-print-struct-variables-in-console