Member-only story

Manually Inject LinkerD into K8s Deployment Specification Files

Kubernetes | Service Mesh | LinkerD | ArgoCD Sync

โš— Kevin Summersill ๐Ÿ”‹
2 min readNov 23, 2020
Photo by Ricardo Gomez Angel on Unsplash

In this article, we will be injecting deployment specifications with LinkerD annotations. This is because we are utilizing ArgoCD for our GitOps approach and the LinkerD Cli does not inject and deploying into our Git repository. The sync process in ArgoCD shows โ€œout of syncโ€ since the injection does not go through the repo. So let's inject via the YAML file within our repo.

Create a deployment.yml file. If you already have one you can move on to the next step. Apply the deployment.yml file. I will utilize the Kubernetes.io side deployment YAML with the Nginx image.

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80

To inject annotations to the deployment we will need to modify the template metadata. The template metadata is what is injected into the pods for the deployment. Change the deployment.yml to have the following:

apiVersion: apps/v1
kind: Deployment
metadataโ€ฆ

--

--

โš— Kevin Summersill ๐Ÿ”‹
โš— Kevin Summersill ๐Ÿ”‹

Written by โš— Kevin Summersill ๐Ÿ”‹

Enterprise Solution Architect | Certified K8s Administrator/Developer โš“ | SAFe SPC | Cert Terraform | AWS Solutions Architect | Dev*Ops/GitOps Engineer ๐Ÿ”ฅ

No responses yet