Member-only story
Manually Inject LinkerD into K8s Deployment Specification Files
Kubernetes | Service Mesh | LinkerD | ArgoCD Sync
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โฆ